3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "this is [my] test [string] and [<script>alert(1)</script>] is very long [with] so many pwords]"; echo preg_replace_callback( "#\[([^\]]+)]#", fn($m) => sprintf( '<a href="/story.php?%s">%s</a>', http_build_query(['word' => $m[1]]), htmlspecialchars($m[1]) ), $str );

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.140.0150.00717.74
8.4.130.0110.00918.13
8.4.120.0130.00722.20
8.4.110.0100.00718.90
8.4.100.0140.00617.97
8.4.90.0090.01217.87
8.4.80.0090.01017.94
8.4.70.0090.00419.90
8.4.60.0110.01018.62
8.4.50.0130.00718.75
8.4.40.0060.00917.88
8.4.30.0160.00320.54
8.4.20.0110.01121.76
8.4.10.0000.00819.63
8.3.270.0160.00416.46
8.3.260.0100.01016.69
8.3.250.0090.01018.97
8.3.240.0120.00716.79
8.3.230.0100.00816.60
8.3.220.0110.00617.38
8.3.210.0100.00916.67
8.3.200.0050.00616.76
8.3.190.0050.00317.02
8.3.180.0130.00519.03
8.3.170.0120.00622.63
8.3.160.0140.00419.24
8.3.150.0120.00617.47
8.3.140.0000.00816.84
8.3.130.0150.00016.88
8.3.120.0060.00320.96
8.3.110.0150.00022.26
8.3.100.0460.00637.54
8.3.90.0380.00937.54
8.3.80.0370.00937.54
8.3.70.0510.00337.54
8.3.60.0360.01637.54
8.3.50.0220.01137.54
8.3.40.0220.00337.54
8.3.30.0190.00337.54
8.3.20.0210.00037.54
8.3.10.0150.00437.54
8.3.00.0070.01437.54
8.2.290.0090.00220.54
8.2.280.0090.00718.32
8.2.270.0050.00317.16
8.2.260.0090.00916.84
8.2.250.0090.00018.71
8.2.240.0070.00317.32
8.2.230.0040.00422.58
8.2.220.0130.00937.54
8.2.210.0220.00737.54
8.2.200.0160.00337.54
8.2.190.0190.00037.54
8.2.180.0170.00437.54
8.2.170.0200.01037.54
8.2.160.0240.00037.54
8.2.150.0240.00037.54
8.2.140.0340.01037.54
8.2.130.0160.00837.54
8.2.120.0340.00637.54
8.2.110.0430.00037.54
8.2.100.0320.01237.54
8.2.90.0420.00637.54
8.2.80.0430.00337.54
8.2.70.0260.01837.54
8.2.60.0440.00737.54
8.2.50.0500.01037.54
8.2.40.0380.00337.54
8.2.30.0270.01537.54
8.2.20.0340.00837.54
8.2.10.0380.00337.54
8.2.00.0380.00437.54
8.1.330.0110.01021.97
8.1.320.0120.00818.26
8.1.310.0110.00417.96
8.1.300.0130.00318.31
8.1.290.0340.00837.54
8.1.280.0300.00737.54
8.1.270.0280.00437.54
8.1.260.0280.01337.54
8.1.250.0360.00337.54
8.1.240.0360.00337.54
8.1.230.0320.00637.54
8.1.220.0360.00337.54
8.1.210.0380.00637.54
8.1.200.0300.00737.54
8.1.190.0100.01037.54
8.1.180.0210.01437.54
8.1.170.0210.01737.54
8.1.160.0330.00737.54
8.1.150.0260.01037.54
8.1.140.0190.01537.54
8.1.130.0290.00337.54
8.1.120.0340.00637.54
8.1.110.0290.00837.54
8.1.100.0180.00437.54
8.1.90.0170.00737.54
8.1.80.0180.00637.54
8.1.70.0140.01137.54
8.1.60.0110.01137.54
8.1.50.0170.00337.54
8.1.40.0160.00437.54
8.1.30.0400.00337.54
8.1.20.0370.00037.54
8.1.10.0150.00737.54
8.1.00.0190.00437.54

preferences:
56.43 ms | 403 KiB | 5 Q