3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $hostname = "localhost"; $dbname = "mydatabase"; $username = "myusername"; $pw = "mypassword"; $db = new PDO ("mysql:host=$hostname;dbname=$dbname","$username","$pw"); } catch (PDOException $e) { echo "Failed to get DB handle: " . $e->getMessage() . "\n"; exit; } echo 'Hello'; $section = 1; $userID = 99; $clean_html = 'test !!!!!!!!!'; $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->bindValue(':section', $section, PDO::PARAM_INT); $stmt->bindValue(':author', $userID, PDO::PARAM_INT); $stmt->bindValue(':content', $clean_html, PDO::PARAM_STR); if (!$stmt) { echo "\nPDO::errorInfo():\n"; print_r($dbh->errorInfo()); } echo 'Worked'; ?>

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.0070.01016.63
8.3.50.0070.00716.52
8.3.40.0070.00718.97
8.3.30.0120.00418.85
8.3.20.0080.00020.22
8.3.10.0080.00021.77
8.3.00.0040.00420.96
8.2.180.0090.00918.54
8.2.170.0050.00822.96
8.2.160.0070.00722.13
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.74
8.2.110.0100.00019.45
8.2.100.0040.00718.03
8.2.90.0050.00318.28
8.2.80.0080.00017.97
8.2.70.0090.00017.48
8.2.60.0000.00817.93
8.2.50.0000.00818.10
8.2.40.0050.00322.05
8.2.30.0050.00321.04
8.2.20.0000.00718.20
8.2.10.0040.00418.04
8.2.00.0000.00718.01
8.1.280.0140.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0090.00323.77
8.1.230.0060.00520.95
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0060.00317.23
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0070.00018.96
8.1.150.0050.00220.68
8.1.140.0040.00419.64
8.1.130.0000.00718.85
8.1.120.0040.00417.44
8.1.110.0000.00817.38
8.1.100.0000.00817.46
8.1.90.0000.00817.36
8.1.80.0000.01017.34
8.1.70.0040.00417.39
8.1.60.0040.00417.60
8.1.50.0000.00817.53
8.1.40.0080.00017.56
8.1.30.0080.00017.66
8.1.20.0000.00817.57
8.1.10.0000.00817.59
8.1.00.0040.00417.41
8.0.300.0000.00819.89
8.0.290.0050.00316.75
8.0.280.0040.00418.46
8.0.270.0030.00617.32
8.0.260.0030.00316.81
8.0.250.0000.00716.99
8.0.240.0060.00316.96
8.0.230.0040.00317.02
8.0.220.0000.00816.98
8.0.210.0000.00716.95
8.0.200.0030.00616.98
8.0.190.0000.00817.00
8.0.180.0030.00417.00
8.0.170.0040.00417.05
8.0.160.0000.00716.96
8.0.150.0080.00016.80
8.0.140.0040.00416.80
8.0.130.0060.00013.34
8.0.120.0030.00516.94
8.0.110.0030.00616.87
8.0.100.0040.00416.97
8.0.90.0000.00716.96
8.0.80.0070.01016.96
8.0.70.0030.00516.95
8.0.60.0000.00716.93
8.0.50.0000.00716.77
8.0.30.0080.01117.12
8.0.20.0100.01517.40
8.0.10.0030.00316.89
8.0.00.0100.00716.79
7.4.330.0000.00515.55
7.4.320.0030.00316.59
7.4.300.0040.00416.53
7.4.290.0030.00316.48
7.4.280.0030.00616.64
7.4.270.0070.00016.51
7.4.260.0000.00613.21
7.4.250.0000.00916.50
7.4.240.0000.00816.54
7.4.230.0070.00016.40
7.4.220.0060.01216.57
7.4.210.0080.00816.59
7.4.200.0030.00316.44
7.4.160.0080.01016.62
7.4.150.0140.00417.40
7.4.140.0050.01517.86
7.4.130.0140.01116.45
7.4.120.0120.00616.58
7.4.110.0120.00416.51
7.4.100.0060.01216.61
7.4.90.0090.00916.59
7.4.80.0070.01819.39
7.4.70.0070.01316.68
7.4.60.0060.01016.55
7.4.50.0060.00916.37
7.4.40.0200.02316.38
7.4.30.0120.00916.40
7.4.00.0070.01214.89
7.3.330.0000.00613.25
7.3.320.0070.00013.32
7.3.310.0070.00016.37
7.3.300.0040.00416.24
7.3.290.0000.00716.45
7.3.280.0080.00816.41
7.3.270.0060.01217.40
7.3.260.0070.01116.58
7.3.250.0080.01016.56
7.3.240.0100.00716.37
7.3.230.0060.01616.56
7.3.210.0120.00616.52
7.3.200.0040.01216.56
7.3.190.0060.01116.63
7.3.180.0090.00916.58
7.3.170.0060.00916.44
7.3.160.0060.00916.40
7.3.120.0110.00714.84
7.3.110.0060.01014.98
7.3.100.0070.00715.03
7.3.90.0030.00915.00
7.3.80.0090.00614.82
7.3.70.0030.01214.88
7.3.60.0030.00614.91
7.3.50.0070.00714.62
7.3.40.0040.00415.01
7.3.30.0070.00715.00
7.3.20.0070.00716.72
7.3.10.0000.01816.79
7.3.00.0090.00616.46
7.2.330.0090.00916.66
7.2.320.0070.01016.79
7.2.310.0100.00616.36
7.2.300.0040.01816.47
7.2.290.0100.00716.61
7.2.250.0100.01015.24
7.2.240.0120.00915.23
7.2.230.0090.00614.98
7.2.220.0060.00915.27
7.2.210.0030.00815.21
7.2.200.0030.01015.12
7.2.190.0030.00615.11
7.2.180.0080.00315.18
7.2.170.0110.00415.20
7.2.60.0040.01117.16
7.2.00.0030.01019.50
7.1.330.0000.01415.84
7.1.320.0070.00415.80
7.1.310.0060.00315.83
7.1.300.0000.01415.44
7.1.290.0030.00615.88
7.1.280.0100.00315.70
7.1.270.0060.00915.56
7.1.260.0070.01015.64
7.1.200.0070.00315.85
7.1.100.0030.01018.35
7.1.70.0000.00717.09
7.1.60.0670.00333.41
7.1.50.0200.01032.92
7.1.40.0200.01032.68
7.1.30.0530.01032.63
7.1.20.0530.01332.69
7.1.10.0100.00314.50
7.1.00.0470.00014.73
7.0.200.0530.00714.93
7.0.190.0530.00715.02
7.0.180.0370.01314.25
7.0.170.0070.00714.14
7.0.160.0370.00314.45
7.0.150.0370.00714.49
7.0.140.0100.00714.48
7.0.130.0070.01014.57
7.0.120.0070.01014.81
7.0.110.0300.00714.77
7.0.100.0370.01014.38
7.0.90.0370.00714.70
7.0.80.0130.01314.75
7.0.70.0030.01014.58
7.0.60.0100.00714.24
7.0.50.0330.01014.48
7.0.40.0130.00314.59
7.0.30.0330.01014.70
7.0.20.0030.01714.50
7.0.10.0030.01714.35
7.0.00.0430.01314.66

preferences:
37.96 ms | 401 KiB | 5 Q