← Back
Editing: oom_json_encode.phpt
--TEST-- json_encode() of large tree doesn't reach hard memory limit --EXTENSIONS-- simplexml --INI-- memory_limit=64M --FILE-- <?php $path = __DIR__ . '/oom_json_encode.xml'; file_put_contents($path, '<r>' . str_repeat('<a/>', 750000) . '</r>'); $xml = simplexml_load_file($path); $result = json_encode($xml); ?> --CLEAN-- <?php @unlink(__DIR__ . '/oom_json_encode.xml'); ?> --EXPECTF-- Fatal error: Allowed memory size of 67108864 bytes exhausted %S(tried to allocate %d bytes) in %s on line %d
Save File
Cancel