(Fabien Villepinte)
. Fixed bug #65274 (Enhance undefined class constant error with class name).
(Nikita)
+ . Fixed bug #49555 (Fatal error "Function must be a string" message should be
+ renamed). (Nikita)
- Date:
. Fixed bug #65547 (Default value for sunrise/sunset zenith still wrong).
Notice: Undefined offset: 2 in %s on line %d
-Fatal error: Uncaught Error: Function name must be a string in %s:%d
+Fatal error: Uncaught Error: Value of type null is not callable in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
?>
--EXPECTF--
Warning: Undefined variable: f in %s on line %d
-string(30) "Function name must be a string"
+string(34) "Value of type null is not callable"
string(31) "Call to undefined method A::y()"
string(31) "Call to undefined method A::y()"
string(34) "Call to undefined function bar\y()"
?>
--EXPECT--
Call to undefined function foobar()
-Function name must be a string
-Function name must be a string
+Array callback must have exactly two elements
+Object of type stdClass is not callable
object_or_called_scope = object;
}
} else {
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Object of type %s is not callable", ZSTR_VAL(function->ce->name));
return NULL;
}
}
}
} else {
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Array callback must have exactly two elements");
return NULL;
}
ZEND_VM_C_GOTO(try_function_name);
} else {
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
- ZVAL_UNDEFINED_OP2();
+ function_name = ZVAL_UNDEFINED_OP2();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Value of type %s is not callable",
+ zend_get_type_by_const(Z_TYPE_P(function_name)));
call = NULL;
}
goto try_function_name;
} else {
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
- ZVAL_UNDEFINED_OP2();
+ function_name = ZVAL_UNDEFINED_OP2();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Value of type %s is not callable",
+ zend_get_type_by_const(Z_TYPE_P(function_name)));
call = NULL;
}
goto try_function_name;
} else {
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
- ZVAL_UNDEFINED_OP2();
+ function_name = ZVAL_UNDEFINED_OP2();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Value of type %s is not callable",
+ zend_get_type_by_const(Z_TYPE_P(function_name)));
call = NULL;
}
goto try_function_name;
} else {
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
- ZVAL_UNDEFINED_OP2();
+ function_name = ZVAL_UNDEFINED_OP2();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
- zend_throw_error(NULL, "Function name must be a string");
+ zend_throw_error(NULL, "Value of type %s is not callable",
+ zend_get_type_by_const(Z_TYPE_P(function_name)));
call = NULL;
}