3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = preg_replace( '#\/_([a-z]+\/)#', '/$1/$1', '/_ticket/' ); var_dump( $result ); exit; $found = null; $route = '/_ticket/'; foreach ( explode( '/', trim( $route, '/' ) ) as $part => $r ) { $uscore = strpos( $r, '_' ); $times = substr_count( $r, '_' ); if ( 1 != $times || 0 != $uscore ) { continue; } $found = $part; break; } if ( null !== $found ) { $parts = explode( '/', trim( $route, '/' ) ); $before = array_slice( $parts, 0, $found, true ); $after = array_slice( $parts, $found + 1, null, true ); $replacePart = ltrim( $parts[ $found ], '_' ); $before[] = $replacePart; $before[] = $replacePart; foreach ( $after as $part ) { $before[] = $part; } }

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.0160.00016.75
8.3.50.0090.00916.59
8.3.40.0090.00619.10
8.3.30.0120.00318.67
8.3.20.0040.00418.89
8.3.10.0050.00318.99
8.3.00.0030.00619.36
8.2.180.0120.00316.75
8.2.170.0070.00722.96
8.2.160.0070.01118.89
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00721.23
8.2.110.0030.00622.38
8.2.100.0080.00417.84
8.2.90.0030.00517.88
8.2.80.0040.00817.97
8.2.70.0040.00417.80
8.2.60.0030.00618.03
8.2.50.0000.00918.10
8.2.40.0080.00019.15
8.2.30.0000.00819.23
8.2.20.0090.00017.66
8.2.10.0070.00017.77
8.2.00.0000.00817.84
8.1.280.0070.01125.92
8.1.270.0080.00023.99
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.80
8.1.230.0070.00417.79
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0040.01117.35
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0000.00718.87
8.1.150.0050.00218.78
8.1.140.0040.00417.46
8.1.130.0040.00417.61
8.1.120.0100.00017.59
8.1.110.0050.00317.43
8.1.100.0080.00017.50
8.1.90.0070.00017.54
8.1.80.0030.00317.52
8.1.70.0070.00017.45
8.1.60.0000.00717.54
8.1.50.0000.00717.67
8.1.40.0030.00617.67
8.1.30.0040.00417.76
8.1.20.0040.00417.81
8.1.10.0000.00817.67
8.1.00.0040.00417.54
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0070.00017.23
8.0.260.0030.00317.02
8.0.250.0000.00817.08
8.0.240.0000.00717.11
8.0.230.0040.00317.06
8.0.220.0040.00417.05
8.0.210.0070.00017.13
8.0.200.0000.00617.13
8.0.190.0050.00317.04
8.0.180.0040.00417.10
8.0.170.0030.00617.08
8.0.160.0000.00817.08
8.0.150.0080.00017.00
8.0.140.0050.00317.02
8.0.130.0000.00513.50
8.0.120.0030.00517.00
8.0.110.0070.00017.11
8.0.100.0040.00417.05
8.0.90.0000.00717.00
8.0.80.0040.01117.04
8.0.70.0000.00717.15
8.0.60.0000.00817.01
8.0.50.0100.00016.89
8.0.30.0130.00317.30
8.0.20.0140.00817.46
8.0.10.0040.00417.29
8.0.00.0110.01017.00
7.4.330.0050.00013.14
7.4.320.0000.00616.65
7.4.300.0030.00316.73
7.4.290.0070.00016.74
7.4.280.0030.00516.76
7.4.270.0080.00016.76
7.4.260.0030.00313.44
7.4.250.0040.00416.66
7.4.240.0070.00016.66
7.4.230.0000.00716.71
7.4.220.0150.01116.73
7.4.210.0090.01216.68
7.4.200.0000.00716.56
7.4.190.0060.00316.74
7.4.160.0060.01116.81
7.4.150.0100.01016.55
7.4.140.0140.01417.86
7.4.130.0090.00916.52
7.4.120.0110.00716.73
7.4.110.0150.01016.58
7.4.100.0100.00716.50
7.4.90.0060.01216.56
7.4.80.0130.00319.39
7.4.70.0060.01216.55
7.4.60.0060.00916.79
7.4.50.0000.00416.48
7.4.40.0100.00316.55
7.4.30.0090.00916.59
7.4.00.0000.01415.24
7.3.330.0030.00313.09
7.3.320.0000.00713.17
7.3.310.0040.00416.30
7.3.300.0040.00416.26
7.3.290.0060.01016.39
7.3.280.0120.00416.36
7.3.270.0000.01716.41
7.3.260.0110.00716.53
7.3.240.0140.00316.58
7.3.230.0070.01016.70
7.3.210.0160.00316.38
7.3.200.0100.00616.47
7.3.190.0060.01016.60
7.3.180.0100.00616.45
7.3.170.0090.01316.43
7.3.160.0160.00016.34
7.3.120.0030.00614.98
7.2.330.0040.01316.73
7.2.320.0030.02016.75
7.2.310.0070.01116.77
7.2.300.0160.00016.73
7.2.290.0100.00716.68
7.2.60.0060.00916.89
7.2.00.0100.01019.47
7.1.200.0140.00015.79
7.1.100.0040.00817.76
7.1.70.0000.01117.38
7.1.60.0180.00719.25
7.1.50.0100.00617.21
7.1.00.0030.04022.34
7.0.200.0000.01016.98
7.0.140.0030.07722.00
7.0.120.0070.07022.09
7.0.60.0100.06319.92
7.0.50.0070.07017.84
7.0.40.0000.07320.29
7.0.30.0330.05720.14
7.0.20.0300.04320.03
7.0.10.0030.04320.02
7.0.00.0000.08720.14
5.6.280.0030.07021.12
5.6.210.0100.07720.48
5.6.200.0070.04018.23
5.6.190.0030.08020.49
5.6.180.0230.04320.27
5.6.170.0230.06320.51
5.6.160.0000.09720.51
5.6.150.0030.08718.19
5.6.140.0070.06318.09
5.6.130.0070.08018.20
5.6.120.0000.04320.90
5.6.110.0030.04021.12
5.6.100.0200.07021.07
5.6.90.0100.04720.98
5.6.80.0130.06020.36
5.6.70.4370.04020.42
5.5.350.0000.03320.44
5.5.340.0030.08318.01
5.5.330.0070.04020.37
5.5.320.0300.07720.18
5.5.310.0230.06020.18
5.5.300.0100.08017.98
5.5.290.0070.06017.92
5.5.280.0100.08320.80
5.5.270.0100.06720.77
5.5.260.0100.07720.87
5.5.250.0100.04720.71
5.5.240.0030.08720.27
5.4.450.0000.04319.33
5.4.440.0100.03319.51
5.4.430.0000.04319.50
5.4.420.0100.06719.11
5.4.410.0000.04019.27
5.4.400.0170.06719.12
5.4.390.0000.04319.15
5.4.380.0000.04019.00
5.4.370.0070.07319.09
5.4.360.0130.05319.13
5.4.350.0070.03718.79
5.4.340.0030.08319.14
5.4.320.0030.06019.13
5.4.310.0130.05019.00
5.4.300.0030.07018.81
5.4.290.0070.08019.02
5.4.280.0000.05719.08
5.4.270.0000.08718.82
5.4.260.0100.07718.92
5.4.250.0170.06319.19
5.4.240.0170.05318.91
5.4.230.0070.04319.11
5.4.220.0130.06319.07
5.4.210.0070.07319.17
5.4.200.0130.07719.11
5.4.190.0100.04318.77
5.4.180.0070.05319.04
5.4.170.0070.06318.99
5.4.160.0070.04019.06
5.4.150.0030.04718.98
5.4.140.0030.04716.28
5.4.130.0070.07716.24
5.4.120.0070.05316.36
5.4.110.0100.05716.36
5.4.100.0030.07716.37
5.4.90.0070.04016.27
5.4.80.0070.06716.33
5.4.70.0070.07016.32
5.4.60.0070.07016.26
5.4.50.0030.06316.25
5.4.40.0100.07316.38
5.4.30.0070.06316.35
5.4.20.0070.04016.13
5.4.10.0070.07316.31
5.4.00.0030.07715.78
5.3.290.0000.05014.60
5.3.280.0000.07714.56
5.3.270.0070.07714.50
5.3.260.0030.06714.43
5.3.250.0030.05714.54
5.3.240.0030.07714.43
5.3.230.0030.04014.55
5.3.220.0070.07314.39
5.3.210.0130.06314.52
5.3.200.0100.06314.50
5.3.190.0070.07714.52
5.3.180.0030.06714.59
5.3.170.0070.05314.52
5.3.160.0130.05014.50
5.3.150.0000.08014.66
5.3.140.0030.05314.58
5.3.130.0130.07314.48
5.3.120.0030.05014.45
5.3.110.0070.04714.52
5.3.100.0000.04314.02
5.3.90.0030.06714.05
5.3.80.0000.05013.97
5.3.70.0030.04713.96
5.3.60.0100.07013.95
5.3.50.0070.07713.91
5.3.40.0070.05013.80
5.3.30.0000.08014.01
5.3.20.0000.04013.63
5.3.10.0030.08013.50
5.3.00.0030.03713.60
5.2.170.0070.05010.98
5.2.160.0070.06311.05
5.2.150.0100.05311.14
5.2.140.0030.04011.14
5.2.130.0030.05011.14
5.2.120.0030.04011.01
5.2.110.0130.03711.01
5.2.100.0000.03011.01
5.2.90.0070.05711.14
5.2.80.0000.06711.05
5.2.70.0000.05011.05
5.2.60.0000.05711.00
5.2.50.0170.02711.03
5.2.40.0070.03010.98
5.2.30.0070.05310.93
5.2.20.0100.05310.87
5.2.10.0000.03010.91
5.2.00.0070.05010.68
5.1.60.0070.05010.11
5.1.50.0100.04710.02
5.1.40.0000.0479.89
5.1.30.0030.05310.39
5.1.20.0030.04710.39
5.1.10.0070.03010.07
5.1.00.0030.05710.09
5.0.50.0070.0438.54
5.0.40.0000.0338.38
5.0.30.0030.0308.23
5.0.20.0030.0238.23
5.0.10.0030.0308.17
5.0.00.0030.0408.19
4.4.90.0030.0277.59
4.4.80.0030.0237.59
4.4.70.0000.0377.59
4.4.60.0000.0177.59
4.4.50.0000.0207.59
4.4.40.0070.0377.59
4.4.30.0030.0377.59
4.4.20.0070.0277.59
4.4.10.0030.0337.59
4.4.00.0070.0507.59
4.3.110.0000.0237.59
4.3.100.0000.0207.59
4.3.90.0030.0237.59
4.3.80.0000.0537.59
4.3.70.0030.0337.59
4.3.60.0070.0307.59
4.3.50.0030.0277.59
4.3.40.0070.0437.59
4.3.30.0030.0337.59
4.3.20.0000.0177.59
4.3.10.0030.0337.59
4.3.00.0000.0307.59

preferences:
70.28 ms | 401 KiB | 5 Q