3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** Object responsible for echoing debug data **/ class EchoLogger implements \SplObserver { public function update($data) { echo $data . PHP_EOL; } } /** Object responsible for emailing debug data **/ class EmailLogger implements \SplObserver { public function update($data) { /** Mail your data **/ } } class HttpClientService implements \SplSubject { private $observers = array(); public function getRand() { return $this->rand; } public function getStatus() { return $this->status; } public function attach(\SplObserver $observer) { $this->observers[] = $observer; } public function detach(\SplObserver $observer) { if($key = array_search($observer,$this->observers, true)) { unset($this->observers[$key]); } } public function notify() { foreach ($this->observers as $observer) { $observer->update($this); } } public function getServiceStatus() { // -- SNIP -- $this->rand = rand(0, 10); $this->status = ($this->rand >= 5) ? 'success' : 'error'; // -- Snip -- return $this->status; } } $service = new HttpClientService; $service->attach(new EchoLogger);

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)
7.2.00.0000.01219.11
7.1.70.0000.01017.03
7.1.60.0100.01419.25
7.1.50.0060.01516.70
7.1.00.0030.07722.57
7.0.200.0070.00316.72
7.0.140.0000.07722.09
7.0.60.0070.08020.05
7.0.50.0000.06717.91
7.0.40.0070.08020.11
7.0.30.0330.04720.13
7.0.20.0330.07320.06
7.0.10.0070.08720.06
7.0.00.0100.03720.23
5.6.280.0030.07321.09
5.6.210.0070.06320.77
5.6.200.0100.08318.19
5.6.190.0130.08020.61
5.6.180.4000.04320.49
5.6.170.0230.04020.71
5.6.160.0100.08320.61
5.6.150.0030.06718.21
5.6.140.0070.08318.14
5.6.130.0000.04318.18
5.6.120.0000.04321.00
5.6.110.0000.06721.14
5.6.100.0070.04021.13
5.6.90.0100.08021.01
5.6.80.0070.07720.43
5.6.70.3470.03720.31
5.5.350.0030.07320.35
5.5.340.0130.07718.07
5.5.330.0170.07720.36
5.5.320.2770.05020.19
5.5.310.0270.07720.30
5.5.300.0170.07718.08
5.5.290.0030.08017.97
5.5.280.0170.07020.70
5.5.270.0070.08020.69
5.5.260.0070.06720.66
5.5.250.0000.07320.81
5.5.240.0270.07020.26
5.4.450.0270.04719.17
5.4.440.0200.04019.54
5.4.430.0130.04019.48
5.4.420.0400.03719.55
5.4.410.0500.04019.33
5.4.400.0130.03719.23
5.4.390.0170.04019.13
5.4.380.0930.05718.78
5.4.370.1100.05718.77
5.4.360.1000.04018.59
5.4.350.0770.05318.48
5.4.340.0930.05318.83
5.4.320.0070.04212.52
5.4.310.0060.04412.51
5.4.300.0090.03712.52
5.4.290.0070.03912.51
5.4.280.0010.04212.41
5.4.270.0030.03912.40
5.4.260.0100.03512.40
5.4.250.0040.04012.40
5.4.240.0060.03612.41
5.4.230.0060.03912.39
5.4.220.0030.03912.39
5.4.210.0050.04212.39
5.4.200.0120.04012.39
5.4.190.0080.03612.40
5.4.180.0100.03312.39
5.4.170.0080.03312.41
5.4.160.0070.03512.40
5.4.150.0080.03612.40
5.4.140.0070.03612.08
5.4.130.0080.03912.07
5.4.120.0080.03712.03
5.4.110.0030.04212.02
5.4.100.0070.03812.02
5.4.90.0050.03712.02
5.4.80.0040.04212.03
5.4.70.0070.03312.02
5.4.60.0030.03712.02
5.4.50.0050.03612.02
5.4.40.0070.03312.00
5.4.30.0120.03212.01
5.4.20.0080.04212.00
5.4.10.0090.03212.00
5.4.00.0070.03611.50
5.3.290.0060.04612.80
5.3.280.0100.04312.71
5.3.270.0040.04212.72
5.3.260.0060.04212.72
5.3.250.0060.03712.71
5.3.240.0040.04012.72
5.3.230.0040.03912.71
5.3.220.0080.03412.68
5.3.210.0050.04612.68
5.3.200.0050.04312.68
5.3.190.0070.03712.68
5.3.180.0070.03612.68
5.3.170.0070.03712.67
5.3.160.0070.03612.68
5.3.150.0060.03712.68
5.3.140.0070.04112.67
5.3.130.0100.04112.66
5.3.120.0060.03912.66
5.3.110.0110.04712.66
5.3.100.0040.03812.15
5.3.90.0020.04112.14
5.3.80.0070.03812.13
5.3.70.0040.03912.13
5.3.60.0110.03912.11
5.3.50.0080.04112.06
5.3.40.0080.03412.05
5.3.30.0060.04412.01
5.3.20.0070.04011.80
5.3.10.0070.03311.77
5.3.00.0050.04111.75
5.2.170.0060.0319.24
5.2.160.0010.0359.23
5.2.150.0060.0369.24
5.2.140.0050.0309.24
5.2.130.0050.0289.20
5.2.120.0050.0309.20
5.2.110.0040.0299.21
5.2.100.0080.0349.20
5.2.90.0060.0319.20
5.2.80.0060.0289.20
5.2.70.0060.0359.20
5.2.60.0090.0349.16
5.2.50.0060.0409.12
5.2.40.0040.0289.10
5.2.30.0070.0309.07
5.2.20.0030.0309.06
5.2.10.0090.0318.96
5.2.00.0060.0328.84
5.1.60.0090.0268.12
5.1.50.0070.0298.12
5.1.40.0070.0338.10
5.1.30.0080.0248.44
5.1.20.0040.0318.47
5.1.10.0070.0288.19
5.1.00.0100.0228.19
5.0.50.0040.0216.67
5.0.40.0020.0216.53
5.0.30.0050.0306.34
5.0.20.0030.0206.30
5.0.10.0030.0206.28
5.0.00.0040.0326.28
4.4.90.0050.0164.78
4.4.80.0030.0174.76
4.4.70.0050.0134.76
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0030.0254.70
4.4.30.0030.0144.76
4.4.20.0030.0154.85
4.4.10.0020.0164.85
4.4.00.0020.0254.76
4.3.110.0050.0134.67
4.3.100.0010.0164.67
4.3.90.0020.0154.63
4.3.80.0030.0244.58
4.3.70.0020.0154.63
4.3.60.0040.0134.63
4.3.50.0040.0144.63
4.3.40.0010.0254.54
4.3.30.0010.0173.30
4.3.20.0040.0143.28
4.3.10.0030.0143.23
4.3.00.0030.01715.27

preferences:
36.52 ms | 400 KiB | 5 Q