<?php
class Person { public $name; public $age; function __construct($name, $age) { $this->name=$name; $this->age=$age; } function say() { echo "我的名字叫:".$this->name."<br />"; echo "我的年龄是:".$this->age; }}$p1 = new Person("张三", 20);$p2 = clone $p1;
$p1->name='hu';
$p1->say();
$p2->say();
?>
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uTjog on line 2
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uTjog on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/uTjog on line 2
Process exited with code 255.