xref: /php-src/Zend/tests/new_oom.inc (revision ee000ea1)
1<?php
2
3$mb_used = (int) ceil(memory_get_usage() / (1024 ** 2));
4ini_set('memory_limit', ($mb_used + 1) . 'M');
5
6$class = $argv[1];
7$objects = [];
8
9try {
10    while (true) {
11        $rc = new ReflectionClass($class);
12        $objects[] = $rc->newInstanceWithoutConstructor();
13    }
14} catch (Throwable) {
15}
16