3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_currency($from_Currency, $to_Currency, $amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "http://www.google.com/finance/converter?a=$amount&from=$from_Currency&to=$to_Currency"; $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)"); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $rawdata = curl_exec($ch); curl_close($ch); $data = explode('bld>', $rawdata); $data = explode($to_Currency, $data[1]); return round($data[0], 2); } // Call the function to get the currency converted echo get_currency('USD', 'NZD', 1); ?>

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)
8.3.60.0120.00618.55
8.3.50.0120.00521.87
8.3.40.0090.00618.62
8.3.30.0070.01419.14
8.3.20.0040.00420.39
8.3.10.0000.00821.91
8.3.00.0000.00822.49
8.2.180.0140.00716.75
8.2.170.0040.01122.96
8.2.160.0110.00320.96
8.2.150.0080.00024.18
8.2.140.0050.00524.66
8.2.130.0070.00026.16
8.2.120.0040.00419.36
8.2.110.0030.00622.27
8.2.100.0090.00317.84
8.2.90.0000.00819.02
8.2.80.0040.00418.03
8.2.70.0030.00617.75
8.2.60.0060.00317.90
8.2.50.0050.00318.07
8.2.40.0000.00718.22
8.2.30.0050.00218.08
8.2.20.0000.00817.79
8.2.10.0000.00819.47
8.2.00.0090.00017.84
8.1.280.0070.00725.92
8.1.270.0040.00422.19
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.92
8.1.230.0080.00319.21
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0000.00817.40
8.1.180.0030.00518.77
8.1.170.0000.00818.51
8.1.160.0060.00322.02
8.1.150.0000.00718.48
8.1.140.0000.00717.41
8.1.130.0070.00317.70
8.1.120.0070.00017.33
8.1.110.0040.00417.32
8.1.100.0000.00717.30
8.1.90.0050.00317.44
8.1.80.0040.00417.33
8.1.70.0000.00717.35
8.1.60.0040.00417.62
8.1.50.0030.00517.60
8.1.40.0040.00417.44
8.1.30.0000.00717.61
8.1.20.0080.00017.73
8.1.10.0000.00817.52
8.1.00.0000.00817.51
8.0.300.0000.00718.77
8.0.290.0000.00717.18
8.0.280.0000.00718.39
8.0.270.0000.00717.27
8.0.260.0000.00716.98
8.0.250.0070.00017.07
8.0.240.0040.00416.94
8.0.230.0030.00316.92
8.0.220.0040.00416.92
8.0.210.0000.00716.98
8.0.200.0070.00016.91
8.0.190.0000.00716.91
8.0.180.0040.00416.96
8.0.170.0040.00416.98
8.0.160.0040.00416.97
8.0.150.0040.00416.83
8.0.140.0040.00416.86
8.0.130.0030.00313.39
8.0.120.0050.00316.93
8.0.110.0040.00416.82
8.0.100.0040.00416.87
8.0.90.0000.00716.78
8.0.80.0090.00617.01
8.0.70.0080.00016.98
8.0.60.0040.00417.05
8.0.50.0050.00317.02
8.0.30.0120.00617.26
8.0.20.0090.00917.42
8.0.10.0000.00717.06
8.0.00.0090.00917.09
7.4.330.0030.00315.00
7.4.320.0030.00316.55
7.4.300.0000.00616.54
7.4.290.0040.00416.46
7.4.280.0000.00916.61
7.4.270.0030.00316.52
7.4.260.0030.00516.50
7.4.250.0000.00816.61
7.4.240.0020.00516.62
7.4.230.0040.00416.63
7.4.220.0090.00916.64
7.4.210.0080.00916.53
7.4.200.0040.00416.41
7.4.190.0030.00316.57
7.4.160.0120.00316.53
7.4.150.0120.00617.40
7.4.140.0060.01117.86
7.4.130.0100.00716.57
7.4.120.0060.01316.56
7.4.110.0100.01316.39
7.4.100.0100.01016.42
7.4.90.0080.01116.64
7.4.80.0110.00619.39
7.4.70.0080.00916.45
7.4.60.0100.01016.58
7.4.50.0060.00316.27
7.4.40.0030.01022.77
7.4.30.0060.01016.63
7.4.00.0090.00614.97
7.3.330.0000.00513.39
7.3.320.0050.00013.37
7.3.310.0040.00416.42
7.3.300.0000.00716.34
7.3.290.0100.00916.44
7.3.280.0130.00616.39
7.3.270.0090.00917.40
7.3.260.0110.00716.32
7.3.250.0070.01016.44
7.3.240.0070.01016.58
7.3.230.0130.01016.53
7.3.210.0100.01016.47
7.3.200.0090.00919.39
7.3.190.0100.01016.58
7.3.180.0070.01016.58
7.3.170.0130.00316.54
7.3.160.0120.00316.59
7.3.120.0030.01414.56
7.2.330.0070.01016.83
7.2.320.0190.00616.41
7.2.310.0140.01016.36
7.2.300.0090.01216.66
7.2.290.0090.00616.57
7.2.110.0070.00716.62
7.2.100.0050.00916.73
7.2.90.0150.00416.45
7.2.80.0110.00816.65
7.2.70.0190.00316.78
7.2.60.0070.00916.89
7.2.50.0070.00716.94
7.2.40.0100.00816.74
7.2.30.0080.00816.90
7.2.20.0190.00016.79
7.2.10.0150.00616.91
7.2.00.0120.00418.17
7.1.230.0190.00015.93
7.1.220.0150.00015.75
7.1.210.0090.00515.93
7.1.200.0100.00315.71
7.1.190.0070.00715.88
7.1.180.0050.01015.72
7.1.170.0070.00715.80
7.1.160.0090.00615.73
7.1.150.0000.01515.78
7.1.140.0160.00315.77
7.1.130.0090.00915.86
7.1.120.0100.00715.46
7.1.110.0070.00715.64
7.1.100.0020.01316.79
7.1.90.0120.00415.86
7.1.80.0140.00315.71
7.1.70.0090.00316.49
7.1.60.0110.00917.82
7.1.50.0060.01616.34
7.1.40.0040.01315.65
7.1.30.0110.00715.92
7.1.20.0070.01015.73
7.1.10.0150.00015.82
7.1.00.0040.04419.00
7.0.310.0000.01515.48
7.0.300.0120.00615.06
7.0.290.0110.00315.39
7.0.280.0100.00715.36
7.0.270.0570.00315.42
7.0.260.0150.00015.57
7.0.250.0130.00315.48
7.0.240.0110.00715.54
7.0.230.0100.00715.10
7.0.220.0750.00315.41
7.0.210.0100.00515.55
7.0.200.0140.00015.87
7.0.190.0090.01215.38
7.0.180.0100.00715.44
7.0.170.0130.00015.22
7.0.160.0120.00415.25
7.0.150.0090.00615.42
7.0.140.0090.03818.58
7.0.130.0570.01015.23
7.0.120.0120.00415.42
7.0.110.0030.01315.25
7.0.100.0100.00515.05
7.0.90.0110.00715.38
7.0.80.0120.00315.37
7.0.70.0330.00415.21
7.0.60.0090.04217.61
7.0.50.0070.04416.72
7.0.40.0120.02116.88
7.0.30.0340.02716.72
7.0.20.0200.04116.87
7.0.10.0190.04416.83
7.0.00.0130.04016.89
5.6.380.0110.00314.21
5.6.370.0110.00714.21
5.6.360.0110.00613.97
5.6.350.0100.01014.30
5.6.340.0040.01014.21
5.6.330.0100.00714.25
5.6.320.0100.00713.99
5.6.310.0130.00014.21
5.6.300.0140.00414.38
5.6.290.0100.00614.22
5.6.280.0080.04017.72
5.6.270.0050.01114.58
5.6.260.0120.00414.23
5.6.250.0120.00614.23
5.6.240.0070.01114.20
5.6.230.0130.00314.30
5.6.220.0050.01014.32
5.6.210.0070.02217.52
5.6.200.0120.03216.12
5.6.190.0060.02717.27
5.6.180.0230.03517.41
5.6.170.0180.03717.39
5.6.160.0140.02917.27
5.6.150.0140.04016.26
5.6.140.0090.04516.21
5.6.130.0060.03716.20
5.6.120.0110.04317.55
5.6.110.0120.03217.71
5.6.100.0150.03717.59
5.6.90.0100.04217.70
5.6.80.0110.03817.17
5.6.70.1610.02217.43
5.6.60.0090.00414.10
5.6.50.0120.00414.09
5.6.40.0160.00014.31
5.6.30.0100.00313.92
5.6.20.0150.00414.15
5.6.10.0060.01214.18
5.6.00.0140.00714.24
5.5.380.0110.00412.79
5.5.370.0040.00412.79
5.5.360.0130.00012.79
5.5.350.0200.03916.55
5.5.340.0070.04315.38
5.5.330.0150.03016.57
5.5.320.0130.02816.60
5.5.310.0150.02516.57
5.5.300.0050.02315.37
5.5.290.0070.03015.39
5.5.280.0030.03716.84
5.5.270.0060.02416.80
5.5.260.0090.03516.82
5.5.250.0080.03316.74
5.5.240.0150.03516.44
5.5.230.0060.00612.79
5.5.220.0050.00812.79
5.5.210.0110.00412.79
5.5.200.0070.00312.79
5.5.190.0110.00412.79
5.5.180.0070.00712.79
5.5.170.0130.00414.07
5.5.160.0090.00612.79
5.5.150.0160.00012.79
5.5.140.0050.00912.79
5.5.130.0060.00312.79
5.5.120.0090.00412.79
5.5.110.0110.00412.79
5.5.100.0050.00512.79
5.5.90.0060.00312.79
5.5.80.0100.00612.79
5.5.70.0030.01012.79
5.5.60.0030.00912.79
5.5.50.0080.00312.79
5.5.40.0040.00712.79
5.5.30.0080.00312.79
5.5.20.0080.00312.79
5.5.10.0090.00412.79
5.5.00.0100.00312.79
5.4.450.0340.03016.17
5.4.440.0330.03515.98
5.4.430.0120.03216.11
5.4.420.0100.02816.08
5.4.410.0090.03115.80
5.4.400.0190.03515.79
5.4.390.0250.02815.79
5.4.380.0160.03115.77
5.4.370.0100.02315.75
5.4.360.0140.02315.63
5.4.350.0090.01912.41
5.4.340.0060.02812.41
5.4.330.0000.01212.79
5.4.320.0040.02612.65
5.4.310.0070.02212.65
5.4.300.0070.02312.65
5.4.290.0100.02112.65
5.4.280.0210.03612.59
5.4.270.0100.02512.59
5.4.260.0130.02512.58
5.4.250.0100.03412.59
5.4.240.0090.03812.59
5.4.230.0110.02512.58
5.4.220.0050.02912.58
5.4.210.0090.03912.58
5.4.200.0060.02812.58
5.4.190.0090.02612.58
5.4.180.0100.02512.58
5.4.170.0070.02612.59
5.4.160.0100.02312.58
5.4.150.0070.02812.58
5.4.140.0120.02512.42
5.4.130.0100.02512.41
5.4.120.0100.02512.40
5.4.110.0090.02512.39
5.4.100.0100.02312.39
5.4.90.0080.02712.39
5.4.80.0070.02812.39
5.4.70.0090.02712.39
5.4.60.0090.02512.39
5.4.50.0120.02312.39
5.4.40.0090.02612.39
5.4.30.0100.02512.38
5.4.20.0070.02612.38
5.4.10.0060.02712.38
5.4.00.0080.02112.13
5.3.290.0070.02112.79
5.3.280.0100.02212.75
5.3.270.0040.02612.76
5.3.260.0100.02612.75
5.3.250.0090.02612.75
5.3.240.0110.02612.75
5.3.230.0090.02512.75
5.3.220.0080.02512.73
5.3.210.0080.02912.73
5.3.200.0060.02912.73
5.3.190.0100.02412.73
5.3.180.0080.02712.73
5.3.170.0060.02612.73
5.3.160.0070.02312.73
5.3.150.0100.02012.73
5.3.140.0070.02212.73
5.3.130.0100.02112.72
5.3.120.0040.02512.72
5.3.110.0030.02712.72
5.3.100.0080.02112.45
5.3.90.0090.02112.44
5.3.80.0060.02412.43
5.3.70.0090.02212.43
5.3.60.0120.02412.43
5.3.50.0090.02612.40
5.3.40.0100.02612.40
5.3.30.0120.02312.38
5.3.20.0100.02312.27
5.3.10.0060.03212.25
5.3.00.0050.03012.25
5.2.170.0050.02611.00
5.2.160.0060.02610.99
5.2.150.0080.02410.99
5.2.140.0070.02510.99
5.2.130.0040.02710.97
5.2.120.0050.02910.97
5.2.110.0090.02110.97
5.2.100.0100.02610.97
5.2.90.0050.02810.97
5.2.80.0070.02810.97
5.2.70.0050.02110.97
5.2.60.0080.02710.95
5.2.50.0070.02610.93
5.2.40.0110.02310.92
5.2.30.0060.02610.91
5.2.20.0100.02010.91
5.2.10.0100.02110.86
5.2.00.0080.02010.79
5.1.60.0070.02710.44
5.1.50.0100.02310.44
5.1.40.0080.01610.43
5.1.30.0050.02010.60
5.1.20.0070.02210.61
5.1.10.0060.02110.47
5.1.00.0050.02010.47
5.0.50.0040.0169.71
5.0.40.0060.0199.64
5.0.30.0040.0299.55
5.0.20.0060.0129.54
5.0.10.0060.0169.53
5.0.00.0060.0269.52
4.4.90.0040.0138.78
4.4.80.0040.0128.77
4.4.70.0020.0128.77
4.4.60.0020.0128.77
4.4.50.0040.0108.78
4.4.40.0010.0158.75
4.4.30.0040.0118.77
4.4.20.0040.0128.82
4.4.10.0030.0188.82
4.4.00.0070.0258.77
4.3.110.0010.0148.73
4.3.100.0060.0078.73
4.3.90.0040.0128.71
4.3.80.0070.0148.69
4.3.70.0030.0168.71
4.3.60.0050.0108.71
4.3.50.0080.0218.71
4.3.40.0040.0198.66
4.3.30.0060.0148.05
4.3.20.0030.0138.04
4.3.10.0010.0148.02
4.3.00.0070.00913.01

preferences:
41.15 ms | 401 KiB | 5 Q