mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
adfdfb2e1e
Use a shared non-terminal for all class modifiers. This avoids conflicts when adding modifiers that are only valid for certain targets. This change is necessary for asymmetric visibility but might be useful for other future additions. Closes GH-9926
20 lines
304 B
PHP
20 lines
304 B
PHP
--TEST--
|
|
Trying to use static as method modifier
|
|
--FILE--
|
|
<?php
|
|
|
|
trait foo {
|
|
public function test() { return 3; }
|
|
}
|
|
|
|
class bar {
|
|
use foo { test as static; }
|
|
}
|
|
|
|
$x = new bar;
|
|
var_dump($x->test());
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use "static" as method modifier in trait alias in %s on line %d
|