3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Closure; class Shared { public function share(Closure $closure) { return function($container) use ($closure) { // We'll simply declare a static variable within the Closures and if it has // not been set we will execute the given Closures to resolve this value // and return it back to these consumers of the method as an instance static $object; if(is_null($object)) { $object = $closure($container); } return $object; }; } }

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.0110.00318.43
8.3.50.0110.00521.27
8.3.40.0160.00318.81
8.3.30.0070.00719.14
8.3.20.0040.00420.25
8.3.10.0040.00422.05
8.3.00.0040.00422.47
8.2.180.0180.00416.63
8.2.170.0110.00422.96
8.2.160.0030.01020.39
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.64
8.2.110.0060.00322.00
8.2.100.0040.00819.31
8.2.90.0040.00418.94
8.2.80.0040.00419.40
8.2.70.0050.00317.49
8.2.60.0080.00017.80
8.2.50.0080.00018.07
8.2.40.0040.00417.97
8.2.30.0020.00517.90
8.2.20.0040.00417.57
8.2.10.0000.00817.57
8.2.00.0060.00317.63
8.1.280.0100.00725.92
8.1.270.0040.00420.04
8.1.260.0080.00026.35
8.1.250.0020.00528.09
8.1.240.0030.00623.79
8.1.230.0030.00719.10
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0110.00017.10
8.1.190.0050.00317.18
8.1.180.0000.00718.52
8.1.170.0090.00018.46
8.1.160.0060.00322.13
8.1.150.0070.00018.59
8.1.140.0070.00017.43
8.1.130.0030.00317.82
8.1.120.0070.00017.27
8.1.110.0050.00317.29
8.1.100.0040.00417.28
8.1.90.0030.00717.33
8.1.80.0000.00717.22
8.1.70.0000.00717.34
8.1.60.0030.00517.39
8.1.50.0030.00517.45
8.1.40.0070.00017.41
8.1.30.0000.00717.53
8.1.20.0040.00417.51
8.1.10.0080.00017.38
8.1.00.0030.00617.23
8.0.300.0000.00718.77
8.0.290.0070.00016.92
8.0.280.0040.00418.38
8.0.270.0030.00317.19
8.0.260.0070.00016.76
8.0.250.0030.00416.92
8.0.240.0000.00816.91
8.0.230.0070.00016.88
8.0.220.0030.00316.88
8.0.210.0030.00316.84
8.0.200.0030.00316.87
8.0.190.0080.00016.85
8.0.180.0030.00516.87
8.0.170.0040.00416.89
8.0.160.0060.00316.69
8.0.150.0000.00816.81
8.0.140.0040.00416.82
8.0.130.0000.00513.29
8.0.120.0000.00816.71
8.0.110.0020.00516.83
8.0.100.0040.00416.63
8.0.90.0070.00016.89
8.0.80.0120.00916.76
8.0.70.0040.00416.87
8.0.60.0000.00716.90
8.0.50.0040.00416.85
8.0.30.0120.00716.93
8.0.20.0060.01217.40
8.0.10.0030.00416.77
8.0.00.0090.00916.54
7.4.330.0000.00815.00
7.4.320.0030.00316.42
7.4.300.0030.00316.47
7.4.290.0020.00516.48
7.4.280.0000.00816.27
7.4.270.0000.00716.42
7.4.260.0040.00416.45
7.4.250.0000.00716.34
7.4.240.0050.00216.47
7.4.230.0000.00616.55
7.4.220.0100.00716.32
7.4.210.0080.00916.48
7.4.200.0070.00016.18
7.4.190.0030.00316.44
7.4.160.0050.01416.15
7.4.150.0070.01117.40
7.4.140.0090.01517.86
7.4.130.0110.00616.35
7.4.120.0090.00916.38
7.4.110.0070.01016.42
7.4.100.0090.01216.68
7.4.90.0060.01216.22
7.4.80.0110.00719.39
7.4.70.0190.00016.33
7.4.60.0160.00316.38
7.4.50.0050.00016.53
7.4.40.0060.00922.77
7.4.30.0090.00916.55
7.4.00.0000.01415.00
7.3.330.0000.00513.27
7.3.320.0060.00013.04
7.3.310.0060.00016.27
7.3.300.0000.00716.28
7.3.290.0100.00316.21
7.3.280.0100.00516.21
7.3.270.0070.01117.40
7.3.260.0060.01116.36
7.3.250.0150.00516.12
7.3.240.0130.00516.18
7.3.230.0120.00616.39
7.3.210.0090.01316.47
7.3.200.0060.01219.39
7.3.190.0140.01016.19
7.3.180.0080.00816.30
7.3.170.0130.00316.30
7.3.160.0120.00316.21
7.3.120.0060.00614.53
7.2.330.0090.00916.36
7.2.320.0090.01616.35
7.2.310.0080.00816.32
7.2.300.0040.01216.36
7.2.290.0130.00916.43
7.2.00.0040.01119.27
7.1.200.0030.00715.60
7.1.100.0030.01017.73
7.1.70.0000.00716.93
7.1.60.0130.01019.82
7.1.50.0000.02116.38
7.1.00.0030.06722.32
7.0.200.0000.00916.55
7.0.140.0030.06321.99
7.0.60.0070.06319.99
7.0.50.0000.04317.96
7.0.40.0070.04020.27
7.0.30.0400.04720.26
7.0.20.0300.08020.19
7.0.10.0030.05320.12
7.0.00.0100.05320.30
5.6.280.0000.07721.08
5.6.210.0100.08720.52
5.6.200.0070.08018.18
5.6.190.0000.04720.58
5.6.180.0400.04320.67
5.6.170.0270.06720.46
5.6.160.0030.04320.46
5.6.150.0030.08718.14
5.6.140.0030.04318.16
5.6.130.0000.04318.27
5.6.120.0100.05321.02
5.6.110.0100.07720.90
5.6.100.0070.05021.14
5.6.90.0070.04020.98
5.6.80.0170.06720.39
5.5.350.0170.07020.34
5.5.340.0100.07718.09
5.5.330.0130.07720.23
5.5.320.0430.03720.30
5.5.310.0130.05720.32
5.5.300.0030.08317.95
5.5.290.0000.08318.07
5.5.280.0030.04020.76
5.5.270.0100.07720.88
5.5.260.0100.08020.88
5.5.250.0070.09020.70
5.5.240.0230.04020.37
5.4.450.0230.06019.55
5.4.440.0900.07019.59
5.4.430.0970.05719.48
5.4.420.0870.05719.61
5.4.410.0730.05319.45
5.4.400.0830.06019.38
5.4.390.0770.06719.06
5.4.380.0330.05318.74
5.4.370.0270.04318.75
5.4.360.0430.05318.56
5.4.350.0080.03812.03
5.4.340.0100.03612.02
5.4.320.0080.04312.52
5.4.310.0080.04212.51
5.4.300.0060.04012.51
5.4.290.0060.03712.51
5.4.280.0080.03312.40
5.4.270.0070.03512.40
5.4.260.0020.04212.40
5.4.250.0070.05319.10
5.4.240.0100.05718.65
5.4.230.0070.06018.79
5.4.220.0130.05318.96
5.4.210.0070.05718.98
5.4.200.0070.05319.00
5.4.190.0070.06018.84
5.4.180.0100.05718.95
5.4.170.0070.05318.93
5.4.160.0070.07318.98
5.4.150.0130.04718.94
5.4.140.0100.04716.42
5.4.130.0100.05016.54
5.4.120.0030.05316.61
5.4.110.0130.05016.67
5.4.100.0100.06716.44
5.4.90.0100.06016.57
5.4.80.0100.04716.55
5.4.70.0070.05016.55
5.4.60.0030.06316.46
5.4.50.0030.05016.38
5.4.40.0100.04716.70
5.4.30.0130.06316.45
5.4.20.0100.06316.39
5.4.10.0030.05316.38
5.4.00.0070.04715.84
5.3.290.0040.04212.80
5.3.280.0070.05314.68
5.3.270.0070.05314.64
5.3.260.0200.04714.64
5.3.250.0130.06014.44
5.3.240.0170.04714.70
5.3.230.0130.04314.69
5.3.220.0100.06014.59
5.3.210.0100.08014.65
5.3.200.0000.06014.61
5.3.190.0100.05014.66
5.3.180.0070.07014.59
5.3.170.0130.05014.65
5.3.160.0070.06014.66
5.3.150.0170.04714.59
5.3.140.0070.05014.63
5.3.130.0070.05314.62
5.3.120.0100.06014.64
5.3.110.0070.05014.46
5.3.100.0030.05014.20
5.3.90.0070.05014.20
5.3.80.0100.04714.20
5.3.70.0100.04713.99
5.3.60.0030.07314.06
5.3.50.0030.06313.85
5.3.40.0070.04714.03
5.3.30.0030.05313.83
5.3.20.0000.05713.88
5.3.10.0070.04713.66
5.3.00.0030.05713.72
5.2.170.0070.04011.25
5.2.160.0030.04011.16
5.2.150.0070.04311.29
5.2.140.0130.03311.07
5.2.130.0130.03711.09
5.2.120.0070.05711.11
5.2.110.0170.03011.19
5.2.100.0100.03310.93
5.2.90.0000.04710.93
5.2.80.0030.04311.09
5.2.70.0070.04311.00
5.2.60.0030.05010.94
5.2.50.0000.04711.04
5.2.40.0100.03310.88
5.2.30.0100.03710.89
5.2.20.0070.05310.96
5.2.10.0100.04710.93
5.2.00.0100.03310.63
5.1.60.0030.0439.92
5.1.50.0000.04010.22
5.1.40.0030.0379.90
5.1.30.0170.03710.10
5.1.20.0030.04010.11
5.1.10.0100.04710.09
5.1.00.0000.0579.91
5.0.50.0070.0278.61
5.0.40.0030.0278.60
5.0.30.0070.0578.15
5.0.20.0070.0238.16
5.0.10.0100.0278.11
5.0.00.0100.0338.09
4.4.90.0070.0176.51
4.4.80.0030.0206.51
4.4.70.0000.0276.51
4.4.60.0030.0206.51
4.4.50.0000.0236.51
4.4.40.0000.0376.51
4.4.30.0100.0176.51
4.4.20.0070.0206.51
4.4.10.0030.0206.51
4.4.00.0000.0376.51
4.3.110.0070.0176.51
4.3.100.0070.0176.51
4.3.90.0030.0206.51
4.3.80.0030.0376.51
4.3.70.0030.0206.51
4.3.60.0100.0236.51
4.3.50.0000.0236.51
4.3.40.0030.0306.51
4.3.30.0030.0236.51
4.3.20.0030.0276.51
4.3.10.0030.0206.51
4.3.00.0070.0207.30

preferences:
33.42 ms | 401 KiB | 5 Q