3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Context { private int $a; private int $b; /** * @param int $a */ public function setA(int $a): self { $new = new self(); $new->setA($a); $new->setB($this->b); return $new; } public function setB(int $b): self { $new = new self(); $new->setA($this->a); $new->setB($b); return $new; } public function getData(): array { return [ 'a' => $this->a, 'b' => $this->b, ]; } } function test(Context &$context) { $context = $context->setB(5); } $context = new Context(); $context = $context->setA(2); test($context); var_dump($context->getData());

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.0640.44396.29
8.5.20.0970.47495.48
8.5.10.0630.46593.55
8.5.00.0930.47893.25
8.4.180.0450.02860.07
8.4.170.0530.02264.41
8.4.160.0490.02163.60
8.4.150.0550.02060.33
8.4.140.0640.02480.87
8.4.130.0660.02580.75
8.4.120.0760.02481.01
8.4.110.0710.02380.87
8.4.100.0590.02081.09
8.4.90.0830.03081.10
8.4.80.0700.02480.87
8.4.70.0840.02980.95
8.4.60.0640.02081.05
8.4.50.0670.02781.14
8.4.40.0680.02680.78
8.4.30.0800.02780.81
8.4.20.0730.03280.82
8.4.10.0860.03380.94
8.3.300.0560.02466.31
8.3.290.0530.02565.68
8.3.280.0600.03162.88
8.3.270.0810.03179.80
8.3.260.0790.02279.69
8.3.250.0700.02079.86
8.3.240.0750.02379.66
8.3.230.0720.02579.83
8.3.220.0790.01979.82
8.3.210.0620.01779.81
8.3.200.0530.01879.70
8.3.190.0740.02579.72
8.3.180.0710.02079.88
8.3.170.0680.01779.63
8.3.160.0690.02179.81
8.3.150.1030.02579.99
8.3.140.0770.02879.70
8.3.130.0640.02079.86
8.3.120.0730.02879.82
8.3.110.0670.01979.78
8.3.100.0610.02179.79
8.3.90.0630.02279.65
8.3.80.0590.02079.89
8.3.70.0570.01979.68
8.3.60.0800.03279.84
8.3.50.0520.01279.78
8.3.40.0450.01645.37
8.3.30.0510.01445.15
8.3.20.0500.01445.30
8.3.10.0530.01645.27
8.3.00.0280.01845.12
8.2.300.0510.02762.79
8.2.290.0720.02279.79
8.2.280.0730.02779.90
8.2.270.0560.02279.88
8.2.260.0740.02879.61
8.2.250.0500.01679.85
8.2.240.0680.01879.63
8.2.230.0740.01979.62
8.2.220.0670.02379.57
8.2.210.0830.02579.53
8.2.200.0730.02579.71
8.2.190.0810.02579.86
8.2.180.0750.02779.79
8.2.170.0550.02247.13
8.2.160.0470.02047.06
8.2.150.0560.01647.10
8.2.140.0350.01647.07
8.2.130.0410.01847.03
8.2.120.0540.01647.11
8.2.110.0550.02046.96
8.2.100.0390.01647.09
8.2.90.0380.01847.13
8.2.80.0430.01547.02
8.2.70.0420.01246.85
8.2.60.0420.01447.01
8.2.50.0460.02446.83
8.2.40.0620.02246.92
8.2.30.0620.01346.89
8.2.20.0470.01846.89
8.2.10.0450.02146.94
8.2.00.0530.02246.89
8.1.340.0510.02562.60

preferences:
16.47 ms | 475 KiB | 5 Q