Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Probleme

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe hier ein größeres Konstrukt aus Klassen etc.

Nun dazwischen ist folgender Teil:


var_dump( is_array( $fields)); // Ausgabe: bool(true)
// var_dump( gettype( $fields)); // Apache stürzt ab
$numFields = count( $fields);
var_dump( $numFields); // Ausgabe UNKNOWN:0
[/PHP]

Fällt da jemandem was ein, warum mir das "count()" hier so ein mist zurückgibt?

Danke und Gruß,

Markus

System:

ApacheFriends XAMPP (basic package) version 1.4.9 (win32)

+ Apache 2.0.52

+ MySQL 4.0.21

+ PHP 5.0.2 + PHP 4.3.9 + PEAR

+ PHP-Switch win32 1.0 (von Apachefriends, man nehme die "php-switch.bat")

+ MiniPerl 5.8.3

+ SQLite 2.8.15

+ PHPMyAdmin 2.6.0 pl1

+ ADODB 4.52

+ Mercury Mail Transport System for Win32 and NetWare Systems v4.01a

+ FileZilla FTP Server 0.9.2

+ Webalizer 2.01-10

+ Zend Optimizer 2.5.3

Lass Dir doch mal den Array mit "print_r()" ausgeben.

was bezweckst du damit ? mehr sinn machen würde eher echo $numFields....

sollen wir ausserdem den array fields raten ? gib inhalt von fields !

Lass Dir doch mal den Array mit "print_r()" ausgeben.

Das ist ein Array von Objekten, dass ich nicht ausgeben kann, da diese Objekte mehrfach aufeinander verweisen und somit bei print_r ein endlos loop kommt.

Gruß,

Markus

Vielleicht hat ja die count-Funktion die gleichen Probleme mit den Querverweisen.

Da das aber Objekte sind, ist vielleicht die engl. Doku der Funktion interessant:

For objects, if you have SPL installed, you can hook into count() by implementing interface Countable. The interface has exactly one method, count(), which returns the return value for the count() function.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.