|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-01-10 16:17 UTC] laruence@php.net
-Status: Open
+Status: Feedback
[2015-01-10 16:17 UTC] laruence@php.net
[2015-01-18 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 23:00:01 2025 UTC |
Description: ------------ I had some old code running for years (since PHP 5.3.x). After upgrade it started to segfault in a overwritten offsetGet method in a class implementing ArrayAccess. After debugging it I reached the broken code at following function made long ago: public function offsetGet($key) { if (in_array($key, array_keys($this->_structure), true) && !isset($this[$key])) { return null; } return (parent::offsetExists($key)) ? parent::offsetGet($key) : null; } The result at dbg: Program received signal SIGSEGV, Segmentation fault. zend_call_method (object_pp=object_pp@entry=0x7fffff7ff078, obj_ce=0x1d14658, fn_proxy=fn_proxy@entry=0x1d5beb0, function_name=function_name@entry=0xb2598c "offsetGet", function_name_len=function_name_len@entry=9, retval_ptr_ptr=retval_ptr_ptr@entry=0x7fffff7ff088, param_count=1, arg1=0x2059d28, arg2=0x0) at /build/php5-NIujy4/php5-5.6.4+dfsg/Zend/zend_interfaces.c:47 47 in /build/php5-NIujy4/php5-5.6.4+dfsg/Zend/zend_interfaces.c I made it work after changing the last tine to: return (parent::offsetExists($key)) ? $this->_structure[$key] : null; Hope that helps.