3v4l.org

run code in 300+ PHP versions simultaneously
<?php $orig = 'welcome-to-your-world-42'; //$orig = 'welcome'; $parts = explode('-', $orig); if (1 < count($parts)) { usort($parts, function($a, $b) { return strlen($a) < strlen($b); }); $s1 = array_shift($parts); $s2 = array_shift($parts); } else { $s1 = $s2 = $orig; } echo $s1 . PHP_EOL . $s2;

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.0150.00018.85
8.3.30.0060.00918.71
8.3.20.0080.00020.35
8.3.10.0080.00020.16
8.3.00.0070.00023.66
8.2.170.0090.00922.96
8.2.160.0110.00320.52
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0030.00620.53
8.2.100.0040.00817.84
8.2.90.0050.00318.09
8.2.80.0080.00018.03
8.2.70.0050.00317.63
8.2.60.0000.00718.04
8.2.50.0080.00018.07
8.2.40.0070.00418.16
8.2.30.0060.00318.07
8.2.20.0050.00318.05
8.2.10.0000.00819.35
8.2.00.0040.00419.29
8.1.270.0040.00420.66
8.1.260.0050.00226.35
8.1.250.0050.00228.09
8.1.240.0030.00622.04
8.1.230.0060.00622.25
8.1.220.0080.00017.74
8.1.210.0090.00318.77
8.1.200.0000.00817.35
8.1.190.0000.00817.41
8.1.180.0000.00918.10
8.1.170.0030.00618.67
8.1.160.0040.00418.86
8.1.150.0030.00418.79
8.1.140.0050.00220.89
8.1.130.0000.00720.18
8.1.120.0000.00717.47
8.1.110.0050.00217.36
8.1.100.0000.00717.34
8.1.90.0030.00517.43
8.1.80.0000.00717.46
8.1.70.0000.00717.48
8.1.60.0030.00517.46
8.1.50.0040.00417.39
8.1.40.0000.00817.42
8.1.30.0000.00817.60
8.1.20.0030.00917.56
8.1.10.0030.00517.45
8.1.00.0110.00017.48
8.0.300.0000.00719.98
8.0.290.0000.00716.75
8.0.280.0030.00318.39
8.0.270.0070.00017.20
8.0.260.0040.00420.03
8.0.250.0050.00216.93
8.0.240.0000.00816.99
8.0.230.0030.00517.07
8.0.220.0000.00817.02
8.0.210.0030.00316.93
8.0.200.0050.00216.90
8.0.190.0000.00717.00
8.0.180.0000.00716.87
8.0.170.0040.00416.96
8.0.160.0000.00716.82
8.0.150.0000.00716.79
8.0.140.0000.00716.93
8.0.130.0060.00013.37
8.0.120.0030.00516.91
8.0.110.0000.00716.86
8.0.100.0040.00416.82
8.0.90.0000.00716.98
8.0.80.0070.00716.93
8.0.70.0000.00716.82
8.0.60.0040.00416.95
8.0.50.0080.00016.95
8.0.30.0060.01417.18
8.0.20.0060.01217.39
8.0.10.0040.00417.06
8.0.00.0080.00916.88
7.4.330.0050.00015.55
7.4.320.0000.00716.51
7.4.300.0000.00716.59
7.4.290.0070.00016.50
7.4.280.0000.00716.62
7.4.270.0080.00016.48
7.4.260.0030.00313.39
7.4.250.0000.00816.59
7.4.240.0040.00416.57
7.4.230.0000.00716.67
7.4.220.0020.00516.55
7.4.210.0080.00916.60
7.4.200.0000.00716.68
7.4.130.0100.00716.43
7.4.120.0130.00716.52
7.4.110.0100.00716.65
7.4.100.0040.01916.55
7.4.90.0060.01616.30
7.4.80.0080.00819.39
7.4.70.0030.01416.46
7.4.60.0070.01016.40
7.4.50.0100.00316.16
7.4.40.0140.00716.28
7.4.10.0150.00315.01
7.4.00.0080.00914.82
7.3.330.0000.00716.31
7.3.320.0050.00013.38
7.3.310.0000.00816.45
7.3.300.0030.00316.28
7.3.290.0070.00016.27
7.3.280.0110.00416.32
7.3.260.0120.00916.45
7.3.230.0060.01116.32
7.3.210.0070.01016.38
7.3.200.0190.00416.38
7.3.190.0040.01216.54
7.3.180.0070.01216.54
7.3.170.0200.00016.48
7.3.160.0100.01116.63
7.3.130.0130.00315.04
7.3.120.0030.01314.76
7.3.110.0100.00714.95
7.3.100.0070.00814.92
7.3.90.0060.00514.85
7.3.80.0070.00514.90
7.3.70.0020.00914.65
7.3.60.0060.00714.73
7.3.50.0060.00614.75
7.3.40.0100.00614.73
7.3.30.0030.01014.63
7.3.20.0110.00516.30
7.3.10.0070.00816.14
7.3.00.0050.00816.17
7.2.330.0110.00816.73
7.2.320.0100.01316.68
7.2.310.0140.00316.77
7.2.300.0090.00916.45
7.2.290.0100.00716.43
7.2.260.0030.01315.05
7.2.250.0040.01215.07
7.2.240.0010.01415.05
7.2.230.0070.01115.12
7.2.220.0090.00615.03
7.2.210.0080.00614.98
7.2.200.0090.00515.01
7.2.190.0070.00615.03
7.2.180.0060.00615.08
7.2.170.0040.00915.03
7.2.160.0040.01015.12
7.2.150.0080.01216.02
7.2.140.0090.01116.08
7.2.130.0050.01215.99
7.2.120.0070.00816.10
7.2.110.0080.00616.05
7.2.100.0080.00515.92
7.2.90.0070.00816.12
7.2.80.0120.00516.00
7.2.70.0140.00616.14
7.2.60.0090.00615.93
7.2.50.0080.00716.15
7.2.40.0030.01316.18
7.2.30.0080.00515.98
7.2.20.0130.00616.01
7.2.10.0100.00715.88
7.2.00.0040.01216.02
7.1.330.0090.00615.73
7.1.320.0050.00815.58
7.1.310.0070.00715.22
7.1.300.0020.01115.21
7.1.290.0080.00615.27
7.1.280.0070.00815.28
7.1.270.0060.00815.28
7.1.260.0080.00715.21
7.1.250.0060.00914.85
7.1.240.0070.00315.93
7.1.230.0100.00315.86
7.1.220.0030.00615.50
7.1.210.0030.00715.52
7.1.200.0080.00515.79
7.1.190.0070.00715.62
7.1.180.0030.00715.87
7.1.170.0040.00815.55
7.1.160.0030.01315.80
7.1.150.0030.00515.88
7.1.140.0030.01315.76
7.1.130.0070.00715.47
7.1.120.0060.00915.73
7.1.110.0060.00615.75
7.1.100.0000.01215.45
7.1.90.0030.01015.90
7.1.80.0070.01015.62
7.1.70.0060.00915.84
7.1.60.0030.01215.73
7.1.50.0150.00015.89
7.1.40.0070.01015.72
7.1.30.0060.00915.62
7.1.20.0000.01215.64
7.1.10.0040.00715.73
7.1.00.0080.00415.71

preferences:
54.72 ms | 400 KiB | 5 Q