3v4l.org

run code in 300+ PHP versions simultaneously
<?php function splitname($input) { $input = trim($input); if ( strlen($input) < 1 ) return array( 0 => null, 1 => null ); $input = explode(' ', $input); if ( count($input) < 2 ) return array( 0 => $input[0], 1 => null ); $lastname = end($input); unset($input[count($input) - 1]); $firstname = implode(' ', $input); return array( 0 => $firstname, 1 => $lastname ); } echo var_dump(splitname(' aasd fef')); ?>

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.40.0120.00318.54
8.3.30.0110.00320.34
8.3.20.0050.00320.57
8.3.10.0050.00321.04
8.3.00.0040.00423.57
8.2.170.0040.01122.96
8.2.160.0090.00620.41
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00021.13
8.2.110.0060.00320.52
8.2.100.0120.00017.77
8.2.90.0040.00419.29
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0060.00518.16
8.2.30.0060.00319.43
8.2.20.0080.00017.71
8.2.10.0070.00017.63
8.2.00.0000.00817.82
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00622.16
8.1.230.0070.00417.52
8.1.220.0050.00317.74
8.1.210.0050.00518.77
8.1.200.0090.00017.22
8.1.190.0040.00417.50
8.1.180.0040.00418.10
8.1.170.0080.00018.46
8.1.160.0000.00718.89
8.1.150.0030.00618.55
8.1.140.0040.00417.46
8.1.130.0000.00717.36
8.1.120.0030.00317.51
8.1.110.0030.00317.30
8.1.100.0040.00417.38
8.1.90.0020.00517.48
8.1.80.0040.00417.35
8.1.70.0070.00017.33
8.1.60.0030.00617.57
8.1.50.0000.00817.47
8.1.40.0000.00817.44
8.1.30.0040.00417.56
8.1.20.0000.00917.70
8.1.10.0050.00217.60
8.1.00.0050.00317.51
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00718.45
8.0.270.0040.00317.27
8.0.260.0050.00216.76
8.0.250.0040.00416.94
8.0.240.0040.00416.95
8.0.230.0040.00416.88
8.0.220.0000.00816.84
8.0.210.0030.00316.79
8.0.200.0030.00316.82
8.0.190.0040.00416.89
8.0.180.0000.00816.87
8.0.170.0040.00416.93
8.0.160.0050.00316.88
8.0.150.0030.00316.90
8.0.140.0000.00716.82
8.0.130.0030.00313.33
8.0.120.0050.00316.87
8.0.110.0040.00416.84
8.0.100.0040.00416.95
8.0.90.0080.00016.71
8.0.80.0060.00916.84
8.0.70.0000.00716.84
8.0.60.0040.00416.93
8.0.50.0000.00716.78
8.0.30.0100.01217.05
8.0.20.0110.00817.40
8.0.10.0000.00816.90
8.0.00.0100.00716.73
7.4.330.0030.00314.99
7.4.320.0000.00616.59
7.4.300.0000.00616.54
7.4.290.0030.00316.59
7.4.280.0070.00016.64
7.4.270.0030.00316.43
7.4.260.0030.00313.22
7.4.250.0000.00816.37
7.4.240.0000.00816.47
7.4.230.0000.00716.50
7.4.220.0210.00016.64
7.4.210.0100.00716.54
7.4.200.0030.00316.25
7.4.190.0040.00416.55
7.4.160.0090.00616.48
7.4.150.0150.00317.40
7.4.140.0050.01217.86
7.4.130.0110.00916.48
7.4.120.0100.00816.46
7.4.110.0030.01416.43
7.4.100.0060.01116.60
7.4.90.0150.00416.57
7.4.80.0060.01019.39
7.4.70.0090.00916.62
7.4.60.0070.01016.60
7.4.50.0030.00616.31
7.4.40.0070.01122.77
7.4.30.0130.01016.47
7.4.10.0100.00914.77
7.4.00.0060.01014.96
7.3.330.0060.00013.16
7.3.320.0030.00313.19
7.3.310.0030.00316.41
7.3.300.0060.00016.38
7.3.290.0100.00916.32
7.3.280.0050.01016.38
7.3.270.0030.01317.40
7.3.260.0080.00918.24
7.3.250.0100.00916.54
7.3.240.0120.00916.60
7.3.230.0090.00916.45
7.3.210.0160.00016.38
7.3.200.0000.02019.39
7.3.190.0030.01416.32
7.3.180.0150.00616.56
7.3.170.0100.01016.58
7.3.160.0100.01316.66
7.3.130.0030.01315.11
7.3.120.0010.01214.69
7.3.110.0120.00614.73
7.3.100.0090.00614.83
7.3.90.0040.01114.84
7.3.80.0090.00315.10
7.3.70.0150.00014.88
7.3.60.0090.00314.98
7.3.50.0030.00614.72
7.3.40.0060.00314.98
7.3.30.0040.00814.89
7.3.20.0030.00616.78
7.3.10.0130.00016.48
7.3.00.0030.01016.63
7.2.330.0110.00616.66
7.2.320.0090.01016.87
7.2.310.0060.01216.66
7.2.300.0090.01216.82
7.2.290.0090.00616.53
7.2.260.0030.01414.95
7.2.250.0080.01115.27
7.2.240.0040.01115.17
7.2.230.0100.00715.34
7.2.220.0060.00915.10
7.2.210.0090.00615.14
7.2.200.0060.00915.02
7.2.190.0060.00914.88
7.2.180.0080.00415.30
7.2.170.0000.01315.10
7.2.160.0070.00715.03
7.2.150.0030.01016.68
7.2.140.0030.01217.09
7.2.130.0000.01417.01
7.2.120.0110.00717.02
7.2.110.0130.00317.00
7.2.100.0120.00616.82
7.2.90.0040.01117.03
7.2.80.0030.01317.05
7.2.70.0040.00716.96
7.2.60.0080.00316.93
7.2.50.0100.00616.87
7.2.40.0030.01216.85
7.2.30.0000.01117.04
7.2.20.0040.00817.03
7.2.10.0060.01016.86
7.2.00.0020.01618.27
7.1.330.0030.01016.13
7.1.320.0060.01015.77
7.1.310.0030.01015.60
7.1.300.0030.00715.77
7.1.290.0000.01215.62
7.1.280.0000.00815.76
7.1.270.0030.00515.71
7.1.260.0040.01015.87
7.1.250.0000.01215.77
7.1.240.0060.00915.83
7.1.230.0070.01115.97
7.1.220.0040.01215.90
7.1.210.0000.01415.57
7.1.200.0060.01215.65
7.1.190.0090.00615.88
7.1.180.0090.00615.96
7.1.170.0080.00015.79
7.1.160.0030.00615.88
7.1.150.0030.00915.97
7.1.140.0000.01316.02
7.1.130.0070.00715.93
7.1.120.0070.00315.71
7.1.110.0060.00615.87
7.1.100.0060.00816.84
7.1.90.0030.00915.85
7.1.80.0100.00316.08
7.1.70.0090.00516.36
7.1.60.0050.01017.47
7.1.50.0050.00916.50
7.1.40.0060.00915.83
7.1.30.0100.00315.70
7.1.20.0060.00315.81
7.1.10.0070.00715.84
7.1.00.0050.02319.04
7.0.330.0030.00615.64
7.0.320.0000.01215.37
7.0.310.0050.00315.26
7.0.300.0060.00915.43
7.0.290.0110.00315.45
7.0.280.0040.00415.59
7.0.270.0100.00315.45
7.0.260.0100.00315.18
7.0.250.0080.00815.31
7.0.240.0100.00315.52
7.0.230.0060.00615.55
7.0.220.0070.00715.23
7.0.210.0030.01015.27
7.0.200.0050.00616.00
7.0.190.0030.00715.36
7.0.180.0100.00315.58
7.0.170.0040.00815.27
7.0.160.0080.00015.49
7.0.150.0060.00615.52
7.0.140.0040.03918.80
7.0.130.0100.00315.60
7.0.120.0030.01015.21
7.0.110.0030.01015.18
7.0.100.0070.04717.69
7.0.90.0070.04417.63
7.0.80.0020.05217.71
7.0.70.0070.02718.60
7.0.60.0020.03818.43
7.0.50.0030.02618.95
7.0.40.0060.04616.72
7.0.30.0070.04616.80
7.0.20.0070.04116.76
7.0.10.0050.04416.85
7.0.00.0070.04216.69
5.6.400.0060.00614.36
5.6.390.0070.00314.28
5.6.380.0030.00614.33
5.6.370.0050.00513.97
5.6.360.0030.00914.40
5.6.350.0030.00714.33
5.6.340.0040.00714.44
5.6.330.0070.01314.47
5.6.320.0000.01314.22
5.6.310.0100.00014.25
5.6.300.0030.00614.29
5.6.290.0030.01314.37
5.6.280.0060.00314.32
5.6.270.0040.00714.43
5.6.260.0040.00814.23
5.6.250.0070.04217.57
5.6.240.0060.04717.63
5.6.230.0050.02417.46
5.6.220.0050.02217.47
5.6.210.0050.02217.31
5.6.200.0060.04017.67
5.6.190.0090.04217.75
5.6.180.0050.03917.71
5.6.170.0020.04717.88
5.6.160.0070.04217.58
5.6.150.0090.04417.66
5.6.140.0070.04117.83
5.6.130.0030.02417.79
5.6.120.0050.03917.59
5.6.110.0050.03817.78
5.6.100.0020.03817.78
5.6.90.0060.02517.51
5.6.80.0020.04017.34
5.6.70.0030.04117.34
5.6.60.0030.04317.27
5.6.50.0030.04617.37
5.6.40.0040.03817.28
5.6.30.0110.03817.34
5.6.20.0070.02017.49
5.6.10.0070.04217.32
5.6.00.0050.04017.41
5.5.380.0080.04017.41
5.5.370.0030.04317.36
5.5.360.0100.01717.51
5.5.350.0020.04617.38
5.5.340.0090.03517.65
5.5.330.0040.03217.59
5.5.320.0070.01817.44
5.5.310.0040.04617.42
5.5.300.0060.03317.44
5.5.290.0050.03917.55
5.5.280.0070.03517.50
5.5.270.0030.04917.56
5.5.260.0050.05017.48
5.5.250.0100.04017.36
5.5.240.0020.02817.10
5.5.230.0030.03017.21
5.5.220.0070.04017.23
5.5.210.0110.03717.18
5.5.200.0060.02817.21
5.5.190.0050.04717.17
5.5.180.0060.04117.16
5.5.170.0030.01014.38
5.5.160.0030.04317.04
5.5.150.0030.04417.20
5.5.140.0080.03917.18
5.5.130.0040.01917.23
5.5.120.0100.04017.13
5.5.110.0030.04017.26
5.5.100.0080.03817.16
5.5.90.0030.02617.27
5.5.80.0060.03517.26
5.5.70.0020.04217.17
5.5.60.0020.04017.08
5.5.50.0040.03917.21
5.5.40.0070.03417.15
5.5.30.0050.01917.19
5.5.20.0070.03917.20
5.5.10.0020.03717.01
5.5.00.0060.04017.08
5.4.450.0050.03016.41
5.4.440.0030.04016.40
5.4.430.0050.04516.43
5.4.420.0020.04116.37
5.4.410.0070.02016.21
5.4.400.0020.02316.22
5.4.390.0050.02616.14
5.4.380.0080.03716.08
5.4.370.0080.03516.18
5.4.360.0050.04216.21
5.4.350.0050.04016.13
5.4.340.0070.03716.15
5.4.330.0000.01013.30
5.4.320.0040.04416.15
5.4.310.0030.04316.23
5.4.300.0030.03316.24
5.4.290.0070.03116.17
5.4.280.0050.03916.21
5.4.270.0050.03816.19
5.4.260.0020.04316.27
5.4.250.0000.03616.17
5.4.240.0030.02216.19
5.4.230.0060.03116.16
5.4.220.0050.01616.27
5.4.210.0070.04016.26
5.4.200.0050.02016.10
5.4.190.0030.03716.07
5.4.180.0050.01816.19
5.4.170.0100.03516.23
5.4.160.0030.03216.11
5.4.150.0060.04016.19
5.4.140.0070.03714.88
5.4.130.0070.03914.83
5.4.120.0030.02314.83
5.4.110.0070.03714.81
5.4.100.0050.03814.87
5.4.90.0040.01614.89
5.4.80.0020.03014.88
5.4.70.0020.04014.88
5.4.60.0020.03514.80
5.4.50.0080.03614.77
5.4.40.0080.01514.80
5.4.30.0050.03414.83
5.4.20.0030.02914.89
5.4.10.0020.02214.89
5.4.00.0020.04214.56
5.3.290.0100.02814.45
5.3.280.0090.03214.45
5.3.270.0030.04114.45
5.3.260.0020.03614.45
5.3.250.0060.03014.45
5.3.240.0030.04214.45
5.3.230.0020.03714.45
5.3.220.0080.03614.45
5.3.210.0050.01714.45
5.3.200.0000.03914.45
5.3.190.0020.04514.45
5.3.180.0020.03614.45
5.3.170.0020.03714.45
5.3.160.0040.03814.45
5.3.150.0040.03514.45
5.3.140.0060.01814.45
5.3.130.0020.02314.45
5.3.120.0040.04114.45
5.3.110.0020.04714.45
5.3.100.0030.03614.45
5.3.90.0050.01714.45
5.3.80.0060.03714.45
5.3.70.0060.03814.45
5.3.60.0050.03714.45
5.3.50.0050.03814.45
5.3.40.0050.02514.45
5.3.30.0000.03814.45
5.3.20.0110.02914.45
5.3.10.0070.01714.45
5.3.00.0000.04314.45
5.2.170.0030.06315.59
5.2.160.0000.02715.59
5.2.150.0070.06015.59
5.2.140.0030.06015.59
5.2.130.0030.06315.59
5.2.120.0070.05715.59
5.2.110.0070.05715.59
5.2.100.0000.04315.59
5.2.90.0000.06715.59
5.2.80.0030.06015.59
5.2.70.0000.06315.59
5.2.60.0030.06015.59
5.2.50.0000.06315.59
5.2.40.0030.04015.59
5.2.30.0070.05315.59
5.2.20.0030.05715.59
5.2.10.0030.05315.59
5.2.00.0000.03015.59
5.1.60.0030.04715.59
5.1.50.0000.04015.59
5.1.40.0000.03315.59
5.1.30.0030.05315.59
5.1.20.0070.05715.59
5.1.10.0000.03715.59
5.1.00.0000.03015.59
5.0.50.0000.04315.59
5.0.40.0000.04315.59
5.0.30.0030.06015.59
5.0.20.0000.02715.59
5.0.10.0030.03715.59
5.0.00.0000.06015.59
4.4.90.0000.03715.59
4.4.80.0000.03715.59
4.4.70.0030.03315.59
4.4.60.0000.01315.59
4.4.50.0030.01015.59
4.4.40.0000.05715.59
4.4.30.0070.02315.59
4.4.20.0030.03015.59
4.4.10.0030.03015.59
4.4.00.0000.05315.59
4.3.110.0000.03715.59
4.3.100.0000.02015.59
4.3.90.0030.01315.59
4.3.80.0000.05015.59
4.3.70.0030.02715.59
4.3.60.0030.02715.59
4.3.50.0000.03715.59
4.3.40.0000.04715.59
4.3.30.0030.03015.59
4.3.20.0000.04015.59
4.3.10.0000.02715.59
4.3.00.0000.01715.59

preferences:
51.35 ms | 400 KiB | 5 Q