summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2010-05-12 21:34:32 +0000
committerChristopher Jones <sixd@php.net>2010-05-12 21:34:32 +0000
commitc5a068e025f4f75410548721493856a4bce37fc7 (patch)
treefba76d3f8a220182d44f2c4e5b0dcce37ec46ef6 /tests
parent24a1dbabc8252b43c7344ee936890f3c33eb7fef (diff)
downloadphp-git-c5a068e025f4f75410548721493856a4bce37fc7.tar.gz
Errors using reserved words as methods
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/bug51709_1.phpt16
-rw-r--r--tests/basic/bug51709_2.phpt16
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt
new file mode 100644
index 0000000000..e929df3844
--- /dev/null
+++ b/tests/basic/bug51709_1.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #51709 (Can't use keywords as method names)
+--FILE--
+<?php
+
+class foo {
+ static function for() {
+ echo "1";
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Parse error: syntax error, unexpected T_FOR, expecting T_STRING in %s/bug51709_1.php on line %d
diff --git a/tests/basic/bug51709_2.phpt b/tests/basic/bug51709_2.phpt
new file mode 100644
index 0000000000..b6224abcf7
--- /dev/null
+++ b/tests/basic/bug51709_2.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #51709 (Can't use keywords as method names)
+--FILE--
+<?php
+
+class foo {
+ static function goto() {
+ echo "1";
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in %s/bug51709_2.php on line %d