3v4l.org

run code in 300+ PHP versions simultaneously
<?php $closure1 = function($val){ return $val; }; $closure2 = function($val){ return $val; }; $reflection_class = new ReflectionClass($closure1); $reflection_method = $reflection_class->getMethod('__invoke'); $arguments1 = array('hello'); $arguments2 = array('world'); // Invoking once is OK... print $reflection_method->invokeArgs($closure1, $arguments1); if(true){ // But don't do it again! #print $reflection_method->invokeArgs($closure1, $arguments1); // Using different arguments per invokation makes no difference :( #print $reflection_method->invokeArgs($closure1, $arguments2); // Doesn't matter if you attempt to invoke a different closure with the same reflection. print $reflection_method->invokeArgs($closure2, $arguments1); }

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.0040.01516.61
8.3.50.0100.00522.89
8.3.40.0110.00418.76
8.3.30.0030.01019.06
8.3.20.0050.00320.29
8.3.10.0040.00423.66
8.3.00.0040.00417.71
8.2.180.0130.01016.50
8.2.170.0080.01122.96
8.2.160.0000.01420.57
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00519.91
8.2.110.0090.00020.56
8.2.100.0060.00617.85
8.2.90.0000.00818.01
8.2.80.0050.00317.97
8.2.70.0030.00617.74
8.2.60.0060.00317.92
8.2.50.0000.00818.07
8.2.40.0000.00818.20
8.2.30.0070.00018.00
8.2.20.0040.00417.77
8.2.10.0000.00818.04
8.2.00.0020.00517.69
8.1.280.0070.00725.92
8.1.270.0050.00323.79
8.1.260.0000.00726.35
8.1.250.0070.00728.09
8.1.240.0040.00422.14
8.1.230.0110.00020.83
8.1.220.0030.00517.77
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0040.00417.36
8.1.180.0030.00518.10
8.1.170.0050.00318.58
8.1.160.0000.00821.98
8.1.150.0040.00418.83
8.1.140.0000.00717.33
8.1.130.0030.00317.88
8.1.120.0030.00317.36
8.1.110.0050.00317.51
8.1.100.0040.00317.37
8.1.90.0040.00317.42
8.1.80.0040.00417.42
8.1.70.0050.00317.36
8.1.60.0030.00517.54
8.1.50.0000.00817.46
8.1.40.0040.00417.41
8.1.30.0090.00017.65
8.1.20.0030.00617.62
8.1.10.0000.00717.57
8.1.00.0090.00017.44
8.0.300.0020.00520.07
8.0.290.0040.00416.75
8.0.280.0070.00018.51
8.0.270.0050.00217.13
8.0.260.0030.00317.26
8.0.250.0060.00016.95
8.0.240.0000.00617.00
8.0.230.0070.00016.95
8.0.220.0050.00316.78
8.0.210.0000.00716.84
8.0.200.0040.00416.98
8.0.190.0030.00317.05
8.0.180.0040.00416.95
8.0.170.0040.00417.02
8.0.160.0040.00416.92
8.0.150.0040.00416.91
8.0.140.0070.00016.81
8.0.130.0000.00613.31
8.0.120.0050.00216.87
8.0.110.0050.00316.85
8.0.100.0040.00416.98
8.0.90.0040.00416.91
8.0.80.0170.00816.92
8.0.70.0070.00016.86
8.0.60.0000.00816.95
8.0.50.0040.00416.98
8.0.30.0080.01517.14
8.0.20.0110.01017.40
8.0.10.0040.00317.02
8.0.00.0100.00817.04
7.4.330.0060.00015.00
7.4.320.0000.00616.50
7.4.300.0000.00716.61
7.4.290.0070.00016.61
7.4.280.0030.00716.52
7.4.270.0070.00016.49
7.4.260.0050.00316.39
7.4.250.0000.00816.48
7.4.240.0020.00616.59
7.4.230.0070.00016.60
7.4.220.0120.00616.64
7.4.210.0070.00716.59
7.4.200.0030.00316.25
7.4.160.0100.00716.53
7.4.150.0120.00617.40
7.4.140.0100.00917.86
7.4.130.0100.00816.50
7.4.120.0060.01116.54
7.4.110.0060.01016.32
7.4.100.0120.01016.59
7.4.90.0070.01016.64
7.4.80.0060.01219.39
7.4.70.0040.01216.61
7.4.60.0100.00716.43
7.4.50.0040.00416.51
7.4.40.0070.01016.36
7.4.30.0120.00616.23
7.4.00.0060.00914.83
7.3.330.0030.00313.27
7.3.320.0060.00013.29
7.3.310.0070.00016.35
7.3.300.0000.00716.25
7.3.290.0060.00916.29
7.3.280.0080.01116.24
7.3.270.0110.00617.40
7.3.260.0050.01116.66
7.3.250.0120.00516.55
7.3.240.0080.01516.27
7.3.230.0110.00516.39
7.3.210.0120.00616.23
7.3.200.0100.00619.39
7.3.190.0170.00716.52
7.3.180.0120.00916.28
7.3.170.0080.00816.35
7.3.160.0130.00316.28
7.3.00.0070.01016.37
7.2.330.0030.01316.75
7.2.320.0100.00716.54
7.2.310.0060.01016.74
7.2.300.0090.00616.62
7.2.290.0040.01216.71
7.2.130.0030.00916.85
7.2.120.0090.00916.64
7.2.110.0090.00916.45
7.2.100.0070.01116.46
7.2.90.0060.00916.88
7.2.80.0160.00316.54
7.2.70.0150.00616.68
7.2.60.0080.00917.01
7.2.50.0090.00916.79
7.2.40.0140.00217.01
7.2.30.0160.00616.84
7.2.20.0150.00916.84
7.2.10.0100.00716.75
7.2.00.0070.00716.61
7.1.250.0030.01515.51
7.1.240.0120.00015.59
7.1.230.0000.01115.56
7.1.220.0070.00715.68
7.1.210.0150.00315.77
7.1.200.0110.00315.76
7.1.190.0070.00715.47
7.1.180.0140.01015.47
7.1.170.0130.00615.60
7.1.160.0070.01415.74
7.1.150.0180.00715.70
7.1.140.0120.00815.80
7.1.130.0170.00415.56
7.1.120.0160.00415.74
7.1.110.0150.00915.39
7.1.100.0160.00415.68
7.1.90.0110.00915.56
7.1.80.0170.00415.71
7.1.70.0040.00716.39
7.1.60.0160.00617.52
7.1.50.0060.01216.25
7.1.40.0070.01015.67
7.1.30.0250.00015.28
7.1.20.0220.00315.54
7.1.10.0130.00615.42
7.1.00.0060.04418.85
7.0.330.0090.00615.19
7.0.320.0070.00714.88
7.0.310.0030.01315.25
7.0.300.0110.00815.15
7.0.290.0120.01215.21
7.0.280.0150.00414.79
7.0.270.0130.00715.43
7.0.260.0190.00015.26
7.0.250.0120.00915.41
7.0.240.0140.00715.07
7.0.230.0180.00015.22
7.0.220.0130.00815.11
7.0.210.0080.01215.02
7.0.200.0110.00315.94
7.0.190.0250.00415.14
7.0.180.0140.00815.17
7.0.170.0110.01115.08
7.0.160.0110.01114.93
7.0.150.0110.00515.26
7.0.140.0070.04418.69
7.0.130.0220.00015.45
7.0.120.0060.01515.47
7.0.110.0030.01314.95
7.0.100.0200.01314.88
7.0.90.0090.00915.25
7.0.80.0130.00515.13
7.0.70.0130.00715.29
7.0.60.0090.02117.56
7.0.50.0020.02716.44
7.0.40.0070.03016.79
7.0.30.0260.04316.63
7.0.20.0190.03816.72
7.0.10.0020.05416.77
7.0.00.0080.02816.70
5.6.380.0140.00314.31
5.6.370.0060.00314.16
5.6.360.0070.01414.43
5.6.350.0090.00313.97
5.6.340.0090.00614.06
5.6.330.0030.01013.88
5.6.320.0080.00414.36
5.6.310.0030.00814.53
5.6.300.0110.00014.27
5.6.290.0060.00314.03
5.6.280.0040.04017.70
5.6.270.0000.01214.33
5.6.260.0000.01114.24
5.6.250.0170.00013.85
5.6.240.0070.00714.20
5.6.230.0000.01714.29
5.6.220.0060.00614.05
5.6.210.0050.04617.30
5.6.200.0080.04016.04
5.6.190.0110.04217.26
5.6.180.1810.02917.48
5.6.170.0150.04517.39
5.6.160.0050.02817.52
5.6.150.0080.03716.35
5.6.140.0100.02016.33
5.6.130.0050.02716.18
5.6.120.0110.04517.69
5.6.110.0100.03717.59
5.6.100.0110.04317.72
5.6.90.0100.02217.58
5.6.80.0050.03717.20
5.6.70.1480.02117.38
5.6.60.0130.00313.72
5.6.50.0170.00714.09
5.6.40.0040.00814.37
5.6.30.0140.00714.01
5.6.20.0070.00413.98
5.6.10.0130.00313.95
5.6.00.0040.01113.91
5.5.380.0040.00410.67
5.5.370.0000.00611.02
5.5.360.0000.01111.13
5.5.350.0090.03015.78
5.5.340.0090.03514.43
5.5.330.0050.04315.54
5.5.320.0170.02015.62
5.5.310.0160.04015.81
5.5.300.0040.02214.46
5.5.290.0100.04114.46
5.5.280.0110.04015.83
5.5.270.0090.01815.82
5.5.260.0080.04015.98
5.5.250.0080.04315.73
5.5.240.0160.02015.63
5.5.230.0000.00911.22
5.5.220.0050.00510.95
5.5.210.0070.00410.79
5.5.200.0060.00311.14
5.5.190.0070.00311.15
5.5.180.0030.00511.16
5.5.170.0030.00611.26
5.5.160.0070.01010.56
5.5.150.0000.01110.91
5.5.140.0050.00511.21
5.5.130.0120.00611.03
5.5.120.0160.00311.02
5.5.110.0090.00011.06
5.5.100.0190.00310.67
5.5.90.0130.00710.78
5.5.80.0040.00711.21
5.5.70.0240.00011.09
5.5.60.0100.00311.27
5.5.50.0040.00411.03
5.5.40.0090.00910.88
5.5.30.0140.00310.87
5.5.20.0210.00410.84
5.5.10.0080.01211.19
5.5.00.0070.00211.16
5.4.450.0050.04115.24
5.4.440.0050.02715.11
5.4.430.0020.04215.11
5.4.420.0030.03515.30
5.4.410.0030.04015.14
5.4.400.0060.03715.03
5.4.390.0030.04314.87
5.4.380.0030.03414.87
5.4.370.0050.03814.84
5.4.360.0070.02314.88
5.4.350.0070.02815.02
5.4.340.0050.03615.02
5.4.330.0000.00811.04
5.4.320.0000.03515.03
5.4.310.0060.03015.06
5.4.300.0060.04014.89
5.4.290.0000.02514.87
5.4.280.0100.03914.97
5.4.270.0030.02014.95
5.4.260.0100.03815.04
5.4.250.0060.04015.05
5.4.240.0060.03414.97
5.4.230.0090.03114.84
5.4.220.0090.02014.91
5.4.210.0090.02514.98
5.4.200.0030.04014.94
5.4.190.0030.03415.11
5.4.180.0150.01815.06
5.4.170.0060.04314.95
5.4.160.0040.02514.78
5.4.150.0040.02514.91
5.4.140.0080.03713.69
5.4.130.0090.03313.53
5.4.120.0090.03213.59
5.4.110.0090.04013.63
5.4.100.0050.03913.55
5.4.90.0050.04113.73
5.4.80.0100.02713.67
5.4.70.0070.03513.68
5.4.60.0080.02713.80
5.4.50.0030.03713.75
5.4.40.0060.02613.71
5.4.30.0040.03713.53
5.4.20.0050.03313.71
5.4.10.0060.02713.74
5.4.00.0010.04413.30
5.3.290.0100.02612.65
5.3.280.0100.03712.45
5.3.270.0040.04012.62
5.3.260.0040.02912.57
5.3.250.0070.02812.63
5.3.240.0100.03212.47
5.3.230.0030.04212.45
5.3.220.0050.04312.46
5.3.210.0020.03712.47
5.3.200.0050.04212.64
5.3.190.0060.03512.52
5.3.180.0020.03012.45
5.3.170.0060.03012.62
5.3.160.0010.03312.52
5.3.150.0030.03512.53
5.3.140.0020.03112.37
5.3.130.0060.03312.35
5.3.120.0050.03612.27
5.3.110.0020.04312.19
5.3.100.0070.03512.13
5.3.90.0030.03512.11
5.3.80.0020.03512.08
5.3.70.0030.03811.95
5.3.60.0000.04011.95
5.3.50.0060.03012.08
5.3.40.0030.03712.10
5.3.30.0060.02212.13
5.3.20.0020.02012.10
5.3.10.0000.02512.06
5.3.00.0000.03812.01
5.2.170.0020.03610.45
5.2.160.0030.03010.45
5.2.150.0040.02010.45
5.2.140.0000.03010.45
5.2.130.0050.01510.45
5.2.120.0010.02110.45
5.2.110.0010.03810.45
5.2.100.0050.03110.45
5.2.90.0050.03210.45
5.2.80.0050.02010.45
5.2.70.0030.02310.45
5.2.60.0020.01910.45
5.2.50.0070.02710.45
5.2.40.0040.02010.45
5.2.30.0070.01510.45
5.2.20.0030.03510.45
5.2.10.0120.03010.45
5.2.00.0000.02610.45
5.1.60.0000.02910.45
5.1.50.0020.01710.45
5.1.40.0070.03010.45
5.1.30.0060.02210.45
5.1.20.0050.02010.45
5.1.10.0150.02310.45
5.1.00.0050.02810.45
5.0.50.0050.01810.45
5.0.40.0080.02310.45
5.0.30.0050.03210.45
5.0.20.0030.01110.45
5.0.10.0060.01210.45
5.0.00.0060.03210.45
4.4.90.0030.01010.45
4.4.80.0020.02010.45
4.4.70.0030.01810.45
4.4.60.0030.01510.45
4.4.50.0020.02010.45
4.4.40.0050.02010.45
4.4.30.0020.01510.45
4.4.20.0010.01610.45
4.4.10.0030.02010.45
4.4.00.0020.03010.45
4.3.110.0020.02110.45
4.3.100.0010.01810.45
4.3.90.0030.01310.45
4.3.80.0020.02810.45
4.3.70.0030.01610.45
4.3.60.0040.01210.45
4.3.50.0000.01610.45
4.3.40.0020.02510.45
4.3.30.0030.01510.45
4.3.20.0020.01710.45
4.3.10.0030.01310.45
4.3.00.0000.01510.45

preferences:
45.79 ms | 401 KiB | 5 Q