3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Change { const YES = 1; const NOT = 0; public function change($field_name) { $this->{$field_name} = ($this->{$field_name} === 1) ? 0 : 1; return $this; } }
Output for 5.4.0 - 5.4.28, 5.5.0 - 5.5.12
Fatal error: Traits cannot have constants in /in/JGCuc on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/JGCuc on line 2
Process exited with code 255.

preferences:
212.24 ms | 1394 KiB | 78 Q