3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = '[html style="font-size: 18px;" dir="ltr"][div style="font-size: 18px;" dir="ltr"][p style="font-weight: bold;"]Hello,[/p][p]You have got a new message from [a href="https://www.example.com/"]Example.com[/a][br][br].You could check your message on [a href="https://www.example.com/en/manager/inbox.html"]Manager[/a][/p][p][img src="https://www.example.com/assets/images/logo-default-120x50.png" width="120px" height="80px"][div style="color: #D4192D; font-weight: bold;"]Example.com Team[/div][/p][/div][/html]'; $rx = '~\[((\w+)\b[^]]*)\]((?>(?!\[\2\b).|(?R))*)\[\/\2]~s'; $tmp = ''; while (preg_match($rx, $sentence) && $tmp != $sentence) { $tmp = $sentence; $sentence = preg_replace($rx, '<$1>$3</$2>', $sentence); } $sentence = preg_replace('~\[([^]]*)]~', '<$1 />', $sentence); echo $sentence;

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.0110.00718.43
8.3.50.0110.00720.16
8.3.40.0150.00418.75
8.3.30.0090.01319.02
8.3.20.0080.00024.18
8.3.10.0050.00524.66
8.3.00.0040.00426.16
8.2.180.0160.00325.92
8.2.170.0030.01619.04
8.2.160.0100.01022.96
8.2.150.0000.00825.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0080.00021.17
8.2.110.0100.00021.16
8.2.100.0120.00018.09
8.2.90.0000.00817.97
8.2.80.0060.00317.88
8.2.70.0060.00317.88
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0080.00020.05
8.2.30.0040.00418.17
8.2.20.0000.00819.41
8.2.10.0040.00418.00
8.2.00.0060.00319.36
8.1.280.0030.01225.92
8.1.270.0060.00322.23
8.1.260.0050.00526.35
8.1.250.0030.00528.09
8.1.240.0040.00719.52
8.1.230.0080.00420.91
8.1.220.0030.00517.91
8.1.210.0060.00319.06
8.1.200.0060.00317.61
8.1.190.0040.00417.47
8.1.180.0080.00018.10
8.1.170.0080.00019.21
8.1.160.0000.00818.90
8.1.150.0000.00818.83
8.1.140.0040.00417.57
8.1.130.0000.00718.96
8.1.120.0040.00717.71
8.1.110.0030.00517.62
8.1.100.0040.00417.61
8.1.90.0070.00017.54
8.1.80.0000.00717.55
8.1.70.0000.00817.66
8.1.60.0030.00617.67
8.1.50.0050.00517.67
8.1.40.0000.00917.76
8.1.30.0000.00917.76
8.1.20.0000.00817.90
8.1.10.0030.00617.61
8.1.00.0000.00817.65
8.0.300.0070.00020.15
8.0.290.0000.00917.00
8.0.280.0000.00718.50
8.0.270.0000.00718.16
8.0.260.0030.00318.37
8.0.250.0000.00717.04
8.0.240.0030.00517.20
8.0.230.0000.00717.18
8.0.220.0050.00217.07
8.0.210.0040.00316.95
8.0.200.0000.00817.10
8.0.190.0030.00517.15
8.0.180.0050.00217.00
8.0.170.0040.00417.01
8.0.160.0050.00317.07
8.0.150.0050.00217.10
8.0.140.0080.00016.87
8.0.130.0030.00313.52
8.0.120.0090.00313.42
8.0.110.0030.00913.45
8.0.100.0110.00013.42
8.0.90.0040.00813.51
8.0.80.0050.01013.51
8.0.70.0050.00913.51
8.0.60.0100.00313.44
8.0.50.0080.00413.51
8.0.30.0080.00413.49
8.0.20.0110.00213.56
8.0.10.0100.00313.60
8.0.00.0040.00413.61
7.4.330.0060.00015.55
7.4.320.0000.00716.87
7.4.300.0000.00716.77
7.4.290.0050.00516.71
7.4.280.0030.00616.74
7.4.270.0000.00716.86
7.4.260.0000.00613.39
7.4.250.0080.00313.52
7.4.240.0110.00313.53
7.4.230.0060.00913.51
7.4.220.0090.00313.59
7.4.210.0100.00313.60
7.4.200.0040.00813.61
7.4.190.0090.00313.59
7.4.180.0100.00313.63
7.4.160.0130.00013.54
7.4.150.0110.00313.60
7.4.140.0130.00013.65
7.4.130.0050.00913.48
7.4.120.0040.00813.52
7.4.110.0110.00213.51
7.4.100.0100.00313.65
7.4.90.0120.00013.58
7.4.80.0110.00213.47
7.4.70.0070.00513.54
7.4.60.0090.00313.54
7.4.50.0110.00213.45
7.4.40.0100.00013.45
7.4.30.0090.00313.54
7.4.20.0070.00513.46
7.4.10.0090.00313.43
7.4.00.0100.00013.54
7.3.330.0020.00516.55
7.3.320.0030.00813.16
7.3.310.0090.00313.19
7.3.300.0130.00013.30
7.3.290.0130.00013.33
7.3.280.0090.00313.24
7.3.270.0130.00013.11
7.3.260.0040.00813.18
7.3.250.0080.00513.33
7.3.240.0070.00713.15
7.3.230.0090.00513.31
7.3.220.0070.00713.13
7.3.210.0040.00813.28
7.3.200.0080.00413.23
7.3.190.0110.00313.11
7.3.180.0150.00013.27
7.3.170.0120.00213.16
7.3.160.0100.00513.08
7.3.150.0130.00013.16
7.3.140.0070.00913.11
7.3.130.0060.00613.04
7.3.120.0120.00013.20
7.3.110.0100.00313.03
7.3.100.0080.00613.09
7.3.90.0030.01013.59
7.3.80.0080.00413.18
7.3.70.0120.00213.31
7.3.60.0050.00913.58
7.3.50.0090.00513.36
7.3.40.0100.00313.43
7.3.30.0100.00313.31
7.3.20.0130.00014.99
7.3.10.0120.00015.07
7.3.00.0090.00415.01

preferences:
67.99 ms | 400 KiB | 5 Q