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 dede errr')); ?>

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.0110.00718.55
8.3.50.0110.00522.16
8.3.40.0100.01018.84
8.3.30.0080.00818.89
8.3.20.0080.00018.78
8.3.10.0000.00920.83
8.3.00.0000.00721.77
8.2.180.0070.00716.50
8.2.170.0100.01022.96
8.2.160.0100.00322.20
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00221.03
8.2.110.0000.01020.38
8.2.100.0120.00017.97
8.2.90.0000.00719.20
8.2.80.0000.00917.97
8.2.70.0030.00617.63
8.2.60.0000.00818.03
8.2.50.0030.00619.36
8.2.40.0000.00818.34
8.2.30.0000.00721.20
8.2.20.0040.00317.63
8.2.10.0030.00617.66
8.2.00.0000.00717.75
8.1.280.0120.00325.92
8.1.270.0050.00223.99
8.1.260.0050.00326.35
8.1.250.0030.00328.09
8.1.240.0100.00022.43
8.1.230.0080.00420.90
8.1.220.0040.00418.77
8.1.210.0080.00018.85
8.1.200.0030.00617.35
8.1.190.0080.00019.32
8.1.180.0060.00318.10
8.1.170.0030.00518.50
8.1.160.0080.00018.95
8.1.150.0040.00418.52
8.1.140.0040.00417.52
8.1.130.0000.00617.94
8.1.120.0000.00817.46
8.1.110.0040.00417.43
8.1.100.0000.00717.44
8.1.90.0000.00717.50
8.1.80.0000.00717.54
8.1.70.0030.00317.37
8.1.60.0030.00517.57
8.1.50.0000.00717.47
8.1.40.0030.00517.47
8.1.30.0050.00217.54
8.1.20.0040.00417.63
8.1.10.0080.00017.55
8.1.00.0000.00917.52
8.0.300.0040.00419.98
8.0.290.0040.00417.28
8.0.280.0040.00418.36
8.0.270.0030.00317.21
8.0.260.0030.00316.82
8.0.250.0040.00416.96
8.0.240.0070.00016.88
8.0.230.0070.00016.91
8.0.220.0030.00316.86
8.0.210.0000.00716.83
8.0.200.0060.00016.79
8.0.190.0000.00716.80
8.0.180.0030.00516.83
8.0.170.0000.00816.90
8.0.160.0000.00716.82
8.0.150.0040.00416.88
8.0.140.0030.00516.76
8.0.130.0030.00313.32
8.0.120.0020.00516.82
8.0.110.0040.00416.76
8.0.100.0070.00016.94
8.0.90.0000.00816.90
8.0.80.0070.00716.84
8.0.70.0040.00416.91
8.0.60.0060.00316.92
8.0.50.0080.00016.82
8.0.30.0080.01117.04
8.0.20.0140.00517.40
8.0.10.0030.00517.02
8.0.00.0050.01216.74
7.4.330.0000.00514.87
7.4.320.0060.00016.52
7.4.300.0060.00016.46
7.4.290.0000.00716.55
7.4.280.0000.00716.64
7.4.270.0030.00316.58
7.4.260.0000.00613.29
7.4.250.0080.00016.56
7.4.240.0000.00716.44
7.4.230.0020.00516.71
7.4.220.0060.01216.45
7.4.210.0060.01016.58
7.4.200.0000.00716.71
7.4.190.0050.00316.36
7.4.160.0080.00816.71
7.4.150.0120.00617.40
7.4.140.0060.01317.86
7.4.130.0080.01216.61
7.4.120.0070.01016.48
7.4.110.0070.01416.55
7.4.100.0080.00816.65
7.4.90.0120.00916.47
7.4.80.0090.00919.39
7.4.70.0170.00016.56
7.4.60.0040.01416.50
7.4.50.0000.00916.20
7.4.40.0090.00622.77
7.4.30.0090.00916.45
7.4.00.0140.00314.96
7.3.330.0000.00513.33
7.3.320.0050.00013.33
7.3.310.0030.00316.41
7.3.300.0070.00016.42
7.3.290.0110.00316.34
7.3.280.0080.01116.36
7.3.270.0120.01217.40
7.3.260.0090.01218.24
7.3.250.0070.01416.53
7.3.240.0100.00716.63
7.3.230.0140.00316.46
7.3.210.0000.01716.67
7.3.200.0030.01319.39
7.3.190.0140.00716.65
7.3.180.0030.01216.54
7.3.170.0090.00916.36
7.3.160.0090.01216.45
7.3.120.0040.01414.87
7.3.10.0030.01016.34
7.3.00.0040.00716.53
7.2.330.0110.00616.75
7.2.320.0120.00816.65
7.2.310.0090.00916.81
7.2.300.0140.00316.49
7.2.290.0170.00316.59
7.2.130.0020.01217.08
7.2.120.0080.00516.97
7.2.110.0050.00716.90
7.2.100.0040.01016.76
7.2.90.0030.01016.89
7.2.80.0060.00817.01
7.2.70.0050.00716.84
7.2.60.0070.00916.86
7.2.50.0070.01016.86
7.2.40.0040.00816.91
7.2.30.0050.01016.93
7.2.20.0050.00917.00
7.2.10.0060.00716.93
7.2.00.0060.00817.76
7.1.250.0050.00915.86
7.1.240.0080.00415.76
7.1.230.0070.00715.81
7.1.220.0060.00315.84
7.1.210.0000.01215.79
7.1.200.0030.01415.78
7.1.190.0060.00615.98
7.1.180.0100.00315.84
7.1.170.0150.00315.82
7.1.160.0100.00615.77
7.1.150.0000.00815.97
7.1.140.0150.00315.75
7.1.130.0100.00715.63
7.1.120.0060.00615.64
7.1.110.0000.01315.88
7.1.100.0040.00916.69
7.1.90.0130.00615.63
7.1.80.0000.01115.78
7.1.70.0050.00516.46
7.1.60.0090.01017.50
7.1.50.0060.01016.44
7.1.40.0070.01115.79
7.1.30.0070.00715.87
7.1.20.0040.01115.84
7.1.10.0000.00915.80
7.1.00.0030.02019.02
7.0.330.0110.00415.10
7.0.320.0120.00015.47
7.0.310.0060.01015.23
7.0.300.0070.00715.27
7.0.290.0000.01115.48
7.0.280.0070.01015.36
7.0.270.0160.00015.23
7.0.260.0120.00615.43
7.0.250.0030.00915.44
7.0.240.0000.00915.44
7.0.230.0070.00715.47
7.0.220.0140.00315.53
7.0.210.0060.00615.47
7.0.200.0090.00516.12
7.0.190.0140.00315.62
7.0.180.0000.00815.61
7.0.170.0160.00315.21
7.0.160.0000.01415.57
7.0.150.0060.00615.36
7.0.140.0100.03218.89
7.0.130.0100.00315.46
7.0.120.0070.00315.21
7.0.110.0030.00715.55
7.0.100.0210.02517.79
7.0.90.0110.02117.67
7.0.80.0130.02617.73
7.0.70.0170.02517.72
7.0.60.0100.02017.73
7.0.50.0080.03017.94
7.0.40.0100.04116.82
7.0.30.0080.02116.59
7.0.20.0080.02216.80
7.0.10.0030.02716.84
7.0.00.0040.04016.81
5.6.380.0060.00613.98
5.6.370.0030.00614.13
5.6.360.0120.00614.03
5.6.350.0040.01214.58
5.6.340.0000.01014.58
5.6.330.0030.00714.03
5.6.320.0000.01114.28
5.6.310.0000.00914.38
5.6.300.0070.00714.59
5.6.290.0030.00914.54
5.6.280.0090.03617.68
5.6.270.0070.00714.09
5.6.260.0090.00614.63
5.6.250.0090.03717.62
5.6.240.0030.02617.54
5.6.230.0080.02317.36
5.6.220.0100.02217.61
5.6.210.0070.02217.40
5.6.200.0060.02317.71
5.6.190.0030.02717.72
5.6.180.0080.01817.77
5.6.170.0070.02317.73
5.6.160.0020.02717.80
5.6.150.0020.02917.64
5.6.140.0050.02517.71
5.6.130.0050.02517.53
5.6.120.0070.02217.63
5.6.110.0090.04017.46
5.6.100.0130.02317.65
5.6.90.0090.02317.39
5.6.80.0080.03817.12
5.6.70.0120.02817.21
5.6.60.0020.03917.27
5.6.50.0080.01817.43
5.6.40.0020.02317.29
5.6.30.0020.04817.33
5.6.20.0060.02117.20
5.6.10.0110.03017.29
5.6.00.0020.02517.43
5.5.380.0050.02315.71
5.5.370.0060.02415.87
5.5.360.0020.02715.84
5.5.350.0030.02315.81
5.5.340.0030.02216.11
5.5.330.0020.02615.90
5.5.320.0080.01516.11
5.5.310.0030.02016.05
5.5.300.0030.02815.97
5.5.290.0070.02315.91
5.5.280.0030.02515.89
5.5.270.0090.02115.96
5.5.260.0040.03015.88
5.5.250.0020.03415.77
5.5.240.0110.04015.59
5.5.230.0050.04715.53
5.5.220.0070.02215.58
5.5.210.0060.02115.66
5.5.200.0050.01815.53
5.5.190.0050.03015.53
5.5.180.0080.03415.75
5.5.170.0030.00511.11
5.5.160.0020.04015.76
5.5.150.0080.04015.71
5.5.140.0060.02715.77
5.5.130.0140.03815.55
5.5.120.0100.03815.48
5.5.110.0070.04015.66
5.5.100.0070.03515.73
5.5.90.0030.03315.54
5.5.80.0060.03015.74
5.5.70.0070.04415.68
5.5.60.0080.02415.65
5.5.50.0080.02815.63
5.5.40.0130.03015.53
5.5.30.0030.04515.70
5.5.20.0120.02515.48
5.5.10.0060.02815.50
5.5.00.0050.04715.50
5.4.450.0020.03315.30
5.4.440.0070.02215.09
5.4.430.0080.02215.14
5.4.420.0060.02315.13
5.4.410.0020.02315.05
5.4.400.0050.03115.06
5.4.390.0050.02414.90
5.4.380.0080.03014.92
5.4.370.0080.03715.04
5.4.360.0070.01615.06
5.4.350.0020.03514.99
5.4.340.0040.01914.87
5.4.330.0070.00711.16
5.4.320.0050.04515.00
5.4.310.0050.04214.88
5.4.300.0050.03915.01
5.4.290.0090.04014.99
5.4.280.0030.02315.05
5.4.270.0080.02614.92
5.4.260.0020.04715.18
5.4.250.0080.03915.12
5.4.240.0020.04015.05
5.4.230.0020.03515.18
5.4.220.0050.04315.08
5.4.210.0060.04015.13
5.4.200.0080.03814.90
5.4.190.0070.04214.97
5.4.180.0070.03314.97
5.4.170.0010.02914.89
5.4.160.0030.03015.10
5.4.150.0100.02314.88
5.4.140.0050.02213.79
5.4.130.0060.03313.68
5.4.120.0070.04213.84
5.4.110.0030.04013.84
5.4.100.0020.02513.72
5.4.90.0060.03813.68
5.4.80.0030.03713.78
5.4.70.0080.03713.78
5.4.60.0070.03313.70
5.4.50.0080.03813.61
5.4.40.0050.03813.76
5.4.30.0050.03813.81
5.4.20.0050.02813.79
5.4.10.0130.02313.78
5.4.00.0050.03813.48
5.3.290.0070.03612.76
5.3.280.0050.02812.73
5.3.270.0050.03312.76
5.3.260.0070.02212.72
5.3.250.0090.03712.78
5.3.240.0080.04012.71
5.3.230.0050.04212.80
5.3.220.0040.02612.72
5.3.210.0050.02412.74
5.3.200.0040.03512.78
5.3.190.0030.04112.80
5.3.180.0060.04112.80
5.3.170.0140.03312.78
5.3.160.0020.04112.81
5.3.150.0020.02912.69
5.3.140.0030.04012.72
5.3.130.0080.04012.75
5.3.120.0050.04412.72
5.3.110.0090.03712.69
5.3.100.0050.02712.53
5.3.90.0050.04112.47
5.3.80.0080.03812.42
5.3.70.0050.03812.49
5.3.60.0080.03912.51
5.3.50.0050.04312.38
5.3.40.0050.03512.42
5.3.30.0050.02312.39
5.3.20.0050.04112.25
5.3.10.0030.04412.32
5.3.00.0060.02912.32
5.2.170.0050.03711.06
5.2.160.0080.03011.06
5.2.150.0030.03211.06
5.2.140.0050.03511.06
5.2.130.0040.03511.07
5.2.120.0030.03211.06
5.2.110.0040.03211.06
5.2.100.0030.02311.06
5.2.90.0030.03311.06
5.2.80.0030.03611.06
5.2.70.0030.03511.06
5.2.60.0030.03311.06
5.2.50.0050.03211.06
5.2.40.0040.03311.06
5.2.30.0080.03011.06
5.2.20.0000.02911.06
5.2.10.0050.03011.06
5.2.00.0010.02511.06
5.1.60.0010.02611.06
5.1.50.0040.03011.06
5.1.40.0020.01611.06
5.1.30.0020.03011.06
5.1.20.0050.02911.06
5.1.10.0020.02011.06
5.1.00.0050.02811.06
5.0.50.0030.01611.06
5.0.40.0020.02511.06
5.0.30.0020.03411.06
5.0.20.0000.02711.06
5.0.10.0000.02611.06
5.0.00.0050.03511.06
4.4.90.0030.01411.06
4.4.80.0000.01611.06
4.4.70.0020.01211.06
4.4.60.0010.01211.06
4.4.50.0020.02211.06
4.4.40.0020.02811.06
4.4.30.0000.01411.06
4.4.20.0030.01011.06
4.4.10.0030.01211.06
4.4.00.0020.03011.06
4.3.110.0000.02311.06
4.3.100.0000.01511.06
4.3.90.0020.02011.06
4.3.80.0020.01711.06
4.3.70.0030.01111.06
4.3.60.0020.01411.06
4.3.50.0060.01711.06
4.3.40.0000.02411.06
4.3.30.0020.01011.06
4.3.20.0020.00811.06
4.3.10.0020.01211.06
4.3.00.0000.01311.06

preferences:
48.47 ms | 400 KiB | 5 Q