3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Outside of the application, e.g. DB or some storage. function addSomeIntegerFieldToDB($value) { $sql = 'INSERT INTO mytable (integer_field) VALUES (:int)'; // $st = $pdo->prepare($sql); // $st->execute(array('int' => $value); } // the application: global $conditional; $conditional = true; class X { public function doSmth($id) { // Assertion will run independently of $conditional, thus preventing a wrong $id to be passed to ->doSmth() method assert(is_int($id), \Exception('wot ar y doin')); global $conditional; if ($conditional) { addSomeIntegerFieldToDB($id); } } } $obj = new X; $obj->doSmth(13);

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.0040.01118.55
8.3.50.0040.01118.30
8.3.40.0150.00018.79
8.3.30.0080.00818.52
8.3.20.0040.00420.20
8.3.10.0000.00820.52
8.3.00.0040.00421.91
8.2.180.0070.00716.50
8.2.170.0110.00422.96
8.2.160.0070.00722.16
8.2.150.0040.00424.18
8.2.140.0030.00724.66
8.2.130.0080.00020.70
8.2.120.0030.00626.35
8.2.110.0090.00019.39
8.2.100.0100.00017.80
8.2.90.0080.00019.05
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0000.00817.80
8.2.50.0000.00818.09
8.2.40.0030.00622.24
8.2.30.0070.00019.39
8.2.20.0040.00417.58
8.2.10.0000.00718.04
8.2.00.0040.00418.06
8.1.280.0080.00825.92
8.1.270.0000.01422.14
8.1.260.0100.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.54
8.1.230.0000.01117.64
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.25
8.1.180.0030.00618.10
8.1.170.0000.00818.58
8.1.160.0040.00420.71
8.1.150.0040.00418.75
8.1.140.0000.00819.52
8.1.130.0030.00317.64
8.1.120.0020.00517.30
8.1.110.0000.00717.35
8.1.100.0040.00317.32
8.1.90.0030.00317.43
8.1.80.0070.00017.38
8.1.70.0000.00717.43
8.1.60.0040.00417.57
8.1.50.0080.00017.54
8.1.40.0000.00817.49
8.1.30.0040.00417.62
8.1.20.0030.00617.47
8.1.10.0000.00717.45
8.1.00.0070.00317.59
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0080.00018.26
8.0.270.0070.00017.25
8.0.260.0070.00017.13
8.0.250.0030.00316.87
8.0.240.0000.00716.93
8.0.230.0030.00316.86
8.0.220.0000.00716.89
8.0.210.0000.00716.77
8.0.200.0020.00516.94
8.0.190.0030.00316.94
8.0.180.0050.00216.82
8.0.170.0000.00816.93
8.0.160.0030.00416.79
8.0.150.0000.00716.86
8.0.140.0040.00416.77
8.0.130.0000.00513.28
8.0.120.0030.00616.89
8.0.110.0040.00416.85
8.0.100.0000.00716.75
8.0.90.0040.00416.77
8.0.80.0100.00716.78
8.0.70.0040.00416.92
8.0.60.0080.00016.77
8.0.50.0000.00817.01
8.0.30.0070.01217.31
8.0.20.0120.00717.40
8.0.10.0030.00517.06
8.0.00.0100.00716.85
7.4.330.0020.00216.71
7.4.320.0030.00316.47
7.4.300.0060.00016.60
7.4.290.0030.00316.53
7.4.280.0080.00316.58
7.4.270.0030.00316.61
7.4.260.0000.00816.48
7.4.250.0040.00416.41
7.4.240.0040.00416.42
7.4.230.0070.00016.35
7.4.220.0070.01116.57
7.4.210.0170.00016.54
7.4.200.0080.00016.48
7.4.160.0130.00416.73
7.4.150.0140.01017.40
7.4.140.0290.02417.86
7.4.130.0140.00416.50
7.4.120.0130.00516.65
7.4.110.0130.00316.71
7.4.100.0110.00916.39
7.4.90.0000.01716.54
7.4.80.0100.01319.39
7.4.70.0070.01416.68
7.4.60.0060.01016.47
7.4.50.0080.00616.26
7.4.40.0120.00416.35
7.4.30.0040.01416.48
7.4.10.0070.01014.89
7.4.00.0070.01015.04
7.3.330.0000.00513.34
7.3.320.0030.00313.39
7.3.310.0040.00416.32
7.3.300.0000.00716.38
7.3.290.0130.00516.30
7.3.280.0120.00716.33
7.3.270.0100.00717.40
7.3.260.0070.01016.36
7.3.250.0180.00916.40
7.3.240.0110.00916.28
7.3.230.0110.00716.48
7.3.210.0080.01116.24
7.3.200.0100.00716.49
7.3.190.0030.01316.40
7.3.180.0090.01316.26
7.3.170.0090.00816.49
7.3.160.0050.01016.45
7.3.130.0080.01014.79
7.3.120.0070.00914.77
7.3.110.0080.00814.81
7.3.100.0080.00714.87
7.3.90.0080.00814.73
7.3.80.0010.01114.83
7.3.70.0060.00914.74
7.3.60.0020.01214.71
7.3.50.0070.00714.62
7.3.40.0050.00614.87
7.3.30.0030.00914.75
7.3.20.0050.00816.54
7.3.10.0020.01116.59
7.3.00.0060.00816.48
7.2.330.0030.01416.75
7.2.320.0030.02216.50
7.2.310.0060.01216.38
7.2.300.0030.01316.54
7.2.290.0060.01716.68
7.2.260.0070.01015.11
7.2.250.0050.01215.13
7.2.240.0060.00914.96
7.2.230.0090.00615.09
7.2.220.0070.00915.13
7.2.210.0110.00515.18
7.2.200.0090.00514.97
7.2.190.0060.00815.00
7.2.180.0050.00815.15
7.2.170.0050.01114.80
7.2.160.0040.00715.10
7.2.150.0010.00816.91
7.2.140.0060.00916.81
7.2.130.0050.01016.91
7.2.120.0070.00616.76
7.2.110.0090.00616.77
7.2.100.0070.00916.95
7.2.90.0050.00516.71
7.2.80.0040.00716.80
7.2.70.0030.01016.93
7.2.60.0040.00816.86
7.2.50.0050.00816.64
7.2.40.0000.01316.89
7.2.30.0070.00516.73
7.2.20.0080.00616.94
7.2.10.0090.00516.94
7.2.00.0080.00617.71
7.1.330.0030.01015.73
7.1.320.0060.01115.81
7.1.310.0040.01215.69
7.1.300.0080.00715.71
7.1.290.0040.00915.70
7.1.280.0080.00315.45
7.1.270.0040.00715.77
7.1.260.0050.00715.79
7.1.250.0060.01015.74
7.1.240.0090.00115.79
7.1.230.0060.00615.70
7.1.220.0030.00915.64
7.1.210.0040.00715.77
7.1.200.0030.01015.79
7.1.190.0030.00815.54
7.1.180.0020.01015.54
7.1.170.0060.00415.75
7.1.160.0100.00415.66
7.1.150.0060.00615.69
7.1.140.0110.00415.74
7.1.130.0020.00915.74
7.1.120.0050.00915.63
7.1.110.0020.00815.74
7.1.100.0060.00616.50
7.1.90.0030.00915.73
7.1.80.0100.00515.66
7.1.70.0080.00516.10
7.1.60.0090.00816.91
7.1.50.0050.01115.97
7.1.40.0050.01015.88
7.1.30.0050.01015.80
7.1.20.0080.00815.56
7.1.10.0080.00815.74
7.1.00.0030.03217.86
7.0.330.0040.00715.25
7.0.320.0080.00315.44
7.0.310.0020.01015.29
7.0.300.0070.00315.25
7.0.290.0070.00615.40
7.0.280.0040.00815.26
7.0.270.0060.00515.36
7.0.260.0030.00815.47
7.0.250.0030.00715.36
7.0.240.0070.00815.17
7.0.230.0050.00815.45
7.0.220.0070.00715.39
7.0.210.0080.00815.35
7.0.200.0100.01015.27
7.0.190.0060.00615.30
7.0.180.0000.01115.37
7.0.170.0070.00415.34
7.0.160.0060.00915.47
7.0.150.0070.00715.45
7.0.140.0020.01115.41
7.0.130.0060.00815.29
7.0.120.0030.01015.21
7.0.110.0060.01015.29
7.0.100.0030.00815.28
7.0.90.0070.00415.34
7.0.80.0040.01115.24
7.0.70.0100.00515.30
7.0.60.0110.03017.51
7.0.50.0060.01916.30
7.0.40.0080.01915.69
7.0.30.0210.02615.59
7.0.20.0130.02415.71
7.0.10.0080.02915.58
7.0.00.0040.03415.62
5.6.400.0080.00514.47
5.6.390.0050.00914.31
5.6.380.0000.01114.26
5.6.370.0060.00614.35
5.6.360.0090.00014.31
5.6.350.0040.00914.16
5.6.340.0060.00514.35
5.6.330.0070.00514.38
5.6.320.0080.00614.11
5.6.310.0080.00614.31
5.6.300.0030.00914.46
5.6.290.0060.00814.20
5.6.280.0030.02016.36
5.6.270.0020.00914.28
5.6.260.0020.01014.30
5.6.250.0030.01114.44
5.6.240.0080.00414.21
5.6.230.0020.01214.32
5.6.220.0010.01214.35
5.6.210.0040.03416.50
5.6.200.0080.03415.67
5.6.190.0050.02116.45
5.6.180.0110.02716.25
5.6.170.0100.03316.28
5.6.160.0030.03516.38
5.6.150.0090.02715.61
5.6.140.0070.02115.61
5.6.130.0080.02915.63
5.6.120.0080.01816.56
5.6.110.0110.02316.55
5.6.100.0060.03316.53
5.6.90.0050.03316.54
5.6.80.0070.03116.34
5.6.70.0020.01114.09
5.6.60.0030.01014.21
5.6.50.0110.00314.11
5.6.40.0020.01014.50
5.6.30.0020.01014.08
5.6.20.0000.01314.07
5.6.10.0050.01014.05
5.6.00.0070.00714.17
5.5.380.0050.01114.22
5.5.370.0040.00714.04
5.5.360.0090.00714.26
5.5.350.1380.01716.34
5.5.340.0040.02315.53
5.5.330.0070.01816.30
5.5.320.0280.02516.21
5.5.310.0110.02616.15
5.5.300.0050.03315.36
5.5.290.0030.03515.51
5.5.280.0040.02616.47
5.5.270.0060.03216.57
5.5.260.0020.03016.45
5.5.250.0050.03416.32
5.5.240.0140.01416.13
5.5.230.0060.00313.99
5.5.220.0020.01114.06
5.5.210.0020.01314.10
5.5.200.0000.01014.33
5.5.190.0080.00314.07
5.5.180.0080.00414.26
5.5.170.0030.00814.38
5.5.160.0030.00813.96
5.5.150.0040.00614.08
5.5.140.0020.00914.31
5.5.130.0080.00614.10
5.5.120.0110.00314.24
5.5.110.0030.01014.05
5.5.100.0040.00714.18
5.5.90.0060.00814.24
5.5.80.0050.01114.20
5.5.70.0030.01114.31
5.5.60.0010.01014.09
5.5.50.0040.00914.10
5.5.40.0070.00914.12
5.5.30.0020.01014.20
5.5.20.0050.00814.01
5.5.10.0030.00714.40
5.5.00.0060.00514.08

preferences:
61.26 ms | 401 KiB | 5 Q