php-src/Zend/tests/static_in_trait_insteadof_list.phpt
Nikita Popov 5d869df753 Make class name references use the class_name production
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.
2020-01-13 11:51:09 +01:00

19 lines
304 B
PHP

--TEST--
Cannot use static in trait insteadof list
--FILE--
<?php
trait SomeTrait {
public function foobar() {}
}
class Test {
use SomeTrait {
SomeTrait::foobar insteadof static;
}
}
?>
--EXPECTF--
Fatal error: Cannot use 'static' as trait name, as it is reserved in %s on line %d