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; $tokenId = 'landlord_name'; // Správný regulární výraz $figurePattern = '/(<figure[^>]*data-trix-attachment="[^"]*data-token-id=\\&quot;' . $tokenId . '\\&quot;.*?"[^>]*>)(.*?)<\/figure>/s'; // Náhrada obsahu $replacement = '$1<span class="trix-token ' . $tokenId . ' tokenClass" data-token-id="' . $tokenId . '">test</span></figure>'; // Proveď nahrazení $html = preg_replace($figurePattern, $replacement, $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.4.120.0130.00422.64
8.4.110.0120.00720.89
8.4.100.0120.01018.12
8.4.90.0110.00917.75
8.4.80.0300.00918.67
8.4.70.0420.00917.99
8.4.60.0470.00817.86
8.4.50.0430.00717.79
8.4.40.0270.00717.63
8.4.30.0250.00417.42
8.4.20.0480.00517.77
8.4.10.0390.00717.57
8.3.250.0090.01017.21
8.3.240.0100.00816.63
8.3.230.0100.00816.74
8.3.220.0110.00519.11
8.3.210.0140.00716.84
8.3.200.0150.00716.84
8.3.190.0160.00616.84
8.3.180.0220.00416.84
8.3.170.0370.01016.84
8.3.160.0380.00616.84
8.3.150.0370.01016.84
8.3.140.0180.00516.84
8.3.130.0350.00816.84
8.3.120.0350.00916.84
8.3.110.0350.00916.84
8.3.100.0460.00616.84
8.3.90.0430.00616.84
8.3.80.0400.01116.84
8.3.70.0420.00816.84
8.3.60.0410.01016.84
8.3.50.0390.00916.84
8.3.40.0370.00917.70
8.3.30.0290.01017.62
8.3.20.0340.00717.74
8.3.10.0340.00817.77
8.3.00.0160.01217.55
8.2.290.0120.00618.74
8.2.280.0360.00416.84
8.2.270.0240.00416.89
8.2.260.0200.00316.84
8.2.250.0230.00816.84
8.2.240.0280.01116.84
8.2.230.0340.00916.84
8.2.220.0270.00616.84
8.2.210.0310.01016.84
8.2.200.0320.01016.84
8.2.190.0340.00716.84
8.2.180.0370.01016.84
8.2.170.0310.00517.75
8.2.160.0330.01217.86
8.2.150.0390.00717.71
8.2.140.0350.01017.54
8.2.130.0320.00817.55
8.2.120.0380.00617.77
8.2.110.0370.00817.71
8.2.100.0280.00917.83
8.2.90.0350.01017.73
8.2.80.0310.01217.47
8.2.70.0330.01017.65
8.2.60.0420.01017.51
8.2.50.0370.00717.48
8.2.40.0330.00517.54
8.2.30.0320.00717.62
8.2.20.0350.00717.61
8.2.10.0300.01217.63
8.2.00.0340.00617.52

preferences:
31.03 ms | 403 KiB | 5 Q