3v4l.org

run code in 300+ PHP versions simultaneously
<?php $example = 'your string here, please/do it by yourself.'; $expected = 'your string here, do it by yourself.'; $slashPos = strpos($example, '/'); $spacePos = strrpos($example, ' ', -1 * $slashPos); $string1 = substr($example, 0, $spacePos + 1); $string2 = substr($example, (strlen($example) - $slashPos - 1) * -1); $result = $string1 . $string2; var_dump(assert($expected === $result));

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.4.140.0150.00717.36
8.4.130.0140.00617.70
8.4.120.0110.00920.52
8.4.110.0120.00722.60
8.4.100.0100.01117.48
8.4.90.0130.00818.75
8.4.80.0060.00417.69
8.4.70.0100.00717.58
8.4.60.0120.00919.37
8.4.50.0100.00617.79
8.4.40.0100.01019.34
8.4.30.0060.01319.72
8.4.20.0170.00320.23
8.4.10.0060.00917.66
8.3.270.0130.00616.58
8.3.260.0100.00916.63
8.3.250.0110.00719.03
8.3.240.0090.00816.82
8.3.230.0080.00716.50
8.3.220.0070.01119.12
8.3.210.0130.00616.48
8.3.200.0100.00916.60
8.3.190.0090.01016.71
8.3.180.0130.00616.59
8.3.170.0100.00016.65
8.3.160.0090.01018.41
8.3.150.0070.00717.20
8.3.140.0070.00016.45
8.3.130.0040.00418.35
8.3.120.0090.00918.86
8.3.110.0080.00016.63
8.3.100.0160.00316.60
8.3.90.0110.00418.32
8.3.80.0080.00417.97
8.3.70.0120.00616.25
8.3.60.0040.01116.63
8.3.50.0080.00818.97
8.3.40.0120.00318.62
8.3.30.0000.01418.89
8.3.20.0000.00721.75
8.3.10.0000.00823.66
8.3.00.0040.00423.53
8.2.290.0110.00820.80
8.2.280.0090.01116.73
8.2.270.0130.00616.57
8.2.260.0160.00318.88
8.2.250.0040.00416.94
8.2.240.0060.00318.14
8.2.230.0030.00620.94
8.2.220.0150.00424.06
8.2.210.0050.00326.77
8.2.200.0030.00618.16
8.2.190.0040.01118.23
8.2.180.0090.01218.54
8.2.170.0040.01122.96
8.2.160.0090.00920.40
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0000.00826.16
8.2.120.0100.00018.09
8.2.110.0060.00322.24
8.2.100.0040.00717.91
8.2.90.0080.00017.91
8.2.80.0040.00417.97
8.2.70.0100.00017.78
8.2.60.0060.00318.09
8.2.50.0000.00818.10
8.2.40.0000.00819.53
8.2.30.0000.00719.28
8.2.20.0040.00418.05
8.2.10.0000.00720.64
8.2.00.0000.00719.54
8.1.330.0120.00620.24
8.1.320.0120.00617.84
8.1.310.0100.00316.79
8.1.300.0030.00617.78
8.1.290.0000.00818.88
8.1.280.0040.01125.92
8.1.270.0040.00418.88
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00717.35
8.1.230.0070.00320.98
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0050.00517.23
8.1.190.0000.00817.23
8.1.180.0080.00018.10
8.1.170.0060.00318.59
8.1.160.0080.00018.76
8.1.150.0070.00018.85
8.1.140.0040.00423.81
8.1.130.0030.00320.11
8.1.120.0030.00417.29
8.1.110.0000.00717.42
8.1.100.0050.00317.46
8.1.90.0080.00017.30
8.1.80.0050.00517.43
8.1.70.0040.00417.43
8.1.60.0000.00817.58
8.1.50.0080.00417.58
8.1.40.0050.00517.51
8.1.30.0000.00717.73
8.1.20.0080.00017.53
8.1.10.0040.00417.54
8.1.00.0050.00217.51
8.0.300.0000.00719.55
8.0.290.0090.00316.63
8.0.280.0080.00018.39
8.0.270.0000.00717.34
8.0.260.0030.00318.34
8.0.250.0090.00016.88
8.0.240.0030.00717.02
8.0.230.0040.00416.92
8.0.220.0000.00816.88
8.0.210.0030.00316.82
8.0.200.0060.00016.95
8.0.190.0000.00816.91
8.0.180.0070.00016.93
8.0.170.0040.00416.97
8.0.160.0080.00016.93
8.0.150.0000.00716.82
8.0.140.0000.00716.87
8.0.130.0000.00513.38
8.0.120.0000.00816.91
8.0.110.0070.00016.89
8.0.100.0050.00216.78
8.0.90.0030.00516.80
8.0.80.0080.00716.97
8.0.70.0020.00516.79
8.0.60.0040.00416.71
8.0.50.0040.00416.80
8.0.30.0110.00817.01
8.0.20.0090.01717.40
8.0.10.0040.00416.84
8.0.00.0090.00916.73
7.4.330.0000.00516.73
7.4.320.0000.00716.48
7.4.300.0070.00016.63
7.4.290.0000.00716.61
7.4.280.0030.00616.53
7.4.270.0070.00016.42
7.4.260.0040.00416.58
7.4.250.0000.00716.58
7.4.240.0000.00816.64
7.4.230.0000.00716.56
7.4.220.0040.00416.54
7.4.210.0060.00816.60
7.4.200.0070.00016.70
7.4.160.0130.00516.38
7.4.140.0100.01017.86
7.4.130.0170.00016.53
7.4.120.0090.01016.52
7.4.110.0150.00316.58
7.4.100.0140.00416.42
7.4.90.0030.01316.37
7.4.80.0110.00719.39
7.4.70.0100.00716.64
7.4.60.0090.01416.44
7.4.50.0030.01016.65
7.4.40.0060.00916.48
7.4.00.0070.01014.90
7.3.330.0000.00613.29
7.3.320.0030.00313.17
7.3.310.0040.00416.47
7.3.300.0080.00016.31
7.3.290.0030.00316.44
7.3.280.0120.00316.36
7.3.260.0110.00816.46
7.3.240.0060.01316.49
7.3.230.0070.01016.29
7.3.210.0140.00716.63
7.3.200.0080.00816.41
7.3.190.0100.00716.31
7.3.180.0030.01316.53
7.3.170.0070.01016.42
7.3.160.0130.00316.53
7.3.10.0140.00416.53
7.3.00.2010.00815.12
7.2.330.0110.01116.57
7.2.320.0080.01216.73
7.2.310.0100.00716.67
7.2.300.0150.00316.54
7.2.290.0150.00316.82
7.2.130.1560.00315.79
7.2.120.1400.00515.72
7.2.110.1640.00915.76
7.2.100.0910.01115.52
7.2.90.1390.00915.55
7.2.80.1230.00515.79
7.2.70.1200.00515.67
7.2.60.1290.00615.74
7.2.50.1140.01115.88
7.2.40.1300.00815.79
7.2.30.1200.01115.97
7.2.20.1280.00715.79
7.2.10.1380.00615.84
7.2.00.1470.00915.86
7.1.250.1830.00214.70
7.0.330.2770.00713.45
5.6.380.0130.00313.90

preferences:
163.58 ms | 403 KiB | 5 Q