3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Person { private $name; private $age; function __construct($name, $age) { $this->name=$name; $this->age=$age; } function say() { echo "我的名字叫:".$this->name."<br />"; echo "我的年龄是:".$this->age; }}$p1 = new Person("张三", 20);$p1->say();$p2 = clone $p1;$p2->say();?>
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected ';' (T_STRING) in /in/Po2NH on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/Po2NH on line 2
Process exited with code 255.