3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $array = ['Prinsha', 'Jypsy']; // echo $array[0]; // index is 0 // foreach($model as $key => $data) { // } // $array[1] = 'data'; // $array = ['model' => $model]; // $array = array(); // date('Y-m-d', strtotime("+3 days", $time)); $array = [1, 2, 3, 4]; echo $array[0] . "\n"; $associative = ['a' => '1', 'apple' => '3v4l', '1337' => 'PHP sucks']; echo $associative['a'] + 1 . "\n"; echo $associative['apple'] . "\n"; echo $associative[1337] . "\n"; $numbers = [1,2,3,4]; $numbers[] = 5; $numbers[] = 6; echo $numbers[0] . "\n"; //1 echo $numbers[4] . "\n"; // echo $numbers[5] . "\n"; $favColors = array(); $favColors[] = 'BlanchedAlmond'; $favColors[] = 'CadetBlue'; $favColors[] = 'BurlyWood'; $favColors[] = 'DarkOliveGreen'; $favColors[] = 'HotPink'; $favColors[] = 'Papayawhip'; echo $favColors[0] . "\n"; $matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]; echo $matrix[1][2]; // 6

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.0100.01016.50
8.3.50.0070.01316.50
8.3.40.0070.00718.78
8.3.30.0110.00418.72
8.3.20.0040.00420.26
8.3.10.0090.00023.48
8.3.00.0050.00321.92
8.2.180.0070.00717.00
8.2.170.0070.00722.96
8.2.160.0110.00419.19
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0000.00820.94
8.2.120.0060.00326.35
8.2.110.0000.00921.96
8.2.100.0120.00317.97
8.2.90.0000.00919.39
8.2.80.0000.00818.05
8.2.70.0140.00017.63
8.2.60.0080.00017.93
8.2.50.0040.00418.10
8.2.40.0000.00720.61
8.2.30.0050.00319.20
8.2.20.0060.00318.05
8.2.10.0040.00418.03
8.2.00.0040.00418.05
8.1.280.0130.00625.92
8.1.270.0050.00222.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00420.95
8.1.230.0000.01119.16
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.34
8.1.190.0040.00417.23
8.1.180.0090.00018.10
8.1.170.0060.00318.57
8.1.160.0050.00318.93
8.1.150.0040.00418.89
8.1.140.0040.00419.59
8.1.130.0080.00018.95
8.1.120.0000.00717.52
8.1.110.0040.00417.45
8.1.100.0080.00017.52
8.1.90.0000.00717.53
8.1.80.0000.00717.43
8.1.70.0000.00717.43
8.1.60.0000.00917.55
8.1.50.0040.00417.47
8.1.40.0000.00817.51
8.1.30.0040.00417.58
8.1.20.0040.00417.72
8.1.10.0040.00517.49
8.1.00.0040.00417.50
8.0.300.0040.00420.27
8.0.290.0040.00416.75
8.0.280.0050.00218.52
8.0.270.0040.00417.31
8.0.260.0080.00016.91
8.0.250.0000.00717.00
8.0.240.0060.00017.04
8.0.230.0000.00716.92
8.0.220.0000.00616.98
8.0.210.0030.00317.00
8.0.200.0060.00017.05
8.0.190.0000.00817.02
8.0.180.0070.00017.05
8.0.170.0030.00317.00
8.0.160.0070.00016.95
8.0.150.0040.00416.92
8.0.140.0000.00716.93
8.0.130.0000.00513.32
8.0.120.0060.00316.97
8.0.110.0070.00016.95
8.0.100.0070.00016.93
8.0.90.0000.00717.00
8.0.80.0140.00316.94
8.0.70.0030.00516.91
8.0.60.0040.00416.70
8.0.50.0000.00716.82
8.0.30.0080.01017.03
8.0.20.0130.01217.40
8.0.10.0040.00416.97
8.0.00.0160.00316.82
7.4.330.0050.00015.55
7.4.320.0000.00716.57
7.4.300.0000.00716.46
7.4.290.0000.00716.39
7.4.280.0040.00416.43
7.4.270.0070.00016.36
7.4.260.0070.00016.53
7.4.250.0070.00016.50
7.4.240.0000.00716.50
7.4.230.0040.00416.63
7.4.220.0190.00016.49
7.4.210.0070.01116.43
7.4.200.0030.00316.39
7.4.160.0090.00816.67
7.4.150.0000.01717.40
7.4.140.0110.00717.86
7.4.130.0080.00916.60
7.4.120.0140.00516.50
7.4.110.0090.00916.59
7.4.100.0170.00016.43
7.4.90.0120.00616.50
7.4.80.0070.01019.39
7.4.70.0070.01016.25
7.4.60.0100.00616.50
7.4.50.0040.01416.25
7.4.40.0110.00816.33
7.4.30.0070.01016.52
7.4.00.0070.01014.97
7.3.330.0000.00513.02
7.3.320.0060.00013.18
7.3.310.0040.00416.26
7.3.300.0000.00716.30
7.3.290.0000.00716.18
7.3.280.0070.00916.28
7.3.270.0130.00417.40
7.3.260.0090.00916.47
7.3.250.0130.00416.42
7.3.240.0100.00916.40
7.3.230.0050.01116.40
7.3.210.0030.01316.25
7.3.200.0120.01116.18
7.3.190.0030.01616.50
7.3.180.0000.01616.38
7.3.170.0130.00316.43
7.3.160.0120.00316.55
7.3.120.0110.00414.97
7.3.110.0110.00714.82
7.3.100.0040.01214.93
7.3.90.0120.00314.81
7.3.80.0100.00714.64
7.3.70.0100.00714.85
7.3.60.0040.01114.73
7.3.50.0030.01014.54
7.3.40.0060.00314.91
7.3.30.0030.01314.56
7.3.20.0100.00316.79
7.3.10.0090.00916.39
7.3.00.0030.00816.75
7.2.330.0070.01416.57
7.2.320.0110.00616.90
7.2.310.0030.01516.65
7.2.300.0180.00016.40
7.2.290.0140.00316.68
7.2.250.0080.01115.10
7.2.240.0100.01015.35
7.2.230.0100.00315.19
7.2.220.0060.01214.92
7.2.210.0030.01315.22
7.2.200.0080.00615.09
7.2.190.0100.00715.00
7.2.180.0060.00915.14
7.2.170.0080.00315.10
7.2.60.0120.00316.93
7.1.330.0040.01215.84
7.1.320.0040.00415.63
7.1.310.0090.00615.64
7.1.300.0040.01115.95
7.1.290.0000.01015.82
7.1.280.0040.00815.90
7.1.270.0140.00015.54
7.1.260.0070.00315.73
7.1.200.0030.00615.74
7.1.100.0030.01018.20
7.1.70.0070.00716.99
7.1.60.0170.01735.13
7.1.50.0180.01434.77
7.1.40.0160.01334.38
7.1.30.0180.01534.48
7.1.20.0180.01434.39
7.1.10.0100.01016.45
7.1.00.0030.01016.77
7.0.200.0110.00416.53
7.0.190.0060.00916.58
7.0.180.0030.01016.24
7.0.170.0060.00916.45
7.0.160.0030.01016.31
7.0.150.0090.00616.28
7.0.140.0030.01016.26
7.0.130.0000.01416.51
7.0.120.0110.00316.38
7.0.110.0000.01316.31
7.0.100.0060.00616.34
7.0.90.0070.00716.43
7.0.80.0120.00616.36
7.0.70.0090.00616.43
7.0.60.0050.00816.14
7.0.50.0050.01116.36
7.0.40.0000.01416.55
7.0.30.0040.01116.37
7.0.20.0030.01016.32
7.0.10.0090.00416.18
7.0.00.0030.01316.34

preferences:
35.39 ms | 400 KiB | 5 Q