3v4l.org

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

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.70.0080.00816.75
8.3.60.0100.00618.68
8.3.50.0110.00817.45
8.3.40.0060.00918.83
8.3.30.0030.01318.70
8.3.20.0040.00422.23
8.3.10.0080.00021.73
8.3.00.0000.00821.02
8.2.180.0040.01118.54
8.2.170.0040.01122.96
8.2.160.0070.00722.21
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00722.25
8.2.120.0000.00826.35
8.2.110.0030.00719.43
8.2.100.0090.00317.97
8.2.90.0060.00319.26
8.2.80.0000.00817.97
8.2.70.0000.00818.05
8.2.60.0030.00518.05
8.2.50.0030.00518.10
8.2.40.0030.00519.30
8.2.30.0040.00419.29
8.2.20.0040.00418.21
8.2.10.0000.00718.10
8.2.00.0070.00018.09
8.1.280.0100.00325.92
8.1.270.0140.00023.73
8.1.260.0050.00226.35
8.1.250.0000.00828.09
8.1.240.0030.00622.69
8.1.230.0110.00017.77
8.1.220.0000.00817.77
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0040.00417.36
8.1.180.0060.00318.10
8.1.170.0030.00618.64
8.1.160.0070.00018.88
8.1.150.0060.00318.98
8.1.140.0000.00819.65
8.1.130.0000.00718.85
8.1.120.0000.00717.55
8.1.110.0030.00517.52
8.1.100.0040.00417.45
8.1.90.0030.00517.50
8.1.80.0030.00717.50
8.1.70.0040.00417.39
8.1.60.0030.00517.61
8.1.50.0030.00517.57
8.1.40.0030.00617.66
8.1.30.0040.00417.75
8.1.20.0050.00317.66
8.1.10.0040.00417.59
8.1.00.0040.00417.70
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0020.00518.43
8.0.270.0040.00417.42
8.0.260.0030.00617.04
8.0.250.0000.00817.18
8.0.240.0040.00417.04
8.0.230.0050.00217.08
8.0.220.0040.00417.02
8.0.210.0000.00717.09
8.0.200.0030.00617.13
8.0.190.0000.00816.99
8.0.180.0040.00417.07
8.0.170.0040.00416.98
8.0.160.0040.00417.11
8.0.150.0050.00317.02
8.0.140.0000.00716.88
8.0.130.0030.00313.41
8.0.120.0040.00416.99
8.0.110.0040.00416.97
8.0.100.0070.00016.90
8.0.90.0040.00417.00
8.0.80.0090.00916.98
8.0.70.0050.00317.02
8.0.60.0000.00816.97
8.0.50.0000.00817.10
8.0.30.0070.01516.96
8.0.20.0120.00817.40
8.0.10.0050.00317.23
8.0.00.0120.00916.85
7.4.330.0000.00515.55
7.4.320.0030.00316.45
7.4.300.0030.00316.45
7.4.290.0000.00716.67
7.4.280.0030.00616.47
7.4.270.0040.00316.63
7.4.260.0040.00416.66
7.4.250.0050.00216.52
7.4.240.0070.00016.49
7.4.230.0030.00316.35
7.4.220.0070.01416.63
7.4.210.0080.00816.62
7.4.200.0000.00716.62
7.4.160.0100.01016.62
7.4.150.0330.01417.40
7.4.140.0130.00517.86
7.4.130.0090.01316.50
7.4.120.0090.00916.68
7.4.110.0040.01516.71
7.4.100.0100.01316.61
7.4.90.0040.01416.46
7.4.80.0080.01119.39
7.4.70.0030.01516.61
7.4.60.0070.01016.44
7.4.50.0080.00516.61
7.4.40.0080.00816.66
7.4.30.0090.00916.61
7.4.00.0000.01815.05
7.3.330.0000.00713.33
7.3.320.0000.00613.23
7.3.310.0030.00516.32
7.3.300.0000.00716.36
7.3.290.0070.00016.46
7.3.280.0100.00916.40
7.3.270.0100.00717.40
7.3.260.0080.00916.46
7.3.250.0100.01216.33
7.3.240.0090.00916.52
7.3.230.0160.00316.52
7.3.210.0090.00916.45
7.3.200.0170.00016.43
7.3.190.0100.00816.60
7.3.180.0130.00316.70
7.3.170.0090.00616.55
7.3.160.0120.00316.54
7.2.330.0120.00416.63
7.2.320.0110.00916.73
7.2.310.0100.00716.45
7.2.300.0090.00916.65
7.2.290.0120.00616.50
7.2.60.0060.01016.68
7.2.00.0000.01219.21
7.1.200.0000.01415.59
7.1.100.0040.00718.11
7.1.70.0030.01316.92
7.1.60.0430.01333.30
7.1.50.0430.01732.99
7.1.40.0400.01332.25
7.1.30.0300.02332.53
7.1.20.0830.01332.44
7.1.10.0300.00714.78
7.1.00.0270.01014.83
7.0.200.0430.00014.83
7.0.190.0300.01014.68
7.0.180.0370.00714.17
7.0.170.0300.01014.32
7.0.160.0300.01014.16
7.0.150.0270.01014.32
7.0.140.0370.00014.43
7.0.130.0330.00314.77
7.0.120.0200.01314.43
7.0.110.0270.00714.41
7.0.100.0330.00714.27
7.0.90.0230.01314.45
7.0.80.0300.00714.54
7.0.70.0230.01314.21
7.0.60.0300.00714.13
7.0.50.0270.01014.58
7.0.40.0230.01014.50
7.0.30.0230.01314.32
7.0.20.0270.00714.70
7.0.10.0230.00714.45
7.0.00.0270.01014.43

preferences:
42.02 ms | 401 KiB | 5 Q