3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Events { private $events = Array(); function __construct(){} function bind($eventName,Closure $callback) { if (!array_key_exists($eventName,$this->events)) { $this->events[$eventName] = $callback; } } function trig($eventName) { if(array_key_exists($eventName, $this->events)) { call_user_func($this->events[$eventName]); } } } function sayHello() { print("Hello world."); } $e = new Events; $e->bind('hello',sayHello); sleep(15); $e->trig('hello');

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.0110.01116.75
8.3.50.0160.00522.05
8.3.40.0060.00918.70
8.3.30.0060.01318.79
8.3.20.0000.00719.97
8.3.10.0000.00821.89
8.3.00.0050.00321.65
8.2.180.0130.00918.54
8.2.170.0110.00422.96
8.2.160.0090.00622.20
8.2.150.0030.00524.18
8.2.140.0000.00724.66
8.2.130.0040.00420.69
8.2.120.0110.00426.35
8.2.110.0060.00319.21
8.2.100.0040.00817.93
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0090.00017.75
8.2.60.0050.00317.80
8.2.50.0000.00818.09
8.2.40.0000.00720.53
8.2.30.0000.00719.56
8.2.20.0000.00917.69
8.2.10.0080.00018.13
8.2.00.0000.00718.11
8.1.280.0090.00625.92
8.1.270.0030.00622.15
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0100.00022.57
8.1.230.0110.00017.89
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.22
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0000.00820.77
8.1.150.0050.00320.61
8.1.140.0030.00519.50
8.1.130.0070.00017.64
8.1.120.0050.00317.35
8.1.110.0000.00717.45
8.1.100.0000.00717.40
8.1.90.0090.00017.38
8.1.80.0030.00317.38
8.1.70.0000.00717.35
8.1.60.0040.00417.49
8.1.50.0040.00417.41
8.1.40.0040.00417.44
8.1.30.0030.00517.59
8.1.20.0030.00617.62
8.1.10.0030.00517.61
8.1.00.0040.00417.57
8.0.300.0000.00818.77
8.0.290.0080.00016.63
8.0.280.0000.00818.37
8.0.270.0030.00317.26
8.0.260.0030.00317.29
8.0.250.0090.00017.01
8.0.240.0040.00417.06
8.0.230.0000.00717.07
8.0.220.0000.00716.97
8.0.210.0000.00716.95
8.0.200.0000.00717.01
8.0.190.0060.00316.88
8.0.180.0000.00716.98
8.0.170.0030.00617.01
8.0.160.0000.00717.00
8.0.150.0040.00417.01
8.0.140.0040.00417.00
8.0.130.0030.00313.38
8.0.120.0000.00816.84
8.0.110.0040.00416.97
8.0.100.0040.00416.94
8.0.90.0040.00416.84
8.0.80.0090.01216.94
8.0.70.0040.00416.98
8.0.60.0040.00417.01
8.0.50.0040.00416.82
8.0.30.0090.01217.01
8.0.20.0130.00917.40
8.0.10.0040.00417.14
8.0.00.0120.00616.71
7.4.330.0020.00216.67
7.4.320.0040.00416.62
7.4.300.0000.00716.55
7.4.290.0000.00816.51
7.4.280.0000.00716.63
7.4.270.0030.00316.38
7.4.260.0030.00616.41
7.4.250.0040.00416.41
7.4.240.0000.00716.61
7.4.230.0000.00716.63
7.4.220.0130.00616.57
7.4.210.0090.00716.56
7.4.200.0040.00416.32
7.4.160.0150.00616.52
7.4.150.0140.00517.40
7.4.140.0140.00717.86
7.4.130.0080.01016.61
7.4.120.0100.00816.60
7.4.110.0230.02016.67
7.4.100.0140.00716.61
7.4.90.0090.01016.64
7.4.80.0150.00919.39
7.4.70.0100.01016.50
7.4.60.0070.01016.51
7.4.50.0070.01016.46
7.4.40.0160.00816.59
7.4.30.0090.00916.57
7.4.00.0070.01015.00
7.3.330.0000.00713.29
7.3.320.0030.00313.21
7.3.310.0030.00316.32
7.3.300.0000.00616.23
7.3.290.0030.00316.34
7.3.280.0030.01416.35
7.3.270.0070.01517.40
7.3.260.0100.00716.46
7.3.250.0090.00816.50
7.3.240.0080.01116.42
7.3.230.0170.00016.39
7.3.210.0100.00716.46
7.3.200.0090.01319.39
7.3.190.0110.00516.37
7.3.180.0130.00316.34
7.3.170.0060.01716.30
7.3.160.0130.00316.35
7.2.330.0040.01316.84
7.2.320.0090.00916.46
7.2.310.0100.00716.67
7.2.300.0030.01516.55
7.2.290.0090.00616.58
7.2.110.0290.00716.43
7.2.60.0070.00716.77
7.2.00.0080.00419.21
7.1.200.0000.01515.71
7.1.100.0090.00318.12
7.1.70.0000.01117.06
7.1.60.0000.01319.40
7.1.50.0030.01816.75
7.1.00.0100.07022.48
7.0.200.0050.00516.78
7.0.60.0200.07321.71
7.0.50.0130.07017.98
7.0.40.0070.08720.26
7.0.30.0200.07720.14
7.0.20.0270.06020.19
7.0.10.0070.04320.06
7.0.00.0100.06020.23
5.6.210.0070.07720.55
5.6.200.0100.08018.19
5.6.190.0070.09020.58
5.6.180.0170.08020.50
5.6.170.0230.04320.41
5.6.160.0170.06020.44
5.6.150.0000.04318.14
5.6.140.0130.07718.15
5.6.130.0030.04718.15
5.6.120.0070.07321.05
5.6.110.0200.06321.15
5.6.100.0100.06021.14
5.6.90.0130.07021.08
5.6.80.0130.07720.45
5.5.350.0170.08020.41
5.5.340.0000.07718.08
5.5.330.0100.04720.30
5.5.320.0400.04720.34
5.5.310.0270.07720.35
5.5.300.0030.08318.01
5.5.290.0030.04017.98
5.5.280.0100.08320.97
5.5.270.0070.08320.79
5.5.260.0100.08320.87
5.5.250.0130.07720.61
5.5.240.0130.07020.16

preferences:
48 ms | 401 KiB | 5 Q