<?php
class C1 {
public function __construct($p) {
$this->p = $p;
}
}
class C2 {
public function __construct(C1 $c) {
$this->c = $c;
}
}
$c1 = new C1(1);
$c2 = new C2($c1);
$c1 = new C1(2);
var_dump($c2->c->p);
Deprecated: Creation of dynamic property C1::$p is deprecated in /in/FgjQI on line 4
Deprecated: Creation of dynamic property C2::$c is deprecated in /in/FgjQI on line 9
Deprecated: Creation of dynamic property C1::$p is deprecated in /in/FgjQI on line 4
int(1)
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FgjQI on line 3
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/FgjQI on line 3
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/FgjQI on line 3
Process exited with code 255.