3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function get_country_code() { } public function get_country_name() { $cn_array = array( 'COUNTRY_NAME' => array( 'AF' => 'Afghanistan', 'US' => 'United Snakes', 'RU' => 'VodkaTown', ), ); $country_code = get_country_code(); $country_name = $cn_array[COUNTRY_NAME][$country_code]; echo $country_name; }

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)
5.6.80.0030.04020.28
5.5.240.0030.07320.21
5.4.400.0130.06018.73
5.4.390.0130.05718.74
5.4.380.0170.05318.46
5.4.370.0130.05718.69
5.4.360.0170.05018.53
5.4.350.0170.05318.70
5.4.340.0270.06718.77
5.4.320.0170.05718.78
5.4.310.0170.05318.69
5.4.300.0070.06718.71
5.4.290.0100.06318.61
5.4.280.0270.04318.52
5.4.270.0130.06718.62
5.4.260.0230.06718.75
5.4.250.0130.05718.85
5.4.240.0230.05018.71
5.4.230.0200.06318.73
5.4.220.0130.06718.55
5.4.210.0200.05018.60
5.4.200.0100.05316.61
5.4.190.0170.05718.56
5.4.180.0270.06318.79
5.4.170.0170.08018.73
5.4.160.0170.05718.47
5.4.150.0100.06318.75
5.4.140.0170.06016.30
5.4.130.0200.04716.36
5.4.120.0270.05316.29
5.4.110.0170.06016.32
5.4.100.0300.06016.26
5.4.90.0200.05016.21
5.4.80.0400.05316.23
5.4.70.0170.05716.26
5.4.60.0130.05716.27
5.4.50.0270.04316.13
5.4.40.0270.04316.39
5.4.30.0130.06316.25
5.4.20.0070.07016.15
5.4.10.0230.04016.39
5.4.00.0200.04715.66
5.3.290.0200.06014.61
5.3.280.0170.05714.51
5.3.270.0100.06014.70
5.3.260.0130.06714.61
5.3.250.0170.05014.63
5.3.240.0200.05014.57
5.3.230.0170.05014.58
5.3.220.0130.05314.46
5.3.210.0130.05714.52
5.3.200.0200.05014.48
5.3.190.0230.04714.56
5.3.180.0270.05014.55
5.3.170.0100.05714.57
5.3.160.0130.05314.64
5.3.150.0200.04714.66
5.3.140.0130.05314.55
5.3.130.0230.05014.53
5.3.120.0100.06014.51
5.3.110.0070.06314.66
5.3.100.0170.05013.99
5.3.90.0070.06014.07
5.3.80.0230.04013.96
5.3.70.0130.05013.99
5.3.60.0270.04013.94
5.3.50.0070.05714.02
5.3.40.0130.05313.91
5.3.30.0200.04713.91
5.3.20.0200.04313.78
5.3.10.0230.04313.74
5.3.00.0170.05313.55
5.2.170.0130.04011.11
5.2.160.0030.04711.17
5.2.150.0130.04311.20
5.2.140.0130.03711.10
5.2.130.0100.04311.10
5.2.120.0100.04011.07
5.2.110.0130.03711.02
5.2.100.0170.03311.24
5.2.90.0100.04311.05
5.2.80.0170.03711.07
5.2.70.0070.04711.07
5.2.60.0130.04311.03
5.2.50.0170.04010.98
5.2.40.0130.05011.02
5.2.30.0130.03711.00
5.2.20.0170.03310.99
5.2.10.0100.03710.84
5.2.00.0130.03710.80
5.1.60.0070.0379.96
5.1.50.0100.0339.95
5.1.40.0100.03310.09
5.1.30.0170.03010.43
5.1.20.0130.03710.41
5.1.10.0100.03710.08
5.1.00.0130.03310.14
5.0.50.0070.0308.54
5.0.40.0030.0308.44
5.0.30.0070.0438.22
5.0.20.0070.0308.37
5.0.10.0070.0308.20
5.0.00.0070.0408.19
4.4.90.0070.0205.94
4.4.80.0030.0235.91
4.4.70.0130.0135.89
4.4.60.0070.0205.86
4.4.50.0030.0235.91
4.4.40.0100.0305.91
4.4.30.0000.0275.88
4.4.20.0070.0235.93
4.4.10.0000.0275.95
4.4.00.0070.0335.93
4.3.110.0100.0275.84
4.3.100.0130.0235.79
4.3.90.0070.0205.80
4.3.80.0170.0305.89
4.3.70.0070.0275.77
4.3.60.0100.0175.80
4.3.50.0030.0275.86
4.3.40.0030.0375.82
4.3.30.0030.0234.61
4.3.20.0000.0274.57
4.3.10.0070.0204.56
4.3.00.0030.0207.30

preferences:
143.23 ms | 1394 KiB | 7 Q