3v4l.org

run code in 300+ PHP versions simultaneously
<?php class KeyValuePairs { private $pairs; public function __construct( $arr = []) { $this->pairs = []; foreach( $arr as $k => $k) { $this->pairs[$k] = $v; } } public function __get($name) { return (isset($this->pairs[$name])) ? $this->pairs[$name] : null; } public function __set($name, $value) { $this->pairs[$name] = $value; } } class MyClass { public $foo; public $bar; public function __construct() { $this->bar = new KeyValuePairs( ['tool' => 'Here we go']); } public function __get($name) { return (isset($this->$name)) ? $this->$name : null; } } $class1 = new MyClass; var_dump($class1->foo); // null var_dump($class1->boo); // null var_dump($class1->bar->tool); // 'Here we go' var_dump($class1->bar->mars);

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.0080.00816.88
8.3.50.0090.00522.05
8.3.40.0070.01018.84
8.3.30.0110.01119.26
8.3.20.0040.00420.38
8.3.10.0080.00021.73
8.3.00.0000.00817.80
8.2.180.0120.00617.00
8.2.170.0070.00722.96
8.2.160.0140.00020.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00820.73
8.2.110.0090.00022.25
8.2.100.0080.00418.22
8.2.90.0000.00819.22
8.2.80.0080.00017.97
8.2.70.0000.00917.75
8.2.60.0000.01118.03
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0050.00318.32
8.2.20.0000.00817.88
8.2.10.0040.00418.19
8.2.00.0060.00317.69
8.1.280.0170.00025.92
8.1.270.0120.00323.99
8.1.260.0070.00026.35
8.1.250.0090.00028.09
8.1.240.0080.00023.80
8.1.230.0110.00019.15
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.23
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0030.00522.05
8.1.150.0000.00718.90
8.1.140.0040.00417.37
8.1.130.0000.00717.75
8.1.120.0040.00417.44
8.1.110.0040.00417.46
8.1.100.0000.00717.37
8.1.90.0000.00817.36
8.1.80.0000.00817.45
8.1.70.0030.00317.43
8.1.60.0040.00417.46
8.1.50.0080.00017.52
8.1.40.0040.00417.48
8.1.30.0080.00017.66
8.1.20.0000.00817.55
8.1.10.0040.00417.44
8.1.00.0040.00417.40
8.0.300.0030.00518.77
8.0.290.0000.00716.75
8.0.280.0000.00818.36
8.0.270.0030.00317.26
8.0.260.0080.00017.20
8.0.250.0070.00016.93
8.0.240.0070.00016.91
8.0.230.0030.00317.02
8.0.220.0000.00616.87
8.0.210.0000.00616.91
8.0.200.0030.00616.93
8.0.190.0040.00317.07
8.0.180.0050.00216.97
8.0.170.0050.00316.90
8.0.160.0040.00416.93
8.0.150.0040.00416.79
8.0.140.0050.00416.96
8.0.130.0060.00013.39
8.0.120.0050.00316.90
8.0.110.0070.00017.00
8.0.100.0000.00717.07
8.0.90.0000.00716.91
8.0.80.0060.00916.95
8.0.70.0000.00816.81
8.0.60.0040.00416.84
8.0.50.0040.00416.82
8.0.30.0160.00517.00
8.0.20.0090.01117.40
8.0.10.0050.00317.18
8.0.00.0090.00816.99
7.4.330.0020.00215.09
7.4.320.0030.00316.58
7.4.300.0000.00616.61
7.4.290.0040.00416.58
7.4.280.0000.00816.64
7.4.270.0070.00016.52
7.4.260.0030.00616.45
7.4.250.0040.00416.49
7.4.240.0020.00516.60
7.4.230.0070.00016.61
7.4.220.0090.00916.48
7.4.210.0130.00316.57
7.4.200.0000.00716.40
7.4.160.0040.01216.43
7.4.150.0070.01317.40
7.4.140.0120.00517.86
7.4.130.0060.01316.53
7.4.120.0100.00616.53
7.4.110.0090.00916.79
7.4.100.0170.00016.60
7.4.90.0110.00716.50
7.4.80.0110.00919.39
7.4.70.0160.00016.44
7.4.60.0060.01216.63
7.4.50.0030.00516.46
7.4.40.0130.00416.66
7.4.30.0060.01016.74
7.4.00.0130.00314.79
7.3.330.0000.00513.45
7.3.320.0070.00013.36
7.3.310.0000.00716.46
7.3.300.0030.00616.45
7.3.290.0100.00716.46
7.3.280.0080.00916.44
7.3.270.0180.00017.40
7.3.260.0120.01216.44
7.3.250.0090.00916.45
7.3.240.0040.01316.59
7.3.230.0100.00716.39
7.3.210.0080.00816.44
7.3.200.0080.00819.39
7.3.190.0030.01716.48
7.3.180.0060.00916.64
7.3.170.0120.00916.39
7.3.160.0060.00916.54
7.3.120.0090.00615.02
7.3.00.0040.00816.42
7.2.330.0100.00716.50
7.2.320.0080.00816.80
7.2.310.0090.00916.49
7.2.300.0080.00816.83
7.2.290.0030.01316.70
7.2.130.0100.00316.95
7.2.120.0070.00716.63
7.2.110.0090.00316.79
7.2.100.0090.00316.97
7.2.90.0070.00716.70
7.2.80.0070.00716.76
7.2.70.0080.00817.05
7.2.60.0030.00716.71
7.2.50.0000.01116.79
7.2.40.0000.01417.00
7.2.30.0060.00316.94
7.2.20.0100.00316.91
7.2.10.0120.00016.95
7.2.00.0050.00516.99
7.1.250.0090.00315.96
7.1.240.0030.00915.57
7.1.230.0030.01515.86
7.1.220.0070.00715.74
7.1.210.0110.00315.98
7.1.200.0040.00815.71
7.1.190.0030.01015.53
7.1.180.0030.01015.93
7.1.170.0040.00815.76
7.1.160.0030.00715.98
7.1.150.0060.00615.56
7.1.140.0040.00715.80
7.1.130.0030.00715.68
7.1.120.0040.00715.77
7.1.110.0000.01015.68
7.1.100.0040.00815.85
7.1.90.0070.00715.59
7.1.80.0000.01315.77
7.1.70.0030.00616.47
7.1.60.0050.00716.45
7.1.50.0050.00716.29
7.1.40.0060.00716.35
7.1.30.0050.00816.14
7.1.20.0100.00416.18
7.1.10.0020.01016.16
7.1.00.0010.00716.09
7.0.330.0090.00015.48
7.0.320.0040.00715.46
7.0.310.0070.00715.38
7.0.300.0080.00415.20
7.0.290.0030.01015.27
7.0.280.0070.00715.17
7.0.270.0000.00715.35
7.0.260.0030.00615.45
7.0.250.0070.00715.47
7.0.240.0050.00315.25
7.0.230.0030.00915.57
7.0.220.0130.00015.39
7.0.210.0040.00715.32
7.0.200.0040.00516.08
7.0.190.0010.00715.96
7.0.180.0020.00915.66
7.0.170.0020.00815.99
7.0.160.0030.00715.79
7.0.150.0030.00615.73
7.0.140.0060.00615.89
7.0.130.0040.00415.86
7.0.120.0060.00615.86
7.0.110.0060.00715.91
7.0.100.0030.00715.93
7.0.90.0040.00515.77
7.0.80.0030.00915.96
7.0.70.0010.00915.67
7.0.60.0020.01015.72
7.0.50.0020.00715.82
7.0.40.0050.00614.41
7.0.30.0050.00514.58
7.0.20.0030.00914.46
7.0.10.0030.00614.43
7.0.00.0080.00214.55
5.6.380.0030.01314.48
5.6.370.0000.01114.19
5.6.360.0000.00914.84
5.6.350.0040.00714.50
5.6.340.0070.00414.38
5.6.330.0040.00814.45
5.6.320.0070.00714.70
5.6.310.0060.00614.63
5.6.300.0080.02117.68
5.6.290.0050.02417.78
5.6.280.0060.02317.67
5.6.270.0080.01917.72
5.6.260.0040.02517.63
5.6.250.0030.02617.65
5.6.240.0030.02517.72
5.6.230.0050.02517.57
5.6.220.0050.02517.50
5.6.210.0080.02217.44
5.6.200.0190.02117.63
5.6.190.0070.02517.63
5.6.180.0030.02617.57
5.6.170.0020.02817.43
5.6.160.0030.02717.56
5.6.150.0030.02417.67
5.6.140.0070.02817.67
5.6.130.0060.04217.58
5.6.120.0030.03417.63
5.6.110.0070.02617.51
5.6.100.0100.02817.74
5.6.90.0090.02717.68
5.6.80.0040.02317.30
5.6.70.0080.02417.34
5.6.60.0090.02417.48
5.6.50.0090.01917.28
5.6.40.0050.02317.31
5.6.30.0000.02717.36
5.6.20.0080.02217.28
5.6.10.0090.02217.18
5.6.00.0110.01917.30
5.5.380.0030.02214.47
5.5.370.0040.02214.29
5.5.360.0050.02814.25
5.5.350.0130.02414.42
5.5.340.0040.02614.59
5.5.330.0080.02014.75
5.5.320.0030.03114.47
5.5.310.0060.02214.80
5.5.300.0070.03514.82
5.5.290.0050.03814.64
5.5.280.0050.03414.57
5.5.270.0030.02414.50
5.5.260.0020.02614.78
5.5.250.0080.02214.38
5.5.240.0090.01614.24
5.5.230.0020.02514.25
5.5.220.0040.02414.04
5.5.210.0030.03114.19
5.5.200.0040.02114.33
5.5.190.0050.02514.43
5.5.180.0060.02014.19
5.5.170.0130.00011.00
5.5.160.0060.02514.36
5.5.150.0060.02114.30
5.5.140.0030.02214.14
5.5.130.0070.03814.23
5.5.120.0040.02414.11
5.5.110.0070.02114.23
5.5.100.0030.02314.35
5.5.90.0040.02314.29
5.5.80.0020.02214.16
5.5.70.0020.02414.19
5.5.60.0070.03414.25
5.5.50.0030.03514.36
5.5.40.0020.02314.35
5.5.30.0030.02614.26
5.5.20.0020.04414.27
5.5.10.0130.01714.21
5.5.00.0080.03614.35
5.4.450.0030.05215.25
5.4.440.0000.03615.12
5.4.430.0040.02615.14
5.4.420.0070.02115.26
5.4.410.0070.02515.10
5.4.400.0070.01815.03
5.4.390.0040.02214.99
5.4.380.0070.02514.94
5.4.370.0110.02615.10
5.4.360.0030.02314.93
5.4.350.0080.02015.13
5.4.340.0080.02115.07
5.4.330.0000.00811.19
5.4.320.0020.02215.18
5.4.310.0080.02515.12
5.4.300.0050.02215.06
5.4.290.0020.02414.85
5.4.280.0060.02315.02
5.4.270.0120.02515.10
5.4.260.0030.02415.07
5.4.250.0050.02215.01
5.4.240.0040.02515.09
5.4.230.0070.01714.93
5.4.220.0030.02814.96
5.4.210.0070.02415.17
5.4.200.0040.03915.03
5.4.190.0050.02715.08
5.4.180.0140.02615.06
5.4.170.0050.02015.00
5.4.160.0030.02414.92
5.4.150.0030.02314.96
5.4.140.0040.02113.74
5.4.130.0070.02813.83
5.4.120.0030.02313.75
5.4.110.0010.02413.80
5.4.100.0000.02613.80
5.4.90.0000.02413.95
5.4.80.0130.02013.73
5.4.70.0090.02513.83
5.4.60.0020.02213.83
5.4.50.0020.02313.75
5.4.40.0030.04413.80
5.4.30.0030.02013.86
5.4.20.0020.04113.73
5.4.10.0050.02313.80
5.4.00.0100.01813.59
5.3.290.0040.02813.01
5.3.280.0040.04412.94
5.3.270.0060.01812.86
5.3.260.0020.02113.00
5.3.250.0040.02112.91
5.3.240.0020.03012.93
5.3.230.0040.03912.95
5.3.220.0030.04012.83
5.3.210.0040.02412.96
5.3.200.0020.02512.95
5.3.190.0030.02412.96
5.3.180.0020.02413.02
5.3.170.0050.02112.89
5.3.160.0080.02112.95
5.3.150.0030.02213.04
5.3.140.0000.02612.86
5.3.130.0060.02212.98
5.3.120.0040.03513.02
5.3.110.0000.02512.86
5.3.100.0060.01913.02
5.3.90.0010.02413.04
5.3.80.0030.02312.98
5.3.70.0020.02012.98
5.3.60.0030.01912.93
5.3.50.0020.02412.98
5.3.40.0050.02612.98
5.3.30.0050.01913.02
5.3.20.0030.02512.96
5.3.10.0040.02312.92
5.3.00.0050.01812.83
5.2.170.0030.01912.53
5.2.160.0030.01812.53
5.2.150.0040.02412.53
5.2.140.0020.02812.54
5.2.130.0030.02312.53
5.2.120.0020.01812.53
5.2.110.0050.01612.53
5.2.100.0050.01712.53
5.2.90.0020.01912.53
5.2.80.0000.02112.53
5.2.70.0010.02112.53
5.2.60.0050.01712.53
5.2.50.0070.01812.53
5.2.40.0050.01612.53
5.2.30.0050.02112.53
5.2.20.0070.03112.53
5.2.10.0040.01712.53
5.2.00.0050.01512.53
5.1.60.0060.01512.53
5.1.50.0020.01612.53
5.1.40.0010.01712.53
5.1.30.0070.01812.53
5.1.20.0010.02212.53
5.1.10.0090.01612.53
5.1.00.0050.01412.53
5.0.50.0050.01612.53
5.0.40.0100.01212.53
5.0.30.0050.02712.53
5.0.20.0050.01112.53
5.0.10.0100.01012.53
5.0.00.0090.01612.53
4.4.90.0000.01112.53
4.4.80.0050.00812.53
4.4.70.0030.01412.53
4.4.60.0030.01112.53
4.4.50.0020.00812.53
4.4.40.0020.01712.53
4.4.30.0050.00812.53
4.4.20.0080.00912.53
4.4.10.0080.01312.53
4.4.00.0030.01712.53
4.3.110.0070.00712.53
4.3.100.0090.01012.53
4.3.90.0050.01012.53
4.3.80.0090.01412.53
4.3.70.0110.01612.53
4.3.60.0110.00912.53
4.3.50.0100.01712.53
4.3.40.0020.01412.53
4.3.30.0000.01812.53
4.3.20.0040.01412.53
4.3.10.0040.00912.53
4.3.00.0030.00812.53

preferences:
47.25 ms | 401 KiB | 5 Q