3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { var $c; function a ($pass) { $this->c = $pass; } function print_data() { echo $this->$c; } } $a = new a(10); $a->$g; ?>
based on GfTme
Output for 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; a has a deprecated constructor in /in/fekkX on line 2 Notice: Undefined variable: g in /in/fekkX on line 9 Notice: Undefined property: a::$ in /in/fekkX on line 9
Output for 7.0.0 - 7.0.14
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; a has a deprecated constructor in /in/fekkX on line 2 Notice: Undefined variable: g in /in/fekkX on line 9 Fatal error: Uncaught Error: Cannot access empty property in /in/fekkX:9 Stack trace: #0 {main} thrown in /in/fekkX on line 9
Process exited with code 255.
Output for 5.1.3 - 5.6.28
Notice: Undefined variable: g in /in/fekkX on line 9 Fatal error: Cannot access empty property in /in/fekkX on line 9
Process exited with code 255.
Output for 5.0.5 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/fekkX on line 3 Notice: Undefined variable: g in /in/fekkX on line 9 Fatal error: Cannot access empty property in /in/fekkX on line 9
Process exited with code 255.
Output for 5.0.4
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/fekkX on line 3 Notice: Undefined variable: g in /in/fekkX on line 9 Notice: Undefined property: a::$ in /in/fekkX on line 9
Output for 5.0.0 - 5.0.3
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/fekkX on line 3 Notice: Undefined variable: g in /in/fekkX on line 9 Notice: Undefined property: a::$ in /in/fekkX on line 9
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: g in /in/fekkX on line 9 Notice: Undefined property: in /in/fekkX on line 9