3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
1000013 2394064
Output for 8.1.0 - 8.1.28
1000013 2394376
Output for 8.0.0 - 8.0.30
1000013 2393720
Output for 7.4.0 - 7.4.33
1000013 2394024
Output for 7.3.16 - 7.3.33
1000013 2394000
Output for 7.2.29 - 7.2.33
1000013 2390120
Output for 7.2.0 - 7.2.6
1000013 2390160
Output for 7.0.0 - 7.0.20, 7.1.0, 7.1.7 - 7.1.20
1000013 2353552
Output for 7.1.5 - 7.1.6
1000013 2353688
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
1000013 2220328

preferences:
162.74 ms | 402 KiB | 183 Q