3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instance; private function __construct() { return 12; } private function __clone() {} private function __wakeup() {} public static function getInstance() { if (empty(self::$instance)) self::$instance = new self(); return self::$instance; } } $Object1 = Singleton::getInstance(); // ------------------------------------------------------- class PrivacyViolator { private $_caller; function __construct() { $this->_caller = function ($method, $args) { return call_user_func_array([$this, $method], $args); }; } function callPrivateMethod($object, $method, $args) { return $this->_caller->bindTo($object, $object)->__invoke($method, $args); } } $privacyViolator = new PrivacyViolator(); $c = $privacyViolator->callPrivateMethod($Object1, '__construct', []); echo $c;

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.70.0070.01418.68
8.3.60.0170.00318.43
8.3.50.0200.00821.14
8.3.40.0120.00918.97
8.3.30.0100.00319.08
8.3.20.0040.00420.29
8.3.10.0040.00421.95
8.3.00.0050.00323.66
8.2.190.0060.01016.88
8.2.180.0120.00916.63
8.2.170.0120.00622.96
8.2.160.0100.01022.02
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0090.00017.50
8.2.110.0060.00321.09
8.2.100.0110.00017.75
8.2.90.0030.00519.21
8.2.80.0000.00917.97
8.2.70.0050.00317.63
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0030.00621.14
8.2.30.0030.00519.84
8.2.20.0030.00617.71
8.2.10.0000.00818.08
8.2.00.0000.00817.95
8.1.280.0100.01025.92
8.1.270.0080.00020.30
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0140.00719.16
8.1.230.0040.00819.26
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.38
8.1.190.0080.00017.35
8.1.180.0060.00318.10
8.1.170.0060.00318.49
8.1.160.0040.00422.16
8.1.150.0040.00418.88
8.1.140.0050.00317.45
8.1.130.0000.00717.74
8.1.120.0040.00417.45
8.1.110.0110.00017.45
8.1.100.0070.00017.39
8.1.90.0070.00317.53
8.1.80.0040.00417.45
8.1.70.0000.00717.48
8.1.60.0000.00917.55
8.1.50.0060.00317.43
8.1.40.0000.00817.43
8.1.30.0030.00517.59
8.1.20.0020.00517.61
8.1.10.0000.00817.66
8.1.00.0060.00317.59
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0030.00318.39
8.0.270.0000.00717.18
8.0.260.0030.00317.35
8.0.250.0040.00417.00
8.0.240.0030.00317.04
8.0.230.0030.00317.03
8.0.220.0030.00316.98
8.0.210.0070.00416.97
8.0.200.0000.00717.00
8.0.190.0090.00016.90
8.0.180.0000.00916.89
8.0.170.0000.00816.89
8.0.160.0030.00316.97
8.0.150.0030.00516.86
8.0.140.0050.00316.83
8.0.130.0000.00513.37
8.0.120.0000.00816.87
8.0.110.0030.00616.94
8.0.100.0070.00017.02
8.0.90.0000.00716.85
8.0.80.0070.00716.95
8.0.70.0000.00717.09
8.0.60.0030.00517.00
8.0.50.0060.00316.95
8.0.30.0070.01417.04
8.0.20.0100.00917.40
8.0.10.0040.00417.10
8.0.00.0080.00916.78
7.4.330.0020.00215.08
7.4.320.0000.00616.54
7.4.300.0080.00016.38
7.4.290.0060.00016.63
7.4.280.0030.00316.52
7.4.270.0000.00716.64
7.4.260.0000.00816.60
7.4.250.0080.00016.41
7.4.240.0030.00516.45
7.4.230.0070.00016.65
7.4.220.0150.00416.64
7.4.210.0080.00616.53
7.4.200.0000.00716.43
7.4.160.0090.00616.39
7.4.150.0130.00617.40
7.4.140.0170.00517.86
7.4.130.0120.00616.54
7.4.120.0100.01216.53
7.4.110.0100.01316.41
7.4.100.0130.01016.33
7.4.90.0150.00716.41
7.4.80.0040.01319.39
7.4.70.0130.01216.54
7.4.60.0080.00816.44
7.4.50.0030.00516.56
7.4.40.0090.00916.46
7.4.30.0130.00616.41
7.4.00.0070.01014.85
7.3.330.0030.00313.40
7.3.320.0000.00613.20
7.3.310.0040.00416.29
7.3.300.0030.00316.16
7.3.290.0070.01116.33
7.3.280.0080.00716.28
7.3.270.0060.01617.40
7.3.260.0060.01916.52
7.3.250.0100.00716.50
7.3.240.0140.00316.41
7.3.230.0090.00916.50
7.3.210.0100.01016.29
7.3.200.0060.01216.60
7.3.190.0100.01316.19
7.3.180.0090.00916.47
7.3.170.0110.00816.29
7.3.160.0110.01216.53
7.3.120.0060.01314.98
7.3.110.0100.00615.00
7.3.100.0040.01515.07
7.3.90.0110.00314.95
7.3.80.0030.01014.68
7.3.70.0100.00314.89
7.3.60.0130.00014.87
7.3.50.0000.01215.04
7.3.40.0000.00914.91
7.3.30.0030.01014.80
7.3.20.0060.01216.56
7.3.10.0030.01016.58
7.3.00.0060.00916.81
7.2.330.0200.00616.82
7.2.320.0100.00716.70
7.2.310.0150.00616.71
7.2.300.0050.01316.32
7.2.290.0090.00916.52
7.2.250.0060.01214.99
7.2.240.0000.01915.09
7.2.230.0070.01015.32
7.2.220.0090.00914.96
7.2.210.0030.01215.07
7.2.200.0150.00015.16
7.2.190.0060.00915.01
7.2.180.0030.00814.76
7.2.170.0120.00414.85
7.2.00.0030.00919.61
7.1.330.0040.01215.60
7.1.320.0080.00815.81
7.1.310.0070.00715.63
7.1.300.0030.01015.82
7.1.290.0100.00315.87
7.1.280.0060.01015.54
7.1.270.0090.00615.90
7.1.260.0060.00915.76
7.1.100.0040.00718.02
7.1.70.0000.00717.06
7.1.60.0070.01719.42
7.1.50.0030.01717.09
7.1.00.0000.08022.57
7.0.200.0840.00314.96
7.0.60.0070.03719.88
7.0.50.0000.04317.83
7.0.40.0070.04320.23
7.0.30.0200.03720.12
7.0.20.0300.05020.19
7.0.10.0100.04720.25
7.0.00.0100.03720.06
5.6.280.0000.03720.84
5.6.210.0170.07720.66
5.6.200.0070.05318.30
5.6.190.0030.04720.55
5.6.180.0330.06320.50
5.6.170.0330.08020.55
5.6.160.0070.06320.47
5.6.150.0030.05318.27
5.6.140.0070.05718.27
5.6.130.0100.07718.16
5.6.120.0130.08321.00
5.6.110.0100.04021.04
5.6.100.0100.07320.90
5.6.90.0030.08720.99
5.6.80.0170.07320.53
5.5.350.0170.08020.54
5.5.340.0030.08717.94
5.5.330.0000.06720.41
5.5.320.0270.04720.24
5.5.310.0300.07020.51
5.5.300.0000.06717.98
5.5.290.0170.07318.02
5.5.280.0100.08020.97
5.5.270.0070.05720.77
5.5.260.0030.04320.91
5.5.250.0070.03720.70
5.5.240.0000.07320.20
5.4.450.0530.06319.50
5.4.440.0170.06719.27
5.4.430.0070.07719.58
5.4.420.0800.06319.31
5.4.410.0930.07019.29
5.4.400.0800.05319.36
5.4.390.0830.07319.09
5.4.380.0970.04719.20
5.4.370.0830.07019.24
5.4.360.1000.08019.04
5.4.350.0930.05019.15
5.4.340.0870.06019.29
5.4.320.0700.06718.84
5.4.310.1030.04318.99
5.4.300.0870.05019.04
5.4.290.0700.06718.81
5.4.280.0700.05719.24
5.4.270.0870.05319.13
5.4.260.0730.05719.04
5.4.250.0900.06719.20
5.4.240.0900.06018.92
5.4.230.1170.06718.81
5.4.220.1000.07319.27
5.4.210.1130.05019.16
5.4.200.1270.06016.84
5.4.190.1030.06319.11
5.4.180.0970.05718.96
5.4.170.0770.06018.90
5.4.160.0770.07019.09
5.4.150.0230.06019.32
5.4.140.0200.06316.79
5.4.130.0530.07016.48
5.4.120.0800.05316.63
5.4.110.1030.06316.46
5.4.100.0970.07016.62
5.4.90.0600.07716.60
5.4.80.0070.07016.34
5.4.70.0170.06016.44
5.4.60.0800.03716.36
5.4.50.0800.05316.50
5.4.40.0800.05316.37
5.4.30.0930.04716.38
5.4.20.0670.05316.48
5.4.10.1000.05316.39
5.4.00.0800.05015.76
5.3.290.0670.05714.59
5.3.280.0930.06314.52
5.3.270.0970.07714.85
5.3.260.0930.05014.67
5.3.250.0930.06014.53
5.3.240.0830.07014.76
5.3.230.0930.05014.62
5.3.220.0900.04714.80
5.3.210.0900.05314.59
5.3.200.0800.06314.49
5.3.190.0830.05314.80
5.3.180.0800.05314.80
5.3.170.0830.06714.57
5.3.160.0800.05314.48
5.3.150.0830.05314.49
5.3.140.0570.06014.63
5.3.130.0630.05314.78
5.3.120.0770.05714.57
5.3.110.0670.05714.56
5.3.100.0930.04714.05
5.3.90.0770.06314.25
5.3.80.0700.06013.89
5.3.70.0830.05314.04
5.3.60.0830.06013.88
5.3.50.1000.06314.20
5.3.40.0830.05014.01
5.3.30.0800.06313.85
5.3.20.0930.06013.60
5.3.10.0770.06713.58
5.3.00.1000.05713.58
5.2.170.0570.04311.06
5.2.160.0570.04011.24
5.2.150.0630.05311.08
5.2.140.0630.07311.08
5.2.130.0870.04711.12
5.2.120.0900.04310.98
5.2.110.0870.03711.12
5.2.100.0630.04711.16
5.2.90.0730.04011.34
5.2.80.0670.04711.25
5.2.70.0700.04311.01
5.2.60.0730.03311.07
5.2.50.0630.05710.89
5.2.40.0670.04010.95
5.2.30.0530.04310.90
5.2.20.0530.05010.88
5.2.10.0670.04010.88
5.2.00.0500.04010.64
5.1.60.0500.04010.25
5.1.50.0130.0379.98
5.1.40.0000.04010.05
5.1.30.0070.03710.26
5.1.20.0170.03310.45
5.1.10.0270.04310.13
5.1.00.0430.03710.13
5.0.50.0230.0308.56
5.0.40.0200.0278.45
5.0.30.0270.0438.16
5.0.20.0170.0508.27
5.0.10.0270.0308.02
5.0.00.0130.0538.09
4.4.90.0070.0205.86
4.4.80.0070.0205.76
4.4.70.0030.0235.92
4.4.60.0000.0235.86
4.4.50.0070.0205.93
4.4.40.0070.0335.84
4.4.30.0030.0205.87
4.4.20.0030.0235.81
4.4.10.0230.0275.93
4.4.00.0200.0375.87
4.3.110.0330.0205.78
4.3.100.0230.0275.75
4.3.90.0500.0235.76
4.3.80.0300.0375.73
4.3.70.0270.0205.74
4.3.60.0270.0375.75
4.3.50.0300.0235.77
4.3.40.0170.0405.70
4.3.30.0130.0234.59
4.3.20.0100.0274.59
4.3.10.0170.0204.59
4.3.00.0230.0107.03

preferences:
68.16 ms | 401 KiB | 5 Q