3v4l.org

run code in 300+ PHP versions simultaneously
<?php var: $country_name; function get_country_code() { $cc = 'US'; return $cc; } function get_country_name() { $cn_array = array( 'COUNTRY_NAME' => array( 'AF' => 'Afghanistan', 'US' => 'United Snakes', 'RU' => 'VodkaTown', ), ); $country_code = 'US'; $country_name = $cn_array['COUNTRY_NAME'][$country_code]; } $country_name = get_country_name($country_name); 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.0100.04320.37
5.5.240.0030.08020.03
5.4.400.0230.05718.75
5.4.390.0270.04318.75
5.4.380.0100.06018.76
5.4.370.0070.06318.71
5.4.360.0270.04318.62
5.4.350.0270.05718.80
5.4.340.0230.04318.74
5.4.320.0170.05318.71
5.4.310.0230.04718.80
5.4.300.0100.06018.66
5.4.290.0100.05718.74
5.4.280.0270.04318.83
5.4.270.0170.05718.75
5.4.260.0130.06018.60
5.4.250.0200.05018.77
5.4.240.0300.05318.59
5.4.230.0170.05718.81
5.4.220.0230.06718.54
5.4.210.0130.05318.77
5.4.200.0130.05716.67
5.4.190.0300.04018.82
5.4.180.0100.07318.73
5.4.170.0230.07018.79
5.4.160.0200.05718.48
5.4.150.0100.06018.72
5.4.140.0030.07016.21
5.4.130.0130.05316.31
5.4.120.0100.05316.32
5.4.110.0200.04716.32
5.4.100.0070.06316.18
5.4.90.0100.05716.32
5.4.80.0130.05316.43
5.4.70.0270.04716.20
5.4.60.0170.06716.17
5.4.50.0130.05016.29
5.4.40.0230.04316.23
5.4.30.0200.06716.13
5.4.20.0170.05316.22
5.4.10.0130.05316.27
5.4.00.0030.06015.73
5.3.290.0130.06014.75
5.3.280.0230.04714.57
5.3.270.0170.06314.59
5.3.260.0100.06014.55
5.3.250.0230.05314.68
5.3.240.0170.05014.54
5.3.230.0200.05014.55
5.3.220.0200.04714.48
5.3.210.0200.05314.56
5.3.200.0170.05014.54
5.3.190.0270.06014.54
5.3.180.0170.05714.53
5.3.170.0170.05314.56
5.3.160.0130.05014.56
5.3.150.0170.05014.51
5.3.140.0230.04714.45
5.3.130.0130.06014.48
5.3.120.0300.06014.48
5.3.110.0070.06014.52
5.3.100.0130.05314.00
5.3.90.0130.05714.12
5.3.80.0130.05313.96
5.3.70.0030.06314.02
5.3.60.0130.05313.93
5.3.50.0300.03714.02
5.3.40.0230.05013.87
5.3.30.0100.05313.98
5.3.20.0170.04713.65
5.3.10.0230.04013.60
5.3.00.0170.05013.57
5.2.170.0170.04011.12
5.2.160.0030.05011.12
5.2.150.0100.04311.13
5.2.140.0170.03711.19
5.2.130.0170.04311.05
5.2.120.0170.03711.24
5.2.110.0130.04311.08
5.2.100.0100.04311.04
5.2.90.0100.04311.26
5.2.80.0170.04011.05
5.2.70.0100.04311.08
5.2.60.0130.04011.02
5.2.50.0130.04311.06
5.2.40.0000.05010.90
5.2.30.0200.03311.11
5.2.20.0070.04310.99
5.2.10.0030.04710.90
5.2.00.0100.04010.75
5.1.60.0170.0439.95
5.1.50.0170.02710.11
5.1.40.0130.03010.01
5.1.30.0070.04010.45
5.1.20.0130.05010.51
5.1.10.0170.03010.19
5.1.00.0170.03010.18
5.0.50.0130.0238.53
5.0.40.0030.0308.40
5.0.30.0070.0508.26
5.0.20.0070.0308.21
5.0.10.0030.0338.16
5.0.00.0070.0408.21
4.4.90.0030.0235.82
4.4.80.0070.0205.91
4.4.70.0100.0175.86
4.4.60.0170.0105.90
4.4.50.0100.0235.91
4.4.40.0100.0405.89
4.4.30.0030.0235.86
4.4.20.0000.0275.88
4.4.10.0030.0235.88
4.4.00.0030.0475.93
4.3.110.0030.0275.85
4.3.100.0100.0235.82
4.3.90.0030.0235.79
4.3.80.0000.0405.79
4.3.70.0070.0235.79
4.3.60.0070.0205.78
4.3.50.0000.0275.77
4.3.40.0030.0375.77
4.3.30.0070.0204.57
4.3.20.0030.0274.62
4.3.10.0030.0274.59
4.3.00.0030.0277.31

preferences:
143.84 ms | 1398 KiB | 7 Q