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"); } 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.0130.00716.50
8.3.50.0040.01116.64
8.3.40.0000.01518.50
8.3.30.0000.01518.63
8.3.20.0070.00020.33
8.3.10.0040.00422.03
8.3.00.0050.00320.79
8.2.180.0100.00718.51
8.2.170.0200.00022.96
8.2.160.0000.01422.25
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00422.33
8.2.120.0070.00026.35
8.2.110.0040.00420.30
8.2.100.0080.00417.72
8.2.90.0060.00319.17
8.2.80.0000.00818.05
8.2.70.0030.00617.50
8.2.60.0030.00517.93
8.2.50.0050.00218.10
8.2.40.0070.00022.33
8.2.30.0040.00421.15
8.2.20.0040.00418.01
8.2.10.0020.00518.06
8.2.00.0070.00017.97
8.1.280.0070.00725.92
8.1.270.0050.00323.79
8.1.260.0030.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00021.02
8.1.230.0070.00418.99
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0000.00817.13
8.1.180.0090.00018.10
8.1.170.0080.00018.74
8.1.160.0040.00419.08
8.1.150.0070.00018.91
8.1.140.0040.00419.51
8.1.130.0000.00818.83
8.1.120.0000.00917.47
8.1.110.0040.00417.38
8.1.100.0000.00717.48
8.1.90.0000.00817.30
8.1.80.0030.00617.46
8.1.70.0030.00317.45
8.1.60.0040.00417.43
8.1.50.0040.00417.39
8.1.40.0030.00617.54
8.1.30.0080.00017.53
8.1.20.0000.00717.59
8.1.10.0000.00717.45
8.1.00.0050.00317.35
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00618.51
8.0.270.0040.00417.23
8.0.260.0000.00716.70
8.0.250.0030.00316.93
8.0.240.0040.00416.77
8.0.230.0040.00416.98
8.0.220.0000.00716.93
8.0.210.0040.00416.84
8.0.200.0030.00616.88
8.0.190.0040.00416.81
8.0.180.0020.00516.86
8.0.170.0000.00716.78
8.0.160.0040.00416.93
8.0.150.0080.00016.80
8.0.140.0000.00716.85
8.0.130.0000.00713.24
8.0.120.0000.00716.82
8.0.110.0030.00616.88
8.0.100.0040.00416.78
8.0.90.0000.00716.73
8.0.80.0060.01016.84
8.0.70.0020.00516.73
8.0.60.0040.00416.84
8.0.50.0000.00816.70
8.0.30.0110.00817.10
8.0.20.0130.01517.40
8.0.10.0030.00316.82
8.0.00.0100.00616.67
7.4.330.0030.00315.55
7.4.320.0030.00316.58
7.4.300.0030.00316.48
7.4.290.0030.00316.47
7.4.280.0000.00816.55
7.4.270.0050.00516.49
7.4.260.0030.00516.55
7.4.250.0070.00016.51
7.4.240.0040.00416.54
7.4.230.0070.00016.65
7.4.220.0100.01616.52
7.4.210.0080.01116.57
7.4.200.0000.00716.41
7.4.160.0080.01116.59
7.4.150.0100.00717.40
7.4.140.0130.00617.86
7.4.130.0140.00616.38
7.4.120.0120.00616.54
7.4.110.0130.00316.36
7.4.100.0090.00916.36
7.4.90.0100.01016.55
7.4.80.0070.01519.39
7.4.70.0100.01016.39
7.4.60.0030.01316.53
7.4.50.0000.01716.37
7.4.40.0090.01216.37
7.4.30.0130.00616.52
7.4.00.0110.00714.98
7.3.330.0030.00313.04
7.3.320.0040.00312.96
7.3.310.0040.00416.16
7.3.300.0000.00716.14
7.3.290.0000.00716.13
7.3.280.0090.00916.21
7.3.270.0060.01117.40
7.3.260.0150.01516.21
7.3.250.0100.01216.32
7.3.240.0110.00816.39
7.3.230.0120.00616.56
7.3.210.0080.00916.46
7.3.200.0090.01316.47
7.3.190.0060.00916.18
7.3.180.0030.01316.48
7.3.170.0060.01016.11
7.3.160.0030.01316.28
7.3.120.0100.00614.68
7.3.110.0100.00714.86
7.3.100.0060.01014.89
7.3.90.0070.00314.80
7.3.80.0070.00714.88
7.3.70.0060.00614.60
7.3.60.0000.01514.89
7.3.50.0110.00014.87
7.3.40.0070.00714.52
7.3.30.0040.00814.65
7.3.20.0070.00416.70
7.3.10.0060.00816.58
7.3.00.0090.00616.57
7.2.330.0070.01016.61
7.2.320.0110.00516.64
7.2.310.0060.01116.69
7.2.300.0170.00716.37
7.2.290.0100.00716.33
7.2.250.0030.01315.11
7.2.240.0040.01414.82
7.2.230.0070.01015.18
7.2.220.0060.00615.15
7.2.210.0000.01414.91
7.2.200.0030.01315.18
7.2.190.0000.01515.17
7.2.180.0030.01015.17
7.2.170.0110.00415.07
7.2.130.0070.00716.85
7.2.120.0110.00916.71
7.2.110.0090.00616.63
7.2.100.0070.01116.74
7.2.90.0060.01316.62
7.2.80.0100.00716.71
7.2.70.0100.00716.58
7.2.60.0060.00916.81
7.2.50.0080.00716.82
7.2.40.0120.00616.75
7.2.30.0120.00816.68
7.2.20.0080.00716.61
7.2.10.0110.00816.57
7.2.00.0110.00517.72
7.1.330.0030.01015.58
7.1.320.0120.00015.68
7.1.310.0040.01115.79
7.1.300.0030.00715.86
7.1.290.0090.00615.64
7.1.280.0060.00915.58
7.1.270.0040.00815.62
7.1.260.0030.01015.67
7.1.250.0080.00715.63
7.1.200.0000.00915.36
7.1.100.0070.00718.12
7.1.70.0110.00016.94
7.1.60.0430.00333.17
7.1.50.0370.01032.77
7.1.40.0400.00732.60
7.1.30.0430.00732.63
7.1.20.0330.01332.62
7.1.10.0230.01314.71
7.1.00.0300.00714.67
7.0.200.0270.01014.84
7.0.190.0330.00314.80
7.0.180.0230.01014.31
7.0.170.0200.01714.19
7.0.160.0370.01014.48
7.0.150.0230.01014.48
7.0.140.0270.00714.37
7.0.130.0300.00714.73
7.0.120.0300.00314.70
7.0.110.0270.00714.41
7.0.100.0200.01314.43
7.0.90.0270.01014.43
7.0.80.0200.01314.34
7.0.70.0230.01014.25
7.0.60.0570.00314.18
7.0.50.0300.00314.38
7.0.40.0200.01314.61
7.0.30.0270.01014.56
7.0.20.0270.00714.41
7.0.10.0500.01014.40
7.0.00.0300.00314.42

preferences:
38.94 ms | 400 KiB | 5 Q