<?php
ini_set('display_errors', 1);
ini_set('memory_limit', '10G');
$fp = fopen('/tmp/test.php', 'w');
fwrite($fp, '<?php return "');
for ($i=0; $i < 2048; $i++) {
fwrite($fp, str_repeat('#', 1024*1024));
}
fwrite($fp, '";');
fclose($fp);
$a = require '/tmp/test.php';
echo strlen($a);
PHP 8.4.11 (cli) (built: Aug 3 2025 08:42:03) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.11, Copyright (c) Zend Technologies
with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
Operating System
Ubuntu 22.04.5 LTS