3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public const TICKET_SEND_AUTO_RESPONSE = 0; public function test() { $s = <<<XML <sendautoresponder>{${self::TICKET_SEND_AUTO_RESPONSE}}</sendautoresponder> XML; return $s; } } $t = new Test(); var_dump($t->test());
Output for 7.1.0 - 7.3.0rc3
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/ZflaT on line 4 Notice: Undefined variable: 0 in /in/ZflaT on line 10 Notice: Undefined variable: 0 in /in/ZflaT on line 10 string(51) " <sendautoresponder></sendautoresponder>"
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/ZflaT on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_CONST, expecting T_VARIABLE in /in/ZflaT:5 Stack trace: #0 {main}
Process exited with code 255.