<?php
class Test {
public function bop() {
$this->foo = "noop";
}
}
abstract class Foo {
private $foo = "aa";
public function boop() {
var_dump($this->foo);
}
}
class Bar extends Foo {
public function beep() {
var_dump($this->foo);
}
}
$b = new Bar();
$b->beep();
$b->boop();
$b->bop();
Warning: Undefined property: Bar::$foo in /in/K3SnX on line 19
NULL
string(2) "aa"
Fatal error: Uncaught Error: Call to undefined method Bar::bop() in /in/K3SnX:27
Stack trace:
#0 {main}
thrown in /in/K3SnX on line 27
Process exited with code 255.
Notice: Undefined property: Bar::$foo in /in/K3SnX on line 19
NULL
string(2) "aa"
Fatal error: Uncaught Error: Call to undefined method Bar::bop() in /in/K3SnX:27
Stack trace:
#0 {main}
thrown in /in/K3SnX on line 27
Process exited with code 255.
Output for 7.3.32 - 7.3.33
NULL
string(2) "aa"
Fatal error: Uncaught Error: Call to undefined method Bar::bop() in /in/K3SnX:27
Stack trace:
#0 {main}
thrown in /in/K3SnX on line 27
Process exited with code 255.
Notice: Undefined property: Bar::$foo in /in/K3SnX on line 19
NULL
string(2) "aa"
Fatal error: Call to undefined method Bar::bop() in /in/K3SnX on line 27
Process exited with code 255.
Notice: Undefined property: Bar::$foo in /in/K3SnX on line 19
NULL
string(2) "aa"
Fatal error: Call to undefined method Bar::bop() in /in/K3SnX on line 27
Process exited with code 255.
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/K3SnX on line 4
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/K3SnX on line 4
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/K3SnX on line 4
Process exited with code 255.