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++) { if (isset(array_keys($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.40.0100.00718.84
8.3.30.0070.00718.71
8.3.20.0040.00422.09
8.3.10.0080.00021.75
8.3.00.0030.00519.66
8.2.170.0120.00322.96
8.2.160.0100.00321.19
8.2.150.0000.00924.18
8.2.140.0070.00024.66
8.2.130.0070.00022.06
8.2.120.0060.00326.35
8.2.110.0100.00019.39
8.2.100.0080.00318.22
8.2.90.0030.00519.20
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0060.00318.05
8.2.50.0030.00618.10
8.2.40.0050.00322.18
8.2.30.0020.00521.07
8.2.20.0020.00517.77
8.2.10.0000.00718.13
8.2.00.0050.00318.14
8.1.270.0040.00423.91
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0090.00019.21
8.1.230.0080.00419.61
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00617.35
8.1.190.0000.00817.24
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0040.00422.16
8.1.150.0000.00720.55
8.1.140.0040.00419.61
8.1.130.0030.00317.63
8.1.120.0030.00517.38
8.1.110.0000.00717.47
8.1.100.0000.00717.41
8.1.90.0000.00817.52
8.1.80.0000.00717.54
8.1.70.0030.00517.48
8.1.60.0000.00817.50
8.1.50.0080.00017.51
8.1.40.0030.00517.58
8.1.30.0080.00017.57
8.1.20.0070.00017.59
8.1.10.0000.00817.57
8.1.00.0040.00417.51
8.0.300.0060.00318.77
8.0.290.0070.00016.75
8.0.280.0030.00318.52
8.0.270.0000.00717.16
8.0.260.0030.00317.13
8.0.250.0090.00016.96
8.0.240.0100.00017.02
8.0.230.0000.00716.98
8.0.220.0070.00016.98
8.0.210.0030.00316.92
8.0.200.0070.00016.97
8.0.190.0040.00416.93
8.0.180.0000.00816.93
8.0.170.0040.00416.98
8.0.160.0000.00717.07
8.0.150.0000.00816.81
8.0.140.0000.00816.84
8.0.130.0000.00513.43
8.0.120.0040.00416.93
8.0.110.0070.00016.86
8.0.100.0030.00516.87
8.0.90.0040.00416.89
8.0.80.0060.01617.02
8.0.70.0000.00817.03
8.0.60.0050.00217.05
8.0.50.0070.00016.81
8.0.30.0100.00817.15
8.0.20.0130.00917.40
8.0.10.0030.00517.09
8.0.00.0140.01017.06
7.4.330.0000.00515.10
7.4.320.0030.00316.52
7.4.300.0030.00316.60
7.4.290.0070.00016.38
7.4.280.0000.00816.46
7.4.270.0000.00816.55
7.4.260.0000.00716.66
7.4.250.0000.00816.42
7.4.240.0050.00216.61
7.4.230.0030.00316.72
7.4.220.0130.00616.55
7.4.210.0040.01116.56
7.4.200.0000.00816.66
7.4.160.0070.00716.51
7.4.150.0060.01317.40
7.4.140.0050.01417.86
7.4.130.0110.00616.63
7.4.120.0050.01216.52
7.4.110.0150.00916.67
7.4.100.0060.01116.72
7.4.90.0200.00316.66
7.4.80.0160.00719.39
7.4.70.0110.00716.70
7.4.60.0000.01616.56
7.4.50.0060.01016.56
7.4.40.0130.01016.54
7.4.30.0120.00616.38
7.4.10.0060.01114.77
7.4.00.0060.00915.05
7.3.330.0030.00313.36
7.3.320.0000.00613.18
7.3.310.0070.00016.45
7.3.300.0050.00316.30
7.3.290.0060.00816.33
7.3.280.0090.01016.40
7.3.270.0180.00017.40
7.3.260.0080.01116.33
7.3.250.0090.00816.43
7.3.240.0090.01216.38
7.3.230.0130.00816.50
7.3.210.0090.00616.34
7.3.200.0140.00316.43
7.3.190.0100.00616.54
7.3.180.0100.01316.70
7.3.170.0000.01816.53
7.3.160.0140.00416.59
7.3.130.0100.00714.91
7.3.120.0070.01214.76
7.3.110.0070.01214.80
7.3.100.0040.01114.89
7.3.90.0040.01014.76
7.3.80.0040.00914.92
7.3.70.0060.00914.95
7.3.60.0040.01014.93
7.3.50.0040.01314.72
7.3.40.0060.01014.87
7.3.30.0050.00814.87
7.3.20.0040.00616.58
7.3.10.0050.01116.54
7.3.00.0100.00716.60
7.2.330.0080.00816.82
7.2.320.0100.00616.74
7.2.310.0090.00916.76
7.2.300.0060.01616.75
7.2.290.0100.00716.66
7.2.260.0120.00515.26
7.2.250.0090.00815.13
7.2.240.0070.01014.99
7.2.230.0060.00915.00
7.2.220.0070.00615.10
7.2.210.0040.00915.04
7.2.200.0090.00415.11
7.2.190.0030.01215.20
7.2.180.0080.00815.14
7.2.170.0080.00415.05
7.2.160.0070.00615.08
7.2.150.0050.00816.79
7.2.140.0070.00616.93
7.2.130.0100.00816.89
7.2.120.0120.00516.99
7.2.110.0090.00816.98
7.2.100.0080.00816.89
7.2.90.0090.00716.83
7.2.80.0070.00916.72
7.2.70.0060.01116.98
7.2.60.0080.00916.94
7.2.50.0100.00616.89
7.2.40.0100.00616.94
7.2.30.0090.01116.74
7.2.20.0080.00716.89
7.2.10.0100.00716.83
7.2.00.0080.00917.39
7.1.330.0050.00715.79
7.1.320.0060.00715.80
7.1.310.0030.00915.88
7.1.300.0050.00515.90
7.1.290.0050.00915.71
7.1.280.0050.00715.82
7.1.270.0040.01015.79
7.1.260.0070.00615.77
7.1.250.0110.00615.74
7.1.240.0070.00515.81
7.1.230.0050.00915.93
7.1.220.0060.00815.75
7.1.210.0060.00715.82
7.1.200.0050.00715.71
7.1.190.0040.00915.63
7.1.180.0040.00815.92
7.1.170.0040.00915.72
7.1.160.0080.00615.72
7.1.150.0030.00915.78
7.1.140.0070.00715.89
7.1.130.0040.01015.89
7.1.120.0030.01015.70
7.1.110.0070.00815.79
7.1.100.0030.00916.47
7.1.90.0040.00815.81
7.1.80.0090.00515.89
7.1.70.0060.00616.16
7.1.60.0030.01016.77
7.1.50.0030.00915.80
7.1.40.0040.01015.79
7.1.30.0040.00915.77
7.1.20.0060.00715.91
7.1.10.0050.00815.68
7.1.00.0040.02317.38
7.0.330.0050.00715.35
7.0.320.0060.00715.40
7.0.310.0060.00715.39
7.0.300.0030.00815.43
7.0.290.0100.00215.42
7.0.280.0030.00715.37
7.0.270.0060.00515.34
7.0.260.0030.00915.40
7.0.250.0050.00715.47
7.0.240.0090.00515.46
7.0.230.0060.00615.56
7.0.220.0050.00915.43
7.0.210.0090.00415.40
7.0.200.0040.00815.75
7.0.190.0090.00315.43
7.0.180.0060.00815.43
7.0.170.0020.00915.27
7.0.160.0060.00715.36
7.0.150.0010.01015.29
7.0.140.0040.01015.45
7.0.130.0030.00815.37
7.0.120.0020.01015.46
7.0.110.0080.00615.46
7.0.100.0040.01015.45
7.0.90.0040.02516.58
7.0.80.0060.02216.52
7.0.70.0070.01916.57
7.0.60.0080.01916.59
7.0.50.0090.02216.82
7.0.40.0070.02115.18
7.0.30.0100.01915.18
7.0.20.0060.02315.18
7.0.10.0090.02315.28
7.0.00.0120.02015.20
5.6.400.0020.01214.52
5.6.390.0040.00814.56
5.6.380.0050.00514.47
5.6.370.0070.00514.57
5.6.360.0020.00814.59
5.6.350.0030.00814.53
5.6.340.0060.00614.46
5.6.330.0060.00914.55
5.6.320.0040.00914.58
5.6.310.0060.00714.60
5.6.300.0100.00514.47
5.6.290.0030.01014.58
5.6.280.0080.00414.62
5.6.270.0060.00914.45
5.6.260.0040.01014.50
5.6.250.0030.00914.49
5.6.240.0080.00914.54
5.6.230.0090.02116.01
5.6.220.0080.01716.00
5.6.210.0070.01816.07
5.6.200.0040.02916.14
5.6.190.0100.02516.20
5.6.180.0050.02216.12
5.6.170.0100.02016.04
5.6.160.0070.02016.02
5.6.150.0080.01916.01
5.6.140.0090.01716.01
5.6.130.0090.02016.18
5.6.120.0060.02016.11
5.6.110.0100.02316.03
5.6.100.0050.02416.23
5.6.90.0070.02316.02
5.6.80.0080.01715.99
5.6.70.0100.01815.99
5.6.60.0080.02316.02
5.6.50.0090.01615.82
5.6.40.0090.01815.88
5.6.30.0090.02315.86
5.6.20.0080.02015.97
5.6.10.0060.02015.88
5.6.00.0080.01815.79

preferences:
33.05 ms | 400 KiB | 5 Q