3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'UPDATE `list` set `item`=?,`type`=? WHERE (`id` = ?);'; $data = array( 'item' => '1', 'type' => 'Are you ok?' ); $pos = 0; $index = 0; do { $pos = strpos($str, '?', $pos); if ($pos === false) { break; } $binding = array_values($data)[$index%count($data)]; $replacement = is_numeric($binding) ? $binding : '"' . $binding . '"'; $str = substr_replace($str, $replacement, $pos, 1); $pos += strlen($replacement); $index++; } while ($pos !== false); echo $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.0140.00717.59
8.4.130.0080.00119.52
8.4.120.0120.00820.30
8.4.110.0130.00918.60
8.4.100.0130.00817.84
8.4.90.0050.00620.60
8.4.80.0090.00918.82
8.4.70.0040.00419.11
8.4.60.0110.00918.93
8.4.50.0130.00718.74
8.4.40.0030.00718.82
8.4.30.0180.00018.93
8.4.20.0150.00619.73
8.4.10.0000.00924.03
8.3.270.0050.00416.66
8.3.260.0090.01016.63
8.3.250.0140.00518.73
8.3.240.0110.00916.55
8.3.230.0120.00816.61
8.3.220.0100.00919.10
8.3.210.0030.00516.69
8.3.200.0050.00316.56
8.3.190.0070.00117.35
8.3.180.0120.00719.16
8.3.170.0060.00919.12
8.3.160.0070.01017.08
8.3.150.0110.00717.24
8.3.140.0030.00516.62
8.3.130.0050.00318.56
8.3.120.0090.00620.72
8.3.110.0060.00318.43
8.3.100.0070.00318.55
8.3.90.0030.00626.77
8.3.80.0100.00018.55
8.3.70.0070.00716.63
8.3.60.0100.01018.55
8.3.50.0170.00318.33
8.3.40.0060.01320.00
8.3.30.0100.01018.89
8.3.20.0080.00024.18
8.3.10.0000.01724.66
8.3.00.0130.00626.16
8.2.290.0110.00816.69
8.2.280.0120.00818.28
8.2.270.0140.00416.84
8.2.260.0090.00016.51
8.2.250.0040.00418.39
8.2.240.0090.00917.13
8.2.230.0060.00320.94
8.2.220.0000.00824.06
8.2.210.0070.01326.77
8.2.200.0080.01216.88
8.2.190.0040.01816.58
8.2.180.0110.00718.41
8.2.170.0070.01418.91
8.2.160.0000.01722.96
8.2.150.0130.00325.66
8.2.140.0090.00924.66
8.2.130.0040.00426.16
8.2.120.0040.00421.10
8.2.110.0070.00320.25
8.2.100.0040.00420.31
8.2.50.0070.00318.10
8.1.330.0120.00716.49
8.1.320.0110.00718.01
8.1.310.0110.00718.00
8.1.300.0050.00517.73
8.1.290.0000.00930.84
8.1.280.0110.01125.92
8.1.270.0040.00424.66
8.1.260.0070.01126.35
8.1.250.0000.00728.09
8.1.240.0120.00918.65
8.1.230.0090.00018.76

preferences:
30.38 ms | 403 KiB | 5 Q