#35559 [Fbk->Opn]: Use of global crashes PHP
| From: | alexei at nfsrm dot com | Date: | Mon, 05 Dec 2005 16:54:55 +0000 |
| Subject: | #35559 [Fbk->Opn]: Use of global crashes PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89769@lists.php.net to get a copy of this message | ||
ID: 35559
User updated by: alexei at nfsrm dot com
Reported By: alexei at nfsrm dot com
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
Operating System: SuSE 9.3
PHP Version: 5.1.1
New Comment:
It works fine in the latest snapshot :).
Thanks
Previous Comments:
------------------------------------------------------------------------
[2005-12-05 17:31:11] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2005-12-05 17:23:13] alexei at nfsrm dot com
Description:
------------
Trying to access global variables using ${varname} syntax crashes PHP
5.1.x. This worked fine in previous version PHP 4.x and 5.0.x
Reproduce code:
---------------
$var = '12346789';
$a['b'] = 'var';
function test()
{
global $a, ${$a['b']};
echo ${$a['b']};
}
test();
Expected result:
----------------
12346789
Actual result:
--------------
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
252 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 0x082b79c5 in zend_inline_hash_func (arKey=0x0,
nKeyLength=1515870811) at zend_hash.h:252
#1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0,
nKeyLength=1515870811, pData=0xbfffc3d0) at
/usr/local/src/php-5.1.1/Zend/zend_hash.c:849
#2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0,
execute_data=0xbfffc4d0) at zend_vm_execute.h:6700
#3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER
(execute_data=0xbfffc4d0) at zend_vm_execute.h:6763
#4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88
#5 0x082d5837 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc630) at zend_vm_execute.h:222
#6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffc630) at zend_vm_execute.h:1578
#7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88
#8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/local/src/php-5.1.1/Zend/zend.c:1090
#9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at
/usr/local/src/php-5.1.1/main/main.c:1704
#10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at
/usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35559&edit=1