3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait ClosureInATrait { public static function getClosureInTrait() { return function () { return __CLASS__; }; } } class ClassConstantTest { use ClosureInATrait; public static function getClosureInClass() { return function () { return __CLASS__; }; } } $closureInClass = ClassConstantTest::getClosureInClass(); $closureInTrait = ClassConstantTest::getClosureInTrait(); var_dump($closureInClass(), $closureInTrait()); $closureInClass = Closure::bind($closureInClass, new stdClass()); $closureInTrait = Closure::bind($closureInTrait, new stdClass()); var_dump($closureInClass(), $closureInTrait());

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.01116.38
8.3.50.0070.01121.88
8.3.40.0140.00318.71
8.3.30.0070.00719.15
8.3.20.0030.00620.34
8.3.10.0000.00823.67
8.3.00.0040.00418.99
8.2.180.0120.00316.38
8.2.170.0040.01122.96
8.2.160.0040.01120.39
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00020.90
8.2.110.0000.00821.95
8.2.100.0040.00820.35
8.2.90.0000.00819.08
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0030.00520.07
8.2.30.0000.00718.29
8.2.20.0000.00817.61
8.2.10.0000.00718.20
8.2.00.0060.00317.66
8.1.280.0100.00325.92
8.1.270.0080.00023.97
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0030.00622.04
8.1.230.0110.00019.15
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00617.35
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0050.00318.46
8.1.160.0030.00521.98
8.1.150.0040.00418.58
8.1.140.0000.00717.40
8.1.130.0000.00717.86
8.1.120.0030.00717.40
8.1.110.0040.00417.41
8.1.100.0000.00717.38
8.1.90.0000.00717.46
8.1.80.0020.00517.40
8.1.70.0070.00017.43
8.1.60.0030.00717.64
8.1.50.0000.00817.64
8.1.40.0030.00517.48
8.1.30.0060.00317.64
8.1.20.0060.00317.68
8.1.10.0000.00817.59
8.1.00.0000.00817.53
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.39
8.0.270.0040.00417.16
8.0.260.0070.00017.21
8.0.250.0070.00017.03
8.0.240.0000.00717.01
8.0.230.0050.00216.96
8.0.220.0070.00016.93
8.0.210.0000.00816.82
8.0.200.0000.00716.85
8.0.190.0040.00416.89
8.0.180.0030.00416.92
8.0.170.0000.00716.95
8.0.160.0040.00416.86
8.0.150.0000.00716.81
8.0.140.0040.00416.79
8.0.130.0060.00013.37
8.0.120.0040.00416.89
8.0.110.0030.00316.88
8.0.100.0030.00516.84
8.0.90.0040.00416.80
8.0.80.0140.00716.89
8.0.70.0020.00517.01
8.0.60.0000.00716.99
8.0.50.0000.00716.84
8.0.30.0100.01017.04
8.0.20.0130.00617.40
8.0.10.0040.00416.87
8.0.00.0120.00816.79
7.4.330.0020.00215.00
7.4.320.0030.00316.49
7.4.300.0000.00616.54
7.4.290.0070.00016.52
7.4.280.0000.00716.43
7.4.270.0040.00416.54
7.4.260.0030.00316.56
7.4.250.0070.00016.49
7.4.240.0020.00616.67
7.4.230.0030.00316.71
7.4.220.0170.00316.59
7.4.210.0100.01016.48
7.4.200.0000.00716.71
7.4.190.0030.00316.72
7.4.160.0100.01016.36
7.4.150.0160.00317.40
7.4.140.0090.00817.86
7.4.130.0150.00416.47
7.4.120.0130.00816.66
7.4.110.0130.01016.45
7.4.100.0090.00916.47
7.4.90.0150.00416.52
7.4.80.0140.00419.39
7.4.70.0070.01016.44
7.4.60.0060.01616.66
7.4.50.0000.00916.35
7.4.40.0170.00016.55
7.4.30.0100.00616.37
7.4.00.0070.01014.73
7.3.330.0040.00413.20
7.3.320.0000.00513.28
7.3.310.0000.00716.18
7.3.300.0040.00416.28
7.3.290.0080.00516.25
7.3.280.0080.00916.34
7.3.270.0110.00717.40
7.3.260.0120.00616.30
7.3.250.0090.00816.42
7.3.240.0030.01416.57
7.3.230.0130.00316.39
7.3.210.0140.00416.32
7.3.200.0180.00619.39
7.3.190.0090.00916.26
7.3.180.0090.00616.44
7.3.170.0060.01616.48
7.3.160.0030.01316.64
7.3.120.0030.01414.56
7.3.10.0040.00716.67
7.3.00.0030.01216.64
7.2.330.0070.01116.36
7.2.320.0140.00916.37
7.2.310.0030.01916.72
7.2.300.0060.01216.48
7.2.290.0070.01316.49
7.2.130.0070.00316.83
7.2.120.0080.00317.05
7.2.110.0080.00416.77
7.2.100.0030.00917.00
7.2.90.0100.00316.91
7.2.80.0030.01016.88
7.2.70.0070.00716.94
7.2.60.0060.00516.89
7.2.50.0000.01116.88
7.2.40.0080.00816.98
7.2.30.0110.00416.98
7.2.20.0030.01016.80
7.2.10.0080.00416.94
7.2.00.0090.00918.14
7.1.250.0060.00315.54
7.1.200.0050.00515.66
7.1.100.0100.00317.88
7.1.70.0000.00817.09
7.1.60.0130.01319.70
7.1.50.0050.00517.02
7.1.00.0030.07722.31
7.0.200.0000.00716.46
7.0.140.0000.07721.93
7.0.60.0030.06319.86
7.0.50.0030.08717.80
7.0.40.0100.08319.96
7.0.30.0130.04720.08
7.0.20.0270.05720.15
7.0.10.0130.05020.20
7.0.00.0100.08020.16
5.6.280.0030.07320.79
5.6.210.0070.06320.72
5.6.200.0070.08718.14
5.6.190.0030.06320.63
5.6.180.0270.05020.68
5.6.170.0370.05320.47
5.6.160.0070.03720.51
5.6.150.0070.05718.15
5.6.140.0030.05318.19
5.6.130.0100.07718.17
5.6.120.0130.07021.02
5.6.110.0070.05720.99
5.6.100.0130.06320.89
5.6.90.0070.06721.14
5.6.80.0000.06720.37
5.5.350.0030.07720.34
5.5.340.0000.07717.95
5.5.330.0200.07020.29
5.5.320.0030.07320.32
5.5.310.0330.07720.36
5.5.300.0000.06018.08
5.5.290.0030.04317.97
5.5.280.0070.04021.00
5.5.270.0100.04320.97
5.5.260.0100.07320.99
5.5.250.0100.07720.60
5.5.240.4170.04320.36
5.4.450.0270.04319.39
5.4.440.0100.04319.49
5.4.430.0200.04319.40
5.4.420.0230.03719.63
5.4.410.0200.03019.41
5.4.400.0530.04019.09
5.4.390.0370.05019.07
5.4.380.0030.08718.58
5.4.370.0170.05018.49
5.4.360.0230.04018.75
5.4.350.0130.06018.73
5.4.340.0030.07018.50
5.4.320.0060.03912.52
5.4.310.0060.04812.51
5.4.300.0040.03712.51
5.4.290.0050.03912.51
5.4.280.0070.03412.41
5.4.270.0050.03812.41
5.4.260.0080.03512.41
5.4.250.0040.03812.41
5.4.240.0070.03412.41
5.4.230.0080.03512.39
5.4.220.0080.03312.40
5.4.210.0090.03112.40
5.4.200.0090.03712.40
5.4.190.0030.03812.40
5.4.180.0050.03912.39
5.4.170.0060.04012.41
5.4.160.0090.03412.40
5.4.150.0090.03712.40
5.4.140.0100.04612.08
5.4.130.0060.05112.07
5.4.120.0070.04212.02
5.4.110.0060.03412.02
5.4.100.0060.05012.02
5.4.90.0070.05412.02
5.4.80.0080.04912.02
5.4.70.0060.03312.02
5.4.60.0050.03912.02
5.4.50.0060.03912.02
5.4.40.0100.04112.00
5.4.30.0030.04012.00
5.4.20.0040.03912.00
5.4.10.0050.03812.00
5.4.00.0080.04011.49
5.3.290.0050.04412.80
5.3.280.0070.04412.71
5.3.270.0050.03912.73
5.3.260.0030.04212.72
5.3.250.0050.04112.72
5.3.240.0080.03912.71
5.3.230.0070.04112.71
5.3.220.0080.03512.68
5.3.210.0020.04312.68
5.3.200.0080.04112.68
5.3.190.0040.04012.68
5.3.180.0090.03412.67
5.3.170.0090.03412.67
5.3.160.0070.03612.67
5.3.150.0070.03712.67
5.3.140.0020.04112.66
5.3.130.0080.03712.66
5.3.120.0060.04312.66
5.3.110.0100.04012.66
5.3.100.0050.04112.12
5.3.90.0060.03912.08
5.3.80.0080.03612.07
5.3.70.0080.03612.08
5.3.60.0090.04012.06
5.3.50.0060.03712.00
5.3.40.0110.03312.00
5.3.30.0080.03311.95
5.3.20.0080.03511.73
5.3.10.0040.03811.70
5.3.00.0100.04011.68
5.2.170.0050.0339.18
5.2.160.0040.0359.18
5.2.150.0040.0339.19
5.2.140.0090.0459.18
5.2.130.0160.0549.14
5.2.120.0070.0449.13
5.2.110.0070.0449.14
5.2.100.0130.0429.14
5.2.90.0070.0489.14
5.2.80.0070.0489.14
5.2.70.0060.0469.14
5.2.60.0070.0449.09
5.2.50.0090.0379.06
5.2.40.0070.0419.04
5.2.30.0040.0549.02
5.2.20.0090.0359.00
5.2.10.0050.0418.92
5.2.00.0070.0408.78
5.1.60.0040.0268.07
5.1.50.0040.0268.06
5.1.40.0050.0248.05
5.1.30.0060.0378.40
5.1.20.0040.0298.42
5.1.10.0050.0418.14
5.1.00.0030.0308.14
5.0.50.0060.0186.63
5.0.40.0030.0206.48
5.0.30.0050.0306.29
5.0.20.0030.0206.27
5.0.10.0020.0226.25
5.0.00.0020.0326.23
4.4.90.0030.0154.78
4.4.80.0040.0144.75
4.4.70.0030.0154.76
4.4.60.0040.0144.75
4.4.50.0010.0174.77
4.4.40.0040.0264.71
4.4.30.0050.0194.76
4.4.20.0030.0174.84
4.4.10.0040.0144.85
4.4.00.0040.0254.76
4.3.110.0010.0174.67
4.3.100.0030.0164.67
4.3.90.0030.0154.63
4.3.80.0050.0304.58
4.3.70.0030.0204.63
4.3.60.0060.0144.62
4.3.50.0040.0154.63
4.3.40.0040.0294.54
4.3.30.0040.0193.28
4.3.20.0040.0223.26
4.3.10.0030.0223.22
4.3.00.0070.01716.92

preferences:
38.72 ms | 401 KiB | 5 Q