|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-20 17:33 UTC] tony2001@php.net
[2004-12-20 17:34 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 19:00:01 2025 UTC |
Description: ------------ The below code should obviously return "aaaaaaa". With PHP 4.3.10 is returns nothing. It does return the expected result if I use: foreach ($arr_test as $key => $objtest) I think in the code below $objtest is an array instead of being an onject. This is critical and it affects lots of existing code (I've seen NuSOAP affected for example) Reproduce code: --------------- <?php class test_class { var $test; } $arr_test = array(); $obj = new test_class(); $obj->test = "aaaaaa"; $arr_test[] = $obj; foreach ($arr_test as $objtest) echo $objtest->test; ?> Expected result: ---------------- aaaaaa Actual result: -------------- Nothing