xref: /PHP-8.0/tests/classes/bug27468.phpt (revision f44dd16b)
1--TEST--
2Bug #27468 (foreach in __destruct() causes segfault)
3--FILE--
4<?php
5class foo {
6    function __destruct() {
7        foreach ($this->x as $x);
8    }
9}
10new foo();
11echo 'OK';
12?>
13--EXPECTF--
14Warning: Undefined property: foo::$x in %s on line %d
15
16Warning: foreach() argument must be of type array|object, null given in %sbug27468.php on line 4
17OK
18