You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug #43332.1 (self and parent as type hint in namespace)
3
+
--FILE--
4
+
<?php
5
+
namespacefoobar;
6
+
7
+
class foo {
8
+
publicfunctionbar(self$a) { }
9
+
}
10
+
11
+
$foo = newfoo;
12
+
$foo->bar($foo); // Ok!
13
+
$foo->bar(newstdclass); // Error, ok!
14
+
--EXPECTF--
15
+
Catchable fatal error: Argument 1 passed to foobar::foo::bar() must be an instance of foobar::foo, instance of stdClass given, called in %sbug43332_1.php on line 10and defined in %sbug43332_1.php on line 5
if (ZEND_FETCH_CLASS_DEFAULT==zend_get_class_fetch_type(Z_TYPE(class_type->u.constant), Z_UNIVAL(class_type->u.constant), Z_UNILEN(class_type->u.constant))) {
if (ZEND_FETCH_CLASS_DEFAULT!=zend_get_class_fetch_type(Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant), Z_UNILEN(class_name->u.constant))) {
1671
+
zend_error(E_COMPILE_ERROR, "'::%R' is a wrong class name", Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant));
if (ZEND_FETCH_CLASS_DEFAULT!=zend_get_class_fetch_type(Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant), Z_UNILEN(class_name->u.constant))) {
1682
+
zend_error(E_COMPILE_ERROR, "'::%R' is a wrong class name", Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant));
1683
+
}
1676
1684
} elseif (CG(current_import)) {
1677
1685
if (Z_TYPE(class_name->u.constant) ==IS_UNICODE) {
0 commit comments