xref: /php-src/Zend/tests/gh16615_002.phpt (revision 3d3b22dd)
1--TEST--
2GH-16615 002 (Assertion failure in zend_std_read_property)
3--FILE--
4<?php
5
6class Foo {
7    public string $bar {
8        set => $value;
9    }
10    public function __clone() {
11        try {
12            echo $this->bar;
13        } catch (Error $e) {
14            printf("%s: %s\n", $e::class, $e->getMessage());
15        }
16    }
17}
18
19// Adds IS_PROP_REINITABLE to prop flags
20clone new Foo();
21
22?>
23--EXPECT--
24Error: Typed property Foo::$bar must not be accessed before initialization
25