3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class person { public $isAlive = true; public $firstname; public $lastname; public $age; public function __construct($firstname, $lastname, $age) { $this -> firstname = $firstname; $this -> lastname = $lastname; $this -> age = $age; } public function greet() { echo "Hello, my name is " . $this->firstname . " " . $this -> lastname . ". Nice to meet you! :-)"; } } $teacher = new person("boring", "12345", 12345); $student = new person("Chandler", "Smith", 33); echo $teacher -> greet(); <br></br> echo $student -> greet(); </br> ?>
based on P9IpqY
Output for 7.0.0
Parse error: syntax error, unexpected '<', expecting end of file in /in/ikP9L on line 24
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected '<' in /in/ikP9L on line 24
Process exited with code 255.