3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Event { private $eventName; function __construct($eventName){ $this->eventName = $eventName; } public function name() { return $this->eventName; } } class QueueManager { private $registeredHandlers = array(); public function addEventListener($eventName, $handler) { if (!isset($this->registeredHandlers[$eventName]) || !is_array($this->registeredHandlers[$eventName])) $this->registeredHandlers[$eventName] = array(); $this->registeredHandlers[$eventName][] = $handler; } public function dispatch($event, &...$args) { $eventName = $event->name(); if (!$this->registeredHandlers[$eventName]) return; foreach ($this->registeredHandlers[$eventName] as $handler) call_user_func_array($handler, $args); } } $qm = new QueueManager(); $qm->addEventListener('click', function(){echo 'ok1';}); //something like this working $qm->addEventListener('click', function(){echo 'ok2';}); $qm->addEventListener('adding', function(&$x){$x = 5;}); //something like this not working $qm->addEventListener('adding', function($x){$x++;}); $qm->addEventListener('adding', function($x){echo $x;}); $clickEvent = new Event('click'); $qm->dispatch($clickEvent); $addingEvent = new Event('adding'); $value; $qm->dispatch($addingEvent, $value);

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.70.0120.00418.29
8.3.60.0140.00316.49
8.3.50.0120.00922.11
8.3.40.0100.01018.84
8.3.30.0140.00418.84
8.3.20.0040.00420.02
8.3.10.0040.00423.65
8.3.00.0030.00617.63
8.2.190.0000.02016.58
8.2.180.0030.01218.54
8.2.170.0100.01022.96
8.2.160.0070.00720.38
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00019.42
8.2.110.0030.00619.30
8.2.100.0060.00618.03
8.2.90.0000.00819.34
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0080.00017.93
8.2.50.0050.00318.07
8.2.40.0000.01119.21
8.2.30.0000.00720.55
8.2.20.0000.00717.66
8.2.10.0040.00418.03
8.2.00.0050.00218.03
8.1.280.0120.00325.92
8.1.270.0050.00324.66
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00321.27
8.1.230.0040.00817.49
8.1.220.0030.00517.79
8.1.210.0060.00318.77
8.1.200.0100.00017.36
8.1.190.0050.00319.01
8.1.180.0040.00418.10
8.1.170.0080.00019.03
8.1.160.0070.00022.00
8.1.150.0040.00418.92
8.1.140.0080.00019.65
8.1.130.0040.00417.73
8.1.120.0040.00417.43
8.1.110.0050.00217.48
8.1.100.0040.00417.39
8.1.90.0060.00317.49
8.1.80.0030.00617.50
8.1.70.0000.00717.43
8.1.60.0040.00417.61
8.1.50.0080.00017.52
8.1.40.0040.00417.57
8.1.30.0030.00517.69
8.1.20.0030.00517.62
8.1.10.0040.00417.67
8.1.00.0030.00617.57
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0070.00018.51
8.0.270.0030.00317.29
8.0.260.0030.00317.29
8.0.250.0040.00417.02
8.0.240.0030.00316.98
8.0.230.0040.00416.97
8.0.220.0030.00316.76
8.0.210.0050.00216.94
8.0.200.0030.00316.98
8.0.190.0040.00416.88
8.0.180.0050.00316.97
8.0.170.0060.00316.82
8.0.160.0020.00517.02
8.0.150.0040.00416.91
8.0.140.0000.00816.93
8.0.130.0030.00313.39
8.0.120.0000.00816.95
8.0.110.0040.00416.91
8.0.100.0000.00816.81
8.0.90.0050.00216.93
8.0.80.0140.00016.90
8.0.70.0040.00416.73
8.0.60.0000.00716.95
8.0.50.0040.00416.99
8.0.30.0110.00517.11
8.0.20.0080.01217.40
8.0.10.0040.00417.00
8.0.00.0080.01216.88
7.4.330.0030.00315.08
7.4.320.0070.00016.54
7.4.300.0000.00716.52
7.4.290.0040.00416.51
7.4.280.0040.00416.63
7.4.270.0000.00716.59
7.4.260.0000.00716.53
7.4.250.0040.00416.60
7.4.240.0020.00616.54
7.4.230.0000.00716.73
7.4.220.0140.01716.47
7.4.210.0080.00816.56
7.4.200.0000.00716.63
7.4.160.0100.01016.75
7.4.150.0110.00717.40
7.4.140.0110.01117.86
7.4.130.0120.00616.50
7.4.120.0110.01016.48
7.4.110.0130.01016.50
7.4.100.0150.00316.50
7.4.90.0150.00616.43
7.4.80.0090.01219.39
7.4.70.0130.00716.57
7.4.60.0100.00716.65
7.4.50.0040.00416.59
7.4.40.0070.01116.72
7.4.30.0130.01016.30
7.4.10.0060.01214.75
7.4.00.0050.01114.85
7.3.330.0050.00013.36
7.3.320.0000.00513.38
7.3.310.0040.00316.36
7.3.300.0000.00816.38
7.3.290.0050.00316.33
7.3.280.0110.00616.38
7.3.270.0030.01317.40
7.3.260.0080.00816.64
7.3.250.0070.01016.41
7.3.240.0130.00616.63
7.3.230.0070.01016.39
7.3.210.0090.00916.53
7.3.200.0130.00316.41
7.3.190.0130.00316.35
7.3.180.0040.01116.32
7.3.170.0000.02016.61
7.3.160.0120.00416.51
7.3.130.0150.00314.98
7.3.120.0110.00714.73
7.3.110.0110.00714.82
7.3.100.0000.00814.59
7.3.90.0120.00314.94
7.3.80.0070.01014.72
7.3.70.0040.00414.87
7.3.60.0030.01514.56
7.3.50.0030.01015.05
7.3.40.0030.01014.88
7.3.30.0000.00814.89
7.3.20.0060.00616.65
7.3.10.0070.01116.87
7.3.00.0000.01516.63
7.2.330.0100.01716.96
7.2.320.0090.00916.66
7.2.310.0130.01016.83
7.2.300.0090.00616.79
7.2.290.0070.01016.78
7.2.260.0130.00615.34
7.2.250.0100.00315.13
7.2.240.0000.01815.28
7.2.230.0120.00414.94
7.2.220.0030.01215.29
7.2.210.0000.01515.03
7.2.200.0030.01015.13
7.2.190.0070.01115.22
7.2.180.0030.01014.86
7.2.170.0070.00714.73
7.2.160.0110.00314.95
7.2.150.0110.00717.16
7.2.140.0060.00916.93
7.2.130.0030.01016.92
7.2.120.0060.00916.69
7.2.110.0030.01017.07
7.2.100.0030.01017.07
7.2.90.0030.00916.73
7.2.80.0070.01017.02
7.2.70.0030.01316.72
7.2.60.0000.01016.96
7.2.50.0030.00717.07
7.2.40.0110.00716.73
7.2.30.0110.00017.05
7.2.20.0080.00416.98
7.2.10.0070.00716.87
7.2.00.0030.01217.90
7.1.330.0060.00916.00
7.1.320.0100.00015.79
7.1.310.0030.00715.67
7.1.300.0100.00715.87
7.1.290.0000.01215.77
7.1.280.0120.00315.83
7.1.270.0150.00015.67
7.1.260.0090.00015.84
7.1.250.0040.01115.88
7.1.240.0030.01015.53
7.1.230.0040.00715.68
7.1.220.0030.01015.82
7.1.210.0110.00415.57
7.1.200.0000.01315.83
7.1.190.0000.00815.97
7.1.180.0120.00315.91
7.1.170.0100.00315.88
7.1.160.0040.00415.66
7.1.150.0030.00915.89
7.1.140.0040.01115.98
7.1.130.0000.01515.86
7.1.120.0030.00715.75
7.1.110.0000.01015.67
7.1.100.0000.01316.97
7.1.90.0060.00616.05
7.1.80.0030.00915.70
7.1.70.0080.00516.51
7.1.60.0050.01417.56
7.1.50.0040.01516.44
7.1.40.0090.00616.04
7.1.30.0000.01615.93
7.1.20.0000.01315.53
7.1.10.0060.00315.74
7.1.00.0000.04619.11
7.0.330.0070.00715.48
7.0.320.0070.00715.12
7.0.310.0060.00615.60
7.0.300.0130.00015.45
7.0.290.0030.00615.29
7.0.280.0080.00015.29
7.0.270.0030.01015.55
7.0.260.0080.00415.49
7.0.250.0140.00015.28
7.0.240.0000.01415.23
7.0.230.0030.01015.36
7.0.220.0060.00615.38
7.0.210.0000.00815.22
7.0.200.0020.00816.13
7.0.190.0070.00715.45
7.0.180.0060.00615.48
7.0.170.0060.00615.45
7.0.160.0060.00615.57
7.0.150.0100.00315.57
7.0.140.0040.01115.54
7.0.130.0060.00315.43
7.0.120.0060.00615.57
7.0.110.0030.00915.43
7.0.100.0030.01015.24
7.0.90.0040.00415.48
7.0.80.0070.00715.47
7.0.70.0030.00615.66
7.0.60.0100.04217.65
7.0.50.0080.04516.78
7.0.40.0100.04616.73
7.0.30.0180.04216.87
7.0.20.0170.04516.75
7.0.10.0120.03916.78
7.0.00.0050.03716.80
5.6.400.0030.00614.40
5.6.390.0060.00614.55
5.6.380.0040.00814.58
5.6.370.0110.00414.46
5.6.360.0100.00314.38
5.6.350.0070.00714.52
5.6.340.0100.00314.68
5.6.330.0060.00614.39
5.6.320.0040.01214.41
5.6.310.0030.01314.80
5.6.300.0110.00414.47
5.6.290.0000.00914.54
5.6.280.0050.03817.73
5.6.270.0080.00614.42
5.6.260.0030.00714.48
5.6.250.0060.00614.79
5.6.240.0100.00314.53
5.6.230.0060.00914.38
5.6.220.0000.01814.73
5.6.210.0070.04717.60
5.6.200.0050.04816.32
5.6.190.0120.04017.53
5.6.180.0230.04217.62
5.6.170.0140.02617.55
5.6.160.0050.02617.43
5.6.150.0080.04216.43
5.6.140.0050.04516.30
5.6.130.0100.04016.32
5.6.120.0070.02717.71
5.6.110.0080.04817.73
5.6.100.0030.02917.73
5.6.90.0050.04717.69
5.6.80.0080.03817.47
5.6.70.0220.02017.48
5.6.60.0100.00314.61
5.6.50.0040.01114.25
5.6.40.0040.01114.75
5.6.30.0040.00814.47
5.6.20.0030.01314.28
5.6.10.0110.00014.38
5.6.00.0000.01414.41
5.5.380.0030.00914.29
5.5.370.0040.00713.97
5.5.360.0100.00714.04
5.5.350.0060.04317.11
5.5.340.0080.04016.03
5.5.330.0050.04817.15
5.5.320.0050.02517.18
5.5.310.0170.02417.35
5.5.300.0050.02816.10
5.5.290.0050.04715.99
5.5.280.0040.02417.50
5.5.270.0060.03517.37
5.5.260.0050.04217.47
5.5.250.0070.04217.40
5.5.240.0050.02917.04
5.5.230.0150.00013.88
5.5.220.0030.01013.96
5.5.210.0040.01114.00
5.5.200.0060.00614.03
5.5.190.0040.01113.88
5.5.180.0090.00614.20
5.5.170.0060.00614.16
5.5.160.0080.00614.18
5.5.150.0050.00514.18
5.5.140.0040.01113.92
5.5.130.0070.01013.97
5.5.120.0090.00314.03
5.5.110.0000.00914.19
5.5.100.0040.01114.12
5.5.90.0060.00614.14
5.5.80.0060.00613.61
5.5.70.0000.01314.02
5.5.60.0060.00613.61
5.5.50.0030.00613.85
5.5.40.0070.00714.27
5.5.30.0040.00814.12
5.5.20.0030.00614.02
5.5.10.0040.00713.94
5.5.00.0000.01313.77
5.4.450.0450.02815.07
5.4.440.0420.02815.22
5.4.430.0430.02515.17
5.4.420.0470.03615.27
5.4.410.0420.03415.08
5.4.400.0320.03214.67
5.4.390.0350.03015.10
5.4.380.0450.02515.05
5.4.370.0400.02815.03
5.4.360.0350.03514.95
5.4.350.0370.03014.99
5.4.340.0490.02914.89
5.4.330.0090.00310.84
5.4.320.0450.03014.80
5.4.310.0330.02915.03
5.4.300.0400.02614.81
5.4.290.0390.02514.88
5.4.280.0400.03014.86
5.4.270.0330.02715.14
5.4.260.0350.02915.01
5.4.250.0350.03114.88
5.4.240.0460.03815.21
5.4.230.0460.02514.72
5.4.220.0420.02514.93
5.4.210.0410.02814.76
5.4.200.0350.02715.03
5.4.190.0400.02814.97
5.4.180.0370.03014.80
5.4.170.0330.03414.85
5.4.160.0390.02815.00
5.4.150.0370.03215.00
5.4.140.0440.02513.68
5.4.130.0380.03013.61
5.4.120.0330.02613.60
5.4.110.0330.02813.63
5.4.100.0340.02613.51
5.4.90.0320.02613.74
5.4.80.0310.02613.69
5.4.70.0460.03213.56
5.4.60.0400.02313.56
5.4.50.0400.03613.68
5.4.40.0380.03213.53
5.4.30.0330.03013.41
5.4.20.0380.03013.58
5.4.10.0330.02713.63
5.4.00.0370.02713.40

preferences:
45.98 ms | 401 KiB | 5 Q