|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2004-03-01 06:41 UTC] reiersol at online dot no
  [2004-03-01 13:39 UTC] kase at gmx dot net
  [2004-03-03 18:28 UTC] pajoye@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
Description: ------------ I get a segfault with this script: Reproduce code: --------------- <?php class test { public function start() { foreach ( $this->array as $foo ) { $foo->any_method(); } } } $test = new test(); $test->start(); ?> Expected result: ---------------- If $this->array is an array with objects, the method any_method() should be called on $foo. (works well) If $this->array is an array with strings, int, ..., php should display an error. (works well) (Fatal error: Call to a member function any_method() on a non-object in /var/www/legendz/web/test/test.php5 on line 5 ) If $this->array is an empty array, nothing should happen. (but php crashes) Actual result: -------------- (gdb) bt #0 0x082128b4 in zend_fetch_obj_w_handler (execute_data=0xbfffd840, opline=0x404e9518, op_array=0x404dd7d4) at /home/kase/php5-200402271430/Zend/zend_execute.c:2044 #1 0x08210be0 in execute (op_array=0x404dd7d4) at /home/kase/php5-200402271430/Zend/zend_execute.c:1339 #2 0x082143c9 in zend_do_fcall_common_helper (execute_data=0xbfffd9f0, opline=0x404e84dc, op_array=0x404dd018) at /home/kase/php5-200402271430/Zend/zend_execute.c:2675 #3 0x082147f6 in zend_do_fcall_by_name_handler (execute_data=0xbfffd9f0, opline=0x404e84dc, op_array=0x404dd018) at /home/kase/php5-200402271430/Zend/zend_execute.c:2757 #4 0x08210be0 in execute (op_array=0x404dd018) at /home/kase/php5-200402271430/Zend/zend_execute.c:1339 #5 0x081f0289 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/kase/php5-200402271430/Zend/zend.c:1041 #6 0x081b0a13 in php_execute_script (primary_file=0xbffffd48) at /home/kase/php5-200402271430/main/main.c:1650 #7 0x0821d16c in main (argc=2, argv=0xbffffde4) at /home/kase/php5-200402271430/sapi/cgi/cgi_main.c:1573