xref: /PHP-8.4/Zend/tests/bug78344.phpt (revision d30cd7d7)
1--TEST--
2Bug #78344: Segmentation fault on zend_check_protected
3--FILE--
4<?php
5
6class A {
7    protected const FOO = 1;
8}
9
10class B {}
11class C extends B {
12    public function method() {
13        var_dump(A::FOO);
14    }
15}
16(new C)->method();
17
18?>
19--EXPECTF--
20Fatal error: Uncaught Error: Cannot access protected constant A::FOO in %s:%d
21Stack trace:
22#0 %s(%d): C->method()
23#1 {main}
24  thrown in %s on line %d
25