mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
5d869df753
Throw a compile error for "static" references instead, where it isn't already the case. Also extract the code that does that -- we have quite a few places where we get a const class ref and require it to be default.
19 lines
316 B
PHP
19 lines
316 B
PHP
--TEST--
|
|
Cannot use static in trait insteadof method reference
|
|
--FILE--
|
|
<?php
|
|
|
|
trait SomeTrait {
|
|
public function foobar() {}
|
|
}
|
|
|
|
class Test {
|
|
use SomeTrait {
|
|
static::foobar insteadof SomeTrait;
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use 'static' as trait name, as it is reserved in %s on line %d
|