3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = preg_replace( '#\/_([a-z]+\/)\g#', '/$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.60.0060.01318.55
8.3.50.0120.00722.04
8.3.40.0150.00418.75
8.3.30.0100.00319.08
8.3.20.0050.00220.24
8.3.10.0050.00322.13
8.3.00.0070.00022.49
8.2.180.0140.00716.38
8.2.170.0130.00922.96
8.2.160.0100.01020.98
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.25
8.2.110.0040.00420.35
8.2.100.0090.00317.91
8.2.90.0060.00317.75
8.2.80.0060.00618.61
8.2.70.0050.00317.50
8.2.60.0030.00517.75
8.2.50.0050.00317.55
8.2.40.0040.00419.35
8.2.30.0080.00017.77
8.2.20.0040.00417.82
8.2.10.0080.00019.50
8.2.00.0030.00517.80
8.1.280.0090.00625.92
8.1.270.0030.00522.05
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0030.00623.79
8.1.230.0080.00320.98
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0050.00317.40
8.1.180.0000.00818.10
8.1.170.0000.00719.02
8.1.160.0080.00018.77
8.1.150.0000.00818.55
8.1.140.0040.00417.45
8.1.130.0000.00717.91
8.1.120.0000.00817.43
8.1.110.0000.00717.39
8.1.100.0040.00417.39
8.1.90.0000.00817.36
8.1.80.0040.00417.30
8.1.70.0030.00317.38
8.1.60.0030.00617.52
8.1.50.0020.00517.45
8.1.40.0040.00417.41
8.1.30.0000.00817.54
8.1.20.0060.00317.56
8.1.10.0080.00017.50
8.1.00.0040.00417.34
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.00
8.0.270.0040.00417.93
8.0.260.0000.00718.45
8.0.250.0000.00716.98
8.0.240.0070.00016.98
8.0.230.0030.00417.01
8.0.220.0030.00316.85
8.0.210.0070.00016.95
8.0.200.0040.00417.01
8.0.190.0050.00316.84
8.0.180.0050.00217.01
8.0.170.0080.00016.80
8.0.160.0000.00716.89
8.0.150.0070.00016.83
8.0.140.0030.00516.88
8.0.130.0050.00013.34
8.0.120.0040.00416.91
8.0.110.0040.00416.97
8.0.100.0000.00716.95
8.0.90.0000.00716.93
8.0.80.0030.01116.97
8.0.70.0040.00416.80
8.0.60.0040.00416.86
8.0.50.0050.00316.95
8.0.30.0110.01116.90
8.0.20.0020.01717.41
8.0.10.0040.00416.99
8.0.00.0060.01116.73
7.4.330.0050.00015.00
7.4.320.0030.00316.75
7.4.300.0000.00616.75
7.4.290.0070.00016.67
7.4.280.0040.00416.75
7.4.270.0070.00016.68
7.4.260.0040.00216.66
7.4.250.0040.00416.70
7.4.240.0060.00116.58
7.4.230.0040.00416.70
7.4.220.0070.02016.77
7.4.210.0040.01216.68
7.4.200.0030.00316.68
7.4.190.0040.00416.71
7.4.160.0000.01716.73
7.4.150.0080.00817.40
7.4.140.0120.00617.86
7.4.130.0110.00616.63
7.4.120.0110.00616.73
7.4.110.0060.01216.71
7.4.100.0070.01016.55
7.4.90.0070.01016.83
7.4.80.0030.01519.39
7.4.70.0060.01016.57
7.4.60.0070.01316.54
7.4.50.0000.00716.60
7.4.40.0060.00922.77
7.4.30.0070.01016.97
7.4.00.0100.00715.26
7.3.330.0030.00313.29
7.3.320.0060.00013.09
7.3.310.0030.00316.42
7.3.300.0070.00016.27
7.3.290.0030.01716.37
7.3.280.0080.00816.39
7.3.270.0120.00917.40
7.3.260.0100.01016.57
7.3.250.0080.00816.47
7.3.240.0070.01016.73
7.3.230.0090.00916.39
7.3.210.0140.00416.68
7.3.200.0170.00619.39
7.3.190.0100.00716.21
7.3.180.0060.00916.40
7.3.170.0000.01716.56
7.3.160.0080.00816.32
7.3.120.0000.01414.83
7.2.330.0070.01116.61
7.2.320.0100.00816.88
7.2.310.0060.01516.74
7.2.300.0120.00916.57
7.2.290.0090.01216.41
7.2.60.0060.00616.90
7.2.00.0030.01019.47
7.1.200.0040.01115.83
7.1.100.0040.01117.79
7.1.70.0050.00216.95
7.1.60.0040.01117.23
7.1.50.0100.01016.91
7.1.00.0000.08022.32
7.0.200.0030.00916.68
7.0.140.0000.08021.92
7.0.110.0400.04719.94
7.0.100.0570.07319.89
7.0.90.0470.04019.86
7.0.80.0470.05319.93
7.0.70.0430.05320.08
7.0.60.0330.06020.00
7.0.50.0270.03319.92
7.0.40.0070.03019.68
7.0.30.0030.04019.66
7.0.20.0000.05019.86
7.0.10.0070.03719.84
7.0.00.0000.04319.64
5.6.260.0070.05020.75
5.6.250.0100.03020.68
5.6.240.0070.06320.68
5.6.230.0030.06020.56
5.6.220.0070.06320.54
5.6.210.0100.08320.57
5.6.200.0070.06720.60
5.6.190.0030.03320.69
5.6.180.0070.08020.57
5.6.170.0100.04320.54
5.6.160.0070.07020.67
5.6.150.0000.05020.56
5.6.140.0100.07720.64
5.6.130.0000.06320.61
5.6.120.0000.07320.68
5.6.110.0170.03020.56
5.6.100.0100.06320.66
5.6.90.0000.07320.69
5.6.80.0030.04019.94
5.6.70.0030.03720.00
5.6.60.0130.07019.94
5.6.50.0030.03020.07
5.6.40.0130.02720.21
5.6.30.0070.03719.93
5.6.20.0100.03319.99
5.6.10.0100.03319.98
5.6.00.0100.03319.98
5.5.380.0030.04017.63
5.5.370.0100.03317.63
5.5.360.0070.05317.54
5.5.350.0100.05317.44
5.5.340.0030.04018.12
5.5.330.0100.03017.98
5.5.320.0030.04018.10
5.5.310.0030.07018.00
5.5.300.0030.05318.10
5.5.290.0000.09718.09
5.5.280.0070.03717.86
5.5.270.0070.03718.24
5.5.260.0000.04317.85
5.5.250.0000.08317.94
5.5.240.0100.03317.51
5.5.230.0000.05317.23
5.5.220.0030.03717.50
5.5.210.0200.07017.27
5.5.200.0030.07317.36
5.5.190.0030.03317.45
5.5.180.0070.03717.12
5.5.160.0100.06317.21
5.5.150.0030.04017.37
5.5.140.0130.03017.59
5.5.130.0000.04017.47
5.5.120.0070.05017.21
5.5.110.0100.04717.47
5.5.100.0000.04017.42
5.5.90.0070.04317.07
5.5.80.0070.03717.29
5.5.70.0030.03717.34
5.5.60.0000.03717.15
5.5.50.0100.05017.40
5.5.40.0030.04717.09
5.5.30.0030.03717.33
5.5.20.0000.04017.39
5.5.10.0000.04317.10
5.5.00.0000.04017.26
5.4.450.0000.04319.28
5.4.440.0030.03719.30
5.4.430.0000.05319.27
5.4.420.0130.07319.35
5.4.410.0030.04319.15
5.4.400.0000.04019.16
5.4.390.0030.03719.12
5.4.380.0070.05718.98
5.4.370.0030.04019.18
5.4.360.0000.08019.08
5.4.350.0030.03718.95
5.4.340.0030.03719.02
5.4.320.0070.06019.12
5.4.310.0100.05018.93
5.4.300.0070.04719.07
5.4.290.0030.05019.24
5.4.280.0000.04319.11
5.4.270.0000.05019.11
5.4.260.0000.07719.00
5.4.250.0030.03719.00
5.4.240.0030.03019.09
5.4.230.0030.05018.95
5.4.220.0030.03719.09
5.4.210.0070.03719.09
5.4.200.0170.02319.11
5.4.190.0070.03319.26
5.4.180.0070.04019.02
5.4.170.0030.06318.94
5.4.160.0000.04318.93
5.4.150.0130.05718.93
5.4.140.0030.04316.49
5.4.130.0030.04316.26
5.4.120.0070.04716.22
5.4.110.0000.04016.52
5.4.100.0000.04016.14
5.4.90.0030.03716.43
5.4.80.0000.03716.38
5.4.70.0000.04316.12
5.4.60.0070.05316.47
5.4.50.0070.03716.11
5.4.40.0000.04016.51
5.4.30.0170.05716.25
5.4.20.0030.03716.26
5.4.10.0030.06016.46
5.4.00.0030.03715.64
5.3.290.0000.06714.76
5.3.280.0130.03014.51
5.3.270.0030.07714.45
5.3.260.0000.08014.48
5.3.250.0030.03314.56
5.3.240.0030.04714.40
5.3.230.0070.03014.52
5.3.220.0070.03714.59
5.3.210.0030.03714.64
5.3.200.0100.03014.52
5.3.190.0000.04014.44
5.3.180.0070.03014.47
5.3.170.0000.04014.52
5.3.160.0100.06714.67
5.3.150.0070.03014.50
5.3.140.0070.06314.36
5.3.130.0130.04314.44
5.3.120.0030.04314.44
5.3.110.0000.04714.46
5.3.100.0000.04013.94
5.3.90.0030.03014.09
5.3.80.0100.03014.10
5.3.70.0000.04014.04
5.3.60.0030.03714.03
5.3.50.0100.03013.97
5.3.40.0070.02713.78
5.3.30.0000.03013.85
5.3.20.0130.02313.71
5.3.10.0070.03013.52
5.3.00.0100.02713.72
5.2.170.0000.03311.96
5.2.160.0030.03711.96
5.2.150.0000.03011.96
5.2.140.0000.03011.96
5.2.130.0000.02711.96
5.2.120.0030.03311.96
5.2.110.0000.03011.96
5.2.100.0000.03011.96
5.2.90.0070.02711.96
5.2.80.0030.02311.96
5.2.70.0000.03011.96
5.2.60.0000.02711.96
5.2.50.0000.03011.96
5.2.40.0030.03711.96
5.2.30.0000.03711.96
5.2.20.0000.04011.96
5.2.10.0000.03011.96
5.2.00.0000.04711.96
5.1.60.0070.03711.96
5.1.50.0070.02311.96
5.1.40.0070.02311.96
5.1.30.0030.04311.96
5.1.20.0030.02711.96
5.1.10.0000.04011.96
5.1.00.0070.03311.96
5.0.50.0000.03011.96
5.0.40.0030.03311.96
5.0.30.0030.02711.96
5.0.20.0000.03011.96
5.0.10.0000.04711.96
5.0.00.0030.03311.96
4.4.90.0030.01711.96
4.4.80.0000.01311.96
4.4.70.0030.03011.96
4.4.60.0000.03011.96
4.4.50.0000.02011.96
4.4.40.0000.02311.96
4.4.30.0000.01711.96
4.4.20.0030.02311.96
4.4.10.0030.02711.96
4.4.00.0070.04711.96
4.3.110.0030.02311.96
4.3.100.0000.03311.96
4.3.90.0030.01311.96
4.3.80.0000.05711.96
4.3.70.0000.03711.96
4.3.60.0030.02711.96
4.3.50.0030.02011.96
4.3.40.0070.02711.96
4.3.30.0030.03311.96
4.3.20.0000.01711.96
4.3.10.0000.01711.96
4.3.00.0000.02711.96

preferences:
40.6 ms | 401 KiB | 5 Q