<?php
class A {
protected $test;
function __construct() {
$test = 999;
}
}
class B extends A {
protected $test2;
function __construct() {
$test2 = 99999;
}
}
class C extends B {
protected $test;
protected $test2;
function Myfunction() {
echo 'VAL: ' . $test;
echo 'VAL2: ' . $test2;
}
}
$obj = new C;
$obj->Myfunction();
?>
Notice: Undefined variable: test in /in/ecLlH on line 20
VAL:
Notice: Undefined variable: test2 in /in/ecLlH on line 21
VAL2:
Output for 7.3.32 - 7.3.33, 7.4.26
VAL: VAL2:
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: test in /in/ecLlH on line 20
VAL:
Notice: Undefined variable: test2 in /in/ecLlH on line 21
VAL2:
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ecLlH 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/ecLlH 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/ecLlH on line 3
Process exited with code 255.