3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait OptionzTrait { protected $_options = array(); public function setOptions(array $options) { $this->_options = array_replace_recursive( $this->_options, $options ); } public function getOptions() { return $this->_options; } } class Optionz { use OptionzTrait; protected $_inception; public function __construct($options) { $this->_options = array( 'fact' => null, 'inception' => array( 'options' => array() ) ); $this->setOptions($options); } public function stateFact() { echo $this->_options['fact'] . "\n"; } public function getInception() { if ($this->_inception === null) { $this->_inception = new static($this->_options['inception']['options']); } return $this->_inception; } public function setInception(Optionz $inception) { $this->_inception = $inception; } } $optionz = new Optionz(array('inception' => array('options' => array('fact' => 'it is known')))); $optionz->getInception()->stateFact(); // caveat: nested properties are only propagated initially $optionz->getInception()->setOptions(array('fact' => 'this works')); $optionz->getInception()->stateFact(); $optionz->setInception(null); // try this $optionz->setOptions(array('inception' => array('options' => array('fact' => 'this doesnt')))); $optionz->getInception()->stateFact();

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.70.0070.00718.43
8.3.60.0070.01416.63
8.3.50.0170.00222.11
8.3.40.0150.00918.63
8.3.30.0040.01118.85
8.3.20.0070.00020.27
8.3.10.0000.00823.65
8.3.00.0050.00319.42
8.2.190.0100.00516.75
8.2.180.0180.00016.75
8.2.170.0040.01122.96
8.2.160.0110.00320.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.50
8.2.120.0000.00826.35
8.2.110.0120.00920.54
8.2.100.0120.00018.05
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0000.00918.03
8.2.50.0050.00318.07
8.2.40.0040.00419.39
8.2.30.0000.00720.69
8.2.20.0030.00717.73
8.2.10.0040.00418.07
8.2.00.0090.00018.16
8.1.280.0120.00625.92
8.1.270.0050.00523.83
8.1.260.0080.00028.09
8.1.250.0000.00728.09
8.1.240.0040.00423.84
8.1.230.0080.00319.07
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0000.00717.70
8.1.180.0040.00418.10
8.1.170.0050.00318.65
8.1.160.0060.00321.94
8.1.150.0000.00718.85
8.1.140.0000.00819.69
8.1.130.0000.00717.68
8.1.120.0030.00517.51
8.1.110.0040.00417.57
8.1.100.0060.00317.53
8.1.90.0000.00817.42
8.1.80.0000.00817.50
8.1.70.0030.00317.48
8.1.60.0030.00517.64
8.1.50.0000.00817.54
8.1.40.0080.00017.44
8.1.30.0060.00317.67
8.1.20.0040.00417.66
8.1.10.0000.00817.64
8.1.00.0070.00017.60
8.0.300.0070.00018.77
8.0.290.0000.00816.88
8.0.280.0070.00018.39
8.0.270.0040.00417.30
8.0.260.0000.00617.21
8.0.250.0030.00316.98
8.0.240.0070.00017.11
8.0.230.0030.00516.93
8.0.220.0050.00317.04
8.0.210.0000.00717.06
8.0.200.0050.00316.99
8.0.190.0040.00416.95
8.0.180.0040.00416.96
8.0.170.0080.00017.05
8.0.160.0000.00717.07
8.0.150.0070.00416.85
8.0.140.0040.00416.87
8.0.130.0000.00813.53
8.0.120.0000.00816.98
8.0.110.0040.00416.98
8.0.100.0040.00416.90
8.0.90.0000.00716.95
8.0.80.0080.00917.02
8.0.70.0000.00817.01
8.0.60.0000.00716.96
8.0.50.0070.00017.10
8.0.30.0120.00717.28
8.0.20.0140.01117.40
8.0.10.0050.00317.14
8.0.00.0090.01016.84
7.4.330.0000.00516.67
7.4.320.0070.00016.58
7.4.300.0030.00316.69
7.4.290.0040.00416.66
7.4.280.0000.00916.51
7.4.270.0070.00016.41
7.4.260.0030.00316.61
7.4.250.0070.00016.42
7.4.240.0040.00416.61
7.4.230.0080.00016.55
7.4.220.0150.00616.58
7.4.210.0040.01416.57
7.4.200.0030.00316.53
7.4.160.0160.00616.77
7.4.150.0110.01217.40
7.4.140.0140.00617.86
7.4.130.0080.01016.68
7.4.120.0050.01216.65
7.4.110.0040.01416.59
7.4.100.0180.00816.73
7.4.90.0080.00916.55
7.4.80.0120.00819.39
7.4.70.0030.01316.46
7.4.60.0090.00616.68
7.4.50.0090.00616.61
7.4.40.0070.01116.53
7.4.30.0100.00716.61
7.4.00.0100.00315.20
7.3.330.0040.00213.31
7.3.320.0060.00013.44
7.3.310.0030.00416.34
7.3.300.0000.00716.45
7.3.290.0070.00916.46
7.3.280.0110.00516.43
7.3.270.0090.00917.40
7.3.260.0100.01216.49
7.3.250.0080.01116.43
7.3.240.0140.00716.48
7.3.230.0070.01016.52
7.3.210.0030.01716.43
7.3.200.0000.01716.46
7.3.190.0110.00516.45
7.3.180.0060.00916.39
7.3.170.0130.00716.38
7.3.160.0030.01516.32
7.3.10.0090.00516.59
7.3.00.0050.00916.39
7.2.330.0030.01416.78
7.2.320.0110.00616.80
7.2.310.0130.00416.82
7.2.300.0040.01216.37
7.2.290.0000.01716.66
7.2.130.0060.00816.75
7.2.120.0050.00716.91
7.2.110.0050.01016.78
7.2.100.0050.01016.65
7.2.90.0020.00916.97
7.2.80.0020.00916.84
7.2.70.0030.01016.94
7.2.60.0110.00216.79
7.2.50.0030.00816.82
7.2.40.0020.01016.74
7.2.30.0090.00316.83
7.2.20.0050.00716.89
7.2.10.0050.00716.76
7.2.00.0060.00717.75
7.1.250.0040.00815.62
7.1.240.0040.01115.49
7.1.230.0100.00615.69
7.1.220.0150.00615.58
7.1.210.0030.00615.66
7.1.200.0070.00415.73
7.1.190.0060.00315.67
7.1.180.0090.00415.62
7.1.170.0090.00315.77
7.1.160.0040.01115.65
7.1.150.0060.00915.66
7.1.140.0030.01015.78
7.1.130.0080.00415.76
7.1.120.0110.00315.90
7.1.110.0070.00715.91
7.1.100.0130.00316.63
7.1.90.0000.01515.61
7.1.80.0030.00715.79
7.1.70.0080.00616.53
7.1.60.0050.00917.55
7.1.50.0040.01416.33
7.1.40.0100.00315.92
7.1.30.0030.00615.51
7.1.20.0090.00615.39
7.1.10.0040.00715.45
7.1.00.0080.04019.07
7.0.330.0030.00714.97
7.0.320.0090.00415.40
7.0.310.0000.01315.31
7.0.300.0000.01015.18
7.0.290.0000.01115.18
7.0.280.0060.00914.80
7.0.270.0040.01015.29
7.0.260.0040.00415.17
7.0.250.0070.00715.27
7.0.240.0030.01015.13
7.0.230.0040.00415.38
7.0.220.0060.00915.35
7.0.210.0070.00715.08
7.0.200.0030.00615.91
7.0.190.0070.00715.34
7.0.180.0000.01315.36
7.0.170.0060.00915.38
7.0.160.0000.01215.49
7.0.150.0060.00615.19
7.0.140.0060.00615.09
7.0.130.0060.01015.17
7.0.120.0060.00615.46
7.0.110.0070.00715.18
7.0.100.0000.01115.38
7.0.90.0030.00615.36
7.0.80.0000.01015.29
7.0.70.0000.00815.18
7.0.60.0070.03917.70
7.0.50.0030.04616.65
7.0.40.0090.02016.73
7.0.30.0140.03016.82
7.0.20.0080.04516.73
7.0.10.0020.04716.73
7.0.00.0070.04616.84
5.6.380.0070.00714.58
5.6.370.0040.00814.33
5.6.360.0060.00614.64
5.6.350.0040.00814.57
5.6.340.0100.00314.42
5.6.330.0060.00914.25
5.6.320.0030.01014.56
5.6.310.0100.00014.33
5.6.300.0060.00614.16
5.6.290.0030.01214.62
5.6.280.0070.03317.63
5.6.270.0000.01414.67
5.6.260.0070.00714.37
5.6.250.0090.00614.40
5.6.240.0030.01014.20
5.6.230.0090.00314.39
5.6.220.0090.00614.03
5.6.210.0050.03717.59
5.6.200.0080.03316.34
5.6.190.0080.04517.39
5.6.180.0280.04317.33
5.6.170.0120.02217.35
5.6.160.0080.04417.38
5.6.150.0050.04516.13
5.6.140.0070.04516.20
5.6.130.0030.02916.14
5.6.120.0060.02317.63
5.6.110.0120.04017.71
5.6.100.0080.04517.65
5.6.90.0030.03017.60
5.6.80.0130.02317.33
5.6.70.0000.00814.29
5.6.60.0090.00314.07
5.6.50.0110.00314.28
5.6.40.0070.00414.14
5.6.30.0030.00714.09
5.6.20.0090.00314.46
5.6.10.0060.00614.54
5.6.00.0110.00314.31
5.5.380.0060.00611.32
5.5.370.0080.00311.07
5.5.360.0030.00911.23
5.5.350.0160.03815.77
5.5.340.0120.03314.43
5.5.330.0150.04315.79
5.5.320.0050.04015.79
5.5.310.0180.03615.75
5.5.300.0080.04514.65
5.5.290.0040.03014.58
5.5.280.0050.04116.07
5.5.270.0040.02215.97
5.5.260.0090.04216.01
5.5.250.0030.02316.02
5.5.240.0090.03915.51
5.5.230.0000.00910.88
5.5.220.0030.01011.25
5.5.210.0030.00511.20
5.5.200.0030.00610.95
5.5.190.0040.00410.91
5.5.180.0070.00011.02
5.5.170.0000.01111.21
5.5.160.0090.00310.74
5.5.150.0030.00310.93
5.5.140.0030.00611.63
5.5.130.0040.00411.36
5.5.120.0030.00811.23
5.5.110.0040.00411.14
5.5.100.0000.00810.92
5.5.90.0080.00011.14
5.5.80.0050.00511.37
5.5.70.0060.00611.37
5.5.60.0040.00810.93
5.5.50.0040.00911.25
5.5.40.0040.00811.09
5.5.30.0050.00311.28
5.5.20.0050.00511.37
5.5.10.0000.01011.25
5.5.00.0070.00311.25

preferences:
65.71 ms | 402 KiB | 5 Q