xref: /PHP-8.2/ext/spl/tests/gh14639.phpt (revision 0d4e0c01)
1--TEST--
2GH-14639 (Member access within null pointer in ext/spl/spl_observer.c)
3--INI--
4memory_limit=2M
5--SKIPIF--
6<?php
7if (getenv("USE_ZEND_ALLOC") === "0") {
8    die("skip Zend MM disabled");
9}
10?>
11--FILE--
12<?php
13$b = new SplObjectStorage();
14for ($i = 10000; $i > 0; $i--) {
15    $object = new StdClass();
16    $object->a = str_repeat("a", 2);
17    $b->attach($object);
18}
19?>
20--EXPECTF--
21Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
22