3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Direction { const $UNKNOWN = PHP_INT_MAX; public function __construct($direction) { $d = 1 << 1; echo $d; switch ($direction) { case (Direction::NORTH): echo "North"; break; case (Direction::EAST): echo "East"; break; case (Direction::SOUTH): echo "South"; break; case (Direction::WEST): echo "West"; break; case (Direction::UNKNOWN): echo "Unknown"; break; default: echo "No Match"; break; } } } $d = new Direction(Direction::UNKNOWN);
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$UNKNOWN' (T_VARIABLE), expecting identifier (T_STRING) in /in/bJd6O on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/bJd6O on line 5
Process exited with code 255.