Browse Source

Errors using reserved words as methods

pull/12/head
Christopher Jones 16 years ago
parent
commit
c5a068e025
  1. 16
      tests/basic/bug51709_1.phpt
  2. 16
      tests/basic/bug51709_2.phpt

16
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

16
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
Loading…
Cancel
Save