|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-05-18 21:07 UTC] wez@php.net
[2004-05-18 23:05 UTC] fred at argus dot pt
[2004-05-18 23:14 UTC] wez@php.net
[2004-05-18 23:15 UTC] wez@php.net
[2004-05-18 23:17 UTC] fred at argus dot pt
[2004-05-18 23:20 UTC] fred at argus dot pt
[2004-05-18 23:21 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 21:00:01 2025 UTC |
Description: ------------ If I create an object with a container(array) instance variable, and then use foreach to iterate over the container, then a segfault occurs. If I copy the container to a temporary variable, and foreach over the temp, the code works fine. Similar code worked fine in PHP4, and I think 5.0.0RC1. Reproduce code: --------------- <?php class user { public $msgs = array(); } class message { public $text; } $user = new user; $msg = new message; $msg->text = "Hello"; $user->msgs[] = $msg; foreach($user->msgs as $msg) { echo "<br>Text is $msg->text"; } echo "<br>Tests completed"; ?> Expected result: ---------------- Text is Hello Tests completed Actual result: -------------- Blank Screen Segfault message in main server error log.