?>
--EXPECTF--
-Warning: The magic method InvokeAble::__invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
+Warning: The magic method InvokeAble::__invoke() cannot be static in %sbug61025.php on line %d
-Warning: The magic method Bar::__invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
+Warning: The magic method Bar::__invoke() must have public visibility in %sbug61025.php on line %d
Bar
Fatal error: Uncaught Error: Call to private method Bar::__invoke() from context '' in %sbug61025.php:%d
Stack trace:
?>
--EXPECTF--
-string(%d) "The magic method A::__invoke() must have public visibility and cannot be static"
+string(%d) "The magic method A::__invoke() must have public visibility"
string(%d) "%s(%d) : eval()'d code"
string(1) "X"
$b = new b();
$b->test();
--EXPECTF--
-string(%d) "The magic method b::__invoke() must have public visibility and cannot be static"
+string(%d) "The magic method b::__invoke() must have public visibility"
b::test()
a::test(c::TESTCONSTANT)
$b = new b();
$b->test();
--EXPECTF--
-Warning: The magic method b::__invoke() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method b::__invoke() must have public visibility in %s on line %d
b::test()
a::test(c::TESTCONSTANT)
?>
--EXPECTF--
-Warning: The magic method A::__invoke() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method A::__invoke() cannot be static in %s on line %d
A
?>
--EXPECTF--
-string(%d) "The magic method A::__invoke() must have public visibility and cannot be static"
+string(%d) "The magic method A::__invoke() must have public visibility"
string(%d) "%s(%d) : eval()'d code"
Warning: Undefined variable $undefined in %s on line %d
?>
--EXPECTF--
-Warning: The magic method foo::__unset() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method foo::__unset() must have public visibility in %s on line %d
?>
--EXPECTF--
-Warning: The magic method foo::__unset() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method foo::__unset() cannot be static in %s on line %d
?>
--EXPECTF--
-Warning: The magic method foo::__unset() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method foo::__unset() must have public visibility in %s on line %d
?>
--EXPECTF--
-Warning: The magic method a::__call() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method a::__call() cannot be static in %s on line %d
?>
--EXPECTF--
-Warning: The magic method a::__callStatic() must have public visibility and be static in %s on line %d
+Warning: The magic method a::__callStatic() must be static in %s on line %d
?>
--EXPECTF--
-Warning: The magic method b::__set() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method b::__set() must have public visibility in %s on line %d
Fatal error: Method b::__set() must take exactly 2 arguments in %s on line %d
?>
--EXPECTF--
-Warning: The magic method a::__set() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method a::__set() must have public visibility in %s on line %d
Fatal error: Access level to a::__set() must be public (as in class b) in %s on line 8
?>
--EXPECTF--
-Warning: The magic method a::__callStatic() must have public visibility and be static in %s on line %d
+Warning: The magic method a::__callStatic() must have public visibility in %s on line %d
?>
--EXPECTF--
-Warning: The magic method a::__toString() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method a::__toString() must have public visibility in %s on line %d
+
+Warning: The magic method a::__toString() cannot be static in %s on line %d
Fatal error: Method a::__toString() cannot take arguments in %s on line %d
}
?>
--EXPECTF--
-Warning: The magic method Foo::__serialize() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method Foo::__serialize() cannot be static in %s on line %d
Fatal error: Method Foo::__serialize() cannot take arguments in %s on line %d
}
?>
--EXPECTF--
-Warning: The magic method Foo::__unserialize() must have public visibility and cannot be static in %s on line %d
+Warning: The magic method Foo::__unserialize() cannot be static in %s on line %d
Fatal error: Method Foo::__unserialize() must take exactly 1 argument in %s on line %d
static void zend_check_magic_method_attr(uint32_t attr, zend_class_entry *ce, const char* method, zend_bool is_static) /* {{{ */
{
+ if (!(attr & ZEND_ACC_PUBLIC)) {
+ zend_error(E_WARNING,
+ "The magic method %s::%s() must have public visibility",
+ ZSTR_VAL(ce->name), method);
+ }
+
if (is_static) {
- if (!(attr & ZEND_ACC_PUBLIC) || !(attr & ZEND_ACC_STATIC)) {
+ if (!(attr & ZEND_ACC_STATIC)) {
zend_error(E_WARNING,
- "The magic method %s::%s() must have public visibility and be static",
+ "The magic method %s::%s() must be static",
ZSTR_VAL(ce->name), method);
}
- } else if (!(attr & ZEND_ACC_PUBLIC) || (attr & ZEND_ACC_STATIC)) {
+ } else if (attr & ZEND_ACC_STATIC) {
zend_error(E_WARNING,
- "The magic method %s::%s() must have public visibility and cannot be static",
+ "The magic method %s::%s() cannot be static",
ZSTR_VAL(ce->name), method);
}
}
$b->test();
?>
--EXPECTF--
-Warning: The magic method A::__call() must have public visibility and cannot be static in %s__call_005.php on line 3
+Warning: The magic method A::__call() must have public visibility in %s__call_005.php on line 3
In A::__call(test1, array(1,a))
object(B)#1 (0) {
}
}
?>
--EXPECTF--
-Warning: The magic method A::__call() must have public visibility and cannot be static in %s on line 3
+Warning: The magic method A::__call() cannot be static in %s on line 3
---> Invoke __call via simple method call.
object(A)#1 (0) {
}