mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
1b4134c07b
[DOC] new resolution rules should be documented soon
16 lines
447 B
PHP
16 lines
447 B
PHP
--TEST--
|
|
Bug #43332.1 (self and parent as type hint in namespace)
|
|
--FILE--
|
|
<?php
|
|
namespace foobar;
|
|
|
|
class foo {
|
|
public function bar(self $a) { }
|
|
}
|
|
|
|
$foo = new foo;
|
|
$foo->bar($foo); // Ok!
|
|
$foo->bar(new \stdclass); // Error, ok!
|
|
--EXPECTF--
|
|
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 10 and defined in %sbug43332_1.php on line 5
|