3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Session { private $started = false; public function start() { if ($this->started) { return; } session_start(); $this->started = true; } } class AutostartingSessionBag implements ArrayAccess { private $session; public function __construct(Session $session) { $this->session = $session; } public function offsetExists($offset) { $this->ensureSessionStarted(); return isset($_SESSION[$offset]); } public function offsetGet($offset) { $this->ensureSessionStarted(); return $_SESSION[$offset]; } public function offsetSet($offset, $vaue) { $this->ensureSessionStarted(); $_SESSION[$offset] = $value; } public function offsetUnset($offset) { $this->ensureSessionStarted(); unset($_SESSION[$offset]); } private function ensureSessionStarted() { $this->session->start(); } } //var_dump($_SESSION); $_SESSION = new AutostartingSessionBag(new Session()); //var_dump($_SESSION); $_SESSION['test'] = 'foobar'; var_dump($_SESSION);

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.40.0190.00019.63
8.3.30.0100.00619.07
8.3.20.0060.00322.44
8.3.10.0050.00524.02
8.3.00.0030.00622.15
8.2.170.0070.01122.96
8.2.160.0110.00422.46
8.2.150.0110.00024.18
8.2.140.0070.00324.66
8.2.130.0000.00920.72
8.2.120.0070.00326.35
8.2.110.0030.00722.58
8.2.100.0070.00718.59
8.2.90.0040.00418.34
8.2.80.0000.00818.00
8.2.70.0000.00818.13
8.2.60.0030.00518.30
8.2.50.0030.00718.07
8.2.40.0000.00818.60
8.2.30.0060.00319.12
8.2.20.0040.00718.53
8.2.10.0000.00818.59
8.2.00.0060.00319.44
8.1.270.0050.00524.29
8.1.260.0030.00626.35
8.1.250.0160.00428.09
8.1.240.0070.00319.77
8.1.230.0040.00821.35
8.1.220.0040.00819.04
8.1.210.0060.00319.32
8.1.200.0030.00717.84
8.1.190.0000.00817.72
8.1.180.0120.00418.91
8.1.170.0040.00419.02
8.1.160.0000.00719.34
8.1.150.0080.00020.74
8.1.140.0080.00019.90
8.1.130.0040.00418.36
8.1.120.0000.00818.17
8.1.110.0060.00318.23
8.1.100.0000.00918.95
8.1.90.0030.00617.95
8.1.80.0030.00618.13
8.1.70.0030.00618.27
8.1.60.0060.00318.38
8.1.50.0070.00318.07
8.1.40.0000.00818.06
8.1.30.0070.00318.93
8.1.20.0110.00018.37
8.1.10.0030.00618.26
8.1.00.0040.00418.10
8.0.300.0000.00720.03
8.0.290.0030.00516.75
8.0.280.0080.00018.54
8.0.270.0070.00016.84
8.0.260.0030.00317.36
8.0.250.0030.00316.93
8.0.240.0060.00317.10
8.0.230.0040.00417.06
8.0.220.0020.00516.88
8.0.210.0040.00416.98
8.0.200.0000.00717.02
8.0.190.0050.00316.97
8.0.180.0070.00017.09
8.0.170.0040.00416.97
8.0.160.0090.00016.95
8.0.150.0030.00516.96
8.0.140.0000.00716.85
8.0.130.0030.00313.48
8.0.120.0000.00816.98
8.0.110.0000.00716.93
8.0.100.0000.00816.93
8.0.90.0040.00416.81
8.0.80.0110.00416.98
8.0.70.0040.00417.02
8.0.60.0000.00716.82
8.0.50.0030.00616.97
8.0.30.0100.01017.02
8.0.20.0100.01117.40
8.0.10.0040.00417.12
8.0.00.0160.00516.77
7.4.330.0020.00215.55
7.4.320.0000.00616.64
7.4.300.0060.00016.46
7.4.290.0060.00316.60
7.4.280.0030.00616.54
7.4.270.0000.00716.40
7.4.260.0030.00316.61
7.4.250.0000.00716.64
7.4.240.0000.00716.65
7.4.230.0040.00416.64
7.4.220.0040.00416.35
7.4.210.0070.00916.63
7.4.200.0000.00716.75
7.4.160.0110.00616.62
7.4.150.0060.01217.40
7.4.140.0120.00817.86
7.4.130.0140.00516.82
7.4.120.0120.00716.62
7.4.110.0100.00616.56
7.4.100.0170.00716.72
7.4.90.0090.00916.63
7.4.80.0090.01219.39
7.4.70.0080.00916.75
7.4.60.0140.00316.32
7.4.50.0060.01216.59
7.4.40.0070.01116.31
7.4.30.0060.00916.74
7.4.00.0000.01514.88
7.3.330.0060.00013.27
7.3.320.0000.00613.41
7.3.310.0000.00816.55
7.3.300.0050.00216.50
7.3.290.0030.00316.27
7.3.280.0130.00316.49
7.3.270.0100.00717.40
7.3.260.0080.01016.43
7.3.250.0080.01016.48
7.3.240.0130.00516.57
7.3.230.0190.00316.64
7.3.210.0110.00816.54
7.3.200.0070.01016.56
7.3.190.0090.00616.48
7.3.180.0040.01216.68
7.3.170.0170.00716.73
7.3.160.0000.01716.54
7.2.330.0090.00916.62
7.2.320.0150.00916.65
7.2.310.0040.01316.89
7.2.300.0120.00616.62
7.2.290.0130.00516.57
7.2.60.0110.00417.07
7.2.20.0060.01217.89
7.2.10.0150.00417.54
7.2.00.0440.00517.63
7.1.200.0090.00315.65
7.1.140.0130.00316.84
7.1.130.0440.01116.80
7.1.120.0150.01216.86
7.1.110.0390.01016.26
7.1.100.0300.00816.20
7.1.90.0440.00916.13
7.1.80.0400.01215.85
7.1.70.0460.01115.27
7.1.60.0450.00933.16
7.1.50.0430.01533.12
7.1.40.0410.01332.61
7.1.30.0470.00732.63
7.1.20.0420.01532.84
7.1.10.0270.01014.69
7.1.00.0280.00914.77

preferences:
56.91 ms | 400 KiB | 5 Q