3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); if (isset($_POST['userContent'])) { 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.70.0090.00616.58
8.3.60.0140.00316.50
8.3.50.0090.00816.44
8.3.40.0070.00718.85
8.3.30.0120.00318.67
8.3.20.0080.00020.46
8.3.10.0000.00721.75
8.3.00.0080.00021.02
8.2.180.0150.00618.29
8.2.170.0200.00022.96
8.2.160.0070.00721.97
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00422.24
8.2.120.0040.00426.35
8.2.110.0100.00020.41
8.2.100.0040.00817.91
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0040.00418.04
8.2.50.0080.00018.10
8.2.40.0040.00422.37
8.2.30.0000.00820.97
8.2.20.0060.00318.07
8.2.10.0000.00817.98
8.2.00.0040.00418.01
8.1.280.0150.00325.92
8.1.270.0040.00423.70
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00620.90
8.1.230.0040.00819.09
8.1.220.0060.00317.79
8.1.210.0030.00518.77
8.1.200.0030.00717.35
8.1.190.0040.00417.10
8.1.180.0050.00318.10
8.1.170.0060.00318.71
8.1.160.0000.00718.95
8.1.150.0080.00018.90
8.1.140.0000.00819.57
8.1.130.0030.00318.82
8.1.120.0040.00417.50
8.1.110.0000.00717.40
8.1.100.0040.00417.45
8.1.90.0040.00417.41
8.1.80.0090.00017.38
8.1.70.0000.00717.40
8.1.60.0000.00817.54
8.1.50.0000.00817.51
8.1.40.0000.00817.50
8.1.30.0030.00617.52
8.1.20.0040.00417.56
8.1.10.0000.00717.53
8.1.00.0050.00317.36
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0050.00318.44
8.0.270.0030.00317.17
8.0.260.0000.00816.82
8.0.250.0000.00716.88
8.0.240.0030.00616.88
8.0.230.0040.00416.90
8.0.220.0070.00016.83
8.0.210.0030.00316.80
8.0.200.0040.00716.77
8.0.190.0040.00416.77
8.0.180.0020.00516.75
8.0.170.0070.00016.76
8.0.160.0040.00416.90
8.0.150.0040.00416.83
8.0.140.0030.00316.74
8.0.130.0000.00713.22
8.0.120.0040.00416.69
8.0.110.0000.00916.81
8.0.100.0000.00816.73
8.0.90.0070.00016.72
8.0.80.0060.00916.88
8.0.70.0050.00216.76
8.0.60.0040.00416.91
8.0.50.0040.00416.85
8.0.30.0120.00617.04
8.0.20.0110.00917.40
8.0.10.0000.00716.86
8.0.00.0110.00716.71
7.4.330.0020.00215.55
7.4.320.0070.00016.48
7.4.300.0060.00016.53
7.4.290.0000.00716.56
7.4.280.0000.00816.56
7.4.270.0030.00316.58
7.4.260.0050.00316.34
7.4.250.0040.00416.40
7.4.240.0030.00316.46
7.4.230.0030.00516.55
7.4.220.0080.01216.40
7.4.210.0050.01016.45
7.4.200.0030.00316.42
7.4.160.0100.00616.46
7.4.150.0100.00717.40
7.4.140.0140.00517.86
7.4.130.0080.01116.40
7.4.120.0150.00616.43
7.4.110.0060.01216.44
7.4.100.0140.00316.37
7.4.90.0030.01716.45
7.4.80.0090.01219.39
7.4.70.0060.01016.29
7.4.60.0060.01616.42
7.4.50.0030.01316.29
7.4.40.0030.01316.33
7.4.30.0130.01616.39
7.4.00.0080.00814.97
7.3.330.0020.00513.14
7.3.320.0000.00813.01
7.3.310.0000.00716.02
7.3.300.0000.00716.09
7.3.290.0070.00016.21
7.3.280.0080.01116.23
7.3.270.0060.01017.40
7.3.260.0050.01116.48
7.3.250.0080.01116.30
7.3.240.0100.00716.24
7.3.230.0080.00816.28
7.3.210.0100.00716.45
7.3.200.0090.00916.20
7.3.190.0080.00816.37
7.3.180.0050.01116.41
7.3.170.0060.00916.43
7.3.160.0100.00616.36
7.3.10.0120.00716.27
7.3.00.0200.00616.38
7.2.330.0070.01016.60
7.2.320.0060.01216.63
7.2.310.0090.00916.65
7.2.300.0110.01416.55
7.2.290.0080.01316.49
7.2.130.0180.00716.44
7.2.120.0180.01016.55
7.2.110.0090.00716.36
7.2.100.0150.00616.48
7.2.90.0110.00616.46
7.2.80.0090.00916.25
7.2.70.0130.00816.35
7.2.60.0160.00416.63
7.2.50.0120.01016.39
7.2.40.0070.00716.62
7.2.30.0100.00616.49
7.2.20.0130.00516.39
7.2.10.0100.00916.63
7.2.00.0070.01017.63
7.1.250.0100.00915.48
7.1.100.0000.01117.88
7.1.70.0000.00816.98
7.1.60.0430.01033.12
7.1.50.0530.00032.55
7.1.40.0430.01332.51
7.1.30.0430.01332.55
7.1.20.0500.00332.67
7.1.10.0230.01314.75
7.1.00.0930.01314.65
7.0.200.0300.01014.96
7.0.190.0330.00714.57
7.0.180.0470.01314.48
7.0.170.0400.00314.48
7.0.160.0370.00714.48
7.0.150.0300.00714.37
7.0.140.0400.00314.41
7.0.130.0330.01314.61
7.0.120.0400.00314.62
7.0.110.0370.00714.30
7.0.100.0430.00714.41
7.0.90.0330.01014.36
7.0.80.0400.00714.44
7.0.70.0400.00714.27
7.0.60.0370.00714.23
7.0.50.0330.01314.36
7.0.40.0330.01014.61
7.0.30.0330.01014.57
7.0.20.0400.00714.45
7.0.10.0330.01314.43
7.0.00.0430.00314.42

preferences:
34.8 ms | 401 KiB | 5 Q