mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
110e0a5a2c
# Conflicts: # Zend/zend_language_scanner.c # Zend/zend_language_scanner.l # ext/simplexml/tests/SimpleXMLElement_xpath.phpt
20 lines
556 B
PHP
20 lines
556 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--
|
|
Fatal error: Uncaught TypeError: 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:5
|
|
Stack trace:
|
|
#0 %s(%d): foobar\foo->bar(Object(stdClass))
|
|
#1 {main}
|
|
thrown in %sbug43332_1.php on line 5
|