3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array ( 0 => array ( 'php' => 5.3, ), 1 => array ( 'php' => 5.3, ), 2 => array ( 'php' => 5.3, ), ); $t = microtime(true); for ($i = 0; $i < 1000000; $i++) { $a = array_map('serialize', $a); $a = array_unique($a); $a = array_map('unserialize', $a); } echo 'serialize'; var_dump($a); echo microtime(true) - $t."\n"; $t = microtime(true); for ($i = 0; $i < 1000000; $i++) { $a = array_map('json_encode', $a); $a = array_unique($a); $a = array_map(function($v) { return json_decode($v, true);}, $a); } echo 'json'; var_dump($a); echo microtime(true) - $t."\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.0072.31719.32
7.1.70.0001.82417.22
7.1.60.1441.73919.27
7.1.50.0071.94016.98
7.1.00.0071.91722.29
7.0.200.0102.37516.49
7.0.140.0102.42322.09
7.0.100.0172.48319.93
7.0.90.0002.17319.91
7.0.80.0172.11319.88
7.0.70.0132.10719.84
7.0.60.0072.16319.93
7.0.50.0302.45320.22
7.0.40.0172.25720.10
7.0.30.0102.28720.07
7.0.20.0032.12720.05
7.0.10.0072.30020.12
7.0.00.0002.19320.04
5.6.280.0032.49720.83
5.6.250.0002.50020.56
5.6.240.0072.49320.61
5.6.230.0002.50020.56
5.6.220.0102.49020.52
5.6.210.0102.49020.73
5.6.200.0102.43721.00
5.6.190.0102.45721.01
5.6.180.0002.50021.07
5.6.170.0102.49021.02
5.6.160.0132.48720.95
5.6.150.0072.49320.97
5.6.140.0072.49321.00
5.6.130.0002.50021.00
5.6.120.0132.48721.03
5.6.110.0102.49021.06
5.6.100.0032.49720.95
5.6.90.2472.23321.02
5.6.80.0072.48720.43
5.6.70.0032.44720.28
5.6.60.0132.46720.27
5.6.50.0102.46020.42
5.6.40.0102.46020.34
5.6.30.0132.46720.34
5.6.20.0132.44020.39
5.6.10.0102.46020.33
5.6.00.0032.25020.26
5.5.380.0002.50020.34
5.5.370.0102.43020.55
5.5.360.0402.38020.64
5.5.350.0272.35720.50
5.5.340.0272.40320.87
5.5.330.0232.41720.88
5.5.320.0372.37320.91
5.5.310.0232.39020.82
5.5.300.0272.42020.80
5.5.290.0102.44320.72
5.5.280.0272.42320.85
5.5.270.0272.40720.91
5.5.260.0102.44720.80
5.5.250.0172.39720.75
5.5.240.0202.39720.26
5.5.230.0432.37720.29
5.5.220.0302.41320.33
5.5.210.0102.40720.27
5.5.200.0172.41020.27
5.5.190.0102.41320.29
5.5.180.0332.34720.32
5.5.160.0232.35020.28
5.5.150.0202.42020.29
5.5.140.0472.39020.30
5.5.130.0172.42020.29
5.5.120.0202.42720.19
5.5.110.0132.42020.16
5.5.100.0102.39320.20
5.5.90.0072.43320.08
5.5.80.0232.40320.20
5.5.70.0172.41020.14
5.5.60.0272.38320.10
5.5.50.0202.37320.13
5.5.40.0302.39020.18
5.5.30.0132.41020.06
5.5.20.0272.38320.17
5.5.10.0132.38320.05
5.5.00.0172.42720.16
5.4.450.0372.39019.38
5.4.440.0202.42319.38
5.4.430.0202.36319.23
5.4.420.0332.36319.29
5.4.410.0202.34319.11
5.4.400.0302.43018.97
5.4.390.0102.39319.04
5.4.380.0172.39719.10
5.4.370.0402.41719.09
5.4.360.0332.41318.89
5.4.350.0272.39719.07
5.4.340.0202.38019.19
5.4.320.0202.42019.11
5.4.310.0102.44018.85
5.4.300.0072.42019.06
5.4.290.0302.40719.10
5.4.280.0172.43019.07
5.4.270.0232.37719.22
5.4.260.0202.39319.07
5.4.250.0172.43018.89
5.4.240.0232.41719.09
5.4.230.0202.42019.03
5.4.220.0302.36719.07
5.4.210.0072.38718.91
5.4.200.0202.40318.84
5.4.190.0172.41019.18
5.4.180.0202.37719.03
5.4.170.0272.42719.17
5.4.160.0332.43018.94
5.4.150.0072.43019.09
5.4.140.0102.45316.46
5.4.130.0372.37316.34
5.4.120.0302.43016.37
5.4.110.0232.38716.48
5.4.100.0032.42016.52
5.4.90.0302.42016.48
5.4.80.0232.42316.51
5.4.70.0172.42316.26
5.4.60.0202.42316.50
5.4.50.0202.38316.39
5.4.40.0232.35316.18
5.4.30.0202.43016.45
5.4.20.0132.41016.21
5.4.10.0272.41316.30
5.4.00.0172.37015.84
5.3.290.0302.39014.53
5.3.280.0272.42014.32
5.3.270.0172.43014.49
5.3.260.0102.43314.43
5.3.250.0172.42714.46
5.3.240.0372.36714.48
5.3.230.0102.40014.48
5.3.220.0272.40014.42
5.3.210.0202.39714.45
5.3.200.0372.41314.42
5.3.190.0302.41314.39
5.3.180.0172.43314.55
5.3.170.0302.37714.42
5.3.160.0102.41314.39
5.3.150.0132.37714.45
5.3.140.0232.40314.44
5.3.130.0232.42014.41
5.3.120.0202.41714.42
5.3.110.0332.41014.34
5.3.100.0172.36713.91
5.3.90.0132.42314.01
5.3.80.0132.40713.84
5.3.70.0172.43713.82
5.3.60.0002.47013.82
5.3.50.0232.40013.76
5.3.40.0202.40713.74
5.3.30.0172.42313.68
5.3.20.0272.37013.48
5.3.10.0172.42313.44
5.3.00.0102.39713.40
5.2.170.0070.05311.13
5.2.160.0030.07011.07
5.2.150.0070.05711.18
5.2.140.0030.04311.12
5.2.130.0100.04711.09
5.2.120.0030.03311.05
5.2.110.0030.04710.89
5.2.100.0030.02711.14
5.2.90.0070.02311.05
5.2.80.0000.03010.89
5.2.70.0000.02711.09
5.2.60.0030.03311.12
5.2.50.0030.02711.09
5.2.40.0000.03011.04
5.2.30.0000.03010.97
5.2.20.0030.03010.80
5.2.10.0100.01710.90
5.2.00.0130.01710.66
5.1.60.0030.01710.02
5.1.50.0030.02010.00
5.1.40.0070.0439.98
5.1.30.0000.04010.35
5.1.20.0030.04710.31
5.1.10.0000.0339.90
5.1.00.0100.05010.07
5.0.50.0030.0238.55
5.0.40.0100.0438.27
5.0.30.0000.0338.12
5.0.20.0070.0378.27
5.0.10.0000.0238.20
5.0.00.0030.0678.20
4.4.90.0030.0137.13
4.4.80.0000.0177.13
4.4.70.0030.0137.13
4.4.60.0000.0137.13
4.4.50.0000.0177.13
4.4.40.0000.0237.13
4.4.30.0030.0337.13
4.4.20.0030.0177.13
4.4.10.0000.0377.13
4.4.00.0000.0477.13
4.3.110.0000.0377.13
4.3.100.0030.0237.13
4.3.90.0030.0237.13
4.3.80.0000.0537.13
4.3.70.0070.0307.13
4.3.60.0000.0407.13
4.3.50.0000.0377.13
4.3.40.0030.0507.13
4.3.30.0000.0377.13
4.3.20.0000.0177.13
4.3.10.0000.0377.13
4.3.00.0070.0137.13

preferences:
45.08 ms | 401 KiB | 5 Q