3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Person { public $name; public function __construct($name) { $this->name = $name; } public function name() { return $this>name(); } } $user = new Person('chris'); var_dump($person->name());
based on h16LT
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: person in /in/mjeSI on line 22 Fatal error: Uncaught Error: Call to a member function name() on null in /in/mjeSI:22 Stack trace: #0 {main} thrown in /in/mjeSI on line 22
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: person in /in/mjeSI on line 22 Fatal error: Uncaught Error: Call to a member function name() on unknown in /in/mjeSI:22 Stack trace: #0 {main} thrown in /in/mjeSI on line 22
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: person in /in/mjeSI on line 22 Fatal error: Call to a member function name() on null in /in/mjeSI on line 22
Process exited with code 255.
Output for 5.3.17 - 5.5.35
Notice: Undefined variable: person in /in/mjeSI on line 22 Fatal error: Call to a member function name() on a non-object in /in/mjeSI on line 22
Process exited with code 255.