php-src/Zend/tests/bug78344.phpt
Nikita Popov 4ae807e84e Fixed bug #78344
When performing a constant visibility check during compilation we
might be dealing with unlinked classes and as such should account
for the possibility of unresolved parents.
2019-07-29 11:12:00 +02:00

25 lines
400 B
PHP

--TEST--
Bug #78344: Segmentation fault on zend_check_protected
--FILE--
<?php
class A {
protected const FOO = 1;
}
class B {}
class C extends B {
public function method() {
var_dump(A::FOO);
}
}
(new C)->method();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access protected const A::FOO in %s:%d
Stack trace:
#0 %s(%d): C->method()
#1 {main}
thrown in %s on line %d