3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getName() { return $this->name; } var_dump(getName());
based on 1tIZd
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Using $this when not in object context in /in/pQciF:5 Stack trace: #0 /in/pQciF(7): getName() #1 {main} thrown in /in/pQciF on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Undefined variable: this in /in/pQciF on line -1 Notice: Cannot access property on non-object in /in/pQciF on line -1 NULL
Output for hhvm-3.18.5 - 3.21.3
Notice: Undefined variable: this in /in/pQciF on line 5 Notice: Cannot access property on non-object in /in/pQciF on line 5 NULL
Output for 5.6.0 - 5.6.30
Fatal error: Using $this when not in object context in /in/pQciF on line 5
Process exited with code 255.