php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php-5-3-splfixedarray-fromarray-should-return-call-scope-instance for SPL related Bug #55128

Patch version 2011-07-26 09:57 UTC

Return to Bug #55128 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: laruence@php.net

Index: ext/spl/spl_fixedarray.c
===================================================================
--- ext/spl/spl_fixedarray.c	(revision 313688)
+++ ext/spl/spl_fixedarray.c	(working copy)
@@ -703,7 +703,7 @@
 		spl_fixedarray_init(array, 0 TSRMLS_CC);
 	}
 
-	object_init_ex(return_value, spl_ce_SplFixedArray);
+	object_init_ex(return_value, EG(called_scope)? EG(called_scope) : spl_ce_SplFixedArray);
 	Z_TYPE_P(return_value) = IS_OBJECT;
 
 	intern = (spl_fixedarray_object *)zend_object_store_get_object(return_value TSRMLS_CC);
@@ -1058,7 +1058,7 @@
 ZEND_END_ARG_INFO()
 
 static zend_function_entry spl_funcs_SplFixedArray[] = { /* {{{ */
-	SPL_ME(SplFixedArray, __construct,     arginfo_splfixedarray_construct,ZEND_ACC_PUBLIC)
+	SPL_ME(SplFixedArray, __construct,     arginfo_splfixedarray_construct,ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
 	SPL_ME(SplFixedArray, count,           arginfo_splfixedarray_void,     ZEND_ACC_PUBLIC)
 	SPL_ME(SplFixedArray, toArray,         arginfo_splfixedarray_void,     ZEND_ACC_PUBLIC)
 	SPL_ME(SplFixedArray, fromArray,       arginfo_fixedarray_fromArray,   ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC