3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo {} define('FOOx', new Foo()); FOOx;
Output for 7.2.0
Warning: Constants may only evaluate to scalar values or arrays in /in/M48oD on line 5 Warning: Use of undefined constant FOOx - assumed 'FOOx' (this will throw an Error in a future version of PHP) in /in/M48oD on line 7
Output for 7.0.0 - 7.1.10
Warning: Constants may only evaluate to scalar values or arrays in /in/M48oD on line 5 Notice: Use of undefined constant FOOx - assumed 'FOOx' in /in/M48oD on line 7
Output for 4.3.0 - 5.6.28
Warning: Constants may only evaluate to scalar values in /in/M48oD on line 5 Notice: Use of undefined constant FOOx - assumed 'FOOx' in /in/M48oD on line 7