3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Person { public $myAge; public $myName; public $gender; public function __construct($myName, $myAge, $gender) { $this->firstname = $myName; $this->leeftijd = $myAge; $this->geslacht = $gender; } public function greet() { return "Hello my name is ".$this->firstname ."My age is ".$this->leeftijd ."dude!!!".geslacht; } } $me = new Person('martin', 28, 'man'); $me->greet(); ?>
based on rbKje
Output for 7.2.0
Warning: Use of undefined constant geslacht - assumed 'geslacht' (this will throw an Error in a future version of PHP) in /in/EX0K4 on line 14
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant geslacht - assumed 'geslacht' in /in/EX0K4 on line 14