3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php Class T { var $Test; function __construct(){ $k = "Test"; $this-${k} = "?"; } } $y = new T(); echo $y->Test;
Output for 7.1.0
Notice: Use of undefined constant k - assumed 'k' in /in/qDqbE on line 6 Notice: Object of class T could not be converted to int in /in/qDqbE on line 6 Warning: A non-numeric value encountered in /in/qDqbE on line 6
Output for 5.1.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Notice: Use of undefined constant k - assumed 'k' in /in/qDqbE on line 6 Notice: Object of class T could not be converted to int in /in/qDqbE on line 6
Output for 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/qDqbE on line 3 Notice: Use of undefined constant k - assumed 'k' in /in/qDqbE on line 6 Notice: Object of class T could not be converted to int in /in/qDqbE on line 6
Output for 5.0.0 - 5.0.5
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/qDqbE on line 3 Notice: Use of undefined constant k - assumed 'k' in /in/qDqbE on line 6 Fatal error: Unsupported operand types in /in/qDqbE on line 6
Process exited with code 255.
Output for 4.3.0 - 4.4.9