|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-10 15:26 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ isset may return true to a $string->member being passed in. Clearly, a string can not have a member variable; therefore, isset is expected to always return false in this case. The actual result of the reproduced code for us is incorrect when using php 5.0.3, while the expected correct result is produced in php 5.0.0. Reproduce code: --------------- <?php class Car { var $mpg; } $car = new Car(); $car->mpg = 30; //the normal case, should work if( isset($car->mpg) ) echo "mpg is set...this is normal<br>"; //the case that may not work right: $some_random_string = "this is some random string, it has no mpg member"; if( isset($some_random_string->mpg) ) echo "ERROR: This line should never be displayed<br>"; ?> Expected result: ---------------- mpg is set...this is normal Actual result: -------------- mpg is set...this is normal ERROR: This line should never be displayed