3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public function __construct($args= []) { $this->throwException($args) } private function throwException($args) { if(!array_key_exists('fullname', $args)) throw new \Exception("Fullname"); if(!array_key_exists('username', $args)) throw new \Exception("Fullname"); if(!array_key_exists('password', $args)) throw new \Exception("Fullname"); } } $u = new User(['fullname' => 'Chuck Norris', 'username' => 'Chuck', 'password' => '12345678']);

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)
5.4.320.0000.04719.22
5.4.310.0070.05318.95
5.4.300.0030.05018.94
5.4.290.0030.07719.25
5.4.280.0130.06719.08
5.4.270.0030.04718.85
5.4.260.0000.05018.85
5.4.250.0070.06718.84
5.4.240.0000.05719.19
5.4.230.0100.06318.94
5.4.220.0000.07319.19
5.4.210.0100.06319.31
5.4.200.0070.05318.94
5.4.190.0000.05018.97
5.4.180.0030.05019.09
5.4.170.0030.07719.05
5.4.160.0070.05318.99
5.4.150.0000.08019.07
5.4.140.0000.05716.35
5.4.130.0030.07016.71
5.4.120.0070.03716.51
5.4.110.0070.06016.40
5.4.100.0030.05316.45
5.4.90.0000.04316.45
5.4.80.0070.04016.57
5.4.70.0030.07016.54
5.4.60.0030.04716.25
5.4.50.0000.04016.54
5.4.40.0030.04316.54
5.4.30.0000.06716.53
5.4.20.0000.05716.57
5.4.10.0070.07716.42
5.4.00.0000.07315.79
5.3.290.0000.05014.64
5.3.280.0000.04014.52
5.3.270.0070.07314.52
5.3.260.0030.06314.82
5.3.250.0000.08314.82
5.3.240.0030.04714.58
5.3.230.0000.05714.67
5.3.220.0030.05014.48
5.3.210.0030.05714.73
5.3.200.0100.06314.66
5.3.190.0000.08014.53
5.3.180.0100.07314.46
5.3.170.0000.06314.72
5.3.160.0000.04714.64
5.3.150.0070.07014.64
5.3.140.0030.04714.42
5.3.130.0000.07014.45
5.3.120.0030.05714.53
5.3.110.0030.08014.46
5.3.100.0000.07314.15
5.3.90.0000.06013.92
5.3.80.0000.04014.06
5.3.70.0000.05314.24
5.3.60.0030.05313.91
5.3.50.0000.07013.84
5.3.40.0030.06014.16
5.3.30.0070.05713.81
5.3.20.0000.07013.77
5.3.10.0030.07013.55
5.3.00.0030.05313.57
5.2.170.0000.06312.52
5.2.160.0070.06012.52
5.2.150.0000.06712.52
5.2.140.0000.04712.52
5.2.130.0030.04712.52
5.2.120.0030.03312.52
5.2.110.0030.06012.52
5.2.100.0030.06012.52
5.2.90.0000.05012.52
5.2.80.0030.03712.52
5.2.70.0070.05712.52
5.2.60.0030.03012.52
5.2.50.0000.05712.52
5.2.40.0030.02712.52
5.2.30.0030.06012.52
5.2.20.0100.05712.52
5.2.10.0000.06012.52
5.2.00.0070.06012.52
5.1.60.0000.04312.52
5.1.50.0000.02712.52
5.1.40.0000.06312.52
5.1.30.0100.04712.52
5.1.20.0000.04712.52
5.1.10.0000.04312.52
5.1.00.0070.03312.52
5.0.50.0000.04712.52
5.0.40.0030.04012.52
5.0.30.0000.05312.52
5.0.20.0070.03712.52
5.0.10.0000.03012.52
5.0.00.0000.06712.52
4.4.90.0000.02012.52
4.4.80.0000.01712.52
4.4.70.0070.02312.52
4.4.60.0000.03312.52
4.4.50.0000.03012.52
4.4.40.0030.02712.52
4.4.30.0030.03312.52
4.4.20.0000.02312.52
4.4.10.0000.04012.52
4.4.00.0070.04312.52
4.3.110.0000.04012.52
4.3.100.0000.03012.52
4.3.90.0000.03012.52
4.3.80.0030.05312.52
4.3.70.0030.02712.52
4.3.60.0000.03312.52
4.3.50.0030.02712.52
4.3.40.0030.03312.52
4.3.30.0030.03312.52
4.3.20.0030.03312.52
4.3.10.0000.03712.52
4.3.00.0100.02012.52

preferences:
143.11 ms | 939 KiB | 8 Q