3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text1 = <<<EOD <tr class="aaa"> <td class="bbb"> <p> あああああ </p> </td> <tr> EOD; $text2 = <<<EOD <tr class="aaa"> <td class="bbb"> あああああ </td> <tr> EOD; echo "【RESULT 1】\n\n"; echo preg_replace_callback( '@(<br[^>]*+>)|\s?</?+p>\s?|(?<=<t(?:r|d))[^>]*+(?=>)@', function ($matches) { return isset($matches[1]) ? '、' : ''; }, $text1 ); echo "\n\n【RESULT 2】\n\n"; echo preg_replace_callback( '@(<br[^>]*+>)|\s*+</?+p>\s*+|(?<=<t(?:r|d))[^>]*+(?=>)@', function ($matches) { return isset($matches[1]) ? '、' : ''; }, $text2 );

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.0070.00716.73
8.3.50.0110.00817.61
8.3.40.0120.00318.96
8.3.30.0120.00618.95
8.3.20.0040.00419.03
8.3.10.0080.00020.77
8.3.00.0040.00419.63
8.2.180.0080.00818.54
8.2.170.0120.00322.96
8.2.160.0070.00721.14
8.2.150.0050.00324.18
8.2.140.0090.00924.66
8.2.130.0060.00326.16
8.2.120.0120.00021.14
8.2.110.0000.00921.16
8.2.100.0040.00718.16
8.2.90.0000.00919.42
8.2.80.0040.00419.28
8.2.70.0060.00317.75
8.2.60.0000.00817.79
8.2.50.0040.00418.07
8.2.40.0000.00718.16
8.2.30.0000.00818.25
8.2.20.0040.00418.02
8.2.10.0040.00417.89
8.2.00.0000.00718.04
8.1.280.0040.01825.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0110.00723.88
8.1.230.0040.00820.97
8.1.220.0000.00817.74
8.1.210.0040.00418.89
8.1.200.0110.00017.48
8.1.190.0000.00917.53
8.1.180.0050.00318.10
8.1.170.0090.00018.95
8.1.160.0000.00818.94
8.1.150.0040.00418.73
8.1.140.0040.00417.63
8.1.130.0000.00717.87
8.1.120.0030.00517.66
8.1.110.0000.00817.53
8.1.100.0040.00417.52
8.1.90.0000.00717.65
8.1.80.0070.00017.69
8.1.70.0050.00217.63
8.1.60.0090.00017.75
8.1.50.0040.00417.58
8.1.40.0000.00817.71
8.1.30.0040.00417.86
8.1.20.0030.00617.83
8.1.10.0000.00817.66
8.1.00.0040.00417.73
8.0.300.0050.00219.90
8.0.290.0000.00717.13
8.0.280.0050.00218.51
8.0.270.0040.00417.22
8.0.260.0070.00017.14
8.0.250.0040.00417.26
8.0.240.0040.00417.25
8.0.230.0030.00517.18
8.0.220.0000.00717.18
8.0.210.0070.00017.04
8.0.200.0030.00317.22
8.0.190.0040.00417.26
8.0.180.0040.00417.05
8.0.170.0030.00617.09
8.0.160.0000.00717.17
8.0.150.0060.00317.14
8.0.140.0020.00517.04
8.0.130.0030.00313.63
8.0.120.0030.00517.21
8.0.110.0020.00517.00
8.0.100.0000.00717.24
8.0.90.0020.00517.16
8.0.80.0030.01617.23
8.0.70.0000.00817.00
8.0.60.0040.00417.25
8.0.50.0040.00417.16
8.0.30.0040.01517.26
8.0.20.0110.00817.21
8.0.10.0030.00517.20
8.0.00.0120.00616.88
7.4.330.0030.00313.22
7.4.320.0000.00616.71
7.4.300.0060.00016.64
7.4.290.0040.00416.86
7.4.280.0030.00616.82
7.4.270.0030.00616.73
7.4.260.0030.00313.49
7.4.250.0090.00016.77
7.4.240.0080.00016.77
7.4.230.0050.00216.95
7.4.220.0120.00616.71
7.4.210.0090.00616.88
7.4.200.0040.00416.64
7.4.190.0030.00316.65
7.4.160.0070.01016.70
7.4.150.0160.00516.80
7.4.140.0060.01116.77
7.4.130.0150.00616.70
7.4.120.0090.00816.81
7.4.110.0070.01116.79
7.4.100.0090.00916.81
7.4.90.0150.00316.80
7.4.80.0160.00019.39
7.4.70.0090.00916.80
7.4.60.0080.00816.68
7.4.50.0030.01016.95
7.4.40.0070.00716.48
7.4.30.0070.01016.74
7.4.00.0040.01115.32
7.3.330.0000.00613.64
7.3.320.0030.00313.42
7.3.310.0030.00316.65
7.3.300.0000.00716.64
7.3.290.0060.01316.66
7.3.280.0070.01016.59
7.3.270.0120.00616.47
7.3.260.0120.00616.81
7.3.250.0090.00816.76
7.3.240.0090.01616.82
7.3.230.0170.00016.43
7.3.210.0070.01116.66
7.3.200.0120.00616.82
7.3.190.0030.01516.71
7.3.180.0090.00616.41
7.3.170.0030.01316.63
7.3.160.0130.00416.68
7.3.120.0100.00714.95
7.3.10.0100.00716.62
7.3.00.0030.01016.77
7.2.330.0150.00316.53
7.2.320.0140.00416.51
7.2.310.0180.00616.85
7.2.300.0100.00616.82
7.2.290.0100.00716.59
7.2.130.0060.00917.02
7.2.120.0030.00916.96
7.2.110.0100.00616.89
7.2.100.0040.00717.11
7.2.90.0030.00716.85
7.2.80.0030.01016.98
7.2.70.0040.01217.12
7.2.60.0070.00417.17
7.2.50.0080.00716.98
7.2.40.0030.01217.21
7.2.30.0030.00917.24
7.2.20.0110.00317.11
7.2.10.0100.00617.13
7.2.00.0080.00818.28
7.1.250.0060.00315.84
7.1.100.0090.00618.13
7.1.70.0000.00917.05
7.1.60.0140.01019.40
7.1.50.0070.00717.01
7.1.00.0030.06722.53
7.0.200.0030.00617.08
7.0.140.0070.07322.09
7.0.120.0070.06722.05
7.0.60.0030.08019.93
7.0.50.0030.04017.89
7.0.40.0030.04717.71
7.0.30.0170.08017.78
7.0.20.0030.05717.78
7.0.10.0170.04717.73
7.0.00.0130.08017.75
5.6.280.0030.07321.10
5.6.210.0070.07320.70
5.6.200.0070.06018.20
5.6.190.0030.04018.16
5.6.180.0000.04318.14
5.6.170.0100.05318.30
5.6.160.0000.09018.27
5.6.150.0070.04718.15
5.6.140.0100.08018.18
5.6.130.0130.06018.23
5.6.120.0030.07718.26
5.6.110.0100.05318.21
5.6.100.0030.06318.18
5.6.90.0070.05018.19
5.6.80.0070.07717.57
5.6.70.0070.08017.63
5.6.60.0070.07317.61
5.6.50.0070.07017.67
5.6.40.0030.08317.54
5.6.30.0170.06717.54
5.6.20.0100.07317.54
5.6.10.0070.08317.63
5.6.00.0230.06717.48
5.5.350.0030.09320.33
5.5.340.0030.04018.08
5.5.330.0000.07717.99
5.5.320.0030.06317.98
5.5.310.0100.07718.08
5.5.300.0130.07317.99
5.5.290.0030.07017.98
5.5.280.0130.07318.04
5.5.270.0030.06718.10
5.5.260.0030.07017.98
5.5.250.0030.05017.73
5.5.240.0070.07717.49
5.5.230.0030.08017.33
5.5.220.0130.05317.46
5.5.210.0000.05317.39
5.5.200.0030.04317.39
5.5.190.0030.05017.34
5.5.180.0070.07717.43
5.5.160.0070.08017.34
5.5.150.0030.07017.42
5.5.140.0100.07317.33
5.5.130.0070.07317.33
5.5.120.0030.04317.31
5.5.110.0070.07317.30
5.5.100.0070.07017.27
5.5.90.0070.05017.32
5.5.80.0070.07317.20
5.5.70.0100.06717.22
5.5.60.0030.08017.21
5.5.50.0100.06717.34
5.5.40.0000.07017.17
5.5.30.0030.05017.19
5.5.20.0100.07317.27
5.5.10.0070.04017.18
5.5.00.0030.05017.19
5.4.450.0100.07719.45
5.4.440.0170.07319.35
5.4.430.0100.08019.21
5.4.420.0130.08019.38
5.4.410.0130.03019.15
5.4.400.0100.04018.89
5.4.390.0070.06719.05
5.4.380.0100.05319.12
5.4.370.0070.07319.05
5.4.360.0100.05719.05
5.4.350.0100.06719.05
5.4.340.0130.04319.05
5.4.320.0030.08019.05
5.4.310.0070.06719.09
5.4.300.0000.06319.05
5.4.290.0030.07719.13
5.4.280.0130.07019.13
5.4.270.0070.07718.89
5.4.260.0030.05719.27
5.4.250.0030.08019.11
5.4.240.0030.05318.97
5.4.230.0070.04319.26
5.4.220.0070.03719.05
5.4.210.0170.07319.05
5.4.200.0030.08019.05
5.4.190.0170.06719.02
5.4.180.0130.04318.97
5.4.170.0070.04019.14
5.4.160.0100.08018.99
5.4.150.0030.08319.08
5.4.140.0000.05316.36
5.4.130.0130.06316.35
5.4.120.0130.06716.36
5.4.110.0130.06716.43
5.4.100.0000.04016.62
5.4.90.0100.06716.56
5.4.80.0100.07316.27
5.4.70.0130.06316.51
5.4.60.0030.07716.59
5.4.50.0030.06316.56
5.4.40.0130.05316.47
5.4.30.0130.07016.38
5.4.20.0070.07316.43
5.4.10.0030.07316.42
5.4.00.0000.06715.84
5.3.290.0030.07014.64
5.3.280.0100.07714.64
5.3.270.0070.04014.72
5.3.260.0070.07714.64
5.3.250.0170.05714.64
5.3.240.0070.06714.57
5.3.230.0030.06714.67
5.3.220.0070.05014.62
5.3.210.0170.04714.63
5.3.200.0030.05014.61
5.3.190.0100.06314.53
5.3.180.0030.07714.58
5.3.170.0030.07714.64
5.3.160.0070.07714.60
5.3.150.0200.05014.58
5.3.140.0000.08014.61
5.3.130.0000.08014.62
5.3.120.0030.07314.62
5.3.110.0030.07714.61
5.3.100.0030.03714.11
5.3.90.0100.07314.05
5.3.80.0070.07314.00
5.3.70.0000.06014.11
5.3.60.0170.03014.01
5.3.50.0030.08014.02
5.3.40.0000.07013.80
5.3.30.0130.07013.91
5.3.20.0070.06013.73
5.3.10.0070.04013.72
5.3.00.0070.07013.48
5.2.170.0030.04311.07
5.2.160.0070.03711.14
5.2.150.0030.06311.12
5.2.140.0100.05711.12
5.2.130.0000.06711.09
5.2.120.0030.06310.89
5.2.110.0070.05710.93
5.2.100.0070.05311.10
5.2.90.0070.04711.13
5.2.80.0130.05711.01
5.2.70.0070.04311.12
5.2.60.0000.05011.02
5.2.50.0070.06010.92
5.2.40.0100.02711.14
5.2.30.0100.05711.11
5.2.20.0100.06310.93
5.2.10.0070.05311.00
5.2.00.0130.04710.88
5.1.60.0000.0409.96
5.1.50.0130.04310.02
5.1.40.0030.04310.05
5.1.30.0030.03310.25
5.1.20.0070.02710.38
5.1.10.0070.05710.22
5.1.00.0000.04710.14
5.0.50.0000.0378.50
5.0.40.0030.0308.44
5.0.30.0070.0438.08
5.0.20.0030.0338.25
5.0.10.0030.0408.19
5.0.00.0000.0708.23
4.4.90.0000.0378.08
4.4.80.0030.0308.08
4.4.70.0000.0308.08
4.4.60.0000.0408.08
4.4.50.0030.0338.08
4.4.40.0000.0408.08
4.4.30.0100.0278.08
4.4.20.0030.0138.08
4.4.10.0000.0308.08
4.4.00.0030.0538.08
4.3.110.0030.0208.08
4.3.100.0030.0338.08
4.3.90.0030.0378.08
4.3.80.0030.0508.08
4.3.70.0030.0278.08
4.3.60.0100.0208.08
4.3.50.0000.0378.08
4.3.40.0000.0578.08
4.3.30.0070.0338.08
4.3.20.0030.0378.08
4.3.10.0000.0308.08
4.3.00.0000.0378.08

preferences:
47.99 ms | 401 KiB | 5 Q