ID: 31265 Updated by: [EMAIL PROTECTED] Reported By: dmitry dot bezer at enterra-inc dot com -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Windows XP PHP Version: 4.3.10 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2004-12-23 07:07:52] dmitry dot bezer at enterra-inc dot com Description: ------------ After setting up PHP4.3.10 my application stoped working with error message saying about error in one of PEAR files. After looking into code that caused error I figured out a very strange thing: the array_keys function gets as parameter a valid array but returns NULL. I tried to reproduce the bug without using PEAR files but didn't succeed. So I will describe the issue using PEAR code. File: PEAR/DB/dataobject.php (version 1.7.2) (DB_DataObject PEAR package) P.S. I have no Zend debuger/optimizer/.... or any 3rd party extensions installed php -v result: C:\wwwroot\bug>php -v PHP 4.3.10 (cgi-fcgi) (built: Dec 14 2004 17:47:59) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies Reproduce code: --------------- 795 if (is_object($from)) { 796 $table = $from->__table; 797 $from = array_keys($from->table()); 798 } $from->table() returns a valid array , but $from after assignment becomes NULL. If we modidfy the code in the following way: 795 if (is_object($from)) { 796 $table = $from->__table; $tmp = $from->table(); var_dump($tmp); 797 $from = array_keys($tmp); var_dump($from) die('theend'); 798 } the result will be: array(2) { ["id"]=> int(129) ["name"]=> int(2) } NULL theend moreover if we modify the code in another way: if (is_object($from)) { $table = $from->__table; $tmp = $from->table(); $from = null; $from = array_keys($tmp); } PHP crashes and Windows offers to send a report to Bill Gates :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31265&edit=1