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']) ) { $titleParts = explode(' ',$row['title']); if ( count($titleParts) > 1 ) { if ( -1 !== strpos($row['title'],$row['surname']) ) { foreach ( $titleParts as $index => $titlePart ) { if ( $row['surname'] === $titlePart ) { unset($titleParts[$index]); } } } $row['title'] = trim(implode(' ',$titleParts)); echo $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.0130.00318.43
8.3.50.0000.01516.48
8.3.40.0070.00718.79
8.3.30.0070.00718.71
8.3.20.0040.00420.29
8.3.10.0060.00323.48
8.3.00.0040.00423.66
8.2.180.0090.00918.54
8.2.170.0090.00622.96
8.2.160.0130.00320.38
8.2.150.0050.00524.18
8.2.140.0030.00624.66
8.2.130.0070.00022.11
8.2.120.0040.00426.35
8.2.110.0090.00021.95
8.2.100.0040.00817.91
8.2.90.0030.00619.52
8.2.80.0040.00418.81
8.2.70.0060.00617.63
8.2.60.0000.00918.16
8.2.50.0030.00718.07
8.2.40.0040.00418.22
8.2.30.0000.00818.00
8.2.20.0050.00218.11
8.2.10.0080.00018.02
8.2.00.0040.00418.11
8.1.280.0090.00625.92
8.1.270.0030.00623.79
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.79
8.1.230.0070.00319.08
8.1.220.0030.00517.76
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0030.00517.22
8.1.180.0030.00618.10
8.1.170.0000.00818.50
8.1.160.0000.00718.84
8.1.150.0000.00718.93
8.1.140.0000.00817.69
8.1.130.0070.00018.89
8.1.120.0000.00717.39
8.1.110.0030.00517.35
8.1.100.0060.00317.36
8.1.90.0000.00817.43
8.1.80.0040.00417.43
8.1.70.0050.00317.46
8.1.60.0030.00517.62
8.1.50.0030.00517.54
8.1.40.0040.00817.48
8.1.30.0080.00017.54
8.1.20.0030.00617.59
8.1.10.0040.00417.44
8.1.00.0040.00417.49
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0050.00218.41
8.0.270.0070.00017.25
8.0.260.0030.00316.82
8.0.250.0030.00316.85
8.0.240.0080.00016.92
8.0.230.0030.00316.89
8.0.220.0040.00416.81
8.0.210.0070.00016.94
8.0.200.0000.00716.88
8.0.190.0000.00816.99
8.0.180.0080.00016.91
8.0.170.0030.00316.89
8.0.160.0030.00416.77
8.0.150.0120.00016.88
8.0.140.0040.00416.73
8.0.130.0030.00613.30
8.0.120.0040.00416.84
8.0.110.0050.00216.90
8.0.100.0000.00716.84
8.0.90.0070.00016.90
8.0.80.0100.01016.87
8.0.70.0000.00716.93
8.0.60.0070.00016.93
8.0.50.0000.00717.02
8.0.30.0120.00717.10
8.0.20.0140.00917.41
8.0.10.0040.00416.98
8.0.00.0110.00716.96
7.4.330.0050.00016.78
7.4.320.0000.00716.51
7.4.300.0030.00316.59
7.4.290.0000.00716.55
7.4.280.0090.00016.41
7.4.270.0030.00316.53
7.4.260.0000.00716.50
7.4.250.0080.00016.56
7.4.240.0040.00416.54
7.4.230.0070.00016.41
7.4.220.0130.00516.52
7.4.210.0090.00616.54
7.4.200.0030.00316.68
7.4.160.0080.01116.54
7.4.150.0110.00717.40
7.4.140.0080.01117.86
7.4.130.0140.00616.58
7.4.120.0150.00516.44
7.4.110.0120.00916.54
7.4.100.0120.00616.74
7.4.90.0060.01516.48
7.4.80.0110.00719.39
7.4.70.0060.01616.52
7.4.60.0090.00616.36
7.4.50.0060.00916.63
7.4.40.0030.01316.56
7.4.30.0110.00716.48
7.4.10.0040.01515.11
7.4.00.0080.00714.99
7.3.330.0050.00013.16
7.3.320.0030.00313.06
7.3.310.0030.00316.17
7.3.300.0030.00316.34
7.3.290.0110.00416.29
7.3.280.0060.01016.31
7.3.270.0210.00817.40
7.3.260.0080.00916.30
7.3.250.0110.00616.43
7.3.240.0090.00816.33
7.3.230.0100.00716.38
7.3.210.0090.00916.39
7.3.200.0090.00916.53
7.3.190.0060.00916.59
7.3.180.0080.00816.66
7.3.170.0090.00816.55
7.3.160.0070.01816.57
7.3.130.0090.00314.79
7.3.120.0040.01414.75
7.3.110.0110.00714.91
7.3.100.0070.00714.79
7.3.90.0040.01114.84
7.3.80.0030.00914.98
7.3.70.0040.01114.89
7.3.60.0040.00814.59
7.3.50.0110.00314.86
7.3.40.0120.00014.66
7.3.30.0000.01514.84
7.3.20.0000.01516.73
7.3.10.0090.00016.75
7.3.00.0060.00816.67
7.2.330.0140.00616.40
7.2.320.0100.00716.44
7.2.310.0100.00616.55
7.2.300.0030.01416.68
7.2.290.0000.01816.80
7.2.260.0040.01115.03
7.2.250.0110.00615.07
7.2.240.0040.01114.77
7.2.230.0030.01315.13
7.2.220.0000.01715.23
7.2.210.0030.00715.10
7.2.200.0030.01214.88
7.2.190.0000.01715.21
7.2.180.0030.00614.72
7.2.170.0000.00915.10
7.2.160.0040.00814.64
7.2.150.0090.00616.77
7.2.140.0100.00617.07
7.2.130.0070.00516.85
7.2.120.0030.01016.73
7.2.110.0050.01016.90
7.2.100.0090.00616.91
7.2.90.0070.00617.01
7.2.80.0030.01117.09
7.2.70.0080.00717.13
7.2.60.0090.00616.90
7.2.50.0050.00717.03
7.2.40.0050.00817.06
7.2.30.0030.01116.87
7.2.20.0020.00916.94
7.2.10.0060.00916.78
7.2.00.0100.00716.76
7.1.330.0070.00715.76
7.1.320.0000.01516.03
7.1.310.0000.01215.98
7.1.300.0060.00615.87
7.1.290.0080.00015.77
7.1.280.0080.00815.86
7.1.270.0060.00615.82
7.1.260.0060.00315.64
7.1.250.0000.01515.77
7.1.240.0030.00915.78
7.1.230.0040.01015.80
7.1.220.0110.00315.81
7.1.210.0040.00715.82
7.1.200.0030.01015.79
7.1.190.0030.00915.79
7.1.180.0050.00915.83
7.1.170.0070.00715.63
7.1.160.0050.00815.89
7.1.150.0070.00515.57
7.1.140.0060.00815.70
7.1.130.0060.00615.68
7.1.120.0070.00715.80
7.1.110.0070.00516.66
7.1.100.0050.00916.59
7.1.90.0040.00916.59
7.1.80.0050.01016.56
7.1.70.0060.00816.27
7.1.60.0110.00722.33
7.1.50.0100.01022.17
7.1.40.0080.01022.03
7.1.30.0120.00721.99
7.1.20.0110.01221.92
7.1.10.0050.01016.06
7.1.00.0090.00516.11
7.0.330.0020.00915.21
7.0.320.0080.00315.41
7.0.310.0050.00915.43
7.0.300.0030.00815.37
7.0.290.0090.00615.44
7.0.280.0070.00715.19
7.0.270.0070.01015.26
7.0.260.0030.00915.23
7.0.250.0030.01116.17
7.0.240.0040.01116.18
7.0.230.0060.00616.15
7.0.220.0080.00616.26
7.0.210.0060.00815.77
7.0.200.0060.00615.97
7.0.190.0040.00715.68
7.0.180.0030.01015.49
7.0.170.0060.00815.70
7.0.160.0020.01015.79
7.0.150.0070.00915.72
7.0.140.0060.00615.74
7.0.130.0030.00915.79
7.0.120.0040.00815.85
7.0.110.0060.00715.72
7.0.100.0090.00415.69
7.0.90.0040.00815.73
7.0.80.0110.00615.14
7.0.70.0120.00815.04
7.0.60.0090.00715.10
7.0.50.0120.00715.13
7.0.40.0080.00614.51
7.0.30.0030.00814.43
7.0.20.0080.00514.35
7.0.10.0030.01114.46
7.0.00.0050.00914.47
5.6.400.0090.00014.57
5.6.390.0030.01314.68
5.6.380.0080.00514.55
5.6.370.0070.00714.67
5.6.360.0100.00313.97
5.6.350.0070.00714.75
5.6.340.0120.00314.45
5.6.330.0060.00914.49
5.6.320.0000.00814.36
5.6.310.0060.00614.57
5.6.300.0000.01314.36
5.6.290.0030.00614.38
5.6.280.0060.00614.45
5.6.270.0090.00614.62
5.6.260.0000.01514.39
5.6.250.0060.00614.59
5.6.240.0070.00714.43
5.6.230.0040.01114.46
5.6.220.0060.00314.63
5.6.210.0100.00314.54
5.6.200.0040.00814.59
5.6.190.0000.00914.71
5.6.180.0060.00714.22
5.6.170.0060.01014.33
5.6.160.0060.01014.54
5.6.150.0030.00914.53
5.6.140.0060.00314.29
5.6.130.0110.00014.48
5.6.120.0000.01214.21
5.6.110.0040.01114.66
5.6.100.0030.01014.48
5.6.90.0060.00614.39
5.6.80.0100.00314.42
5.6.70.0000.01214.21
5.6.60.0030.00714.46
5.6.50.0060.00314.33
5.6.40.0060.00914.48
5.6.30.0060.00614.36
5.6.20.0100.00314.27
5.6.10.0100.00314.42
5.6.00.0060.00614.45

preferences:
60.21 ms | 400 KiB | 5 Q