3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = [ 'Alice Sandy', 'Alice Nanami', 'James Watt', 'Alice Monica', 'Johann Gauss', 'Cooper Alice', ]; $needle = 'Alice'; foreach($lines as $index => &$line) { if ($needle === strstr($line, ' ', true)) { // check whole first word if (!isset($firstOccurrence)) { $firstOccurrence =& $line; } else { $firstOccurrence .= strstr($line, ' '); unset($lines[$index]); } } } var_export($lines);

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.5.10.0100.00816.63
8.5.00.0110.01021.84
8.4.160.0090.01223.85
8.4.150.0090.00516.85
8.4.140.0120.00917.73
8.4.130.0110.01017.74
8.4.120.0130.00820.81
8.4.110.0090.01118.84
8.4.100.0080.00217.74
8.4.90.0120.00818.00
8.4.80.0070.00118.75
8.4.70.0060.00317.89
8.4.60.0090.01218.57
8.4.50.0060.00217.80
8.4.40.0130.00619.38
8.4.30.0070.01318.86
8.4.20.0130.00319.61
8.4.10.0040.00420.56
8.3.280.0060.00516.23
8.3.270.0120.00816.55
8.3.260.0120.00816.32
8.3.250.0090.01018.99
8.3.240.0100.00816.71
8.3.230.0100.00916.34
8.3.220.0120.00717.39
8.3.210.0070.01018.44
8.3.200.0050.00316.50
8.3.190.0120.00519.18
8.3.180.0050.00316.55
8.3.170.0030.01418.71
8.3.160.0040.00420.09
8.3.150.0060.01216.72
8.3.140.0040.00419.14
8.3.130.0030.01418.54
8.3.120.0040.00420.55
8.3.110.0050.01418.52
8.3.100.0090.00618.61
8.3.90.0050.00326.77
8.3.80.0090.00019.36
8.3.70.0000.01516.58
8.3.60.0070.01116.74
8.3.50.0100.00824.49
8.3.40.0090.00919.04
8.3.30.0120.00918.75
8.3.20.0050.00524.18
8.3.10.0050.00224.66
8.3.00.0030.00526.16
8.2.290.0090.00620.35
8.2.280.0110.00719.98
8.2.270.0030.00518.85
8.2.260.0040.00418.21
8.2.250.0000.00818.36
8.2.240.0060.00317.40
8.2.230.0110.01120.94
8.2.220.0090.00037.54
8.2.210.0060.00326.77
8.2.200.0030.00618.88
8.2.190.0150.00616.75
8.2.180.0100.01025.92
8.2.170.0000.01422.96
8.2.160.0110.00422.96
8.2.150.0040.01125.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.81
8.2.110.0100.00020.94
8.2.100.0110.00017.78
8.2.90.0000.00817.90
8.2.80.0000.00919.78
8.2.70.0030.00617.46
8.2.60.0080.00017.63
8.2.50.0000.00818.05
8.2.40.0000.00720.44
8.2.30.0070.00018.04
8.2.20.0000.00717.99
8.2.10.0040.00419.13
8.2.00.0000.00719.36
8.1.330.0130.00616.54
8.1.320.0090.01016.14
8.1.310.0050.00218.49
8.1.300.0080.00017.86
8.1.290.0040.00730.84
8.1.280.0150.00325.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00319.13
8.1.230.0120.00019.13
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0030.00617.25
8.1.190.0000.00817.23
8.1.180.0000.00918.10
8.1.170.0030.00617.62
8.1.160.0070.00018.88
8.1.150.0040.00418.87
8.1.140.0020.00520.71
8.1.130.0000.00817.51
8.1.120.0000.00817.34
8.1.110.0000.00717.43
8.1.100.0000.00817.37
8.1.90.0080.00017.48
8.1.80.0030.00617.51
8.1.70.0030.00517.42
8.1.60.0000.00717.64
8.1.50.0080.00017.51
8.1.40.0000.00717.44
8.1.30.0000.00817.59
8.1.20.0030.00517.54
8.1.10.0000.00817.50
8.1.00.0060.00317.44
8.0.300.0070.00019.77
8.0.290.0000.00816.63
8.0.280.0030.00318.44
8.0.270.0040.00418.09
8.0.260.0070.00016.77
8.0.250.0100.00016.92
8.0.240.0030.00316.86
8.0.230.0070.00016.82
8.0.220.0000.00716.80
8.0.210.0030.00316.88
8.0.200.0050.00216.95
8.0.190.0050.00216.96
8.0.180.0050.00216.92
8.0.170.0040.00416.92
8.0.160.0020.00516.84
8.0.150.0040.00416.88
8.0.140.0040.00416.73
8.0.130.0030.00313.36
8.0.120.0000.00816.88
8.0.110.0080.00016.79
8.0.100.0030.00516.70
8.0.90.0060.00316.83
8.0.80.0080.00916.87
8.0.70.0000.00716.88
8.0.60.0040.00416.75
8.0.50.0080.00016.84
8.0.30.0120.00617.08
8.0.20.0110.00917.16
8.0.10.0040.00416.99
8.0.00.0040.01516.84
7.4.330.0000.00515.55
7.4.320.0000.00616.52
7.4.300.0030.00316.59
7.4.290.0040.00416.60
7.4.280.0040.00416.51
7.4.270.0000.00716.59
7.4.260.0060.00013.29
7.4.250.0030.00316.50
7.4.240.0070.00016.49
7.4.230.0080.00016.38
7.4.220.0040.00416.50
7.4.210.0070.00916.59
7.4.200.0050.00216.41
7.4.130.0130.00516.52
7.4.120.0080.01816.48
7.4.110.0120.00616.64
7.4.100.0070.01416.51
7.4.90.0080.00816.40
7.4.80.0150.00319.39
7.4.70.0110.01116.46
7.4.60.0130.00616.54
7.4.50.0060.01016.47
7.4.40.0100.00716.49
7.4.30.0070.01216.56
7.4.20.0120.00916.46
7.4.10.0090.00916.38
7.4.00.0080.00916.52
7.3.330.0040.00416.19
7.3.320.0030.00313.16
7.3.310.0070.00016.39
7.3.300.0070.00016.34
7.3.290.0050.01116.37
7.3.280.0040.01116.29
7.3.260.0100.01516.64
7.3.240.0090.00816.45
7.3.230.0070.01016.47
7.3.210.0090.00916.46
7.3.200.0110.00616.60
7.3.190.0210.00016.15
7.3.180.0080.00816.40
7.3.170.0090.00816.40
7.3.160.0130.00816.31
7.3.150.0100.00916.49
7.3.140.0080.01016.51
7.3.130.0060.01016.48
7.3.120.0070.01016.36
7.3.110.0150.00316.51
7.3.100.0070.01016.32
7.3.90.0080.01116.34
7.3.80.0060.01216.51
7.3.70.0050.01316.48
7.3.60.0080.01016.34
7.3.50.0070.01116.34
7.3.40.0080.01016.37
7.3.30.0140.00816.43
7.3.20.0110.01116.42
7.3.10.0090.01016.49
7.3.00.0100.01316.31
7.2.330.0150.00316.56
7.2.310.0100.01016.45
7.2.300.0070.01216.66
7.2.290.0160.00816.53
7.2.280.0120.00516.73
7.2.270.0100.00916.66
7.2.260.0140.00416.37
7.2.250.0090.00916.50
7.2.240.0100.00916.69
7.2.230.0100.00916.57
7.2.220.0110.00816.56
7.2.210.0090.00916.53
7.2.200.0120.00516.54
7.2.190.0100.00916.51
7.2.180.0070.01016.55
7.2.170.0110.00716.53
7.2.160.0080.01416.60
7.2.150.0140.00716.71
7.2.140.0080.01016.61
7.2.130.0070.01416.62
7.2.120.0090.01316.53
7.2.110.0100.01016.66
7.2.100.0070.01116.73
7.2.90.0130.00716.56
7.2.80.0080.01116.64
7.2.70.0100.01016.66
7.2.60.0100.01016.57
7.2.50.0090.00816.62
7.2.40.0080.01016.72
7.2.30.0100.00916.68
7.2.20.0080.00916.67
7.2.10.0090.00816.70
7.2.00.0100.00816.78

preferences:
172.18 ms | 403 KiB | 5 Q