diff options
author | Christopher Jones <sixd@php.net> | 2010-05-12 21:34:32 +0000 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2010-05-12 21:34:32 +0000 |
commit | ec93c50c3f1478be5b02ee1d0ae16bde3e3c0e02 (patch) | |
tree | 3e2e08b11b199a103c31ff695a5b9f947db81e72 /tests | |
parent | 3e51f4a966de1bf0b2fc2377cbc5585c4d3599db (diff) | |
download | php-git-ec93c50c3f1478be5b02ee1d0ae16bde3e3c0e02.tar.gz |
Errors using reserved words as methods
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/bug51709_1.phpt | 16 | ||||
-rw-r--r-- | tests/basic/bug51709_2.phpt | 16 |
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 |