--- /dev/null
+--TEST--
+Bug #69167 (call_user_func does not support references anymore)
+--FILE--
+<?php
+function l($m) {
+ echo $m . "\n";
+}
+
+$cb = 'l';
+call_user_func($cb, 'hi');
+
+$cb2 = &$cb;
+call_user_func($cb2, 'hi2');
+?>
+--EXPECT--
+hi
+hi2
return 0;
}
+again:
switch (Z_TYPE_P(callable)) {
case IS_STRING:
if (object) {
}
}
return 0;
-
case IS_OBJECT:
if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(callable, &fcc->calling_scope, &fcc->function_handler, &fcc->object) == SUCCESS) {
fcc->called_scope = fcc->calling_scope;
return 1;
}
/* break missing intentionally */
-
+ if (callable_name) {
+ *callable_name = zval_get_string(callable);
+ }
+ if (error) zend_spprintf(error, 0, "no array or string given");
+ return 0;
+ case IS_REFERENCE:
+ callable = Z_REFVAL_P(callable);
+ goto again;
default:
if (callable_name) {
*callable_name = zval_get_string(callable);
zend_class_entry *called_scope;
zend_object *object;
+ if (OP2_TYPE & (IS_VAR|IS_CV)) {
+ ZVAL_DEREF(function_name);
+ }
+
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
zend_class_entry *called_scope;
zend_object *object;
+ if (IS_CONST & (IS_VAR|IS_CV)) {
+ ZVAL_DEREF(function_name);
+ }
+
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
zend_class_entry *called_scope;
zend_object *object;
+ if (IS_CV & (IS_VAR|IS_CV)) {
+ ZVAL_DEREF(function_name);
+ }
+
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);
zend_class_entry *called_scope;
zend_object *object;
+ if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) {
+ ZVAL_DEREF(function_name);
+ }
+
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
if (error) {
efree(error);