3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reverse = TRUE; $separator = '/'; $str = 'test'; $f = $reverse ? 'strrpos' : 'strpos'; if (($pos = $f($str, $separator)) !== FALSE) { $str = substr($str,0, $pos); } var_dump($str);

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.0100.00618.42
8.3.50.0120.00522.11
8.3.40.0110.00418.73
8.3.30.0110.00419.27
8.3.20.0080.00020.16
8.3.10.0050.00322.12
8.3.00.0090.00022.36
8.2.180.0130.00316.32
8.2.170.0130.00722.96
8.2.160.0070.00720.89
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.01126.16
8.2.120.0040.00417.50
8.2.110.0070.00320.94
8.2.100.0110.00017.78
8.2.90.0040.00419.09
8.2.80.0090.00017.97
8.2.70.0050.00317.38
8.2.60.0030.00618.04
8.2.50.0090.00018.10
8.2.40.0070.00322.20
8.2.30.0060.00317.99
8.2.20.0040.00417.49
8.2.10.0040.00417.55
8.2.00.0040.00417.72
8.1.280.0110.01125.92
8.1.270.0040.00421.89
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0050.00322.66
8.1.230.0120.00017.43
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0000.00917.22
8.1.190.0030.00616.98
8.1.180.0040.00418.10
8.1.170.0030.00518.52
8.1.160.0040.00422.14
8.1.150.0040.00418.52
8.1.140.0040.00417.38
8.1.130.0030.00317.79
8.1.120.0000.00717.29
8.1.110.0050.00317.34
8.1.100.0000.00817.38
8.1.90.0040.00417.42
8.1.80.0030.00517.38
8.1.70.0080.00017.28
8.1.60.0070.00317.43
8.1.50.0040.00417.47
8.1.40.0050.00317.32
8.1.30.0000.00817.55
8.1.20.0060.00317.55
8.1.10.0030.00517.38
8.1.00.0040.00417.34
8.0.300.0070.00018.77
8.0.290.0040.00416.58
8.0.280.0000.00718.39
8.0.270.0000.00717.21
8.0.260.0000.00616.66
8.0.250.0000.00716.91
8.0.240.0040.00416.85
8.0.230.0000.00716.92
8.0.220.0040.00416.78
8.0.210.0030.00316.75
8.0.200.0030.00316.90
8.0.190.0000.00816.90
8.0.180.0070.00016.77
8.0.170.0000.00816.74
8.0.160.0040.00416.71
8.0.150.0030.00316.80
8.0.140.0000.00716.82
8.0.130.0030.00313.26
8.0.120.0050.00216.81
8.0.110.0040.00416.75
8.0.100.0080.00016.73
8.0.90.0030.00516.64
8.0.80.0040.01216.81
8.0.70.0040.00416.67
8.0.60.0070.00016.64
8.0.50.0000.00816.69
8.0.30.0150.00517.02
8.0.20.0100.00817.40
8.0.10.0020.00516.84
8.0.00.0120.00516.64
7.4.330.0000.00515.14
7.4.320.0000.00616.50
7.4.300.0030.00316.59
7.4.290.0030.00316.45
7.4.280.0030.00316.38
7.4.270.0000.00716.59
7.4.260.0030.00316.47
7.4.250.0000.00816.55
7.4.240.0020.00616.63
7.4.230.0030.00316.70
7.4.220.0120.00916.68
7.4.210.0120.00716.51
7.4.200.0000.00916.34
7.4.190.0050.00216.68
7.4.160.0120.01216.20
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0110.00916.42
7.4.120.0090.01116.43
7.4.110.0110.00616.48
7.4.100.0100.00716.45
7.4.90.0080.00916.47
7.4.80.0170.00619.39
7.4.70.0050.01116.58
7.4.60.0090.00916.33
7.4.50.0000.00516.35
7.4.40.0030.01322.77
7.4.30.0150.00016.67
7.4.00.0080.00714.91
7.3.330.0060.00013.03
7.3.320.0040.00412.94
7.3.310.0050.00216.17
7.3.300.0050.00316.18
7.3.290.0110.00616.22
7.3.280.0050.01116.17
7.3.270.0100.00717.40
7.3.260.0090.00916.38
7.3.250.0120.00516.44
7.3.240.0120.00616.46
7.3.230.0170.00016.39
7.3.210.0120.00316.24
7.3.200.0120.00619.39
7.3.190.0060.01316.29
7.3.180.0060.00916.44
7.3.170.0090.00616.27
7.3.160.0090.00616.26
7.3.120.0080.00914.58
7.3.110.0050.00814.89
7.3.100.0040.00814.83
7.3.90.0050.00514.60
7.3.80.0050.00614.96
7.3.70.0070.00314.53
7.3.60.0080.00314.57
7.3.50.0030.00714.79
7.3.40.0070.00714.73
7.3.30.0030.00614.66
7.3.20.0050.00716.69
7.3.10.0000.01316.60
7.3.00.0080.00316.63
7.2.330.0100.00716.61
7.2.320.0180.00616.55
7.2.310.0100.01016.51
7.2.300.0040.01216.57
7.2.290.0030.01316.57
7.2.250.0020.01415.04
7.2.240.0050.01115.02
7.2.230.0060.00814.93
7.2.220.0040.00914.93
7.2.210.0040.01214.84
7.2.200.0110.00214.86
7.2.190.0040.00914.89
7.2.180.0050.00914.84
7.2.170.0060.01014.66
7.2.00.0040.00419.49
7.1.330.0020.01215.65
7.1.320.0040.00715.73
7.1.310.0070.00515.70
7.1.300.0030.01115.69
7.1.290.0040.00915.77
7.1.280.0060.00715.71
7.1.270.0020.00815.66
7.1.260.0030.01015.80
7.1.100.0070.00718.12
7.1.70.0050.00317.31
7.1.60.0060.01619.82
7.1.50.0140.01016.87
7.1.00.0070.07022.31
7.0.200.0040.00416.77
7.0.140.0000.07322.01
7.0.60.0100.08019.99
7.0.50.0070.05017.88
7.0.40.0030.07720.21
7.0.30.0230.03720.04
7.0.20.0200.05720.18
7.0.10.0230.08720.12
7.0.00.0100.06720.33
5.6.280.0000.07720.99
5.6.210.0100.05720.71
5.6.200.0070.04018.16
5.6.190.0100.07320.33
5.6.180.3730.04020.44
5.6.170.0300.08020.45
5.6.160.0070.05720.69
5.6.150.0100.03718.21
5.6.140.0030.05318.21
5.6.130.0070.03718.18
5.6.120.0030.04321.14
5.6.110.0070.08720.96
5.6.100.0070.08321.13
5.6.90.0130.07721.09
5.6.80.0000.07020.50
5.6.70.0270.07020.36
5.5.350.0070.07020.44
5.5.340.0030.07017.97
5.5.330.0030.04320.20
5.5.320.0200.05020.21
5.5.310.0270.06020.21
5.5.300.0030.05717.98
5.5.290.0070.04017.90
5.5.280.0100.07720.84
5.5.270.0130.07720.95
5.5.260.0100.08020.87
5.5.250.0170.06020.61
5.5.240.0100.07320.17
5.4.450.0070.06019.49
5.4.440.0500.06019.66
5.4.430.0130.05019.14
5.4.420.0000.06319.33
5.4.410.0030.06319.04
5.4.400.1570.00018.72
5.4.390.1630.00018.74
5.4.380.0230.06318.56
5.4.370.0170.05718.63
5.4.360.0230.05718.52
5.4.350.0400.04318.52
5.4.340.0370.05318.49
5.4.320.0030.04012.45
5.4.310.0060.04012.45
5.4.300.0040.04612.45
5.4.290.0080.04212.45
5.4.280.0080.04012.34
5.4.270.0090.03412.35
5.4.260.0130.06318.72
5.4.250.0230.05718.79
5.4.240.0070.05719.01
5.4.230.0030.05718.88
5.4.220.0170.06719.02
5.4.210.0100.07018.73
5.4.200.0070.06718.73
5.4.190.0070.07318.79
5.4.180.0030.05318.64
5.4.170.0000.06718.73
5.4.160.0100.05018.82
5.4.150.0130.08718.89
5.4.140.0130.06716.24
5.4.130.0000.05716.29
5.4.120.0030.06716.30
5.4.110.0130.06316.55
5.4.100.0070.05016.25
5.4.90.0030.07716.48
5.4.80.0230.05716.42
5.4.70.0200.06016.47
5.4.60.0170.05716.43
5.4.50.0130.04716.44
5.4.40.0070.05716.52
5.4.30.0030.07316.22
5.4.20.0100.07316.49
5.4.10.0170.05716.30
5.4.00.0100.06015.68
5.3.290.0100.04112.80
5.3.280.0200.06014.45
5.3.270.0100.05014.46
5.3.260.0030.07314.54
5.3.250.0100.05314.61
5.3.240.0070.05314.61
5.3.230.0030.05714.50
5.3.220.0030.05314.56
5.3.210.0070.05314.58
5.3.200.0100.06714.58
5.3.190.0100.06014.58
5.3.180.0070.06014.55
5.3.170.0130.06714.71
5.3.160.0130.06714.45
5.3.150.0100.07014.39
5.3.140.0100.04714.32
5.3.130.0000.08014.39
5.3.120.0070.05314.57
5.3.110.0030.05714.56
5.3.100.0070.06713.91
5.3.90.0100.06713.87
5.3.80.0130.05313.87
5.3.70.0070.06013.87
5.3.60.0100.05014.01
5.3.50.0030.07714.04
5.3.40.0170.06313.83
5.3.30.0130.06014.00
5.3.20.0230.05013.54
5.3.10.0100.07313.50
5.3.00.0030.08013.33
5.2.170.0000.05711.15
5.2.160.0130.03710.90
5.2.150.0130.05311.05
5.2.140.0230.04311.15
5.2.130.0100.04011.04
5.2.120.0100.05011.09
5.2.110.0100.05011.21
5.2.100.0000.04311.03
5.2.90.0000.04711.20
5.2.80.0230.04010.97
5.2.70.0100.03711.11
5.2.60.0100.04010.96
5.2.50.0100.05311.02
5.2.40.0070.04010.83
5.2.30.0070.04710.96
5.2.20.0030.04310.95
5.2.10.0070.04310.84
5.2.00.0100.04010.93
5.1.60.0030.04310.32
5.1.50.0000.04310.32
5.1.40.0100.03310.32
5.1.30.0070.03310.48
5.1.20.0000.05310.32
5.1.10.0000.05310.32
5.1.00.0070.03710.32
5.0.50.0030.04010.32
5.0.40.0030.02710.32
5.0.30.0030.04310.32
5.0.20.0170.01310.32
5.0.10.0130.03010.32
5.0.00.0000.04310.32
4.4.90.0070.02710.32
4.4.80.0070.02310.32
4.4.70.0070.01710.32
4.4.60.0030.02010.32
4.4.50.0030.02310.32
4.4.40.0030.04010.32
4.4.30.0030.02310.32
4.4.20.0070.03010.32
4.4.10.0070.01710.32
4.4.00.0070.04010.32
4.3.110.0100.01710.32
4.3.100.0030.02710.32
4.3.90.0100.01310.32
4.3.80.0000.03310.32
4.3.70.0070.01710.32
4.3.60.0030.01710.32
4.3.50.0030.03010.32
4.3.40.0000.03310.32
4.3.30.0000.03010.32
4.3.20.0000.02310.32
4.3.10.0000.02710.32
4.3.00.0030.0277.80

preferences:
45.62 ms | 400 KiB | 5 Q