3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); /** * @author Abel de Beer <abel@thispagecannotbefound.com> */ class Slot { /** * @var mixed */ public $listener; /** * @var boolean */ public $once; function __construct($listener, $once) { $this->listener = $listener; $this->once = $once; } } /** * @author Abel de Beer <abel@thispagecannotbefound.com> */ class OnceSignal implements OnceSignalInterface { /** * @var Slot[] */ protected $slots; function __construct() { $this->slots = array(); } public function addOnce($listener) { $this->slots[] = new Slot($listener, true); } public function dispatch() { foreach ($this->slots as $index => $slot) { if ($slot->once) { unset($this->slots[$index]); } $callback = $slot->listener; call_user_func($callback); } } } function myListener() { echo __FILE__.' : '.__LINE__."\n"; } $signal = new OnceSignal(); $signal->addOnce('myListener'); $signal->dispatch();

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.0070.01418.43
8.3.50.0120.00522.00
8.3.40.0090.00918.63
8.3.30.0070.00719.09
8.3.20.0040.00420.15
8.3.10.0040.00423.36
8.3.00.0040.00420.69
8.2.180.0120.00316.75
8.2.170.0110.00422.96
8.2.160.0070.00722.21
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0030.00622.25
8.2.100.0040.00817.88
8.2.90.0000.00819.23
8.2.80.0030.00618.03
8.2.70.0000.00817.63
8.2.60.0000.00817.93
8.2.50.0030.00518.07
8.2.40.0000.00718.09
8.2.30.0000.00818.06
8.2.20.0040.00417.78
8.2.10.0000.00717.78
8.2.00.0070.00017.66
8.1.280.0100.00725.92
8.1.270.0040.00422.23
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0000.00923.84
8.1.230.0000.01119.07
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0000.01017.35
8.1.190.0050.00317.40
8.1.180.0040.00418.10
8.1.170.0040.00418.55
8.1.160.0060.00322.08
8.1.150.0030.00518.59
8.1.140.0040.00417.28
8.1.130.0030.00317.82
8.1.120.0040.00417.45
8.1.110.0040.00417.39
8.1.100.0040.00417.48
8.1.90.0030.00517.44
8.1.80.0070.00017.34
8.1.70.0070.00017.36
8.1.60.0060.00317.52
8.1.50.0000.00917.46
8.1.40.0000.00717.48
8.1.30.0040.00417.58
8.1.20.0070.00017.53
8.1.10.0040.00417.38
8.1.00.0080.00017.47
8.0.300.0000.00718.77
8.0.290.0000.00717.16
8.0.280.0030.00318.45
8.0.270.0050.00217.27
8.0.260.0030.00316.86
8.0.250.0000.00716.91
8.0.240.0000.00717.02
8.0.230.0000.00717.02
8.0.220.0030.00316.94
8.0.210.0070.00016.95
8.0.200.0040.00417.04
8.0.190.0030.00317.04
8.0.180.0000.00716.87
8.0.170.0000.00717.02
8.0.160.0000.00816.95
8.0.150.0040.00416.97
8.0.140.0000.00716.97
8.0.130.0050.00013.39
8.0.120.0030.00516.96
8.0.110.0000.00816.92
8.0.100.0000.00817.08
8.0.90.0040.00417.03
8.0.80.0130.00316.97
8.0.70.0070.00016.75
8.0.60.0050.00316.81
8.0.50.0070.00016.82
8.0.30.0080.01017.03
8.0.20.0110.01017.40
8.0.10.0000.00817.06
8.0.00.0090.00917.01
7.4.330.0000.00515.07
7.4.320.0000.00616.39
7.4.300.0030.00316.37
7.4.290.0000.00716.36
7.4.280.0030.00316.59
7.4.270.0070.00016.36
7.4.260.0040.00416.58
7.4.250.0040.00416.54
7.4.240.0030.00516.50
7.4.230.0040.00416.43
7.4.220.0090.00916.49
7.4.210.0060.01016.59
7.4.200.0000.00816.55
7.4.190.0000.00816.70
7.4.160.0140.00716.66
7.4.150.0110.00617.40
7.4.140.0100.01017.86
7.4.130.0120.00516.47
7.4.120.0100.01116.74
7.4.110.0000.01716.46
7.4.100.0140.00316.46
7.4.90.0120.00616.49
7.4.80.0030.01619.39
7.4.70.0070.01016.46
7.4.60.0060.01016.45
7.4.50.0070.00016.64
7.4.40.0140.00322.77
7.4.30.0080.00816.39
7.4.00.0030.01015.00
7.3.330.0000.00513.22
7.3.320.0060.00013.11
7.3.310.0070.00016.13
7.3.300.0000.00716.31
7.3.290.0090.01216.32
7.3.280.0090.01216.28
7.3.270.0080.01117.40
7.3.260.0100.01016.30
7.3.250.0120.00716.43
7.3.240.0150.00316.41
7.3.230.0130.00316.52
7.3.210.0070.01016.16
7.3.200.0100.01016.43
7.3.190.0100.00616.38
7.3.180.0150.00616.49
7.3.170.0060.01116.46
7.3.160.0060.01016.34
7.3.120.0000.01814.91
7.2.330.0060.01216.24
7.2.320.0110.01216.53
7.2.310.0090.00916.45
7.2.300.0120.00616.59
7.2.290.0060.01016.23
7.2.00.0110.00019.13
7.1.100.0000.00917.80
7.1.70.0050.00216.91
7.1.60.0070.01819.32
7.1.50.0030.00716.53
7.1.00.0100.07022.34
7.0.200.0000.01016.65
7.0.140.0030.07722.07
7.0.60.0130.07319.75
7.0.50.0070.08317.89
7.0.40.0100.08320.18
7.0.30.0230.04320.25
7.0.20.0130.04320.14
7.0.10.0100.06720.23
7.0.00.0100.07720.08
5.6.280.0000.07721.11
5.6.210.0030.05020.52
5.6.200.0030.04018.24
5.6.190.0070.07320.33
5.6.180.0270.04320.50
5.6.170.0200.06020.54
5.6.160.0000.08320.46
5.6.150.0100.04718.21
5.6.140.0100.03318.23
5.6.130.0070.08018.21
5.6.120.0100.05021.13
5.6.110.0170.05721.00
5.6.100.0100.08321.09
5.6.90.0100.07720.96
5.6.80.0070.06720.30
5.6.70.2830.03320.38
5.5.350.0030.07720.43
5.5.340.0030.04017.98
5.5.330.0100.06020.32
5.5.320.0200.07320.34
5.5.310.0330.05720.41
5.5.300.0070.08018.02
5.5.290.0070.08017.99
5.5.280.0070.04020.89
5.5.270.0000.04720.80
5.5.260.0270.06020.68
5.5.250.0100.08720.71
5.5.240.0100.07320.13
5.4.450.0870.05019.47
5.4.440.0830.07019.30
5.4.430.0170.04319.56
5.4.420.0670.00019.68
5.4.410.0130.05318.97
5.4.400.0200.04718.77
5.4.390.0200.05318.75
5.4.380.0170.06018.79
5.4.370.0170.04718.70
5.4.360.0130.04318.74
5.4.350.0070.03612.03
5.4.340.0070.03612.02
5.4.320.0060.03512.52
5.4.310.0080.03612.52
5.4.300.0070.04112.51
5.4.290.0070.03912.51
5.4.280.0070.05312.38
5.4.270.0100.05112.39
5.4.260.0080.05612.39
5.4.250.0090.05112.38
5.4.240.0090.05112.38
5.4.230.0330.13212.38
5.4.220.0100.10012.38
5.4.210.0150.09212.38
5.4.200.0280.09412.38
5.4.190.0150.09212.37
5.4.180.0080.05212.38
5.4.170.0150.12412.38
5.4.160.0180.11212.38
5.4.150.0230.13012.37
5.4.140.0150.17812.05
5.4.130.0120.04812.04
5.4.120.0080.05512.00
5.4.110.0090.07712.00
5.4.100.0110.07612.00
5.4.90.0100.05212.00
5.4.80.0100.06212.00
5.4.70.0090.04912.00
5.4.60.0140.04412.00
5.4.50.0140.04611.98
5.4.40.0140.05311.98
5.4.30.0080.05711.97
5.4.20.0080.05511.97
5.4.10.0100.05111.97
5.4.00.0120.04811.46
5.3.290.0060.03812.80
5.3.280.0100.09312.71
5.3.270.0210.10712.72
5.3.260.0130.05612.72
5.3.250.0050.05612.72
5.3.240.0130.04912.72
5.3.230.0070.05312.71
5.3.220.0070.05612.68
5.3.210.0090.05912.68
5.3.200.0100.05012.68
5.3.190.0060.05612.68
5.3.180.0130.04712.67
5.3.170.0120.05512.67
5.3.160.0110.05112.68
5.3.150.0100.05412.67
5.3.140.0160.05912.66
5.3.130.0110.05512.66
5.3.120.0080.07312.66
5.3.110.0420.12512.66
5.3.100.0210.10312.12
5.3.90.0280.09812.09
5.3.80.0440.10812.07
5.3.70.0130.09312.08
5.3.60.0130.04712.07
5.3.50.0090.08012.01
5.3.40.0310.09912.01
5.3.30.0060.06911.96
5.3.20.0080.05811.76
5.3.10.0110.05511.71
5.3.00.0180.07011.71
5.2.170.0080.0499.20
5.2.160.0080.0499.20
5.2.150.0060.0609.20
5.2.140.0040.0659.20
5.2.130.0070.0499.16
5.2.120.0100.0459.16
5.2.110.0060.0499.17
5.2.100.0080.0469.17
5.2.90.0080.0499.16
5.2.80.0100.0509.16
5.2.70.0050.0549.16
5.2.60.0290.0639.11
5.2.50.0150.0909.09
5.2.40.0240.0719.06
5.2.30.0160.0839.04
5.2.20.0270.0959.02
5.2.10.0130.0838.93
5.2.00.0160.0758.80
5.1.60.0050.0348.09
5.1.50.0040.0348.08
5.1.40.0040.0358.07
5.1.30.0080.0358.41
5.1.20.0080.0368.44
5.1.10.0070.0368.16
5.1.00.0070.0398.16
5.0.50.0090.0306.63
5.0.40.0080.0316.50
5.0.30.0040.0536.30
5.0.20.0040.0276.28
5.0.10.0070.0266.26
5.0.00.0020.0456.25
4.4.90.0040.0234.78
4.4.80.0060.0214.76
4.4.70.0040.0354.75
4.4.60.0110.0384.76
4.4.50.0080.0264.77
4.4.40.0080.0324.71
4.4.30.0060.0334.76
4.4.20.0270.0664.84
4.4.10.0110.0384.84
4.4.00.0030.0534.76
4.3.110.0100.0354.67
4.3.100.0060.0414.66
4.3.90.0080.0384.63
4.3.80.0100.0774.59
4.3.70.0020.0184.63
4.3.60.0140.0574.62
4.3.50.0060.0234.62
4.3.40.0030.0364.53
4.3.30.0060.0383.29
4.3.20.0000.0513.27
4.3.10.0020.0453.23
4.3.00.0000.0237.09

preferences:
35.66 ms | 401 KiB | 5 Q