Bug #3901: Using var will set the correct Count()

From: Date: Wed, 22 Mar 2000 20:27:15 +0000
Subject: Bug #3901: Using var will set the correct Count()
Groups: php.dev 
Request: Send a blank email to php-dev+get-17151@lists.php.net to get a copy of this message
From: aulbach@unter.franken.de Operating system: Linux PHP version: 3.0.11 PHP Bug Type: Misbehaving function Bug description: Using var will set the correct Count() Perhaps this bug has been already fixed (I locked arround here and I found a nearly similar bug depending Count() and Arrays, which was fixed fpr PHP4). But I search now a longer time (5 months) for a reproduceable example cause the error happens only in very seldom situation. <?php class blubb { function bla () { $y[3][d]="D"; # $y[xxx][]=$y[0][a]; return($y); } function fasel () { $x=$this->bla(); echo "Value is : '". $x[xxx][0] ."' and it is " . ((isset($x[xxx][0]))?"":"not") ." set<br>"; echo "Count is now ". Count($x[xxx]) ."<br>"; echo "Value is : '". $x[xxx][0] ."' and it is ". ((isset($x[xxx][0]))?"":"not") ." set<br>"; echo "Count is now ".Count($x[xxx]) ."<br>"; } } $z=new blubb; $z->fasel(); ?> Output: Value is : '' and it is not set Count is now 1 Value is : '' and it is not set Count is now 0 Strange, eh? The other way arround I would understand, but this is unintelligible.

« previous php.dev (#17151) next »