$data = str_pad('<?php\necho PHP_VERSION;', 4096); // PHP will crash if its size is multiples of 4096 bytes. if (version_compare(PHP_VERSION, '5.3.10', '<=') && !(strlen($data) % 4096)) { $data = preg_replace('/<\?php/', '<?php ', $data); } file_put_contents('test.php', $data); require('./test.php');