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 = [ 'author' => $_SESSION['userId'], 'content' => $purifier->purify($_POST['userContent']) ]; if (isset($_POST['id'])) { $data['contentID'] = $_POST['id']; $stmt = $db->prepare("UPDATE userContent SET content=:content WHERE id=:contentID AND author=:author"); } else { $data['section'] = 1; $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.0140.00418.30
8.3.50.0040.01116.34
8.3.40.0110.00418.71
8.3.30.0120.00318.84
8.3.20.0040.00420.33
8.3.10.0000.00721.95
8.3.00.0040.00420.89
8.2.180.0140.00418.28
8.2.170.0100.01022.96
8.2.160.0070.00722.01
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00422.20
8.2.120.0040.00426.35
8.2.110.0000.01022.20
8.2.100.0070.00417.91
8.2.90.0050.00319.13
8.2.80.0000.00818.00
8.2.70.0050.00317.38
8.2.60.0000.00818.05
8.2.50.0000.00818.10
8.2.40.0040.00422.37
8.2.30.0030.00521.17
8.2.20.0060.00318.05
8.2.10.0040.00418.03
8.2.00.0040.00418.09
8.1.280.0070.00725.92
8.1.270.0070.00023.82
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00624.05
8.1.230.0000.01122.25
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00917.22
8.1.180.0080.00018.10
8.1.170.0000.00818.63
8.1.160.0000.00719.04
8.1.150.0040.00418.77
8.1.140.0040.00419.48
8.1.130.0000.00718.90
8.1.120.0030.00517.41
8.1.110.0040.00417.41
8.1.100.0000.00717.32
8.1.90.0040.00417.49
8.1.80.0040.00417.39
8.1.70.0030.00317.41
8.1.60.0040.00417.53
8.1.50.0000.00817.37
8.1.40.0040.00417.32
8.1.30.0030.00517.63
8.1.20.0030.00617.45
8.1.10.0050.00317.37
8.1.00.0040.00417.39
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0030.00318.34
8.0.270.0000.00817.19
8.0.260.0050.00316.77
8.0.250.0030.00316.96
8.0.240.0040.00416.70
8.0.230.0080.00016.75
8.0.220.0030.00316.81
8.0.210.0030.00316.89
8.0.200.0050.00316.82
8.0.190.0090.00016.89
8.0.180.0040.00416.80
8.0.170.0040.00416.88
8.0.160.0050.00316.84
8.0.150.0040.00416.78
8.0.140.0030.00316.84
8.0.130.0040.00413.35
8.0.120.0000.00816.84
8.0.110.0040.00416.78
8.0.100.0050.00316.87
8.0.90.0040.00416.65
8.0.80.0100.00716.84
8.0.70.0070.00016.85
8.0.60.0040.00416.86
8.0.50.0080.00016.92
8.0.30.0090.01017.16
8.0.20.0120.00717.40
8.0.10.0070.00016.99
8.0.00.0110.00516.53
7.4.330.0020.00215.55
7.4.320.0030.00316.47
7.4.300.0060.00016.42
7.4.290.0000.00816.45
7.4.280.0040.00416.45
7.4.270.0000.00716.38
7.4.260.0040.00416.59
7.4.250.0000.00816.45
7.4.240.0070.00016.55
7.4.230.0050.00316.57
7.4.220.0150.00416.39
7.4.210.0110.00716.60
7.4.200.0030.00316.28
7.4.160.0070.01116.57
7.4.150.0060.01517.40
7.4.140.0120.00717.86
7.4.130.0150.00916.31
7.4.120.0090.00816.46
7.4.110.0080.00916.54
7.4.100.0150.00416.37
7.4.90.0100.00716.56
7.4.80.0070.01119.39
7.4.70.0070.01016.35
7.4.60.0070.01016.38
7.4.50.0090.00616.34
7.4.40.0130.00916.52
7.4.30.0090.00916.68
7.4.10.0100.00714.82
7.4.00.0070.00815.02
7.3.330.0030.00313.05
7.3.320.0030.00513.06
7.3.310.0040.00416.05
7.3.300.0000.00716.06
7.3.290.0060.00016.14
7.3.280.0120.00716.24
7.3.270.0130.00617.40
7.3.260.0120.00616.33
7.3.250.0110.01016.33
7.3.240.0110.00616.32
7.3.230.0120.00916.33
7.3.210.0070.01016.48
7.3.200.0050.01116.25
7.3.190.0120.00316.12
7.3.180.0100.01016.32
7.3.170.0100.00716.51
7.3.160.0070.01016.33
7.3.130.0070.01014.98
7.3.120.0140.00414.63
7.3.110.0030.01414.90
7.3.100.0040.01214.83
7.3.90.0030.00614.82
7.3.80.0030.00714.77
7.3.70.0100.00314.50
7.3.60.0040.00714.74
7.3.50.0030.01014.78
7.3.40.0060.00614.80
7.3.30.0090.00314.77
7.3.20.0120.00316.69
7.3.10.0070.01116.43
7.3.00.0120.00316.64
7.2.330.0120.00616.54
7.2.320.0030.01716.69
7.2.310.0130.00416.66
7.2.300.0120.01216.64
7.2.290.0090.00816.65
7.2.260.0070.01114.77
7.2.250.0110.00614.96
7.2.240.0030.01014.94
7.2.230.0060.00615.22
7.2.220.0100.00015.20
7.2.210.0040.01215.11
7.2.200.0060.00315.09
7.2.190.0030.01014.78
7.2.180.0040.01114.89
7.2.170.0100.00315.18
7.2.160.0100.00715.04
7.2.150.0070.01116.88
7.2.140.0070.01016.57
7.2.130.0070.00716.88
7.2.120.0100.00616.79
7.2.110.0040.01116.66
7.2.100.0070.00716.95
7.2.90.0030.00916.88
7.2.80.0030.00616.75
7.2.70.0030.01316.98
7.2.60.0070.00716.79
7.2.50.0040.01117.00
7.2.40.0050.00516.47
7.2.30.0030.00716.98
7.2.20.0040.01416.93
7.2.10.0000.01116.49
7.2.00.0060.00818.16
7.1.330.0070.00715.88
7.1.320.0030.01015.50
7.1.310.0000.01415.77
7.1.300.0040.01115.66
7.1.290.0040.00715.70
7.1.280.0030.01015.53
7.1.270.0060.00615.65
7.1.260.0090.00615.68
7.1.250.0090.00615.58
7.1.240.0030.01415.50
7.1.230.0040.01115.69
7.1.220.0060.00615.59
7.1.210.0100.00315.68
7.1.200.0040.01015.66
7.1.190.0030.00615.75
7.1.180.0040.01215.72
7.1.170.0060.00915.71
7.1.160.0070.00315.36
7.1.150.0030.01015.77
7.1.140.0030.00915.60
7.1.130.0030.00915.82
7.1.120.0030.01015.74
7.1.110.0030.01015.88
7.1.100.0040.00816.91
7.1.90.0060.00915.72
7.1.80.0030.01015.79
7.1.70.0080.00516.23
7.1.60.0300.01124.36
7.1.50.0290.00724.24
7.1.40.0210.01023.87
7.1.30.0230.01024.14
7.1.20.0230.00924.10
7.1.10.0130.01015.23
7.1.00.0170.01115.33
7.0.330.0040.01115.32
7.0.320.0100.00015.24
7.0.310.0040.00814.92
7.0.300.0150.00015.01
7.0.290.0030.00915.27
7.0.280.0070.00715.25
7.0.270.0040.00815.16
7.0.260.0100.00315.39
7.0.250.0090.00315.55
7.0.240.0030.00715.40
7.0.230.0100.00015.32
7.0.220.0000.01115.43
7.0.210.0040.00815.40
7.0.200.0210.00614.91
7.0.190.0170.01014.88
7.0.180.0200.00714.82
7.0.170.0170.01014.91
7.0.160.0220.00714.81
7.0.150.0130.01214.72
7.0.140.0170.00714.88
7.0.130.0170.01014.88
7.0.120.0220.01215.06
7.0.110.0170.00814.90
7.0.100.0160.00714.90
7.0.90.0200.00614.84
7.0.80.0180.00614.93
7.0.70.0120.01114.95
7.0.60.0200.00714.84
7.0.50.0200.00514.80
7.0.40.0150.01113.86
7.0.30.0150.00913.97
7.0.20.0180.00913.90
7.0.10.0120.00913.89
7.0.00.0190.00513.91
5.6.400.0090.00614.03
5.6.390.0040.01414.28
5.6.380.0090.00614.48
5.6.370.0100.00314.54
5.6.360.0030.01414.06
5.6.350.0080.00414.06
5.6.340.0100.00714.20
5.6.330.0030.00914.16
5.6.320.0060.00914.22
5.6.310.0060.01014.13
5.6.300.0030.01014.33
5.6.290.0000.01214.23
5.6.280.0060.00313.97
5.6.270.0030.01014.27
5.6.260.0000.01114.29
5.6.250.0030.01314.33
5.6.240.0030.00914.33
5.6.230.0090.00614.39
5.6.220.0060.00614.29
5.6.210.0030.00514.12
5.6.200.0060.00914.08
5.6.190.0170.00013.98
5.6.180.0100.00014.54
5.6.170.0000.01413.95
5.6.160.0130.00313.98
5.6.150.0030.01214.61
5.6.140.0080.00814.24
5.6.130.0040.00414.04
5.6.120.0040.00814.13
5.6.110.0000.00814.08
5.6.100.0080.00714.21
5.6.90.0040.00714.52
5.6.80.0100.00314.26
5.6.70.0000.01314.36
5.6.60.0070.00314.14
5.6.50.0090.00914.10
5.6.40.0070.01014.40
5.6.30.0120.00614.32
5.6.20.0090.00914.11
5.6.10.0070.00714.41
5.6.00.0030.01014.41

preferences:
53.67 ms | 401 KiB | 5 Q