]> granicus.if.org Git - php/commitdiff
Errors using reserved words as methods
authorChristopher Jones <sixd@php.net>
Wed, 12 May 2010 21:34:32 +0000 (21:34 +0000)
committerChristopher Jones <sixd@php.net>
Wed, 12 May 2010 21:34:32 +0000 (21:34 +0000)
tests/basic/bug51709_1.phpt [new file with mode: 0644]
tests/basic/bug51709_2.phpt [new file with mode: 0644]

diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt
new file mode 100644 (file)
index 0000000..e929df3
--- /dev/null
@@ -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 (file)
index 0000000..b6224ab
--- /dev/null
@@ -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