(Derick)
- Fixed bug #34277 (array_filter() crashes with references and objects).
(Dmitry)
+- Fixed bug #34260 (Segfault with callbacks (array_map) + overloading).
+ (Dmitry)
- Fixed bug #34137 (assigning array element by reference causes binary mess).
(Dmitry)
- Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number).
--- /dev/null
+--TEST--
+Bug #34260 (Segfault with callbacks (array_map) + overloading)
+--FILE--
+<?php
+class Faulty
+{
+ function __call($Method,$Args)
+ {
+ switch($Method)
+ {
+ case 'seg':
+ echo "I hate me\n";
+ break;
+ }
+ }
+
+ function NormalMethod($Args)
+ {
+ echo "I heart me\n";
+ }
+}
+
+$Faulty = new Faulty();
+$Array = array('Some junk','Some other junk');
+
+// This causes a seg fault.
+$Failure = array_map(array($Faulty,'seg'),$Array);
+
+// This does not.
+$Failure = array_map(array($Faulty,'NormalMethod'),$Array);
+?>
+--EXPECT--
+I hate me
+I hate me
+I heart me
+I heart me
return FAILURE;
}
}
- if (fci_cache) {
+ if (fci_cache &&
+ (EX(function_state).function->type != ZEND_INTERNAL_FUNCTION ||
+ ((zend_internal_function*)EX(function_state).function)->handler != zend_std_call_user_call)) {
fci_cache->function_handler = EX(function_state).function;
fci_cache->object_pp = fci->object_pp;
fci_cache->calling_scope = calling_scope;