3v4l.org

run code in 300+ PHP versions simultaneously
<?php function apiCall($url) { $data = null; // New prices uploaded if (get_transient("newPricesUploaded")) { // Get all cached API urls and delete them if (false !== ($transients = get_transient("apiCallTransients"))) { foreach ($transients as $transient) { delete_transient($transient); } delete_transient("apiCallTransients"); } // Reset set_transient("newPricesUploaded", 0, YEAR_IN_SECONDS); } if (false === ($data = get_transient(md5($url)))) { $data = file_get_contents($url); // Cache the request set_transient(md5($url), $data, 10800); // Update the apiCallTransients reference if (false !== ($transients = get_transient("apiCallTransients"))) { $transients[] = md5($url); } else { $transients = array(md5($url)); } set_transient("apiCallTransients", $transients, YEAR_IN_SECONDS); } return $data; }

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.0060.00918.55
8.3.50.0120.00722.05
8.3.40.0110.00818.67
8.3.30.0100.01020.05
8.3.20.0120.00318.48
8.3.10.0120.00318.94
8.3.00.0030.00619.67
8.2.180.0100.01018.41
8.2.170.0090.00622.96
8.2.160.0140.00020.52
8.2.150.0130.00324.18
8.2.140.0080.00624.66
8.2.130.0070.00026.16
8.2.120.0000.01019.29
8.2.110.0030.00622.31
8.2.100.0070.00417.52
8.2.90.0050.00319.09
8.2.80.0030.00619.39
8.2.70.0000.00817.50
8.2.60.0080.00017.90
8.2.50.0030.00618.07
8.2.40.0000.00819.82
8.2.30.0000.00821.22
8.2.20.0000.00717.53
8.2.10.0050.00217.49
8.2.00.0030.00717.64
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0070.01126.35
8.1.250.0000.00728.09
8.1.240.0030.00622.35
8.1.230.0080.00420.73
8.1.220.0090.00018.77
8.1.210.0050.00318.91
8.1.200.0080.00017.10
8.1.190.0050.00217.38
8.1.180.0030.00618.10
8.1.170.0050.00318.54
8.1.160.0000.00718.78
8.1.150.0070.00418.50
8.1.140.0040.00417.40
8.1.130.0030.00517.66
8.1.120.0030.00517.35
8.1.110.0070.00017.33
8.1.100.0050.00317.31
8.1.90.0040.00417.36
8.1.80.0000.00717.36
8.1.70.0030.00517.38
8.1.60.0050.00317.38
8.1.50.0030.00517.39
8.1.40.0000.00717.44
8.1.30.0000.00817.56
8.1.20.0050.00317.44
8.1.10.0040.00417.34
8.1.00.0030.00917.30
8.0.300.0030.00719.82
8.0.290.0080.00017.05
8.0.280.0070.00018.28
8.0.270.0030.00317.05
8.0.260.0030.00316.72
8.0.250.0050.00216.85
8.0.240.0000.00716.83
8.0.230.0090.00016.80
8.0.220.0030.00316.79
8.0.210.0070.00316.68
8.0.200.0070.00016.73
8.0.190.0000.00716.84
8.0.180.0070.00016.81
8.0.170.0060.00316.80
8.0.160.0000.00816.75
8.0.150.0080.00016.79
8.0.140.0040.00416.61
8.0.130.0030.00613.21
8.0.120.0040.00416.66
8.0.110.0070.00016.61
8.0.100.0000.00816.77
8.0.90.0050.00216.69
8.0.80.0070.01116.68
8.0.70.0050.00316.68
8.0.60.0000.00716.68
8.0.50.0030.00516.68
8.0.30.0110.01017.02
8.0.20.0110.00817.40
8.0.10.0080.00016.82
8.0.00.0170.00316.59
7.4.330.0040.00016.83
7.4.320.0030.00316.39
7.4.300.0050.00316.34
7.4.290.0030.00316.53
7.4.280.0000.00716.40
7.4.270.0070.00016.50
7.4.260.0000.00513.13
7.4.250.0000.00916.37
7.4.240.0000.00816.54
7.4.230.0070.00016.49
7.4.220.0180.00316.54
7.4.210.0090.00816.48
7.4.200.0040.00416.47
7.4.190.0000.00716.55
7.4.160.0160.00716.43
7.4.150.0160.00617.40
7.4.140.0060.01117.86
7.4.130.0090.00916.38
7.4.120.0090.01216.29
7.4.110.0000.02216.20
7.4.100.0070.01016.23
7.4.90.0060.01216.24
7.4.80.0100.01019.39
7.4.70.0070.01316.57
7.4.60.0090.00916.45
7.4.50.0000.00716.54
7.4.40.0090.00922.77
7.4.30.0100.01016.38
7.4.10.0060.01516.55
7.4.00.0060.01115.66
7.3.330.0000.00513.18
7.3.320.0060.00013.01
7.3.310.0000.00716.10
7.3.300.0030.00316.16
7.3.290.0070.01016.21
7.3.280.0080.00916.20
7.3.270.0130.00417.40
7.3.260.0090.01118.24
7.3.250.0130.00616.32
7.3.240.0040.01216.30
7.3.230.0100.00716.47
7.3.210.0070.01016.14
7.3.200.0090.00919.39
7.3.190.0140.00716.33
7.3.180.0100.00716.44
7.3.170.0110.00716.27
7.3.160.0000.01716.32
7.3.130.0060.01216.23
7.3.120.0090.00615.52
7.3.110.0110.00416.40
7.3.100.0000.01916.06
7.3.90.0110.00416.04
7.3.80.0030.01316.13
7.3.70.0070.00416.24
7.3.60.0000.01016.03
7.3.50.0040.00916.26
7.3.40.0030.00616.23
7.3.30.0070.00716.07
7.3.20.0120.00417.86
7.3.10.0070.00616.98
7.3.00.0070.00517.00
7.2.330.0030.01316.41
7.2.320.0070.01016.20
7.2.310.0070.01416.41
7.2.300.0090.01216.36
7.2.290.0110.00616.39
7.2.260.0070.01016.39
7.2.250.0090.01216.59
7.2.240.0030.00916.46
7.2.230.0090.00916.41
7.2.220.0050.00516.33
7.2.210.0070.01016.36
7.2.200.0070.01016.29
7.2.190.0030.01416.30
7.2.180.0070.00316.40
7.2.170.0070.00716.39
7.2.160.0090.00316.16
7.2.150.0060.01018.36
7.2.140.0070.01018.03
7.2.130.0020.01117.16
7.2.120.0050.01017.04
7.2.110.0040.01117.05
7.2.100.0050.00716.96
7.2.90.0050.00817.11
7.2.80.0050.00817.10
7.2.70.0020.01017.15
7.2.60.0050.00717.13
7.2.50.0060.01017.07
7.2.40.0070.00817.09
7.2.30.0070.00717.15
7.2.20.0070.00817.25
7.2.10.0070.00617.10
7.2.00.0050.01017.52
7.1.330.0030.01017.39
7.1.320.0030.01117.03
7.1.310.0000.01117.38
7.1.300.0050.00817.11
7.1.290.0040.00717.35
7.1.280.0000.01117.24
7.1.270.0060.01017.27
7.1.260.0070.00317.16
7.1.250.0020.01015.92
7.1.240.0100.00317.20
7.1.230.0000.01117.07
7.1.220.0030.00717.03
7.1.210.0030.00717.02
7.1.200.0060.01217.20
7.1.190.0030.01317.11
7.1.180.0060.01017.04
7.1.170.0130.00617.13
7.1.160.0120.00317.07
7.1.150.0030.01317.26
7.1.140.0060.00617.11
7.1.130.0060.00817.14
7.1.120.0070.00417.16
7.1.110.0060.00917.23
7.1.100.0030.01117.48
7.1.90.0070.00717.13
7.1.80.0030.01017.12
7.1.70.0050.00817.06
7.1.60.0080.00617.01
7.1.50.0030.01016.97
7.1.40.0030.01016.69
7.1.30.0090.00616.86
7.1.20.0030.00816.94
7.1.10.0030.00816.65
7.1.00.0020.00916.85
7.0.330.0000.01016.82
7.0.320.0070.00716.73
7.0.310.0030.00716.88
7.0.300.0080.00816.73
7.0.290.0070.01016.85
7.0.280.0000.01116.83
7.0.270.0030.01216.86
7.0.260.0030.00916.83
7.0.250.0090.00616.98
7.0.240.0030.00616.83
7.0.230.0030.01416.62
7.0.220.0030.00916.86
7.0.210.0090.00916.79
7.0.200.0020.00916.77
7.0.190.0030.00816.68
7.0.180.0030.01116.68
7.0.170.0020.00816.53
7.0.160.0040.00916.51
7.0.150.0050.01116.58
7.0.140.0070.00516.47
7.0.130.0080.00316.57
7.0.120.0050.00516.45
7.0.110.0060.00316.53
7.0.100.0030.01016.52
7.0.90.0090.00616.48
7.0.80.0060.00616.64
7.0.70.0040.00716.55
7.0.60.0040.00916.50
7.0.50.0070.00516.53
7.0.40.0020.01115.43
7.0.30.0060.00615.52
7.0.20.0050.00515.54
7.0.10.0060.00815.57
7.0.00.0070.00615.52
5.6.400.0050.00515.77
5.6.390.0070.00315.84
5.6.380.0030.00915.75
5.6.370.0070.00315.78
5.6.360.0030.00715.82
5.6.350.0030.01215.54
5.6.340.0000.01215.54
5.6.330.0040.00815.48
5.6.320.0030.01115.54
5.6.310.0000.01115.52
5.6.300.0070.03818.34
5.6.290.0000.03218.25
5.6.280.0050.02418.31
5.6.270.0040.02518.34
5.6.260.0070.02918.35
5.6.250.0080.02118.27
5.6.240.0060.02418.34
5.6.230.0020.03018.28
5.6.220.0060.02718.22
5.6.210.0070.02218.03
5.6.200.0090.02118.21
5.6.190.0040.02818.24
5.6.180.0050.03318.21
5.6.170.0080.03718.15
5.6.160.0080.02518.27
5.6.150.0000.02918.26
5.6.140.0020.02718.24
5.6.130.0060.03818.29
5.6.120.0050.03318.38
5.6.110.0090.04318.20
5.6.100.0070.02118.26
5.6.90.0060.04418.36
5.6.80.0060.02817.86
5.6.70.0040.04118.00
5.6.60.0020.02817.85
5.6.50.0090.03217.94
5.6.40.0050.04118.04
5.6.30.0040.02517.87
5.6.20.0070.04317.94
5.6.10.0050.04718.06
5.6.00.0090.04017.88
5.5.380.0040.02816.66
5.5.370.0060.03616.57
5.5.360.0030.04816.70
5.5.350.0070.02416.53
5.5.340.0050.02316.98
5.5.330.0080.02316.73
5.5.320.0030.03816.60
5.5.310.0040.02316.75
5.5.300.0080.02416.90
5.5.290.0050.02716.82
5.5.280.0050.03016.81
5.5.270.0050.02616.88
5.5.260.0060.04916.74
5.5.250.0070.04316.55
5.5.240.0060.03816.45
5.5.230.0060.03916.46
5.5.220.0050.02416.46
5.5.210.0020.02716.48
5.5.200.0080.03816.31
5.5.190.0050.04516.38
5.5.180.0030.02716.29
5.5.170.0120.00615.56
5.5.160.0030.04516.46
5.5.150.0040.03516.48
5.5.140.0090.04116.41
5.5.130.0040.02416.47
5.5.120.0120.02116.43
5.5.110.0060.02116.42
5.5.100.0080.02216.38
5.5.90.0050.02716.19
5.5.80.0080.02616.34
5.5.70.0020.02616.47
5.5.60.0070.02116.31
5.5.50.0030.02416.33
5.5.40.0040.02716.38
5.5.30.0060.01916.36
5.5.20.0030.02516.33
5.5.10.0040.02216.44
5.5.00.0050.02216.42
5.4.450.0070.03715.98
5.4.440.0030.04515.99
5.4.430.0050.02215.71
5.4.420.0030.03115.78
5.4.410.0030.02315.83
5.4.400.0020.02315.79
5.4.390.0030.02615.69
5.4.380.0020.02415.71
5.4.370.0020.02215.64
5.4.360.0080.04115.83
5.4.350.0060.02715.75
5.4.340.0020.02415.62
5.4.330.0080.00412.40
5.4.320.0050.02315.61
5.4.310.0030.02315.79
5.4.300.0060.03715.67
5.4.290.0080.03615.55
5.4.280.0000.02715.67
5.4.270.0030.02115.62
5.4.260.0050.02515.72
5.4.250.0020.02815.67
5.4.240.0020.02615.76
5.4.230.0080.01915.66
5.4.220.0060.01915.70
5.4.210.0030.03015.74
5.4.200.0020.02415.70
5.4.190.0010.02615.71
5.4.180.0030.02315.73
5.4.170.0060.02015.60
5.4.160.0020.02215.67
5.4.150.0040.02215.61
5.4.140.0020.02314.50
5.4.130.0030.02214.57
5.4.120.0030.02914.57
5.4.110.0080.01814.51
5.4.100.0110.02114.62
5.4.90.0060.01914.53
5.4.80.0030.02214.48
5.4.70.0060.01914.51
5.4.60.0030.01914.47
5.4.50.0010.02414.49
5.4.40.0080.02114.50
5.4.30.0020.02114.45
5.4.20.0070.01814.50
5.4.10.0020.02714.54
5.4.00.0070.02914.35
5.3.290.0050.03214.57
5.3.280.0040.02114.53
5.3.270.0040.02014.56
5.3.260.0020.02814.42
5.3.250.0000.02414.48
5.3.240.0030.02114.48
5.3.230.0020.02314.47
5.3.220.0080.02414.51
5.3.210.0050.02214.50
5.3.200.0070.02014.50
5.3.190.0040.02214.47
5.3.180.0050.02114.51
5.3.170.0020.02214.60
5.3.160.0020.02414.53
5.3.150.0020.03014.60
5.3.140.0030.02114.51
5.3.130.0020.02714.52
5.3.120.0060.02414.51
5.3.110.0020.02214.44
5.3.100.0040.02714.40
5.3.90.0050.02414.49
5.3.80.0030.02514.42
5.3.70.0030.02214.44
5.3.60.0000.02414.57
5.3.50.0030.02014.46
5.3.40.0070.01814.43
5.3.30.0000.02214.45
5.3.20.0020.02114.49
5.3.10.0050.02514.32
5.3.00.0050.02014.38
5.2.170.0030.03216.20
5.2.160.0030.03016.20
5.2.150.0070.03016.20
5.2.140.0000.03116.20
5.2.130.0070.02616.20
5.2.120.0000.03116.20
5.2.110.0030.02616.20
5.2.100.0030.02816.20
5.2.90.0030.02716.20
5.2.80.0030.02816.20
5.2.70.0070.04616.20
5.2.60.0030.05416.20
5.2.50.0070.04816.20
5.2.40.0030.03516.20
5.2.30.0030.03116.20
5.2.20.0030.02716.20
5.2.10.0030.04416.20
5.2.00.0030.02716.20
5.1.60.0070.02316.20
5.1.50.0060.05216.20
5.1.40.0000.03716.20
5.1.30.0030.02616.20
5.1.20.0070.05316.20
5.1.10.0030.04916.20
5.1.00.0030.05316.20
5.0.50.0040.01816.20
5.0.40.0030.01916.20
5.0.30.0070.02916.20
5.0.20.0000.04016.20
5.0.10.0070.02016.20
5.0.00.0000.03216.20
4.4.90.0000.03816.20
4.4.80.0030.01816.20
4.4.70.0000.03416.20
4.4.60.0000.02316.20
4.4.50.0060.03216.20
4.4.40.0030.05216.20
4.4.30.0030.03316.20
4.4.20.0030.03516.20
4.4.10.0000.02816.20
4.4.00.0000.05716.20
4.3.110.0000.01916.20
4.3.100.0000.01916.20
4.3.90.0100.02816.20
4.3.80.0030.03116.20
4.3.70.0000.03716.20
4.3.60.0030.03216.20
4.3.50.0000.01716.20
4.3.40.0030.05216.20
4.3.30.0060.02316.20
4.3.20.0000.02016.20
4.3.10.0000.01716.20
4.3.00.0000.02916.20

preferences:
47.63 ms | 401 KiB | 5 Q