3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("4","6","2","ololo"); $time = microtime(true); $i=0; while($i < 50000) { $i++; json_encode($arr); } $time1 = microtime(true) - $time; $time = microtime(true); $i=0; while($i < 50000) { $i++; serialize($arr); } $time2 = microtime(true) - $time; echo '1 took ' . number_format($time1, 3) . "\n"; echo '2 took ' . number_format($time2, 3) . "\n";

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).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0030.02919.25
7.1.70.0000.02517.01
7.1.60.0070.03919.33
7.1.50.0070.04616.66
7.1.00.0000.10722.51
7.0.200.0030.02316.73
7.0.140.0000.10322.18
7.0.90.0100.08019.91
7.0.80.0170.09019.89
7.0.70.0030.05719.93
7.0.60.0100.10719.99
7.0.50.0100.08320.38
7.0.40.0070.06720.04
7.0.30.0030.10720.10
7.0.20.0030.06020.13
7.0.10.0000.11320.13
7.0.00.0130.06720.16
5.6.280.0000.14720.86
5.6.240.0100.14720.48
5.6.230.0100.14020.50
5.6.220.0000.12020.55
5.6.210.0100.14720.58
5.6.200.0130.14021.03
5.6.190.0030.14321.10
5.6.180.0070.13021.03
5.6.170.0230.14320.96
5.6.160.0100.13720.96
5.6.150.0130.12721.11
5.6.140.0130.15021.03
5.6.130.0070.09021.08
5.6.120.0100.13321.09
5.6.110.0070.13321.09
5.6.100.0100.15020.89
5.6.90.0070.13721.03
5.6.80.0070.11320.34
5.6.70.0130.13320.33
5.6.60.0030.08720.45
5.6.50.0100.13320.40
5.6.40.0000.14020.34
5.6.30.0100.14320.34
5.6.20.0030.10320.48
5.6.10.0070.11720.41
5.6.00.0100.14320.45
5.5.380.0070.11020.36
5.5.370.0170.14020.39
5.5.360.0100.12020.35
5.5.350.0130.09720.45
5.5.340.0070.13020.91
5.5.330.0130.15320.88
5.5.320.0170.08320.64
5.5.310.0030.15020.89
5.5.300.0070.14020.92
5.5.290.0030.09320.75
5.5.280.0070.12720.80
5.5.270.0130.13720.86
5.5.260.0130.11720.78
5.5.250.0100.11720.64
5.5.240.0170.12720.26
5.5.230.0070.14320.14
5.5.220.0070.12720.01
5.5.210.0030.15720.20
5.5.200.0130.12720.18
5.5.190.0200.13320.08
5.5.180.0100.14320.24
5.5.160.0070.10020.27
5.5.150.0030.11020.17
5.5.140.0000.10020.25
5.5.130.0030.13020.24
5.5.120.0100.13019.98
5.5.110.0100.13020.27
5.5.100.0000.10020.12
5.5.90.0070.09020.05
5.5.80.0070.13720.09
5.5.70.0170.10320.06
5.5.60.0070.12320.05
5.5.50.0130.13020.05
5.5.40.0100.13719.92
5.5.30.0030.14019.92
5.5.20.0030.14720.05
5.5.10.0030.09020.11
5.5.00.0030.14320.09
5.4.450.0030.10319.43
5.4.440.0100.11319.35
5.4.430.0130.12319.43
5.4.420.0130.13719.32
5.4.410.0000.11019.16
5.4.400.0000.10319.06
5.4.390.0200.13719.29
5.4.380.0200.11018.84
5.4.370.0030.14018.85
5.4.360.0070.13018.98
5.4.350.0100.12319.06
5.4.340.0170.12319.12
5.4.320.0100.15019.01
5.4.310.0130.14719.09
5.4.300.0030.15719.02
5.4.290.0130.12719.00
5.4.280.0070.08719.28
5.4.270.0100.14718.87
5.4.260.0130.11719.09
5.4.250.0070.13319.28
5.4.240.0070.12718.86
5.4.230.0030.12319.15
5.4.220.0030.14018.97
5.4.210.0070.10018.84
5.4.200.0070.12018.84
5.4.190.0070.09318.95
5.4.180.0070.09018.84
5.4.170.0100.14019.11
5.4.160.0030.10018.87
5.4.150.0100.10019.12
5.4.140.0070.10316.36
5.4.130.0100.12316.33
5.4.120.0070.14316.23
5.4.110.0100.13016.42
5.4.100.0000.14716.42
5.4.90.0100.13716.40
5.4.80.0000.07716.43
5.4.70.0000.13716.26
5.4.60.0030.08716.32
5.4.50.0070.07316.41
5.4.40.0030.08016.35
5.4.30.0070.12316.27
5.4.20.0030.08016.26
5.4.10.0000.08316.41
5.4.00.0070.07715.79
5.3.290.0100.12314.55
5.3.280.0070.12714.60
5.3.270.0030.09714.52
5.3.260.0170.11014.58
5.3.250.0070.09314.59
5.3.240.0070.09314.48
5.3.230.0100.14714.57
5.3.220.0030.10014.54
5.3.210.0000.10314.49
5.3.200.0100.10314.53
5.3.190.0030.13014.54
5.3.180.0070.07714.44
5.3.170.0070.12714.45
5.3.160.0070.08014.48
5.3.150.0030.08014.55
5.3.140.0000.10014.50
5.3.130.0070.08014.44
5.3.120.0030.08714.50
5.3.110.0100.08014.47
5.3.100.0030.07714.09
5.3.90.0000.08713.99
5.3.80.0030.07714.06
5.3.70.0000.08014.07
5.3.60.0030.13713.96
5.3.50.0030.07713.92
5.3.40.0030.08013.92
5.3.30.0070.13313.76
5.3.20.0030.12713.67
5.3.10.0100.13013.60
5.3.00.0000.08313.39
5.2.170.0030.07711.40
5.2.160.0030.07311.17
5.2.150.0000.08011.17
5.2.140.0030.12311.25
5.2.130.0000.09711.04
5.2.120.0100.12311.26
5.2.110.0030.07711.18
5.2.100.0030.12011.25
5.2.90.0030.06711.19
5.2.80.0130.05711.26
5.2.70.0000.08011.18
5.2.60.0030.11711.22
5.2.50.0070.12311.28
5.2.40.0170.05711.11
5.2.30.0030.07711.15
5.2.20.0000.12710.96
5.2.10.0030.07711.04
5.2.00.0000.08010.82
5.1.60.0170.03710.00
5.1.50.0000.0479.97
5.1.40.0030.0309.97
5.1.30.0030.05310.39
5.1.20.0300.02710.42
5.1.10.0070.0609.94
5.1.00.0000.04310.05
5.0.50.0000.0339.79
5.0.40.0030.0439.79
5.0.30.0000.0479.79
5.0.20.0000.0509.79
5.0.10.0200.0339.79
5.0.00.0000.0639.79
4.4.90.0030.0339.79
4.4.80.0000.0179.79
4.4.70.0000.0309.79
4.4.60.0000.0179.79
4.4.50.0070.0109.79
4.4.40.0070.0509.79
4.4.30.0000.0279.79
4.4.20.0000.0409.79
4.4.10.0000.0239.79
4.4.00.0070.0539.79
4.3.110.0030.0309.79
4.3.100.0000.0409.79
4.3.90.0030.0309.79
4.3.80.0070.0479.79
4.3.70.0000.0309.79
4.3.60.0070.0309.79
4.3.50.0070.0209.79
4.3.40.0100.0439.79
4.3.30.0000.0309.79
4.3.20.0000.0409.79
4.3.10.0030.0279.79
4.3.00.0030.0209.79

preferences:
31.03 ms | 401 KiB | 5 Q