xref: /php-src/Zend/tests/bug78379_2.phpt (revision 902d6439)
1--TEST--
2Bug #78379.2 (Cast to object confuses GC, causes crash)
3--FILE--
4<?php
5#[AllowDynamicProperties]
6class E {}
7function f() {
8    $e1 = new E;
9    $e2 = new E;
10    $a = ['e2' => $e2];
11    $e1->a = (object)$a;
12    $e2->e1 = $e1;
13    $e2->a = (object)$a;
14}
15f();
16gc_collect_cycles();
17echo "End\n";
18?>
19--EXPECT--
20End
21