3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); } ?>
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.7 - 5.6.13
Parse error: syntax error, unexpected '$me' (T_VARIABLE), expecting function (T_FUNCTION) in /in/mAj6m on line 17
Process exited with code 255.

preferences:
183.17 ms | 1395 KiB | 63 Q