<?php
abstract class Test {
protected $pro = 9;
public function __construct($x, $a) {
}
}
class TestMe extends Test {
protected $pro = 50;
}
class TestProxy extends TestMe {
protected $a;
public function __construct($x, $a = null) {
echo $a->pro;
}
}
$a = new TestMe('');
$p = new TestProxy('', $a);
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Test::__construct(), 1 passed in /in/887mp on line 22 and exactly 2 expected in /in/887mp:5
Stack trace:
#0 /in/887mp(22): Test->__construct('')
#1 {main}
thrown in /in/887mp on line 5
Process exited with code 255.
Warning: Missing argument 2 for Test::__construct(), called in /in/887mp on line 22 and defined in /in/887mp on line 5
50
Output for 5.0.5
Warning: Missing argument 2 for Test::__construct() in /in/887mp on line 5
50
Output for 5.0.0 - 5.0.4
Warning: Missing argument 2 for Test::__construct() in /in/887mp on line 5
Fatal error: Cannot access protected property TestMe::$pro in /in/887mp on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/887mp on line 3
Process exited with code 255.