<?php
class Fare
{
private $value;
public function __construct($value) { $this->value = $value; }
}
class Trip
{
public $fare;
public function __construct() {
$this->fare = new Fare(5);
}
}
$trip = new Trip();
$trip2 = clone $trip;
var_dump($trip === $trip2, $trip->fare === $trip2->fare);
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/MZCNW on line 5
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/MZCNW on line 5
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/MZCNW on line 5
Process exited with code 255.