3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $0 in /in/ZflaT on line 10 string(51) " <sendautoresponder></sendautoresponder>"
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
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 7.3.32 - 7.3.33
string(51) " <sendautoresponder></sendautoresponder>"
Output for 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.

preferences:
159 ms | 401 KiB | 169 Q