xref: /PHP-7.4/Zend/tests/objects_030.phpt (revision e97d5fab)
1--TEST--
2Trying to access undeclared parent property
3--FILE--
4<?php
5
6class bar {
7	public function __set($a, $b) {
8		print "hello\n";
9	}
10}
11
12class foo extends bar {
13	public function __construct() {
14		parent::$f = 1;
15	}
16	public function __set($a, $b) {
17		print "foo\n";
18	}
19}
20
21
22new foo;
23
24?>
25--EXPECTF--
26Fatal error: Uncaught Error: Access to undeclared static property: bar::$f in %s:%d
27Stack trace:
28#0 %s(%d): foo->__construct()
29#1 {main}
30  thrown in %s on line %d
31