3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; $lastChar = null; foreach (str_split('10001101') as $char) { if ($char !== $lastChar) { unset($ref); $array[] = &$ref; $ref = $char; $lastChar = $char; } else { $ref .= $char; } } var_export($array);

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.0070.01116.63
8.3.50.0150.00316.54
8.3.40.0090.00618.80
8.3.30.0090.00618.55
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0030.00326.16
8.2.180.0120.00325.92
8.2.170.0110.00719.04
8.2.160.0110.00322.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0040.00420.35
8.2.100.0110.00417.91
8.2.90.0040.00420.30
8.2.80.0080.00017.97
8.2.70.0000.00817.75
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0040.00418.14
8.2.20.0040.00418.16
8.2.10.0050.00219.31
8.2.00.0000.00719.25
8.1.280.0110.00825.92
8.1.270.0040.00423.99
8.1.260.0060.00328.09
8.1.250.0000.00828.09
8.1.240.0030.00623.93
8.1.230.0040.00820.95
8.1.220.0060.00317.74
8.1.210.0000.00719.00
8.1.200.0040.00417.23
8.1.190.0080.00017.23
8.1.180.0030.00518.10
8.1.170.0040.00418.77
8.1.160.0050.00218.76
8.1.150.0040.00418.89
8.1.140.0000.00718.88
8.1.130.0030.00320.20
8.1.120.0030.00617.36
8.1.110.0000.00717.37
8.1.100.0030.00417.40
8.1.90.0000.00817.49
8.1.80.0020.00517.44
8.1.70.0000.00717.45
8.1.60.0000.00817.50
8.1.50.0000.00917.49
8.1.40.0060.00317.52
8.1.30.0030.00617.65
8.1.20.0030.00617.69
8.1.10.0080.00017.44
8.1.00.0050.00317.45
8.0.300.0030.00319.94
8.0.290.0000.00816.63
8.0.280.0030.00318.44
8.0.270.0030.00317.89
8.0.260.0030.00318.44
8.0.250.0040.00417.00
8.0.240.0000.00716.85
8.0.230.0080.00016.85
8.0.220.0070.00016.81
8.0.210.0030.00316.95
8.0.200.0000.00716.99
8.0.190.0000.00816.91
8.0.180.0080.00316.97
8.0.170.0000.00916.82
8.0.160.0000.00716.77
8.0.150.0050.00216.82
8.0.140.0000.00816.80
8.0.130.0050.00013.35
8.0.120.0040.00416.80
8.0.110.0040.00416.75
8.0.100.0000.00716.91
8.0.90.0040.00416.88
8.0.80.0070.01216.89
8.0.70.0040.00416.82
8.0.60.0080.00016.93
8.0.50.0040.00416.92
8.0.30.0190.01916.84
8.0.20.0290.01016.87
8.0.10.0180.01216.90
8.0.00.0160.01617.00
7.4.330.0040.00015.55
7.4.320.0000.00616.41
7.4.300.0040.00416.50
7.4.290.0040.00416.56
7.4.280.0030.00616.49
7.4.270.0100.00016.61
7.4.260.0030.00313.34
7.4.250.0000.00716.60
7.4.240.0030.00416.46
7.4.230.0050.00316.40
7.4.220.0020.00516.52
7.4.210.0040.00916.50
7.4.200.0040.00416.60
7.4.160.0210.01216.59
7.4.150.0230.01116.48
7.4.140.0230.00716.48
7.4.130.0250.00816.40
7.4.120.0270.00516.53
7.4.110.0280.01416.48
7.4.100.0210.01016.45
7.4.90.0150.01816.39
7.4.80.0250.01016.48
7.4.70.0180.01216.49
7.4.60.0290.00416.41
7.4.50.0260.01316.27
7.4.40.0220.01116.50
7.4.30.0310.00616.32
7.4.20.0200.01716.60
7.4.10.0240.00516.54
7.4.00.0270.01016.54
7.3.330.0000.00816.27
7.3.320.0050.00012.99
7.3.310.0020.00516.25
7.3.300.0040.00416.31
7.3.290.0040.01216.31
7.3.280.0070.01316.31
7.3.270.0320.00016.27
7.3.260.0210.01016.27
7.3.250.0120.01916.16
7.3.240.0200.01316.24
7.3.230.0280.00416.21
7.3.220.0220.01116.19
7.3.210.0290.00816.11
7.3.200.0110.01816.15
7.3.190.0270.01616.15
7.3.180.0180.01416.23
7.3.170.0260.00716.18
7.3.160.0280.01616.28
7.3.150.0210.01416.20
7.3.140.0280.01116.26
7.3.130.0270.00616.19
7.3.120.0320.00716.10
7.3.110.0210.01216.11
7.3.100.0250.01016.14
7.3.90.0210.01516.42
7.3.80.0190.01616.19
7.3.70.0300.00616.42
7.3.60.0190.01816.43
7.3.50.0370.01116.40
7.3.40.0210.01016.42
7.3.30.0180.01716.46
7.3.20.0320.01016.38
7.3.10.0270.00916.30
7.3.00.0250.01116.34

preferences:
59.91 ms | 400 KiB | 5 Q