3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row = array(); $row['title'] = 'Mr Smith'; $row['surname'] = 'Smith'; if ( isset($row['title']) && isset($row['surname']) ) { if ( '' !== trim($row['title']) && '' !== trim($row['surname']) ) { if ( -1 !== strpos($row['title'],$row['surname']) ) { $titleParts = explode(' ',$row['title']); if ( count($titleParts) > 1 ) { foreach ( $titleParts as $index => $titlePart ) { if ( $row['surname'] === $titlePart ) { unset($titleParts[$index]); } } $row['title'] = trim(implode(' ',$titleParts)); } } } } var_dump($row['title']);

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.0090.00616.75
8.3.50.0100.00716.50
8.3.40.0040.01118.87
8.3.30.0000.01418.47
8.3.20.0000.00820.16
8.3.10.0080.00023.66
8.3.00.0040.00423.66
8.2.180.0070.01418.05
8.2.170.0040.01422.96
8.2.160.0100.00320.57
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0000.00722.13
8.2.120.0080.00026.35
8.2.110.0030.00622.13
8.2.100.0040.00817.75
8.2.90.0030.00517.75
8.2.80.0000.00817.97
8.2.70.0050.00317.90
8.2.60.0030.00518.22
8.2.50.0080.00018.10
8.2.40.0000.00720.42
8.2.30.0070.00021.16
8.2.20.0040.00418.00
8.2.10.0040.00418.13
8.2.00.0000.00718.00
8.1.280.0070.00725.92
8.1.270.0000.00823.79
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0080.00421.89
8.1.230.0070.00219.10
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0040.00417.36
8.1.190.0000.00817.35
8.1.180.0000.01019.30
8.1.170.0000.00818.47
8.1.160.0040.00318.77
8.1.150.0070.00018.89
8.1.140.0000.00717.66
8.1.130.0040.00418.80
8.1.120.0080.00017.45
8.1.110.0040.00417.34
8.1.100.0050.00317.37
8.1.90.0030.00317.33
8.1.80.0000.00717.49
8.1.70.0040.00417.43
8.1.60.0030.00617.63
8.1.50.0000.00817.58
8.1.40.0070.00417.52
8.1.30.0000.00817.67
8.1.20.0000.00817.55
8.1.10.0000.00817.55
8.1.00.0000.00817.60
8.0.300.0000.00719.63
8.0.290.0040.00416.63
8.0.280.0000.00718.45
8.0.270.0000.00717.18
8.0.260.0000.00616.93
8.0.250.0000.00717.02
8.0.240.0040.00416.92
8.0.230.0060.00016.86
8.0.220.0020.00516.92
8.0.210.0070.00016.96
8.0.200.0030.00616.94
8.0.190.0040.00416.93
8.0.180.0040.00416.80
8.0.170.0020.00516.80
8.0.160.0030.00316.85
8.0.150.0070.00316.83
8.0.140.0000.00716.80
8.0.130.0040.00413.32
8.0.120.0070.00016.87
8.0.110.0040.00416.79
8.0.100.0000.00716.92
8.0.90.0000.00716.80
8.0.80.0060.00916.93
8.0.70.0040.00416.89
8.0.60.0070.00016.75
8.0.50.0000.00716.82
8.0.30.0150.00516.98
8.0.20.0100.00917.40
8.0.10.0000.00716.81
8.0.00.0140.01016.73
7.4.330.0050.00016.63
7.4.320.0060.00016.62
7.4.300.0030.00316.53
7.4.290.0040.00416.50
7.4.280.0050.00316.60
7.4.270.0030.00316.52
7.4.260.0000.00716.50
7.4.250.0020.00516.45
7.4.240.0050.00316.48
7.4.230.0000.00716.70
7.4.220.0150.00416.63
7.4.210.0040.01216.64
7.4.200.0030.00316.71
7.4.160.0070.00916.48
7.4.150.0150.00317.40
7.4.140.0090.01217.86
7.4.130.0090.01516.43
7.4.120.0100.00816.53
7.4.110.0090.00916.59
7.4.100.0060.01216.42
7.4.90.0120.00416.52
7.4.80.0040.01519.39
7.4.70.0150.00616.74
7.4.60.0100.00716.51
7.4.50.0100.00716.45
7.4.40.0030.01216.65
7.4.30.0100.01016.59
7.4.10.0030.01415.11
7.4.00.0120.00515.03
7.3.330.0050.00013.21
7.3.320.0060.00013.06
7.3.310.0030.00316.25
7.3.300.0070.00016.35
7.3.290.0090.00716.30
7.3.280.0070.00916.32
7.3.270.0170.00717.40
7.3.260.0100.00716.44
7.3.250.0100.00916.40
7.3.240.0090.01316.49
7.3.230.0110.00616.25
7.3.210.0090.00916.55
7.3.200.0130.00316.48
7.3.190.0070.01016.43
7.3.180.0040.01116.43
7.3.170.0130.00416.63
7.3.160.0090.01216.54
7.3.130.0090.00914.81
7.3.120.0130.00314.98
7.3.110.0100.01015.00
7.3.100.0040.01214.72
7.3.90.0060.00615.02
7.3.80.0040.01114.84
7.3.70.0030.00914.83
7.3.60.0110.00414.96
7.3.50.0130.00314.79
7.3.40.0070.01014.84
7.3.30.0000.00914.84
7.3.20.0090.00016.63
7.3.10.0130.00016.75
7.3.00.0060.00616.48
7.2.330.0150.00416.69
7.2.320.0030.01316.41
7.2.310.0090.00916.42
7.2.300.0150.00616.60
7.2.290.0060.01116.57
7.2.260.0070.01014.93
7.2.250.0090.00914.96
7.2.240.0040.00815.19
7.2.230.0050.00515.05
7.2.220.0080.00815.21
7.2.210.0090.00615.02
7.2.200.0070.00715.20
7.2.190.0090.00915.08
7.2.180.0160.00315.21
7.2.170.0070.00714.93
7.2.160.0090.00615.06
7.2.150.0040.01117.00
7.2.140.0030.01316.95
7.2.130.0070.00716.94
7.2.120.0030.01316.89
7.2.110.0000.00916.75
7.2.100.0030.01017.01
7.2.90.0120.00616.86
7.2.80.0060.00617.07
7.2.70.0150.00017.05
7.2.60.0070.00517.04
7.2.50.0030.00617.03
7.2.40.0030.01517.12
7.2.30.0040.00817.21
7.2.20.0080.00416.91
7.2.10.0110.00416.94
7.2.00.0040.01416.81
7.1.330.0070.00715.84
7.1.320.0000.01215.87
7.1.310.0030.01015.88
7.1.300.0090.00915.79
7.1.290.0070.01015.53
7.1.280.0000.01315.55
7.1.270.0030.00915.81
7.1.260.0070.00715.71
7.1.250.0130.00315.91
7.1.240.0070.00315.98
7.1.230.0000.01115.95
7.1.220.0040.00715.84
7.1.210.0070.00715.44
7.1.200.0030.00915.52
7.1.190.0000.01415.96
7.1.180.0030.01015.84
7.1.170.0040.00415.71
7.1.160.0130.00015.55
7.1.150.0030.01215.46
7.1.140.0000.00915.90
7.1.130.0030.01015.72
7.1.120.0120.00415.46
7.1.110.0090.00716.76
7.1.100.0080.00817.11
7.1.90.0100.00915.89
7.1.80.0130.01315.98
7.1.70.0150.01115.70
7.1.60.0270.00724.50
7.1.50.0260.01325.17
7.1.40.0180.01525.06
7.1.30.0280.00924.26
7.1.20.0180.01025.27
7.1.10.0460.01316.06
7.1.00.0480.00515.41
7.0.330.0070.01015.60
7.0.320.0050.00515.57
7.0.310.0080.00415.36
7.0.300.0030.01015.48
7.0.290.0070.00715.34
7.0.280.0080.00415.28
7.0.270.0000.01715.60
7.0.260.0100.00715.55
7.0.250.0200.00315.65
7.0.240.0050.01116.58
7.0.230.0050.00816.63
7.0.220.0170.00715.74
7.0.210.0130.01315.06
7.0.200.0140.01415.12
7.0.190.0220.00715.17
7.0.180.0170.01114.84
7.0.170.0070.01714.76
7.0.160.0220.00714.95
7.0.150.0060.00915.81
7.0.140.0100.00616.06
7.0.130.0060.01016.06
7.0.120.0430.01315.13
7.0.110.0060.00915.68
7.0.100.0140.01314.95
7.0.90.0180.01115.04
7.0.80.0090.00615.88
7.0.70.0070.00915.93
7.0.60.0060.01415.83
7.0.50.0170.00915.12
7.0.40.0070.01314.20
7.0.30.0170.01414.05
7.0.20.0200.01014.11
7.0.10.0200.00814.20
7.0.00.0260.01114.06
5.6.400.0100.00314.56
5.6.390.0000.01514.33
5.6.380.0030.00914.41
5.6.370.0030.01014.64
5.6.360.0060.00314.50
5.6.350.0000.01614.42
5.6.340.0060.00914.58
5.6.330.0000.01714.16
5.6.320.0040.00414.44
5.6.310.0000.00914.67
5.6.300.0030.00714.45
5.6.290.0030.01314.79
5.6.280.0030.00614.58
5.6.270.0090.00614.57
5.6.260.0060.00314.43
5.6.250.0030.00914.24
5.6.240.0070.00314.48
5.6.230.0040.00814.28
5.6.220.0030.00714.23
5.6.210.0070.00714.34
5.6.200.0040.00714.45
5.6.190.0070.00714.50
5.6.180.0070.00714.40
5.6.170.0000.01514.33
5.6.160.0120.00314.44
5.6.150.0060.00314.49
5.6.140.0030.01014.33
5.6.130.0060.00614.18
5.6.120.0070.00714.46
5.6.110.0140.00014.48
5.6.100.0030.01314.53
5.6.90.0060.00914.61
5.6.80.0110.00414.62
5.6.70.0000.01314.35
5.6.60.0070.00714.50
5.6.50.0030.01014.09
5.6.40.0080.00814.18
5.6.30.0140.00314.43
5.6.20.0080.00414.57
5.6.10.0030.01014.71
5.6.00.0030.00514.34

preferences:
59.33 ms | 401 KiB | 5 Q