3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test() { $data = str_repeat('.', 1000000); echo strlen(serialize($data)); //echo strlen(serialize(str_repeat('.', 1000000))); //$data = serialize(str_repeat('.', 1000000)); //echo strlen($data); } test(); echo PHP_EOL, memory_get_peak_usage(), PHP_EOL;
Output for 7.2.0
1000013 2390160
Output for 7.0.0 - 7.1.0, 7.1.7 - 7.1.10
1000013 2353552
Output for 7.1.5 - 7.1.6
1000013 2353688
Output for 5.5.24 - 5.6.28
1000013 2220328
Output for 5.4.10 - 5.4.45
1000013 2220208
Output for 5.3.20 - 5.3.29
1000013 2622216