3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); include('pdo.php'); require_once 'tools/HTMLPurifier.standalone.php'; $editFlag = $_POST['editFlag'] ?? false; $contentID = $_POST['id'] ?? false; $userContent = $_POST['userContent'] ?? false; $section = 1; $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($userContent); if ($editFlag != "1"){ $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content]); } else { $stmt = $db->prepare("UPDATE userContent SET section=:section, author=:author, content=:content WHERE id=:contentID"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content, 'contentID' => $contentID]); } ?>

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.3.60.0150.00418.43
8.3.50.0090.00616.36
8.3.40.0090.00618.95
8.3.30.0090.00918.96
8.3.20.0050.00320.41
8.3.10.0000.00822.03
8.3.00.0000.00820.88
8.2.180.0110.00418.66
8.2.170.0110.00422.96
8.2.160.0070.00722.08
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0040.00420.37
8.2.120.0080.00026.35
8.2.110.0030.00722.24
8.2.100.0080.00317.91
8.2.90.0080.00019.26
8.2.80.0040.00418.05
8.2.70.0040.00417.63
8.2.60.0040.00418.05
8.2.50.0000.00818.10
8.2.40.0040.00422.36
8.2.30.0040.00421.07
8.2.20.0040.00418.02
8.2.10.0040.00418.11
8.2.00.0000.00717.99
8.1.280.0040.01125.92
8.1.270.0060.00923.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00619.16
8.1.230.0060.00619.22
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0000.00917.35
8.1.180.0060.00318.10
8.1.170.0000.00818.59
8.1.160.0040.00418.98
8.1.150.0040.00418.89
8.1.140.0040.00419.66
8.1.130.0080.00018.79
8.1.120.0040.00417.49
8.1.110.0000.00817.31
8.1.100.0000.00817.44
8.1.90.0080.00017.30
8.1.80.0070.00317.41
8.1.70.0020.00517.35
8.1.60.0030.00617.64
8.1.50.0030.00617.57
8.1.40.0040.00417.44
8.1.30.0050.00317.59
8.1.20.0000.00917.68
8.1.10.0040.00417.58
8.1.00.0030.00517.52
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0030.00317.47
8.0.260.0030.00316.95
8.0.250.0040.00417.11
8.0.240.0060.00317.01
8.0.230.0070.00017.19
8.0.220.0000.00817.00
8.0.210.0000.00717.08
8.0.200.0100.00017.12
8.0.190.0030.00617.17
8.0.180.0070.00017.11
8.0.170.0000.00817.03
8.0.160.0040.00416.96
8.0.150.0000.00816.89
8.0.140.0020.00516.98
8.0.130.0000.00713.38
8.0.120.0040.00417.01
8.0.110.0030.00617.04
8.0.100.0040.00416.95
8.0.90.0000.00717.03
8.0.80.0030.01416.94
8.0.70.0080.00017.10
8.0.60.0040.00416.96
8.0.50.0050.00317.00
8.0.30.0180.00217.08
8.0.20.0110.00917.40
8.0.10.0000.00716.84
8.0.00.0060.01216.66
7.4.330.0020.00215.55
7.4.320.0030.00316.58
7.4.300.0060.00016.52
7.4.290.0030.00516.52
7.4.280.0000.00716.63
7.4.270.0050.00216.60
7.4.260.0050.00516.42
7.4.250.0000.00916.45
7.4.240.0070.00016.52
7.4.230.0030.00316.65
7.4.220.0150.01216.62
7.4.210.0050.01116.56
7.4.200.0030.00516.61
7.4.160.0100.01016.49
7.4.150.0120.00617.40
7.4.140.0110.01117.86
7.4.130.0170.00316.43
7.4.120.0090.01216.44
7.4.110.0070.01716.56
7.4.100.0120.00616.40
7.4.90.0140.00716.65
7.4.80.0100.00719.39
7.4.70.0200.00316.46
7.4.60.0130.01016.64
7.4.50.0050.00916.56
7.4.40.0060.00916.20
7.4.30.0040.01516.51
7.4.10.0100.01015.11
7.4.00.0080.00914.99
7.3.330.0050.00213.09
7.3.320.0050.00213.14
7.3.310.0030.00516.27
7.3.300.0000.00616.32
7.3.290.0000.00716.29
7.3.280.0090.00716.30
7.3.270.0120.00617.40
7.3.260.0090.00816.45
7.3.250.0090.00816.35
7.3.240.0060.01216.37
7.3.230.0120.00616.52
7.3.210.0060.00916.44
7.3.200.0070.01016.36
7.3.190.0160.00016.42
7.3.180.0090.00916.58
7.3.170.0060.00916.38
7.3.160.0090.00916.34
7.3.130.0030.01614.87
7.3.120.0130.00614.75
7.3.110.0070.01314.96
7.3.100.0030.01114.79
7.3.90.0090.00414.77
7.3.80.0060.00315.04
7.3.70.0000.01214.84
7.3.60.0070.00714.73
7.3.50.0090.00314.83
7.3.40.0070.01014.72
7.3.30.0000.01314.81
7.3.20.0030.01016.72
7.3.10.0060.01016.50
7.3.00.0030.00716.50
7.2.330.0150.00216.60
7.2.320.0090.01116.40
7.2.310.0170.00716.42
7.2.300.0100.01316.49
7.2.290.0120.00616.66
7.2.260.0070.01114.69
7.2.250.0110.00715.03
7.2.240.0070.00715.11
7.2.230.0110.00314.95
7.2.220.0080.00314.86
7.2.210.0060.00614.87
7.2.200.0030.01014.86
7.2.190.0000.01014.75
7.2.180.0060.01015.09
7.2.170.0060.01014.74
7.2.160.0090.00315.03
7.2.150.0090.00616.95
7.2.140.0100.00316.76
7.2.130.0000.01316.48
7.2.120.0050.00916.63
7.2.110.0070.00516.68
7.2.100.0050.00816.71
7.2.90.0050.00816.78
7.2.80.0020.01216.75
7.2.70.0070.00516.65
7.2.60.0060.00716.66
7.2.50.0050.01216.96
7.2.40.0070.00516.89
7.2.30.0070.00616.81
7.2.20.0050.00516.65
7.2.10.0020.01116.81
7.2.00.0010.01017.68
7.1.330.0000.01515.54
7.1.320.0030.01015.69
7.1.310.0070.00715.59
7.1.300.0060.00615.77
7.1.290.0080.00415.50
7.1.280.0030.00615.51
7.1.270.0000.00815.46
7.1.260.0000.01315.44
7.1.250.0030.00815.55
7.1.240.0000.01215.51
7.1.230.0030.01215.58
7.1.220.0000.01315.91
7.1.210.0040.00715.66
7.1.200.0090.00115.76
7.1.190.0030.01015.85
7.1.180.0130.00015.45
7.1.170.0030.01315.73
7.1.160.0040.00415.72
7.1.150.0000.01215.66
7.1.140.0060.00815.49
7.1.130.0070.00715.51
7.1.120.0120.00315.75
7.1.110.0000.00915.55
7.1.100.0050.00816.82
7.1.90.0070.00715.68
7.1.80.0000.01615.54
7.1.70.0030.01016.24
7.1.60.0300.00924.50
7.1.50.0240.01024.16
7.1.40.0270.00724.10
7.1.30.0270.00824.11
7.1.20.0290.00624.20
7.1.10.0170.01215.26
7.1.00.0200.00715.22
7.0.330.0040.00815.24
7.0.320.0130.00015.07
7.0.310.0050.00515.27
7.0.300.0000.01415.22
7.0.290.0090.00015.27
7.0.280.0000.01315.27
7.0.270.0090.00415.23
7.0.260.0100.00315.39
7.0.250.0030.00715.36
7.0.240.0030.01015.47
7.0.230.0050.00515.45
7.0.220.0060.00615.47
7.0.210.0030.01115.41
7.0.200.0200.00615.04
7.0.190.0200.00914.96
7.0.180.0220.00914.83
7.0.170.0220.00514.64
7.0.160.0230.00514.66
7.0.150.0180.01014.90
7.0.140.0190.00714.69
7.0.130.0150.00914.97
7.0.120.0200.00714.95
7.0.110.0290.00714.91
7.0.100.0180.00914.66
7.0.90.0200.00514.79
7.0.80.0170.00614.85
7.0.70.0150.00814.79
7.0.60.0150.01014.74
7.0.50.0180.00614.99
7.0.40.0130.01013.96
7.0.30.0160.00614.00
7.0.20.0230.01013.86
7.0.10.0160.00613.98
7.0.00.0120.01113.83
5.6.400.0000.01314.39
5.6.390.0040.01214.25
5.6.380.0130.00314.03
5.6.370.0060.00913.95
5.6.360.0090.00614.44
5.6.350.0040.00414.01
5.6.340.0000.00914.11
5.6.330.0030.00914.33
5.6.320.0040.01114.09
5.6.310.0070.01114.29
5.6.300.0080.00814.16
5.6.290.0030.00613.96
5.6.280.0000.01214.15
5.6.270.0090.00614.37
5.6.260.0130.00014.25
5.6.250.0060.00914.16
5.6.240.0120.00014.36
5.6.230.0120.00614.43
5.6.220.0060.00313.89
5.6.210.0110.00413.97
5.6.200.0070.00714.21
5.6.190.0030.01114.43
5.6.180.0060.00614.24
5.6.170.0000.01314.24
5.6.160.0070.00714.35
5.6.150.0000.00814.11
5.6.140.0000.01214.20
5.6.130.0060.00614.02
5.6.120.0060.01113.85
5.6.110.0040.01413.88
5.6.100.0040.01014.34
5.6.90.0040.01214.31
5.6.80.0030.00614.08
5.6.70.0000.01313.98
5.6.60.0060.00914.09
5.6.50.0060.00314.15
5.6.40.0030.00713.91
5.6.30.0000.01013.96
5.6.20.0060.00614.12
5.6.10.0070.01014.00
5.6.00.0060.00614.01

preferences:
51.3 ms | 401 KiB | 5 Q