3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = ["White", "White Tank", "White Tank Top"]; foreach ($strings as $string) { echo "\n{$string}:"; echo "\n-\t" , substr($string, 1 + (strpos($string, ' ') ?: -1)); $explodeOnce = explode(' ', $string, 2); echo "\n-\t" , end($explodeOnce); echo "\n-\t" , substr(strstr($string, " "), 1); echo "\n-\t" , ltrim(strstr($string, " ")); echo "\n-\t" , preg_replace('~^\S+\s~', '', $string); }

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.4.140.0140.00717.67
8.4.130.0090.00917.93
8.4.120.0150.00620.49
8.4.110.0130.00718.61
8.4.100.0100.01017.96
8.4.90.0130.00818.55
8.4.80.0130.00717.89
8.4.70.0090.01117.91
8.4.60.0130.00920.41
8.4.50.0140.00817.98
8.4.40.0100.01019.69
8.4.30.0050.00520.21
8.4.20.0080.01218.68
8.4.10.0030.00617.96
8.3.270.0060.01516.89
8.3.260.0110.00916.79
8.3.250.0120.00618.85
8.3.240.0150.00516.54
8.3.230.0140.00516.52
8.3.220.0080.00117.08
8.3.210.0100.00916.80
8.3.200.0060.00316.82
8.3.190.0030.00516.82
8.3.180.0140.00518.48
8.3.170.0110.00416.70
8.3.160.0040.01418.41
8.3.150.0120.00916.99
8.3.140.0110.00716.64
8.3.130.0110.00416.70
8.3.120.0030.00620.73
8.3.110.0130.00720.94
8.3.100.0070.00324.06
8.3.90.0000.00926.77
8.3.80.0090.00017.97
8.3.70.0070.00716.88
8.3.60.0000.01618.68
8.3.50.0060.00724.51
8.3.40.0040.01118.93
8.3.30.0070.00718.92
8.3.20.0050.00322.61
8.3.10.0080.00021.77
8.3.00.0040.00420.59
8.2.290.0040.00420.36
8.2.280.0110.00921.97
8.2.270.0060.01316.76
8.2.260.0040.00819.17
8.2.250.0080.00018.70
8.2.240.0100.00717.39
8.2.230.0040.00422.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0090.00018.51
8.2.190.0190.00016.63
8.2.180.0060.01218.38
8.2.170.0120.00922.96
8.2.160.0130.00322.22
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0100.00020.15
8.2.100.0030.01017.84
8.2.90.0050.00318.16
8.2.80.0000.00817.88
8.2.70.0000.00917.88
8.2.60.0000.00818.05
8.2.50.0090.00018.07
8.2.40.0000.00818.22
8.2.30.0040.00718.06
8.2.20.0000.00718.05
8.2.10.0030.00619.00
8.2.00.0070.00019.38
8.1.330.0060.00422.12
8.1.320.0050.00316.47
8.1.310.0110.00716.64
8.1.300.0030.00618.54
8.1.290.0030.00618.88
8.1.280.0080.00825.92
8.1.270.0050.00320.68
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.55
8.1.230.0080.00320.76
8.1.220.0040.00417.76
8.1.210.0080.00018.79
8.1.200.0000.00917.48
8.1.190.0070.00017.35
8.1.180.0070.00318.10
8.1.170.0050.00518.66
8.1.160.0000.00718.97
8.1.150.0040.00418.84
8.1.140.0050.00318.90
8.1.130.0030.00320.14
8.1.120.0030.00617.59
8.1.110.0000.00717.58
8.1.100.0000.00817.50
8.1.90.0040.00417.51
8.1.80.0070.00017.65
8.1.70.0030.00317.58
8.1.60.0060.00317.63
8.1.50.0000.00817.59
8.1.40.0060.00617.70
8.1.30.0000.00817.71
8.1.20.0080.00017.73
8.1.10.0040.00417.53
8.1.00.0000.00817.44
8.0.300.0070.00019.94
8.0.290.0040.00416.88
8.0.280.0040.00418.46
8.0.270.0000.00817.39
8.0.260.0000.00720.13
8.0.250.0030.00717.11
8.0.240.0000.00716.93
8.0.230.0000.00816.96
8.0.220.0000.00716.89
8.0.210.0030.00316.89
8.0.200.0000.00717.13
8.0.190.0040.00417.11
8.0.180.0040.00417.04
8.0.170.0030.00616.92
8.0.160.0050.00217.03
8.0.150.0040.00416.96
8.0.140.0030.00616.95
8.0.130.0000.00613.44
8.0.120.0050.00216.91
8.0.110.0040.00416.92
8.0.100.0000.00816.93
8.0.90.0040.00417.03
8.0.80.0070.01316.94
8.0.70.0070.00017.05
8.0.60.0000.00717.10
8.0.50.0000.00816.88
8.0.30.0060.01216.88
8.0.20.0080.01117.38
8.0.10.0040.00417.02
8.0.00.0100.01016.70
7.4.330.0000.00615.55
7.4.320.0060.00016.80
7.4.300.0060.00016.71
7.4.290.0000.00716.66
7.4.280.0000.00816.64
7.4.270.0000.00716.80
7.4.260.0050.00013.46
7.4.250.0070.00016.77
7.4.240.0040.00416.69
7.4.230.0000.00816.80
7.4.220.0030.00316.81
7.4.210.0090.00816.78
7.4.200.0030.00416.55
7.4.130.0180.00716.70
7.4.120.0080.01116.79
7.4.110.0140.00716.79
7.4.100.0140.00616.64
7.4.90.0090.00916.85
7.4.80.0090.01619.39
7.4.70.0160.00316.83
7.4.60.0100.01016.76
7.4.50.0090.00616.77
7.4.40.0090.01216.49
7.4.00.0100.00715.20
7.3.330.0030.00616.57
7.3.320.0060.00013.35
7.3.310.0000.00716.40
7.3.300.0000.00716.38
7.3.290.0040.00416.38
7.3.280.0090.00616.43
7.3.260.0170.00716.89
7.3.240.0110.00716.64
7.3.230.0070.01016.70
7.3.210.0140.00316.50
7.3.200.0120.00616.83
7.3.190.0050.01116.29
7.3.180.0030.01216.71
7.3.170.0140.00316.46
7.3.160.0070.01016.47
7.3.120.0060.00915.12
7.3.110.0030.00914.55
7.3.100.0070.01014.92
7.3.90.0100.00714.94
7.3.80.0090.00914.95
7.3.70.0060.01014.98
7.3.60.0080.01214.95
7.3.50.0100.01015.07
7.3.40.0120.00314.68
7.3.30.0040.01114.83
7.3.20.0100.00714.86
7.3.10.0300.00314.91
7.3.00.0070.00815.04
7.2.330.0120.01117.00
7.2.320.0110.00816.92
7.2.310.0040.02016.59
7.2.300.0120.00616.83
7.2.290.0160.00616.97
7.2.240.0050.00914.99
7.2.230.0110.00814.85
7.2.220.0110.00614.99
7.2.210.0140.00714.93
7.2.200.0030.01515.16
7.2.190.0060.01515.11
7.2.180.0110.01115.34
7.2.170.0030.01315.10
7.2.160.0000.01415.07
7.2.150.0140.00315.50
7.2.140.0120.00815.11
7.2.130.0110.00815.24
7.2.120.0070.01015.06
7.2.110.0050.01114.95
7.2.100.0110.00615.34
7.2.90.0050.01015.38
7.2.80.0060.01615.30
7.2.70.0080.01115.13
7.2.60.0150.00015.28
7.2.50.0060.00915.09
7.2.40.0000.01715.23
7.2.30.0130.00715.22
7.2.20.0100.00715.04
7.2.10.0120.00815.07
7.2.00.0110.00615.11
7.1.330.0030.01014.22
7.1.320.0080.00713.86
7.1.310.0080.01114.02
7.1.300.0120.01114.09
7.1.290.0120.00313.96
7.1.280.0090.00614.03
7.1.270.0050.01414.05
7.1.260.0110.00314.11
7.1.250.0090.00613.98

preferences:
125.79 ms | 403 KiB | 5 Q