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.0130.01016.63
8.3.50.0070.00718.28
8.3.40.0100.01018.92
8.3.30.0110.00718.84
8.3.20.0050.00320.29
8.3.10.0000.00721.71
8.3.00.0000.00821.90
8.2.180.0090.00616.63
8.2.170.0070.00722.96
8.2.160.0060.00921.97
8.2.150.0090.00025.66
8.2.140.0070.00724.66
8.2.130.0040.00420.87
8.2.120.0070.00726.35
8.2.110.0040.00422.25
8.2.100.0080.00417.97
8.2.90.0070.00419.04
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0000.00918.09
8.2.40.0030.00520.59
8.2.30.0070.00019.39
8.2.20.0060.00317.61
8.2.10.0050.00317.89
8.2.00.0070.00018.07
8.1.280.0120.00625.92
8.1.270.0150.00422.20
8.1.260.0050.00328.09
8.1.250.0070.00028.09
8.1.240.0130.00723.95
8.1.230.0000.01219.14
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00418.41
8.1.160.0040.00420.73
8.1.150.0030.00520.61
8.1.140.0040.00419.45
8.1.130.0030.00317.66
8.1.120.0000.00717.42
8.1.110.0080.00017.44
8.1.100.0000.00717.32
8.1.90.0070.00017.38
8.1.80.0040.00417.41
8.1.70.0000.00717.41
8.1.60.0000.00817.57
8.1.50.0000.00917.52
8.1.40.0040.00417.54
8.1.30.0000.00817.66
8.1.20.0040.00417.50
8.1.10.0040.00417.49
8.1.00.0030.00617.50
8.0.300.0000.00821.50
8.0.290.0000.00716.63
8.0.280.0030.00318.39
8.0.270.0000.00717.17
8.0.260.0070.00017.29
8.0.250.0090.00016.89
8.0.240.0030.00317.05
8.0.230.0030.00516.84
8.0.220.0000.00816.92
8.0.210.0060.00316.78
8.0.200.0000.00716.96
8.0.190.0000.00816.95
8.0.180.0000.00816.85
8.0.170.0040.00417.00
8.0.160.0050.00216.82
8.0.150.0030.00516.83
8.0.140.0000.00716.79
8.0.130.0000.00513.38
8.0.120.0040.00416.82
8.0.110.0040.00416.89
8.0.100.0040.00416.97
8.0.90.0040.00416.91
8.0.80.0060.00916.80
8.0.70.0030.00516.98
8.0.60.0000.00716.89
8.0.50.0080.00016.75
8.0.30.0050.01417.25
8.0.20.0130.00517.40
8.0.10.0080.00016.86
8.0.00.0090.00916.75
7.4.330.0020.00216.67
7.4.320.0030.00316.52
7.4.300.0000.00616.44
7.4.290.0040.00416.61
7.4.280.0030.00616.61
7.4.270.0000.00716.45
7.4.260.0000.00916.60
7.4.250.0070.00016.51
7.4.240.0000.00716.60
7.4.230.0050.00316.60
7.4.220.0040.01416.54
7.4.210.0130.00716.65
7.4.200.0040.00416.55
7.4.160.0080.00816.49
7.4.150.0150.00317.40
7.4.140.0140.00817.86
7.4.130.0120.00616.59
7.4.120.0060.01516.41
7.4.110.0060.01916.51
7.4.100.0080.00916.50
7.4.90.0070.01016.44
7.4.80.0090.00919.39
7.4.70.0090.01216.62
7.4.60.0090.00816.63
7.4.50.0070.00716.68
7.4.40.0110.01416.59
7.4.30.0060.01216.64
7.4.00.0060.00915.09
7.3.330.0040.00413.23
7.3.320.0050.00013.23
7.3.310.0000.00716.41
7.3.300.0030.00316.23
7.3.290.0000.00616.41
7.3.280.0110.00516.33
7.3.270.0070.01017.40
7.3.260.0130.00916.57
7.3.250.0060.01116.46
7.3.240.0100.00916.54
7.3.230.0100.00616.46
7.3.210.0090.01116.56
7.3.200.0110.00619.39
7.3.190.0090.00616.40
7.3.180.0160.00016.61
7.3.170.0060.01216.39
7.3.160.0070.01016.56
7.3.10.0100.00316.46
7.3.00.0110.00416.47
7.2.330.0100.00716.60
7.2.320.0110.00716.80
7.2.310.0100.00616.56
7.2.300.0120.00616.39
7.2.290.0130.00316.71
7.2.130.0080.00616.66
7.2.120.0060.00716.72
7.2.110.0050.01116.69
7.2.100.0070.00916.61
7.2.90.0090.00616.97
7.2.80.0090.00816.78
7.2.70.0100.00516.69
7.2.60.0080.00616.59
7.2.50.0120.00516.77
7.2.40.0080.00917.02
7.2.30.0090.00616.88
7.2.20.0100.00616.77
7.2.10.0020.01216.59
7.2.00.0090.00617.58
7.1.250.0100.00515.36
7.1.240.0060.00915.31
7.1.230.0080.01115.61
7.1.220.0110.00415.19
7.1.210.0040.01115.28
7.1.200.0080.00715.35
7.1.190.0120.00915.39
7.1.180.0100.00315.29
7.1.170.0090.00315.43
7.1.160.0100.00615.58
7.1.150.0090.00415.26
7.1.140.0100.00715.45
7.1.130.0110.00415.39
7.1.120.0170.00315.35
7.1.110.0110.00715.43
7.1.100.0110.00416.69
7.1.90.0100.00715.77
7.1.80.0140.00315.41
7.1.70.0080.00316.34
7.1.60.0090.01217.51
7.1.50.0100.01016.08
7.1.40.0140.00315.47
7.1.30.0030.01015.09
7.1.20.0100.00715.50
7.1.10.0090.00615.38
7.1.00.0070.04018.64
7.0.330.0120.00014.75
7.0.320.0070.00714.97
7.0.310.0100.00715.30
7.0.300.0100.01015.23
7.0.290.0090.00615.20
7.0.280.0060.00815.05
7.0.270.0150.00315.11
7.0.260.0140.00315.05
7.0.250.0130.00315.13
7.0.240.0140.00315.12
7.0.230.0170.00015.03
7.0.220.0060.01015.12
7.0.210.0170.00015.18
7.0.200.0080.00215.99
7.0.190.0110.00315.05
7.0.180.0120.00015.14
7.0.170.0090.00315.27
7.0.160.0070.01415.11
7.0.150.0100.01015.08
7.0.140.0100.00315.25
7.0.130.0110.00815.23
7.0.120.0100.00714.84
7.0.110.0060.01014.86
7.0.100.0190.00314.86
7.0.90.0130.00615.18
7.0.80.0100.01015.04
7.0.70.0120.00615.08
7.0.60.0140.04218.26
7.0.50.0070.02816.59
7.0.40.0080.02816.69
7.0.30.0180.02616.80
7.0.20.0220.04016.49
7.0.10.0070.02716.72
7.0.00.0070.04616.59
5.6.380.0040.00814.10
5.6.370.0100.00714.25
5.6.360.0070.01114.04
5.6.350.0040.00814.39
5.6.340.0080.00814.33
5.6.330.0040.01314.19
5.6.320.0130.00014.51
5.6.310.0040.01314.63
5.6.300.0090.00614.09
5.6.290.0060.00614.38
5.6.280.0050.03217.38
5.6.270.0070.00414.41
5.6.260.0090.00614.29
5.6.250.0000.01414.12
5.6.240.0000.01114.42
5.6.230.0040.01214.03
5.6.220.0090.01114.31
5.6.210.0030.05117.31
5.6.200.0110.04015.99
5.6.190.0060.03017.33
5.6.180.0180.02517.41
5.6.170.0160.03517.47
5.6.160.0070.04817.21
5.6.150.0080.04216.22
5.6.140.0060.04616.03
5.6.130.0080.03716.35
5.6.120.0070.04517.55
5.6.110.0100.04417.58
5.6.100.0080.03517.56
5.6.90.0020.04317.69
5.6.80.0050.02617.21
5.6.70.0000.01513.99
5.6.60.0120.00414.20
5.6.50.0130.00313.71
5.6.40.0000.01013.95
5.6.30.0030.01013.88
5.6.20.0030.00913.95
5.6.10.0090.00913.93
5.6.00.0030.01314.03
5.5.380.0070.00710.74
5.5.370.0000.01210.65
5.5.360.0050.00810.58
5.5.350.0140.04015.69
5.5.340.0110.03914.59
5.5.330.0100.04315.60
5.5.320.0230.02515.60
5.5.310.0180.03815.65
5.5.300.0080.04014.34
5.5.290.0000.02714.29
5.5.280.0080.04315.66
5.5.270.0070.04415.86
5.5.260.0030.04215.88
5.5.250.0050.04515.75
5.5.240.0140.04315.60
5.5.230.0110.00411.26
5.5.220.0100.00811.13
5.5.210.0040.01211.16
5.5.200.0040.01110.96
5.5.190.0030.00910.98
5.5.180.0030.01110.75
5.5.170.0070.00511.03
5.5.160.0060.00610.86
5.5.150.0090.00911.02
5.5.140.0190.00010.78
5.5.130.0060.01011.22
5.5.120.0050.01011.26
5.5.110.0050.01011.23
5.5.100.0120.00411.16
5.5.90.0040.00810.92
5.5.80.0130.00010.95
5.5.70.0000.01410.88
5.5.60.0030.01010.65
5.5.50.0030.00911.04
5.5.40.0000.00910.75
5.5.30.0100.00010.85
5.5.20.0020.00410.92
5.5.10.0040.00810.95
5.5.00.0030.00911.01

preferences:
57.54 ms | 401 KiB | 5 Q