summaryrefslogtreecommitdiff
path: root/Zend/tests/static_in_trait_insteadof_reference.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-01-13 11:34:04 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-01-13 11:51:09 +0100
commit5d869df75329530a28860a3c2399ab32414fe5bc (patch)
treedaad3602d02cfe19d5579c10ef652e670d584aa2 /Zend/tests/static_in_trait_insteadof_reference.phpt
parent2a3e37a496216488e273cdc46b46c454b0017baa (diff)
downloadphp-git-5d869df75329530a28860a3c2399ab32414fe5bc.tar.gz
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.
Diffstat (limited to 'Zend/tests/static_in_trait_insteadof_reference.phpt')
-rw-r--r--Zend/tests/static_in_trait_insteadof_reference.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/tests/static_in_trait_insteadof_reference.phpt b/Zend/tests/static_in_trait_insteadof_reference.phpt
new file mode 100644
index 0000000000..95a6b3c170
--- /dev/null
+++ b/Zend/tests/static_in_trait_insteadof_reference.phpt
@@ -0,0 +1,18 @@
+--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