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.0100.01016.50
8.3.50.0230.00617.47
8.3.40.0100.00719.10
8.3.30.0120.00318.92
8.3.20.0040.00418.89
8.3.10.0000.00920.69
8.3.00.0040.00419.38
8.2.180.0060.01016.88
8.2.170.0140.00722.96
8.2.160.0120.00320.95
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00018.82
8.2.110.0030.00621.12
8.2.100.0080.00318.03
8.2.90.0040.00419.08
8.2.80.0040.00419.41
8.2.70.0030.00617.75
8.2.60.0080.00017.80
8.2.50.0040.00418.07
8.2.40.0090.00018.16
8.2.30.0040.00418.00
8.2.20.0080.00017.84
8.2.10.0070.00017.73
8.2.00.0040.00417.77
8.1.280.0090.00625.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00321.91
8.1.230.0040.00820.96
8.1.220.0080.00018.77
8.1.210.0000.00818.99
8.1.200.0000.00817.48
8.1.190.0070.00017.53
8.1.180.0030.00518.10
8.1.170.0000.00818.90
8.1.160.0050.00218.86
8.1.150.0000.00718.61
8.1.140.0070.00017.55
8.1.130.0000.00717.86
8.1.120.0040.00417.57
8.1.110.0000.00717.54
8.1.100.0040.00417.58
8.1.90.0030.00617.44
8.1.80.0000.00817.58
8.1.70.0000.01017.57
8.1.60.0070.00017.65
8.1.50.0000.00717.61
8.1.40.0000.00817.61
8.1.30.0000.00817.71
8.1.20.0080.00017.82
8.1.10.0030.00617.59
8.1.00.0030.00617.62
8.0.300.0000.00719.94
8.0.290.0050.00316.75
8.0.280.0040.00418.32
8.0.270.0000.00717.14
8.0.260.0040.00416.98
8.0.250.0080.00017.09
8.0.240.0000.00717.11
8.0.230.0000.00717.09
8.0.220.0030.00317.07
8.0.210.0000.00716.94
8.0.200.0060.00017.11
8.0.190.0000.00817.07
8.0.180.0000.00716.97
8.0.170.0090.00016.94
8.0.160.0040.00417.11
8.0.150.0080.00016.88
8.0.140.0000.00816.90
8.0.130.0000.00613.46
8.0.120.0000.00816.99
8.0.110.0070.00016.90
8.0.100.0000.00817.10
8.0.90.0000.00817.04
8.0.80.0080.00817.10
8.0.70.0000.00716.93
8.0.60.0020.00517.15
8.0.50.0030.00616.84
8.0.30.0040.01517.43
8.0.20.0090.00917.16
8.0.10.0030.00516.97
8.0.00.0130.00717.10
7.4.330.0000.00513.13
7.4.320.0000.00716.67
7.4.300.0000.00716.57
7.4.290.0070.00016.62
7.4.280.0080.00316.64
7.4.270.0030.00316.68
7.4.260.0060.00013.55
7.4.250.0050.00316.72
7.4.240.0070.00016.81
7.4.230.0030.00316.72
7.4.220.0080.01116.81
7.4.210.0000.01116.63
7.4.200.0030.00316.75
7.4.190.0030.00316.73
7.4.160.0160.00016.53
7.4.150.0100.00916.48
7.4.140.0070.01516.62
7.4.130.0120.00516.41
7.4.120.0140.00916.64
7.4.110.0060.01216.76
7.4.100.0150.01016.84
7.4.90.0140.00316.78
7.4.80.0180.00019.39
7.4.70.0000.01616.69
7.4.60.0000.01516.60
7.4.50.0000.00516.53
7.4.40.0090.00916.50
7.4.30.0110.00516.73
7.4.00.0060.00915.16
7.3.330.0000.00613.09
7.3.320.0030.00313.16
7.3.310.0030.00316.22
7.3.300.0070.00016.38
7.3.290.0110.00516.38
7.3.280.0120.00816.38
7.3.270.0090.00816.41
7.3.260.0150.00616.50
7.3.250.0110.00816.38
7.3.240.0040.01416.38
7.3.230.0130.00416.46
7.3.210.0100.00616.40
7.3.200.0030.01316.43
7.3.190.0030.01816.35
7.3.180.0030.01216.70
7.3.170.0150.00316.34
7.3.160.0140.00616.47
7.3.120.0070.00715.18
7.3.10.0070.00416.96
7.3.00.0030.00616.79
7.2.330.0060.01216.61
7.2.320.0110.00716.65
7.2.310.0110.01116.80
7.2.300.0140.00616.68
7.2.290.0000.02016.59
7.2.130.0000.01616.94
7.2.120.0100.00317.21
7.2.110.0060.00317.00
7.2.100.0090.00317.04
7.2.90.0070.00716.95
7.2.80.0120.00317.12
7.2.70.0030.00717.13
7.2.60.0090.00617.06
7.2.50.0080.00216.97
7.2.40.0070.00717.04
7.2.30.0000.01216.73
7.2.20.0060.00916.87
7.2.10.0080.00316.90
7.2.00.0070.00818.34
7.1.250.0050.00515.63
7.1.200.0030.00616.13
7.1.70.0000.00717.46
7.1.60.0030.02019.30
7.1.50.0000.01917.07
7.1.00.0000.08022.46
7.0.200.0350.00715.04
7.0.140.0030.07322.14
7.0.120.0100.06722.16
7.0.60.0070.07320.07
7.0.50.0130.07317.92
7.0.40.0130.08020.11
7.0.30.0430.06320.32
7.0.20.0270.04720.02
7.0.10.0330.07320.14
7.0.00.0030.04020.14
5.6.210.0030.07720.47
5.6.200.0030.08718.21
5.6.190.0170.06320.56
5.6.180.0330.07320.32
5.6.170.0170.04720.61
5.6.160.0030.05720.51
5.6.150.0070.08018.17
5.6.140.0130.03318.12
5.6.130.0070.08318.18
5.6.120.0200.06721.10
5.6.110.0100.06720.89
5.6.100.0130.07021.07
5.6.90.0130.08320.97
5.6.80.0070.07320.37
5.6.70.0470.06020.38
5.5.350.0230.04320.39
5.5.340.0170.07017.98
5.5.330.0100.08320.40
5.5.320.0170.06720.36
5.5.310.0300.04720.32
5.5.300.0130.06717.96
5.5.290.0070.04717.98
5.5.280.0070.07020.90
5.5.270.0070.05320.80
5.5.260.0070.05020.73
5.5.250.0070.08720.78
5.5.240.0100.07720.19
5.4.450.0130.05319.51
5.4.440.0070.07719.41
5.4.430.0070.04319.11
5.4.420.0030.04719.11
5.4.410.0070.05719.37
5.4.400.0100.05319.18
5.4.390.0030.06719.18
5.4.380.0100.07318.93
5.4.370.0030.06019.15
5.4.360.0130.05718.79
5.4.350.0100.04319.15
5.4.340.0100.07319.17
5.4.320.0030.07318.93
5.4.310.0130.06319.15
5.4.300.0070.08319.00
5.4.290.0000.04019.20
5.4.280.0100.04718.91
5.4.270.0130.07719.07
5.4.260.0130.07319.14
5.4.250.0130.07318.80
5.4.240.0100.06318.77
5.4.230.0070.04318.78
5.4.220.0070.05719.17
5.4.210.0100.06319.07
5.4.200.0030.08019.08
5.4.190.0170.06718.79
5.4.180.0070.07719.14
5.4.170.0130.04018.78
5.4.160.0070.07718.90
5.4.150.0100.05719.16
5.4.140.0100.04716.29
5.4.130.0070.06016.24
5.4.120.0130.06716.25
5.4.110.0100.06716.28
5.4.100.0100.03316.32
5.4.90.0030.04716.23
5.4.80.0100.07016.35
5.4.70.0030.04016.35
5.4.60.0200.06016.28
5.4.50.0070.03316.24
5.4.40.0070.06716.55
5.4.30.0130.05316.21
5.4.20.0070.08016.26
5.4.10.0000.07716.21
5.4.00.0100.06715.65
5.3.290.0170.06314.61
5.3.280.0100.07714.51
5.3.270.0170.05714.57
5.3.260.0100.04314.57
5.3.250.0070.05714.60
5.3.240.0030.04714.41
5.3.230.0170.06714.70
5.3.220.0170.06714.59
5.3.210.0070.07314.66
5.3.200.0000.08314.51
5.3.190.0070.06314.51
5.3.180.0030.08014.66
5.3.170.0000.05714.41
5.3.160.0070.07314.59
5.3.150.0030.04714.59
5.3.140.0000.07714.52
5.3.130.0030.06314.51
5.3.120.0000.05314.50
5.3.110.0070.07714.46
5.3.100.0100.07314.00
5.3.90.0070.07313.97
5.3.80.0100.07013.96
5.3.70.0070.06013.95
5.3.60.0130.06713.95
5.3.50.0170.06013.75
5.3.40.0100.04713.78
5.3.30.0070.07713.86
5.3.20.0030.07713.65
5.3.10.0000.05713.62
5.3.00.0030.06013.61
5.2.170.0000.06711.09
5.2.160.0070.04310.98
5.2.150.0000.04011.24
5.2.140.0100.05711.00
5.2.130.0100.03011.05
5.2.120.0000.06711.01
5.2.110.0000.06011.10
5.2.100.0100.06011.05
5.2.90.0100.05711.05
5.2.80.0070.06011.09
5.2.70.0030.06311.01
5.2.60.0030.05710.91
5.2.50.0030.06711.00
5.2.40.0130.04710.92
5.2.30.0030.05310.93
5.2.20.0070.05010.95
5.2.10.0100.05710.91
5.2.00.0030.04310.68
5.1.60.0070.0409.98
5.1.50.0100.05010.05
5.1.40.0030.04310.00
5.1.30.0070.05710.33
5.1.20.0070.05310.35
5.1.10.0070.0539.98
5.1.00.0000.03310.09
5.0.50.0100.0338.64
5.0.40.0000.0238.50
5.0.30.0030.0438.23
5.0.20.0000.0478.27
5.0.10.0030.0278.23
5.0.00.0000.0338.07
4.4.90.0000.0377.85
4.4.80.0070.0277.85
4.4.70.0030.0337.85
4.4.60.0070.0307.85
4.4.50.0030.0307.85
4.4.40.0000.0537.85
4.4.30.0070.0237.85
4.4.20.0030.0377.85
4.4.10.0030.0337.85
4.4.00.0000.0337.85
4.3.110.0000.0307.85
4.3.100.0070.0177.85
4.3.90.0000.0237.85
4.3.80.0100.0177.85
4.3.70.0030.0137.85
4.3.60.0000.0207.85
4.3.50.0000.0177.85
4.3.40.0030.0207.85
4.3.30.0000.0177.85
4.3.20.0000.0177.85
4.3.10.0000.0177.85
4.3.00.0000.0177.85

preferences:
43.53 ms | 401 KiB | 5 Q