3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-token\&quot; data-token-id=\&quot;landlord_name\&quot;>Jméno pronajímatele</span>&quot;}" data-trix-content-type="undefined" class="attachment attachment--content"><span class="trix-token">Jméno pronajímatele</span><figcaption class="attachment__caption"></figcaption></figure> HTML; $figureOpenTagPattern = \sprintf('<figure data-token-id="%s"[^>]*>','landlord_name'); $figureOpenTagReplacement = \sprintf('<figure data-token-id="%s">', 'landlord_name'); $figureEndTag = '<\/figure>'; $html = \preg_replace( '/' . $figureOpenTagPattern . '(.+)' . $figureEndTag . '/U', $figureOpenTagReplacement . \sprintf('<span class="trix-token %s %s" data-token-id="%s">%s</span>', 'landlord_name', 'tokenClass', 'landlord_name', 'test') . '</figure>', $html, ); echo $html;

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.5.00.0130.01120.10
8.4.150.0030.00014.05
8.4.140.0100.01317.79
8.4.130.0150.00618.03
8.4.120.0060.00422.30
8.4.110.0150.00418.75
8.4.100.0080.00917.98
8.4.90.0070.00718.10
8.4.80.0340.01018.85
8.4.70.0250.00617.74
8.4.60.0200.00317.75
8.4.50.0200.00317.73
8.4.40.0320.00517.61
8.4.30.0270.00317.28
8.4.20.0440.00917.39
8.4.10.0420.00917.78
8.3.280.0030.00014.05
8.3.270.0080.01216.76
8.3.260.0040.00416.90
8.3.250.0120.00617.13
8.3.240.0110.00916.66
8.3.230.0080.01116.73
8.3.220.0250.00818.83
8.3.210.0390.00616.84
8.3.200.0160.00616.84
8.3.190.0210.00616.84
8.3.180.0210.00416.84
8.3.170.0330.00716.84
8.3.160.0260.00216.84
8.3.150.0240.00416.84
8.3.140.0190.00416.84
8.3.130.0340.00816.84
8.3.120.0290.01516.84
8.3.110.0350.00816.84
8.3.100.0240.00716.85
8.3.90.0360.00516.84
8.3.80.0400.01116.84
8.3.70.0330.00716.84
8.3.60.0400.01216.84
8.3.50.0320.00916.84
8.3.40.0420.00617.88
8.3.30.0300.01017.63
8.3.20.0310.00917.64
8.3.10.0240.00517.61
8.3.00.0070.00417.54
8.2.290.0110.00718.72
8.2.280.0160.00416.84
8.2.270.0150.00416.84
8.2.260.0180.00616.84
8.2.250.0160.00516.84
8.2.240.0350.00416.84
8.2.230.0290.01016.84
8.2.220.0330.01016.84
8.2.210.0250.01216.84
8.2.200.0250.01216.84
8.2.190.0340.00516.84
8.2.180.0320.00816.84
8.2.170.0380.01117.87
8.2.160.0460.00717.73
8.2.150.0390.00517.71
8.2.140.0370.01217.52
8.2.130.0340.00417.41
8.2.120.0220.00417.80
8.2.110.0170.00317.79
8.2.100.0210.00717.88
8.2.90.0300.01017.68
8.2.80.0340.00917.67
8.2.70.0380.00717.77
8.2.60.0370.00717.74
8.2.50.0260.01117.58
8.2.40.0270.01117.82
8.2.30.0350.00617.30
8.2.20.0410.00817.48
8.2.10.0340.00717.77
8.2.00.0370.00617.45

preferences:
30.76 ms | 403 KiB | 5 Q