3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instance = null; final private function __construct() {} final private function __clone() {} public function __wakeup() { throw new Exception("Cannot unserialize singleton"); } public static function getInstance() { if (!self::$instance) { self::$instance = new self; } return self::$instance; } } $oneInstance = Singleton::getInstance(); echo "Cloneable outside:", var_dump((new ReflectionClass('Singleton'))->isCloneable()); $cloner = function () { return clone $this; }; $secondInstance = $cloner->bindTo($oneInstance, 'Singleton');//->__invoke(); // $thirdInstance = clone $oneInstance; var_dump($secondInstance); $reflection = new ReflectionClass($secondInstance); var_dump($reflection->getMethods()); var_dump($reflection->getMethod('bind')); var_dump($reflection->getMethod('bindTo'));

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.0000.01518.55
8.3.50.0080.00921.27
8.3.40.0060.00918.79
8.3.30.0130.00720.34
8.3.20.0040.00420.16
8.3.10.0040.00421.88
8.3.00.0040.00422.52
8.2.180.0100.01016.63
8.2.170.0130.00322.96
8.2.160.0120.00620.39
8.2.150.0080.00024.18
8.2.140.0000.00924.66
8.2.130.0050.00326.16
8.2.120.0050.00319.41
8.2.110.0060.00322.19
8.2.100.0090.00317.91
8.2.90.0050.00319.13
8.2.80.0080.00019.33
8.2.70.0090.00017.50
8.2.60.0030.00517.80
8.2.50.0050.00318.07
8.2.40.0000.00818.09
8.2.30.0060.00317.96
8.2.20.0080.00017.73
8.2.10.0000.00817.64
8.2.00.0080.00317.72
8.1.280.0070.00725.92
8.1.270.0160.00324.66
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0050.00523.79
8.1.230.0000.01119.14
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0030.00717.48
8.1.190.0000.00817.53
8.1.180.0060.00320.15
8.1.170.0060.00318.51
8.1.160.0050.00322.17
8.1.150.0060.00318.71
8.1.140.0040.00417.51
8.1.130.0030.00317.72
8.1.120.0040.00417.51
8.1.110.0070.00017.53
8.1.100.0000.00717.51
8.1.90.0080.00017.55
8.1.80.0000.00717.54
8.1.70.0000.00717.43
8.1.60.0030.00617.65
8.1.50.0000.00817.58
8.1.40.0040.00417.43
8.1.30.0040.00417.47
8.1.20.0040.00417.54
8.1.10.0080.00017.67
8.1.00.0070.00317.39
8.0.300.0040.00418.77
8.0.290.0070.00017.04
8.0.280.0050.00318.45
8.0.270.0070.00017.14
8.0.260.0030.00316.89
8.0.250.0030.00317.06
8.0.240.0080.00016.97
8.0.230.0030.00316.96
8.0.220.0000.00816.98
8.0.210.0070.00016.95
8.0.200.0040.00417.07
8.0.190.0040.00417.02
8.0.180.0000.00816.97
8.0.170.0000.00817.04
8.0.160.0040.00416.93
8.0.150.0030.00616.93
8.0.140.0040.00416.85
8.0.130.0030.00313.39
8.0.120.0040.00416.84
8.0.110.0000.00716.87
8.0.100.0000.00716.95
8.0.90.0070.00016.86
8.0.80.0140.00817.01
8.0.70.0040.00417.01
8.0.60.0070.00017.08
8.0.50.0000.00716.84
8.0.30.0130.00817.12
8.0.20.0100.01017.40
8.0.10.0000.00816.97
8.0.00.0140.00616.97
7.4.330.0050.00015.00
7.4.320.0040.00416.51
7.4.300.0020.00516.42
7.4.290.0030.00316.59
7.4.280.0050.00316.52
7.4.270.0080.00316.67
7.4.260.0030.00516.53
7.4.250.0000.00716.39
7.4.240.0020.00616.55
7.4.230.0000.00716.27
7.4.220.0100.01716.54
7.4.210.0090.00516.57
7.4.200.0040.00416.27
7.4.190.0000.00716.67
7.4.160.0080.00816.54
7.4.150.0110.00717.40
7.4.140.0080.01317.86
7.4.130.0160.00216.55
7.4.120.0100.00916.55
7.4.110.0150.00416.58
7.4.100.0170.00316.50
7.4.90.0100.01616.50
7.4.80.0090.00919.39
7.4.70.0120.00416.54
7.4.60.0040.01516.51
7.4.50.0040.00016.40
7.4.40.0080.00822.77
7.4.30.0180.00016.39
7.4.00.0060.00615.20
7.3.330.0050.00013.18
7.3.320.0060.00013.29
7.3.310.0040.00416.29
7.3.300.0030.00316.35
7.3.290.0090.00916.23
7.3.280.0090.00716.30
7.3.270.0130.00717.40
7.3.260.0100.01016.63
7.3.250.0090.00916.31
7.3.240.0110.01116.33
7.3.230.0100.01016.39
7.3.210.0150.00416.53
7.3.200.0090.00919.39
7.3.190.0060.01716.43
7.3.180.0070.01116.46
7.3.170.0100.00716.34
7.3.160.0060.01016.26
7.3.120.0140.00414.71
7.2.330.0120.00616.71
7.2.320.0170.00716.39
7.2.310.0110.01216.68
7.2.300.0040.01416.82
7.2.290.0100.00716.84
7.2.60.0480.00416.71
7.2.50.0070.01416.63
7.2.00.0060.00319.71
7.1.200.0030.00715.63
7.1.70.0030.00317.02
7.1.60.0100.01619.21
7.1.50.0120.01216.73
7.1.00.0030.03322.43
7.0.200.0170.00714.49
7.0.140.0030.07322.09
7.0.60.0030.05719.98
7.0.50.0100.04017.73
7.0.40.0130.08020.40
7.0.30.0230.04020.07
7.0.20.0170.04320.23
7.0.10.0230.08720.12
7.0.00.0070.08320.09
5.6.280.0030.07321.08
5.6.210.0170.07020.48
5.6.200.0070.08018.15
5.6.190.0030.08320.50
5.6.180.0200.05020.41
5.6.170.0300.06720.51
5.6.160.0100.08020.47
5.6.150.0070.06718.17
5.6.140.0100.08018.21
5.6.130.0070.06318.17
5.6.120.0100.03321.00
5.6.110.0100.05021.14
5.6.100.0030.05020.95
5.6.90.0170.07320.87
5.6.80.0030.08320.54
5.6.70.0230.07720.39
5.5.350.0000.07020.43
5.5.340.0030.05017.98
5.5.330.0170.07320.32
5.5.320.0200.04720.27
5.5.310.0270.05720.34
5.5.300.0070.07717.96
5.5.290.0070.08717.98
5.5.280.0000.05720.70
5.5.270.0030.04020.89
5.5.260.0070.08720.80
5.5.250.0130.07020.59
5.5.240.0170.06020.27
5.4.450.0200.03319.51
5.4.440.0200.07719.38
5.4.430.0230.07719.44
5.4.420.0200.05019.48
5.4.410.0270.07019.07
5.4.400.0100.06019.06
5.4.390.0230.03319.16
5.4.380.0130.04719.31
5.4.370.0200.07019.00
5.4.360.0170.04719.09
5.4.350.0230.04019.27
5.4.340.0200.07019.24
5.4.320.0100.08019.21
5.4.310.0170.07719.14
5.4.300.0070.05019.22
5.4.290.0200.07019.05
5.4.280.0100.05719.16
5.4.270.0200.07018.95
5.4.260.0100.04718.95
5.4.250.0130.04018.83
5.4.240.0130.03718.83
5.4.230.0270.07318.95
5.4.220.0170.05019.23
5.4.210.0170.05319.08
5.4.200.0130.04318.83
5.4.190.0170.06718.83
5.4.180.0130.04318.93
5.4.170.0130.04019.15
5.4.160.0170.04318.96
5.4.150.0200.04319.15
5.4.140.0100.04016.36
5.4.130.0230.06316.39
5.4.120.0230.03316.34
5.4.110.0200.05716.35
5.4.100.0130.05016.54
5.4.90.0130.07016.42
5.4.80.0170.05016.49
5.4.70.0230.04716.27
5.4.60.0100.06316.43
5.4.50.0230.05016.14
5.4.40.0130.03716.43
5.4.30.0130.03716.34
5.4.20.0200.04016.48
5.4.10.0100.04016.47
5.4.00.0170.04015.77
5.3.290.0200.07714.58
5.3.280.0100.08014.57
5.3.270.0130.07314.60
5.3.260.0130.07014.70
5.3.250.0130.08014.76
5.3.240.0170.06314.52
5.3.230.0130.04714.63
5.3.220.0200.07014.80
5.3.210.0200.06714.59
5.3.200.0270.07714.69
5.3.190.0170.05314.80
5.3.180.0170.05014.66
5.3.170.0270.06314.49
5.3.160.0170.04314.57
5.3.150.0170.06714.48
5.3.140.0270.04314.64
5.3.130.0270.05714.46
5.3.120.0130.04714.48
5.3.110.0400.02714.64
5.3.100.0130.04313.95
5.3.90.0200.06314.13
5.3.80.0200.04314.02
5.3.70.0230.03014.00
5.3.60.0070.04714.10
5.3.50.0200.03314.07
5.3.40.0130.04014.18
5.3.30.0200.04314.06
5.3.20.0230.02713.84
5.3.10.0200.03013.70
5.3.00.0230.02713.79
5.2.170.0100.03012.25
5.2.160.0170.02312.25
5.2.150.0170.03012.25
5.2.140.0170.05712.25
5.2.130.0200.02012.25
5.2.120.0130.03012.25
5.2.110.0230.05012.25
5.2.100.0170.04312.25
5.2.90.0170.02712.25
5.2.80.0130.06012.25
5.2.70.0200.05712.25
5.2.60.0100.05712.25
5.2.50.0170.03312.25
5.2.40.0130.06012.25
5.2.30.0130.03012.25
5.2.20.0130.03012.25
5.2.10.0170.03712.25
5.2.00.0130.04712.25
5.1.60.0130.02312.25
5.1.50.0130.02312.25
5.1.40.0170.03712.25
5.1.30.0130.04012.25
5.1.20.0100.06012.25
5.1.10.0130.02712.25
5.1.00.0070.03012.25
5.0.50.0070.04712.25
5.0.40.0030.03012.25
5.0.30.0070.04012.25
5.0.20.0100.02312.25
5.0.10.0070.02712.25
5.0.00.0070.06312.25
4.4.90.0100.03312.25
4.4.80.0100.01712.25
4.4.70.0030.03712.25
4.4.60.0070.02712.25
4.4.50.0070.02012.25
4.4.40.0130.05012.25
4.4.30.0030.03312.25
4.4.20.0100.03012.25
4.4.10.0100.02712.25
4.4.00.0070.05312.25
4.3.110.0070.02012.25
4.3.100.0070.02712.25
4.3.90.0070.01312.25
4.3.80.0070.05312.25
4.3.70.0070.01712.25
4.3.60.0070.03012.25
4.3.50.0030.01712.25
4.3.40.0070.05312.25
4.3.30.0030.03712.25
4.3.20.0070.02712.25
4.3.10.0070.03312.25
4.3.00.0030.02712.25

preferences:
41.93 ms | 401 KiB | 5 Q