3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Event { protected $Events; public function dispatch() { echo "default Event \n"; } public function setEvents(Events $events) { $this->Events = $events; } } class customEvent extends Event { public function dispatch() { echo "should be in same notify loop"; } } class addedInIterationEvent extends Event { public function dispatch() { echo "addedInIterationEvent \n"; $this->Events->addEvent("customEvent",new customEvent()); } } class Events { protected $eventList = array(); public function notify() { $events = $this->eventList; for ($i = 0; $i <= sizeof($events); $i++) { $eventName = array_keys($events)[$i]; $event = $events[$eventName]; $event->setEvents($this); $event->dispatch(); $events = array_merge($events,$this->eventList); echo $eventName; } } public function addEvent($name,$event) { $this->eventList[$name] = $event; } } $events = new Events(); $events->addEvent("basicEvent",new Event); $events->addEvent("addedInIterationEvent",new addedInIterationEvent); $events->notify();

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.0100.00618.30
8.3.50.0140.00522.96
8.3.40.0070.01019.02
8.3.30.0040.01218.79
8.3.20.0040.00421.73
8.3.10.0050.00321.85
8.3.00.0040.00419.88
8.2.180.0150.00318.54
8.2.170.0060.00922.96
8.2.160.0140.00721.07
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00422.25
8.2.120.0030.00726.35
8.2.110.0060.00321.04
8.2.100.0000.01218.34
8.2.90.0000.00819.20
8.2.80.0000.00817.97
8.2.70.0030.00717.75
8.2.60.0000.00818.03
8.2.50.0060.00318.10
8.2.40.0080.00022.15
8.2.30.0000.00821.14
8.2.20.0050.00217.71
8.2.10.0050.00318.10
8.2.00.0030.00518.02
8.1.280.0090.00625.92
8.1.270.0050.00224.04
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0040.00422.19
8.1.230.0060.00619.67
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0050.00317.23
8.1.180.0050.00318.10
8.1.170.0030.00518.43
8.1.160.0040.00422.15
8.1.150.0000.00820.63
8.1.140.0030.00619.54
8.1.130.0030.00317.73
8.1.120.0040.00417.34
8.1.110.0050.00317.38
8.1.100.0000.00817.40
8.1.90.0090.00017.37
8.1.80.0070.00017.43
8.1.70.0000.00717.50
8.1.60.0000.00917.47
8.1.50.0040.00417.58
8.1.40.0040.00417.50
8.1.30.0000.00817.64
8.1.20.0040.00417.68
8.1.10.0040.00417.48
8.1.00.0040.00417.43
8.0.300.0050.00218.77
8.0.290.0000.00816.75
8.0.280.0040.00418.47
8.0.270.0070.00017.28
8.0.260.0040.00417.15
8.0.250.0040.00416.95
8.0.240.0000.00817.04
8.0.230.0040.00416.91
8.0.220.0040.00416.79
8.0.210.0030.00316.82
8.0.200.0000.00716.95
8.0.190.0060.00317.04
8.0.180.0000.00716.97
8.0.170.0070.00016.99
8.0.160.0040.00416.99
8.0.150.0080.00016.96
8.0.140.0040.00416.83
8.0.130.0060.00013.46
8.0.120.0060.00316.85
8.0.110.0050.00216.98
8.0.100.0040.00416.85
8.0.90.0000.00816.93
8.0.80.0100.01216.99
8.0.70.0080.00016.92
8.0.60.0000.00716.76
8.0.50.0080.00017.03
8.0.30.0120.00717.12
8.0.20.0090.01017.40
8.0.10.0000.00716.95
8.0.00.0060.01116.55
7.4.330.0050.00015.10
7.4.320.0000.00716.63
7.4.300.0030.00316.50
7.4.290.0070.00016.51
7.4.280.0040.00416.63
7.4.270.0030.00316.48
7.4.260.0000.00716.52
7.4.250.0000.00716.43
7.4.240.0000.00816.49
7.4.230.0000.00716.50
7.4.220.0070.01116.56
7.4.210.0170.00316.63
7.4.200.0000.00716.44
7.4.160.0070.00916.65
7.4.150.0090.01017.40
7.4.140.0120.00617.86
7.4.130.0130.00416.46
7.4.120.0080.01116.56
7.4.110.0150.00916.67
7.4.100.0110.00716.50
7.4.90.0200.00316.67
7.4.80.0080.00819.39
7.4.70.0030.01316.61
7.4.60.0070.01316.64
7.4.50.0070.00716.57
7.4.40.0200.00316.61
7.4.30.0070.01016.34
7.4.00.0140.00414.95
7.3.330.0020.00213.39
7.3.320.0000.00513.46
7.3.310.0030.00316.54
7.3.300.0000.00716.46
7.3.290.0060.01216.41
7.3.280.0110.00916.40
7.3.270.0070.01017.40
7.3.260.0130.00616.51
7.3.250.0110.00916.57
7.3.240.0110.00716.43
7.3.230.0060.01616.48
7.3.210.0180.00416.48
7.3.200.0110.00616.45
7.3.190.0050.01116.66
7.3.180.0090.00916.60
7.3.170.0100.00716.59
7.3.160.0090.00916.52
7.2.330.0120.00616.78
7.2.320.0140.00916.37
7.2.310.0090.00916.79
7.2.300.0140.00316.52
7.2.290.0000.01816.56
7.2.60.0100.00316.80
7.2.00.0080.00419.51
7.1.200.0090.00615.93
7.1.100.0030.01018.11
7.1.70.0000.01016.92
7.1.60.0040.00919.75
7.1.50.0160.00616.69
7.1.00.0070.07322.30
7.0.200.0030.00516.85
7.0.90.0230.07020.03
7.0.80.0270.06019.93
7.0.70.0300.06320.02
7.0.60.0270.07319.87
7.0.50.0330.05720.38
7.0.40.0270.06320.36
7.0.30.0400.06720.42
7.0.20.0430.08720.41
7.0.10.0300.06320.36
7.0.00.0570.06320.23
5.6.230.0130.06720.82
5.6.220.0070.07320.76
5.6.210.0200.05320.58
5.6.200.0230.06021.11
5.6.190.0100.06321.11
5.6.180.0170.06021.13
5.6.170.0330.05321.10
5.6.160.0030.08021.22
5.6.150.0070.06721.08
5.6.140.0200.06321.07
5.6.130.0300.07321.14
5.6.120.0270.06321.14
5.6.110.0230.05721.11
5.6.100.0170.06721.08
5.6.90.0300.06321.09
5.6.80.0270.04720.52
5.6.70.0130.08020.49
5.6.60.0130.05720.45
5.6.50.0170.05320.48
5.6.40.0100.06320.55
5.6.30.0130.05720.55
5.6.20.0100.07020.48
5.6.10.0130.05320.57
5.6.00.0170.05020.44

preferences:
60.16 ms | 401 KiB | 5 Q