3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar implements ArrayAccess { public $fields = []; /** * __construct * * @param mixed $eventInfo * @return void */ public function __construct($eventInfo) { // parent::__construct(); foreach ($eventInfo as $name => $value) { $this[$name] = $value; } } /** * getId * * @return void */ public function getId() { return $this; } /** * offsetExists * * @param mixed $name * @return void */ public function offsetExists($name) { return isset($this->fields[$name]); } /** * offsetGet * * @param mixed $name * @return void */ public function offsetGet($name) { return isset($this->fields[$name]) ? $this->fields[$name] : null; } /** * offsetSet * * @param mixed $name * @param mixed $value * @return void */ public function offsetSet($name, $value) { $this->fields[$name] = $value; } /** * offsetUnset * * @param mixed $name * @return void */ public function offsetUnset($name) { unset($this->fields[$name]); } } $eventInfo = ["name" => "A", "type" => "Programmer", "action" => "success"]; print_r((new bar($eventInfo))->getId());

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.5.30.0060.00417.66
8.5.20.0130.00519.50
8.5.10.0110.00716.73
8.5.00.0130.01020.16
8.4.180.0030.00819.76
8.4.170.0120.01020.53
8.4.160.0120.01023.95
8.4.150.0100.00616.89
8.4.140.0090.01117.43
8.4.130.0130.00618.46
8.4.120.0060.00324.02
8.4.110.0130.00718.11
8.4.100.0090.01018.68
8.4.90.0150.00520.77
8.4.80.0060.00318.84
8.4.70.0110.00819.06
8.4.60.0110.01018.80
8.4.50.0110.00820.22
8.4.40.0100.01018.04
8.4.30.0040.01518.82
8.4.20.0070.01020.59
8.4.10.0190.00020.54
8.3.300.0120.00720.91
8.3.290.0120.01020.95
8.3.280.0140.00818.64
8.3.270.0120.00916.48
8.3.260.0120.00816.53
8.3.250.0090.00618.98
8.3.240.0120.00917.07
8.3.230.0080.01216.88
8.3.220.0100.00818.76
8.3.210.0080.01018.53
8.3.200.0030.00516.54
8.3.190.0080.00817.06
8.3.180.0130.00618.94
8.3.170.0120.00320.47
8.3.160.0130.00717.08
8.3.150.0110.00717.13
8.3.140.0000.00716.66
8.3.130.0040.00418.55
8.3.120.0090.00020.65
8.3.110.0000.01520.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0090.00019.36
8.3.70.0120.00616.63
8.3.60.0100.00318.66
8.3.50.0110.00824.49
8.3.40.0070.01018.84
8.3.30.0000.01419.09
8.3.20.0090.00024.18
8.3.10.0060.00324.66
8.3.00.0070.00026.16
8.2.300.0110.00922.17
8.2.290.0110.00820.49
8.2.280.0060.00918.59
8.2.270.0070.01116.86
8.2.260.0150.00016.79
8.2.250.0050.00318.56
8.2.240.0030.01317.34
8.2.230.0040.00422.58
8.2.220.0100.01037.54
8.2.210.0070.00026.77
8.2.200.0050.00518.88
8.2.190.0120.00316.63
8.2.180.0070.00725.92
8.2.170.0070.00722.96
8.2.160.0130.00322.96
8.2.150.0020.00525.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00021.00
8.2.110.0070.00419.35
8.2.100.0090.00317.91
8.2.90.0040.00417.75
8.2.80.0080.00018.91
8.2.70.0070.00417.38
8.2.60.0060.00317.50
8.2.50.0030.00618.05
8.2.40.0060.00319.95
8.2.30.0040.00418.26
8.2.20.0040.00418.21
8.2.10.0040.00419.31
8.2.00.0040.00419.34
8.1.340.0100.01119.82
8.1.330.0090.01021.99
8.1.320.0110.01016.24
8.1.310.0040.01216.89
8.1.300.0060.00320.03
8.1.290.0100.00030.84
8.1.280.0030.01225.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0150.00028.09
8.1.240.0050.00523.69
8.1.230.0060.00620.87
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.53
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0050.00218.88
8.1.160.0040.00420.71
8.1.150.0000.00718.92
8.1.140.0000.00718.98
8.1.130.0000.01020.16
8.1.120.0040.00417.39
8.1.110.0030.00517.52
8.1.100.0060.00317.47
8.1.90.0000.00817.47
8.1.80.0030.00617.54
8.1.70.0030.00617.37
8.1.60.0030.00517.49
8.1.50.0040.00417.57
8.1.40.0040.00417.52
8.1.30.0040.00417.58
8.1.20.0040.00817.68
8.1.10.0040.00417.53
8.1.00.0060.00617.54
8.0.300.0000.00718.77
8.0.290.0060.00316.63
8.0.280.0070.00018.48
8.0.270.0000.00718.04
8.0.260.0000.00618.44
8.0.250.0050.00216.82
8.0.240.0000.00616.99
8.0.230.0000.00816.95
8.0.220.0000.00716.90
8.0.210.0080.00016.87
8.0.200.0020.00516.94
8.0.190.0000.00716.85
8.0.180.0040.00416.96
8.0.170.0030.00516.97
8.0.160.0030.00516.92
8.0.150.0070.00016.77
8.0.140.0050.00316.80
8.0.130.0030.00313.33
8.0.120.0000.00716.91
8.0.110.0030.00416.86
8.0.100.0040.00416.89
8.0.90.0030.00616.96
8.0.80.0060.01216.88
8.0.70.0080.00016.88
8.0.60.0040.00416.82
8.0.50.0020.00516.93
8.0.30.0070.01017.12
8.0.20.0130.01017.16
8.0.10.0070.00016.89
8.0.00.0090.00916.55
7.4.330.0000.00515.55
7.4.320.0000.00616.39
7.4.300.0000.00716.43
7.4.290.0000.00716.53
7.4.280.0080.00016.57
7.4.270.0070.00016.44
7.4.260.0060.00013.39
7.4.250.0030.00316.58
7.4.240.0030.00316.61
7.4.230.0000.00616.45
7.4.220.0050.00216.45
7.4.210.0080.00816.58
7.4.200.0070.00016.68
7.4.130.0070.01016.59
7.4.120.0170.00316.53
7.4.110.0090.00916.54
7.4.100.0100.00716.50
7.4.90.0060.01016.41
7.4.80.0060.01219.39
7.4.70.0070.01016.44
7.4.60.0090.00916.55
7.4.50.0100.00716.58
7.4.40.0040.01216.41
7.4.30.0070.01016.42
7.4.20.0030.01416.57
7.4.10.0030.01216.46
7.4.00.0160.00016.70
7.3.330.0000.00716.43
7.3.320.0050.00013.36
7.3.310.0040.00416.47
7.3.300.0030.00316.37
7.3.290.0040.01016.35
7.3.260.0170.00716.80
7.3.240.0150.00416.47
7.3.230.0120.00616.32
7.3.210.0100.00716.37
7.3.200.0100.00616.49
7.3.190.0090.00616.70
7.3.180.0140.00316.55
7.3.170.0060.00916.19
7.3.160.0100.00716.35
7.3.150.0130.00316.10
7.3.140.0080.00816.54
7.3.130.0100.00616.35
7.3.120.0090.00616.35
7.3.110.0090.00916.16
7.3.100.0160.00016.37
7.3.90.0030.01316.36
7.3.80.0120.00316.63
7.3.70.0060.00916.36
7.3.60.0120.00316.50
7.3.50.0090.00616.35
7.3.40.0130.00316.36
7.3.30.0070.01016.40
7.3.20.0110.00516.40
7.3.10.0070.01116.31
7.3.00.0100.00716.35
7.2.330.0000.01816.53
7.2.320.0070.01016.78
7.2.310.0110.00616.43
7.2.300.0110.01116.64
7.2.290.0070.01016.63
7.2.280.0120.00616.29
7.2.270.0060.01016.65
7.2.260.0040.01616.73
7.2.250.0130.00316.77
7.2.240.0150.00416.82
7.2.230.0110.00816.83
7.2.220.0130.00316.75
7.2.210.0060.01016.54
7.2.200.0060.01116.62
7.2.190.0130.00316.50
7.2.180.0060.01116.48
7.2.170.0170.00016.52
7.2.160.0100.00616.52
7.2.150.0070.01416.67
7.2.140.0060.01216.70
7.2.130.0070.01016.61
7.2.120.0090.00916.61
7.2.110.0140.00316.63
7.2.100.0030.01316.71
7.2.90.0120.00616.68
7.2.80.0120.00616.61
7.2.70.0120.00616.66
7.2.60.0070.01116.79
7.2.50.0150.00616.78
7.2.40.0070.01316.64
7.2.30.0140.00916.74
7.2.20.0050.01316.55
7.2.10.0260.00716.81
7.2.00.0110.00716.61

preferences:
111.26 ms | 1649 KiB | 5 Q