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 ']; // 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 $alphabets = ['b', 'c', 'a', 'z', 'y']; foreach($alphabets as $alphabet) { echo $alphabet . "\n"; } sort($alphabets); echo 'After sorting...'; foreach($alphabets as $alphabet) { echo $alphabet . "\n"; }

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.40.0120.00318.84
8.3.30.0110.00418.58
8.3.20.0040.00420.38
8.3.10.0040.00421.95
8.3.00.0070.00022.09
8.2.170.0090.00622.96
8.2.160.0100.00319.09
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0040.00420.88
8.2.120.0040.00426.35
8.2.110.0090.00020.99
8.2.100.0080.00317.84
8.2.90.0040.00419.05
8.2.80.0050.00318.03
8.2.70.0090.00317.50
8.2.60.0080.00017.90
8.2.50.0080.00018.10
8.2.40.0040.00420.53
8.2.30.0050.00221.09
8.2.20.0040.00417.99
8.2.10.0040.00417.99
8.2.00.0000.00718.11
8.1.270.0070.00022.25
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.96
8.1.230.0070.00418.98
8.1.220.0000.00817.74
8.1.210.0050.00518.77
8.1.200.0030.00617.38
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0000.00719.02
8.1.150.0040.00420.71
8.1.140.0000.00719.63
8.1.130.0000.00718.80
8.1.120.0070.00017.52
8.1.110.0000.00717.45
8.1.100.0050.00217.35
8.1.90.0000.00817.54
8.1.80.0000.00717.47
8.1.70.0040.00417.36
8.1.60.0000.00717.50
8.1.50.0040.00417.43
8.1.40.0040.00417.55
8.1.30.0040.00417.58
8.1.20.0050.00317.53
8.1.10.0040.00417.38
8.1.00.0050.00217.45
8.0.300.0000.00718.77
8.0.290.0030.00516.75
8.0.280.0000.00718.49
8.0.270.0000.00717.27
8.0.260.0000.00616.83
8.0.250.0030.00316.95
8.0.240.0000.00716.99
8.0.230.0040.00416.97
8.0.220.0040.00416.81
8.0.210.0040.00416.83
8.0.200.0030.00317.02
8.0.190.0040.00416.98
8.0.180.0040.00416.90
8.0.170.0000.00716.89
8.0.160.0030.00716.94
8.0.150.0000.00716.85
8.0.140.0030.00316.86
8.0.130.0030.00313.26
8.0.120.0020.00516.78
8.0.110.0000.00716.89
8.0.100.0000.00716.75
8.0.90.0040.00416.78
8.0.80.0060.01616.84
8.0.70.0000.00716.96
8.0.60.0070.00016.88
8.0.50.0040.00416.79
8.0.30.0060.01117.29
8.0.20.0100.00817.40
8.0.10.0000.00716.86
8.0.00.0090.00916.85
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0040.00416.54
7.4.290.0030.00316.50
7.4.280.0040.00416.52
7.4.270.0060.00016.43
7.4.260.0030.00316.48
7.4.250.0000.00616.57
7.4.240.0050.00316.61
7.4.230.0070.00016.26
7.4.220.0170.00416.66
7.4.210.0090.00716.59
7.4.200.0070.00016.61
7.4.160.0110.00416.45
7.4.150.0140.00317.40
7.4.140.0140.00617.86
7.4.130.0120.00616.51
7.4.120.0140.00616.55
7.4.110.0140.00616.43
7.4.100.0090.00916.49
7.4.90.0140.00316.39
7.4.80.0200.01619.39
7.4.70.0030.01216.49
7.4.60.0090.00616.30
7.4.50.0000.01716.48
7.4.40.0100.01016.50
7.4.30.0060.01216.31
7.4.10.0000.01614.93
7.4.00.0100.00714.92
7.3.330.0050.00013.00
7.3.320.0030.00313.25
7.3.310.0040.00416.31
7.3.300.0030.00316.25
7.3.290.0070.00016.26
7.3.280.0060.01016.23
7.3.270.0090.00917.40
7.3.260.0120.00916.28
7.3.250.0130.00416.28
7.3.240.0080.00816.37
7.3.230.0120.00616.48
7.3.210.0030.01316.27
7.3.200.0100.00716.40
7.3.190.0100.00616.62
7.3.180.0030.01216.29
7.3.170.0080.00816.32
7.3.160.0060.00916.38
7.3.130.0100.01014.99
7.3.120.0120.00414.74
7.3.110.0090.00614.73
7.3.100.0060.00614.74
7.3.90.0090.00614.76
7.3.80.0100.00314.87
7.3.70.0030.01314.78
7.3.60.0070.00314.89
7.3.50.0070.01114.83
7.3.40.0110.00314.39
7.3.30.0030.01014.75
7.3.20.0040.00816.55
7.3.10.0100.00316.75
7.3.00.0070.00716.48
7.2.330.0120.00616.38
7.2.320.0130.00916.52
7.2.310.0070.01016.52
7.2.300.0160.00616.50
7.2.290.0130.00716.67
7.2.260.0060.01315.03
7.2.250.0040.01415.01
7.2.240.0040.01115.07
7.2.230.0040.01115.10
7.2.220.0070.01114.96
7.2.210.0070.00714.64
7.2.200.0030.01314.80
7.2.190.0090.00315.07
7.2.180.0030.00614.91
7.2.170.0040.01214.94
7.2.160.0070.00715.00
7.2.150.0070.01116.79
7.2.140.0040.01116.83
7.2.130.0040.01016.78
7.2.120.0140.00016.69
7.2.110.0090.00617.01
7.2.100.0100.00416.91
7.2.90.0070.00717.00
7.2.80.0040.01116.95
7.2.70.0060.00817.06
7.2.60.0060.00716.79
7.2.50.0030.01016.89
7.2.40.0100.00617.02
7.2.30.0100.00317.00
7.2.20.0080.00416.80
7.2.10.0100.00717.00
7.2.00.0050.00718.18
7.1.330.0030.01015.73
7.1.320.0000.01415.93
7.1.310.0080.00815.75
7.1.300.0040.00815.68
7.1.290.0070.00715.82
7.1.280.0040.01115.80
7.1.270.0090.00315.39
7.1.260.0080.00015.81
7.1.250.0090.00315.78
7.1.240.0070.00715.48
7.1.230.0000.01515.71
7.1.220.0070.00715.61
7.1.210.0040.01115.57
7.1.200.0090.00115.62
7.1.190.0070.00315.95
7.1.180.0060.00915.75
7.1.170.0000.01115.67
7.1.160.0040.00415.92
7.1.150.0070.00715.82
7.1.140.0040.01215.80
7.1.130.0070.00715.67
7.1.120.0040.00715.43
7.1.110.0080.00615.81
7.1.100.0030.01116.99
7.1.90.0060.00915.50
7.1.80.0030.00615.77
7.1.70.0090.00516.40
7.1.60.0150.01125.20
7.1.50.0130.01125.03
7.1.40.0130.00824.98
7.1.30.0180.00925.04
7.1.20.0120.01325.08
7.1.10.0090.00716.03
7.1.00.0020.01616.33
7.0.330.0000.00815.16
7.0.320.0000.01014.99
7.0.310.0040.00715.16
7.0.300.0040.01115.02
7.0.290.0030.00515.46
7.0.280.0030.00515.15
7.0.270.0030.00715.19
7.0.260.0090.00615.03
7.0.250.0030.01015.48
7.0.240.0000.00915.52
7.0.230.0040.00715.48
7.0.220.0050.00315.40
7.0.210.0030.00915.18
7.0.200.0110.00216.05
7.0.190.0050.00715.99
7.0.180.0080.00815.90
7.0.170.0080.00815.81
7.0.160.0080.00615.69
7.0.150.0050.01015.81
7.0.140.0050.01015.81
7.0.130.0080.00816.00
7.0.120.0060.01215.84
7.0.110.0060.01115.73
7.0.100.0060.01015.93
7.0.90.0010.01415.91
7.0.80.0090.00715.87
7.0.70.0090.00815.73
7.0.60.0050.01115.80
7.0.50.0020.01415.91
7.0.40.0080.00914.74
7.0.30.0090.00614.89
7.0.20.0080.01014.92
7.0.10.0060.01214.91
7.0.00.0080.00814.79
5.6.400.0040.00714.27
5.6.390.0040.00714.58
5.6.380.0090.00314.42
5.6.370.0000.00914.24
5.6.360.0100.00314.46
5.6.350.0100.00714.24
5.6.340.0120.00314.52
5.6.330.0110.00414.28
5.6.320.0040.01214.43
5.6.310.0030.01014.09
5.6.300.0120.00314.48
5.6.290.0080.00814.08
5.6.280.0060.00614.31
5.6.270.0040.00714.33
5.6.260.0030.01314.30
5.6.250.0090.00614.41
5.6.240.0070.00714.44
5.6.230.0120.00014.61
5.6.220.0110.00314.45
5.6.210.0100.00714.17
5.6.200.0070.00714.44
5.6.190.0090.00614.22
5.6.180.0030.01014.20
5.6.170.0090.00414.23
5.6.160.0060.00614.57
5.6.150.0090.00614.07
5.6.140.0000.01114.51
5.6.130.0060.00614.16
5.6.120.0060.00614.24
5.6.110.0060.01514.00
5.6.100.0030.00714.06
5.6.90.0000.01014.20
5.6.80.0040.00714.16
5.6.70.0100.00314.23
5.6.60.0120.00014.11
5.6.50.0040.01114.30
5.6.40.0070.00714.15
5.6.30.0040.00714.35
5.6.20.0070.00714.07
5.6.10.0070.00714.24
5.6.00.0090.00014.33

preferences:
37.32 ms | 400 KiB | 5 Q