3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wrap_js($js) { $confirm_text = "It will not be possible to modify your responses anymore if you continue.\\n\\nAre you sure you want to continue?"; $new_js_start = 'if( window.confirm("' . $confirm_text . '") ) { '; $new_js_end = ' } else { event.preventDefault(); }'; return $new_js_start . $js . $new_js_end; } $html = "<input type='submit' id='gform_submit_button_4' class='gform_button button' value='Envoyer' onclick='/* Lots of JS */' onkeypress='/* Lots of JS */' />"; $doc = new DOMDocument(); $doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($doc); foreach ($xpath->query("//input[@type='submit']") as $submit_input) { foreach (['onclick', 'onkeypress'] as $attribute) { if (($js = $submit_input->getAttribute($attribute)) != '') { $submit_input->setAttribute($attribute, wrap_js($js)); } } } echo $doc->saveHTML();

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.0100.01218.02
8.4.130.0080.01217.99
8.4.120.0070.00922.70
8.4.110.0030.00520.77
8.4.100.0140.00718.20
8.4.90.0140.00721.06
8.4.80.0110.00319.23
8.4.70.0110.00919.36
8.4.60.0130.00919.27
8.4.50.0030.00620.93
8.4.40.0070.01119.77
8.4.30.0180.00322.70
8.4.20.0040.00418.95
8.4.10.0030.00619.80
8.3.270.0120.00917.03
8.3.260.0120.00717.07
8.3.250.0110.00919.31
8.3.240.0150.00517.04
8.3.230.0150.00416.87
8.3.220.0020.00519.34
8.3.210.0060.00417.22
8.3.200.0050.00416.89
8.3.190.0140.00617.56
8.3.180.0150.00419.57
8.3.170.0090.00916.80
8.3.160.0120.00617.86
8.3.150.0130.00717.55
8.3.140.0040.00419.32
8.3.130.0130.00617.34
8.3.120.0080.00820.89
8.3.110.0060.00318.70
8.3.100.0100.00018.46
8.3.90.0070.00718.73
8.3.80.0060.00318.68
8.3.70.0160.00316.75
8.3.60.0120.00618.56
8.3.50.0040.01017.74
8.3.40.0080.00819.08
8.3.30.0090.00619.22
8.3.20.0000.00721.32
8.3.10.0060.00320.78
8.3.00.0090.00022.81
8.2.290.0120.00716.95
8.2.280.0100.01020.68
8.2.270.0120.00618.83
8.2.260.0040.00416.86
8.2.250.0000.00816.99
8.2.240.0110.00717.73
8.2.230.0000.00820.94
8.2.220.0060.00324.06
8.2.210.0120.00326.77
8.2.200.0050.00518.56
8.2.190.0100.00616.74
8.2.180.0120.00617.25
8.2.170.0060.00922.96
8.2.160.0030.01022.63
8.2.150.0100.00324.18
8.2.140.0090.00024.66
8.2.130.0110.00726.16
8.2.120.0060.00321.55
8.2.110.0060.00322.66
8.2.100.0120.00018.28
8.2.90.0060.00318.41
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0030.00618.05
8.2.50.0030.00618.07
8.2.40.0040.00420.07
8.2.30.0000.00718.55
8.2.20.0040.00418.38
8.2.10.0030.00619.63
8.2.00.0020.00518.46
8.1.330.0130.00722.48
8.1.320.0100.00916.34
8.1.310.0120.00617.32
8.1.300.0060.01618.72
8.1.290.0090.00018.88
8.1.280.0100.01025.92
8.1.270.0100.00019.25
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00622.71
8.1.230.0020.01021.33
8.1.220.0000.00918.14
8.1.210.0040.00419.09
8.1.200.0000.00917.63
8.1.190.0000.00817.72
8.1.180.0080.00018.10
8.1.170.0030.00618.97
8.1.160.0000.00819.32
8.1.150.0000.00819.35
8.1.140.0000.00720.55
8.1.130.0030.00320.55
8.1.120.0070.00017.83
8.1.110.0040.00417.87
8.1.100.0000.00717.89
8.1.90.0040.00417.85
8.1.80.0000.00717.74
8.1.70.0030.00317.75
8.1.60.0040.00418.00
8.1.50.0060.00317.93
8.1.40.0000.00717.82
8.1.30.0050.00318.04
8.1.20.0080.00017.98
8.1.10.0060.00318.00
8.1.00.0040.00417.93
8.0.300.0000.00820.54
8.0.290.0000.00817.25
8.0.280.0000.00718.80
8.0.270.0070.00017.66
8.0.260.0090.00018.82
8.0.250.0030.00517.34
8.0.240.0030.00517.34
8.0.230.0050.00217.27
8.0.220.0000.00917.19
8.0.210.0080.00017.29
8.0.200.0050.00317.34
8.0.190.0050.00317.26
8.0.180.0050.00317.28
8.0.170.0070.00317.16
8.0.160.0060.00617.28
8.0.150.0070.00017.10
8.0.140.0050.00217.23
8.0.130.0030.00313.68
8.0.120.0090.00017.14
8.0.110.0000.00717.30
8.0.100.0040.00417.28
8.0.90.0000.00717.20
8.0.80.0120.00817.27
8.0.70.0040.00417.20
8.0.60.0040.00417.33
8.0.50.0040.00417.34
8.0.30.0120.00817.55
8.0.20.0130.01317.55
8.0.10.0000.00717.32
8.0.00.0120.00617.08
7.4.330.0030.00315.55
7.4.320.0030.00316.91
7.4.300.0060.00016.87
7.4.290.0070.00016.90
7.4.280.0060.00316.98
7.4.270.0050.00816.84
7.4.260.0040.00416.94
7.4.250.0030.00516.86
7.4.240.0030.00316.94
7.4.230.0000.00717.00
7.4.220.0000.00816.80
7.4.210.0100.00716.99
7.4.200.0000.00716.95
7.4.160.0100.00816.96
7.4.140.0080.00917.86
7.4.130.0150.00316.84
7.4.120.0110.00916.94
7.4.110.0070.01117.00
7.4.100.0160.01016.86
7.4.90.0140.00316.98
7.4.80.0160.00619.39
7.4.70.0060.01216.90
7.4.60.0150.00316.91
7.4.50.0070.00516.62
7.4.40.0070.01016.95
7.4.00.0050.01315.18
7.3.330.0050.00013.52
7.3.320.0030.00313.52
7.3.310.0000.00716.69
7.3.300.0070.00016.52
7.3.290.0070.00716.66
7.3.280.0120.00716.66
7.3.260.0120.01116.80
7.3.240.0050.01216.84
7.3.230.0090.00916.80
7.3.210.0030.01316.70
7.3.200.0030.01416.96
7.3.190.0230.00016.86
7.3.180.0110.00816.95
7.3.170.0150.00616.73
7.3.160.0170.00316.57
7.3.120.0070.01114.83
7.3.110.0060.01214.94
7.3.100.0130.00615.18
7.3.90.0030.01014.96
7.3.80.0060.00914.91
7.3.70.0030.01015.04
7.3.60.0030.01014.90
7.3.50.0110.00414.92
7.3.40.0070.00714.79
7.3.30.0100.00315.04
7.3.20.0330.00415.94
7.3.10.0260.00315.85
7.3.00.0300.00815.81
7.2.330.0100.01017.11
7.2.320.0030.01417.08
7.2.310.0100.00716.95
7.2.300.0090.00916.83
7.2.290.0100.00717.18
7.2.250.0120.00615.34
7.2.240.0100.00715.29
7.2.230.0070.00715.49
7.2.220.0040.01115.40
7.2.210.0060.01014.96
7.2.200.0070.01015.30
7.2.190.0030.00615.22
7.2.180.0100.00315.16
7.2.170.0060.00615.25
7.2.160.0100.00315.13
7.2.150.0250.00516.27
7.2.140.0230.00616.09
7.2.130.0280.00216.13
7.2.120.0690.00516.12
7.2.110.0270.00916.27
7.2.100.0270.01016.24
7.2.90.0260.00516.30
7.2.80.0260.00616.16
7.2.70.0280.00316.17
7.2.60.0210.00716.12
7.2.50.0210.00816.30
7.2.40.0270.00816.34
7.2.30.0240.00815.99
7.2.20.0240.00916.18
7.2.10.0280.00216.24
7.2.00.0250.00516.10
7.1.330.0000.01415.92
7.1.320.0000.01516.04
7.1.310.0100.00715.61
7.1.300.0100.00315.91
7.1.290.0100.00715.76
7.1.280.0060.00616.05
7.1.270.0040.00716.16
7.1.260.0100.00315.89
7.1.250.0260.00215.07
7.1.240.0030.00716.02
7.1.230.0000.01315.73
7.1.220.0080.00415.91
7.1.210.0000.01515.96
7.1.200.0100.00715.90
7.1.190.0070.00715.91
7.1.180.0000.01415.91
7.1.170.0030.01015.81
7.1.160.0100.00615.88
7.1.150.0030.01515.76
7.1.140.0090.00916.07
7.1.130.0080.00315.82
7.1.120.0130.00015.72
7.1.110.0090.00915.84
7.1.100.0100.00315.73
7.1.90.0000.01015.99
7.1.80.0060.01015.91
7.1.70.0060.00915.88
7.1.60.0060.01215.88
7.1.50.0030.01315.83
7.1.40.0090.00615.73
7.1.30.0070.00315.86
7.1.20.0030.01415.84
7.1.10.0110.00415.78
7.1.00.0040.01215.92

preferences:
133.72 ms | 403 KiB | 5 Q