3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); // some sort of user authorization should go here. if (isset($_POST['userContent'])) { // see https://gist.github.com/adrian-enspired/2e03b01fcfff54151864 require 'pdo.php'; require_once 'tools/HTMLPurifier.standalone.php'; $purifier = new HTMLPurifier(HTMLPurifier_Config::createDefault()); $data = [ 'section' => $section, 'author' => $_SESSION['userId'], 'content' => $purifier->purify($_POST['userContent']) ]; if (isset($_POST['id'])) { $data['contentID'] = $_POST['id']; // i'd question why you're updating the author. is it potentially being changed? same goes for $section. $stmt = $db->prepare("UPDATE userContent SET section=:section, author=:author, content=:content WHERE id=:contentID"); $stmt->execute($data); } else { $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->execute($data); } }

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.0080.01116.50
8.3.50.0070.00716.38
8.3.40.0030.01318.79
8.3.30.0030.01418.45
8.3.20.0070.00020.33
8.3.10.0040.00421.85
8.3.00.0000.00821.02
8.2.180.0080.00816.63
8.2.170.0140.00722.96
8.2.160.0070.00722.18
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0040.00422.38
8.2.120.0050.00226.35
8.2.110.0100.00022.13
8.2.100.0070.00417.84
8.2.90.0040.00417.84
8.2.80.0080.00019.95
8.2.70.0040.00417.50
8.2.60.0050.00318.16
8.2.50.0030.00618.10
8.2.40.0000.00922.28
8.2.30.0060.00321.02
8.2.20.0000.00818.04
8.2.10.0000.00718.05
8.2.00.0040.00418.18
8.1.280.0040.01125.92
8.1.270.0000.00823.96
8.1.260.0030.00326.35
8.1.250.0000.00728.09
8.1.240.0030.00619.09
8.1.230.0030.00922.16
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0040.00417.35
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0030.00518.68
8.1.160.0000.00718.94
8.1.150.0000.00818.77
8.1.140.0040.00419.60
8.1.130.0030.00617.46
8.1.120.0020.00517.42
8.1.110.0050.00217.50
8.1.100.0040.00417.42
8.1.90.0030.00517.39
8.1.80.0030.00717.49
8.1.70.0070.00017.42
8.1.60.0050.00317.56
8.1.50.0000.00817.50
8.1.40.0000.00717.48
8.1.30.0060.00317.59
8.1.20.0000.00817.62
8.1.10.0040.00417.48
8.1.00.0050.00317.37
8.0.300.0030.00619.86
8.0.290.0040.00416.63
8.0.280.0080.00018.38
8.0.270.0040.00417.28
8.0.260.0000.00816.75
8.0.250.0030.00316.89
8.0.240.0030.00616.77
8.0.230.0040.00417.00
8.0.220.0050.00316.84
8.0.210.0030.00316.91
8.0.200.0030.00516.91
8.0.190.0030.00516.81
8.0.180.0070.00016.80
8.0.170.0060.00316.80
8.0.160.0040.00416.84
8.0.150.0000.00816.75
8.0.140.0040.00416.85
8.0.130.0070.00013.21
8.0.120.0040.00416.76
8.0.110.0000.00816.90
8.0.100.0000.00716.75
8.0.90.0040.00416.89
8.0.80.0070.01016.82
8.0.70.0000.00716.89
8.0.60.0040.00416.85
8.0.50.0000.00716.67
8.0.30.0120.00917.04
8.0.20.0100.01117.40
8.0.10.0000.00717.02
8.0.00.0110.00716.63
7.4.330.0060.00015.55
7.4.320.0030.00316.40
7.4.300.0030.00316.51
7.4.290.0070.00016.36
7.4.280.0000.00716.57
7.4.270.0030.00316.52
7.4.260.0070.00016.59
7.4.250.0000.00816.44
7.4.240.0050.00316.55
7.4.230.0040.00416.54
7.4.220.0090.00916.57
7.4.210.0070.00716.49
7.4.200.0000.00716.56
7.4.160.0070.01416.34
7.4.150.0120.00617.40
7.4.140.0130.00917.86
7.4.130.0140.00816.44
7.4.120.0090.01016.37
7.4.110.0060.01016.35
7.4.100.0090.01216.45
7.4.90.0070.01016.38
7.4.80.0150.00619.39
7.4.70.0100.00616.42
7.4.60.0070.01016.43
7.4.50.0060.00616.33
7.4.40.0100.00716.68
7.4.30.0120.00616.46
7.4.00.0080.00814.68
7.3.330.0070.00012.95
7.3.320.0030.00313.08
7.3.310.0000.00716.22
7.3.300.0040.00416.19
7.3.290.0070.00016.26
7.3.280.0090.00916.22
7.3.270.0070.01017.40
7.3.260.0090.01116.29
7.3.250.0110.01316.38
7.3.240.0160.00716.46
7.3.230.0040.01516.34
7.3.210.0120.00616.46
7.3.200.0080.00816.55
7.3.190.0030.01316.41
7.3.180.0100.00616.29
7.3.170.0100.00616.38
7.3.160.0100.00616.19
7.2.330.0070.01116.66
7.2.320.0100.00716.46
7.2.310.0060.01116.71
7.2.300.0170.00616.56
7.2.290.0140.00316.52
7.2.60.0040.01216.79
7.2.00.0030.00719.36
7.1.200.0040.01115.69
7.1.100.0040.00418.21
7.1.70.0030.00617.02
7.1.60.0570.01033.13
7.1.50.0400.02033.02
7.1.40.0770.01032.19
7.1.30.0570.01332.54
7.1.20.0530.01332.74
7.1.10.0400.00714.75
7.1.00.0430.00314.80
7.0.200.0330.01314.80
7.0.190.0400.00714.84
7.0.180.0470.00714.21
7.0.170.0470.00314.28
7.0.160.0430.00714.02
7.0.150.0470.00714.48
7.0.140.0370.01014.24
7.0.130.0330.01014.60
7.0.120.0300.01314.77
7.0.110.0300.01014.39
7.0.100.0300.01014.37
7.0.90.0300.01014.27
7.0.80.0200.01714.45
7.0.70.0330.00714.12
7.0.60.0270.01314.08
7.0.50.0330.00314.35
7.0.40.0330.00714.60
7.0.30.0330.00714.50
7.0.20.0330.00314.27
7.0.10.0230.01314.67
7.0.00.0270.01014.57

preferences:
53.93 ms | 401 KiB | 5 Q