3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B{ const X = 43; const Y = new \DateTime(); }
based on a0PFr
Output for 7.0.0
Fatal error: Constant expression contains invalid operations in /in/Fart3 on line 5
Process exited with code 255.
Output for 5.4.10 - 5.6.16
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/Fart3 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_NEW in /in/Fart3 on line 5
Process exited with code 255.