|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-27 19:54 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
Description: ------------ When dereferencing an object-reference in an array, php gets a segfault. (see reproduce code) Okay, I know that $object here is out of scope and should be subject to the GC, but PHP should still not segfault, but report an error or something like that. This bug makes horde-imp not work anymore on PHP 5 - the same code seems to have worked on PHP 4 (can't verify that, sorry). Reproduce code: --------------- <?php class testobject { var $test; } function return_object() { $object = new testobject; $object->test = "lala"; $array = array( &$object, NULL ); return $array; } $object = return_object(); $object = $object[0]; // segmentation fault on this line echo "WORKED: " . $object->test . "\n"; ?> Expected result: ---------------- The script prints out "WORKED: lala" or an error that the array-index is not present (or something like that). Actual result: -------------- (empty page, "[Mon Sep 20 12:45:01 2004] [notice] child pid 2075 exit signal Segmentation fault (11)" in apache-log)