3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { public $x = 'a' . 'b'; // ok - can be calculated at compile-time public $y = $_POST['foo']; // not ok - only calculable at runtime. }
based on n5MVj
Output for 7.0.0
Fatal error: Constant expression contains invalid operations in /in/DmFH2 on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.16
Parse error: syntax error, unexpected '$_POST' (T_VARIABLE) in /in/DmFH2 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.5.30
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/DmFH2 on line 4
Process exited with code 255.