3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = preg_replace( '#\/_([a-z]+\/)#', '/$1$1', '/ticket/_show/xxx' ); 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.40.0090.00618.76
8.3.30.0090.01219.27
8.3.20.0040.00420.16
8.3.10.0050.00223.48
8.3.00.0100.00020.71
8.2.170.0110.00422.96
8.2.160.0070.01322.23
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.08
8.2.110.0090.00022.38
8.2.100.0070.00418.03
8.2.90.0030.00519.07
8.2.80.0060.00318.04
8.2.70.0060.00317.88
8.2.60.0030.00617.80
8.2.50.0000.00918.07
8.2.40.0030.00619.39
8.2.30.0050.00318.04
8.2.20.0070.00017.81
8.2.10.0040.00419.54
8.2.00.0000.00817.85
8.1.270.0030.00623.95
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0110.00019.12
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0040.00417.51
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0070.00321.89
8.1.150.0040.00418.72
8.1.140.0000.00817.55
8.1.130.0030.00317.73
8.1.120.0000.00717.46
8.1.110.0040.00317.55
8.1.100.0070.00017.59
8.1.90.0040.00417.52
8.1.80.0030.00517.46
8.1.70.0000.00717.50
8.1.60.0040.00417.67
8.1.50.0040.00417.62
8.1.40.0040.00417.69
8.1.30.0030.00517.86
8.1.20.0040.00417.81
8.1.10.0060.00317.68
8.1.00.0020.00517.63
8.0.300.0050.00218.77
8.0.290.0000.00717.13
8.0.280.0030.00318.46
8.0.270.0030.00317.14
8.0.260.0070.00017.03
8.0.250.0040.00417.10
8.0.240.0020.00817.14
8.0.230.0030.00317.00
8.0.220.0030.00317.03
8.0.210.0040.00416.95
8.0.200.0000.00817.09
8.0.190.0030.00317.02
8.0.180.0040.00417.04
8.0.170.0040.00416.95
8.0.160.0000.00817.09
8.0.150.0040.00417.04
8.0.140.0000.00717.05
8.0.130.0050.00013.48
8.0.120.0040.00417.06
8.0.110.0070.00017.02
8.0.100.0000.00717.03
8.0.90.0000.00716.96
8.0.80.0060.01017.04
8.0.70.0000.00717.05
8.0.60.0030.00517.12
8.0.50.0040.00416.95
8.0.30.0120.00717.32
8.0.20.0090.01017.45
8.0.10.0040.00417.20
8.0.00.0080.01016.92
7.4.330.0030.00315.11
7.4.320.0000.00616.78
7.4.300.0060.00016.77
7.4.290.0100.00016.59
7.4.280.0000.00716.77
7.4.270.0030.00316.57
7.4.260.0030.00316.79
7.4.250.0040.00416.55
7.4.240.0040.00316.63
7.4.230.0030.00316.84
7.4.220.0090.00916.83
7.4.210.0120.00616.70
7.4.200.0050.00316.58
7.4.190.0030.00516.84
7.4.160.0100.00616.65
7.4.150.0110.00717.40
7.4.140.0100.00817.86
7.4.130.0140.00516.50
7.4.120.0120.00716.67
7.4.110.0110.00816.61
7.4.100.0110.00716.80
7.4.90.0140.00716.51
7.4.80.0100.01016.83
7.4.70.0080.00816.54
7.4.60.0070.01016.46
7.4.50.0030.00516.52
7.4.40.0130.00322.77
7.4.30.0110.00616.60
7.4.00.0090.00615.16
7.3.330.0030.00313.21
7.3.320.0000.00613.21
7.3.310.0040.00416.20
7.3.300.0000.00716.35
7.3.290.0090.00616.30
7.3.280.0090.01016.40
7.3.270.0070.01117.40
7.3.260.0120.00916.55
7.3.250.0110.01116.48
7.3.240.0180.00616.32
7.3.230.0120.00616.45
7.3.210.0290.01216.39
7.3.200.0110.00519.39
7.3.190.0120.00716.59
7.3.180.0100.00716.46
7.3.170.0080.00816.48
7.3.160.0130.00316.72
7.3.120.0150.00014.83
7.2.330.0250.02316.75
7.2.320.0070.01016.71
7.2.310.0070.01016.68
7.2.300.0100.00716.70
7.2.290.0110.00716.70
7.2.60.0070.00716.94
7.2.00.0060.00619.39
7.1.200.0000.00916.04
7.1.100.0070.00718.34
7.1.70.0000.00917.32
7.1.60.0120.01219.29
7.1.50.0110.01416.98
7.1.00.0030.07722.55
7.0.200.0000.00916.93
7.0.140.0030.07322.00
7.0.100.0030.04020.04
7.0.90.0170.03320.03
7.0.80.0070.03319.87
7.0.70.0030.06019.95
7.0.60.0070.06720.11
7.0.50.0070.07320.34
7.0.40.0130.08320.08
7.0.30.0130.06320.04
7.0.20.0130.03720.12
7.0.10.0070.08020.08
7.0.00.0070.08720.06
5.6.280.0070.07020.99
5.6.250.0070.03320.64
5.6.240.0030.04320.61
5.6.230.0070.04320.69
5.6.220.0070.05020.74
5.6.210.0030.08720.63
5.6.200.0030.08021.12
5.6.190.0030.08020.94
5.6.180.0100.08021.17
5.6.170.0070.08021.03
5.6.160.0170.09020.94
5.6.150.0030.09021.14
5.6.140.0130.07320.96
5.6.130.0000.08721.17
5.6.120.0100.07721.04
5.6.110.0170.07021.04
5.6.100.0130.08021.01
5.6.90.0170.07721.01
5.6.80.0130.03320.49
5.6.70.0100.03320.38
5.6.60.0030.03720.54
5.6.50.0130.07320.45
5.6.40.0030.08320.38
5.6.30.0100.05320.42
5.6.20.0030.04320.38
5.6.10.0070.07320.49
5.6.00.0100.06720.43
5.5.380.0000.04320.36
5.5.370.0030.06720.41
5.5.360.0030.04720.34
5.5.350.0000.05720.40
5.5.340.0100.07720.80
5.5.330.0070.08320.89
5.5.320.0030.04720.64
5.5.310.0030.08720.78
5.5.300.0030.08720.79
5.5.290.0030.08320.78
5.5.280.0100.08020.89
5.5.270.0100.07720.72
5.5.260.0070.09020.63
5.5.250.0070.04720.65
5.5.240.0130.07020.12
5.5.230.0030.03720.14
5.5.220.0000.04320.27
5.5.210.0000.04020.27
5.5.200.0070.03720.12
5.5.190.0270.04720.18
5.5.180.0100.09720.24
5.5.160.0030.05720.28
5.5.150.0070.06020.08
5.5.140.0100.04320.27
5.5.130.0100.07720.09
5.5.120.0070.06720.23
5.5.110.0130.07020.14
5.5.100.0000.04320.09
5.5.90.0100.07020.05
5.5.80.0070.04320.17
5.5.70.0030.06020.06
5.5.60.0130.06720.04
5.5.50.0070.05020.07
5.5.40.0100.05020.03
5.5.30.0130.07020.09
5.5.20.0100.06020.04
5.5.10.0100.07020.02
5.5.00.0130.03720.13
5.4.450.0030.06019.40
5.4.440.0070.07319.39
5.4.430.0070.07319.26
5.4.420.0030.07019.47
5.4.410.0070.03719.27
5.4.400.0070.07719.15
5.4.390.0030.08718.96
5.4.380.0170.06318.95
5.4.370.0070.07318.90
5.4.360.0100.08719.04
5.4.350.0170.06319.10
5.4.340.0100.07719.07
5.4.320.0130.05019.13
5.4.310.0200.06318.78
5.4.300.0030.07018.75
5.4.290.0130.06719.07
5.4.280.0100.07318.80
5.4.270.0100.05319.03
5.4.260.0070.04318.96
5.4.250.0130.07019.22
5.4.240.0130.05018.96
5.4.230.0070.07718.89
5.4.220.0070.06319.02
5.4.210.0030.07719.06
5.4.200.0030.07019.07
5.4.190.0100.07319.04
5.4.180.0130.08019.04
5.4.170.0130.07318.80
5.4.160.0100.07319.02
5.4.150.0030.08018.78
5.4.140.0100.07016.31
5.4.130.0030.04316.39
5.4.120.0000.05016.06
5.4.110.0030.04316.26
5.4.100.0100.06716.32
5.4.90.0030.07016.43
5.4.80.0130.07316.29
5.4.70.0070.06716.25
5.4.60.0030.04316.28
5.4.50.0000.06016.35
5.4.40.0070.07316.34
5.4.30.0070.07316.40
5.4.20.0070.03716.34
5.4.10.0030.03716.18
5.4.00.0100.06015.82
5.3.290.0070.07314.51
5.3.280.0030.07714.61
5.3.270.0100.07014.45
5.3.260.0070.06714.57
5.3.250.0100.06014.59
5.3.240.0070.04014.48
5.3.230.0070.06314.46
5.3.220.0100.06014.57
5.3.210.0070.08014.43
5.3.200.0030.08014.43
5.3.190.0100.04014.53
5.3.180.0100.07314.54
5.3.170.0130.07314.39
5.3.160.0070.07314.58
5.3.150.0030.07714.43
5.3.140.0070.04714.56
5.3.130.0030.07714.39
5.3.120.0070.06314.42
5.3.110.0000.04314.53
5.3.100.0030.08714.03
5.3.90.0100.05013.88
5.3.80.0070.04014.01
5.3.70.0030.04713.99
5.3.60.0030.07013.88
5.3.50.0070.03713.96
5.3.40.0130.06713.93
5.3.30.0130.06713.68
5.3.20.0100.03713.67
5.3.10.0030.04013.52
5.3.00.0030.07313.63
5.2.170.0100.05311.11
5.2.160.0070.05711.15
5.2.150.0100.03311.14
5.2.140.0000.06011.20
5.2.130.0030.06011.16
5.2.120.0130.05010.96
5.2.110.0000.06311.06
5.2.100.0030.05711.06
5.2.90.0130.05311.09
5.2.80.0000.06711.14
5.2.70.0070.06011.16
5.2.60.0030.06710.93
5.2.50.0200.04710.89
5.2.40.0070.06011.00
5.2.30.0100.02711.01
5.2.20.0070.06010.89
5.2.10.0000.03710.93
5.2.00.0070.06010.65
5.1.60.0100.05010.04
5.1.50.0100.05310.03
5.1.40.0100.0479.87
5.1.30.0070.06010.39
5.1.20.0030.05710.39
5.1.10.0030.0539.91
5.1.00.0070.05310.06
5.0.50.0030.0478.59
5.0.40.0170.0338.41
5.0.30.0000.0608.22
5.0.20.0030.0338.33
5.0.10.0030.0378.21
5.0.00.0030.0638.25
4.4.90.0000.0378.21
4.4.80.0000.0278.21
4.4.70.0070.0338.21
4.4.60.0000.0338.21
4.4.50.0000.0338.21
4.4.40.0000.0308.21
4.4.30.0100.0278.21
4.4.20.0070.0308.21
4.4.10.0070.0238.21
4.4.00.0000.0438.21
4.3.110.0030.0338.21
4.3.100.0030.0338.21
4.3.90.0030.0378.21
4.3.80.0030.0508.21
4.3.70.0070.0308.21
4.3.60.0070.0278.21
4.3.50.0030.0338.21
4.3.40.0000.0408.21
4.3.30.0000.0378.21
4.3.20.0000.0378.21
4.3.10.0030.0308.21
4.3.00.0030.0238.21

preferences:
38.1 ms | 400 KiB | 5 Q