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;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0090.00918.50
7.2.00.0000.01521.04
7.1.200.0030.00917.78
7.1.100.0080.00319.64
7.1.70.0130.01019.01
7.1.60.0110.01419.52
7.1.50.0250.01336.96
7.1.00.0070.07324.29
7.0.200.0050.00518.68
7.0.60.0170.07321.68
7.0.50.0200.07319.60
7.0.40.0030.05020.20
7.0.30.0330.07720.26
7.0.20.0270.08320.09
7.0.10.0100.07320.45
7.0.00.0000.04320.23
5.6.280.0030.06022.90
5.6.210.0000.07722.47
5.6.200.0100.06319.94
5.6.190.0070.06722.17
5.6.180.0170.04022.29
5.6.170.0500.06022.23
5.6.160.0070.07722.13
5.6.150.0100.08019.93
5.6.140.0070.08019.95
5.6.130.0100.08719.94
5.6.120.0170.05322.92
5.6.110.0170.07022.92
5.6.100.0100.08722.82
5.6.90.0070.08722.77
5.6.80.0100.08322.21
5.5.350.0230.04322.19
5.5.340.0000.06019.75
5.5.330.0100.07721.97
5.5.320.0230.04721.95
5.5.310.0230.03721.93
5.5.300.0070.04319.75
5.5.290.0100.05019.77
5.5.280.0030.04022.70
5.5.270.0030.06722.45
5.5.260.0030.05022.57
5.5.250.0170.06022.35
5.5.240.4230.03721.84
5.4.450.0570.05021.43
5.4.440.0070.06021.34
5.4.430.0270.04321.13
5.4.420.0130.05721.07
5.4.410.0300.04320.77
5.4.400.0230.04720.91
5.4.390.0130.05720.97
5.4.380.0200.06321.00
5.4.370.0130.05720.74
5.4.360.0200.05321.00
5.4.350.0200.05021.00
5.4.340.0200.05020.98
5.4.320.0130.05720.72
5.4.310.0270.04320.88
5.4.300.0170.05321.00
5.4.290.0200.05320.93
5.4.280.0170.05720.92
5.4.270.0170.05020.82
5.4.260.0230.04320.61
5.4.250.0230.04720.68
5.4.240.0130.05720.55
5.4.230.0200.05320.91
5.4.220.0230.05020.71
5.4.210.0200.05020.58
5.4.200.0270.04320.71
5.4.190.0170.05321.08
5.4.180.0230.04720.86
5.4.170.0230.04320.96
5.4.160.0170.05020.88
5.4.150.0230.04721.09
5.4.140.0300.04018.30
5.4.130.0200.04718.11
5.4.120.0170.04718.29
5.4.110.0230.04318.12
5.4.100.0170.04718.26
5.3.290.0070.06316.22
5.3.280.0130.05316.20
5.3.270.0100.06016.16
5.3.260.0200.05016.25
5.3.250.0130.05316.11
5.3.240.0070.06016.11
5.3.230.0130.05716.24
5.3.220.0100.06016.22
5.3.210.0200.05316.19
5.3.200.0100.05716.21