3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singleton { private static $instance; private function __construct() {} 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 $Object1 == $c ? '+' : '-'; echo $Object1 === $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.60.0110.01118.68
8.3.50.0100.00821.25
8.3.40.0070.00718.99
8.3.30.0100.01019.22
8.3.20.0030.00620.39
8.3.10.0030.00621.85
8.3.00.0040.00423.64
8.2.180.0120.00316.50
8.2.170.0110.00722.96
8.2.160.0100.01022.07
8.2.150.0040.01124.18
8.2.140.0090.00624.66
8.2.130.0080.00026.16
8.2.120.0040.00417.75
8.2.110.0060.00319.33
8.2.100.0080.00417.79
8.2.90.0050.00319.20
8.2.80.0000.00817.97
8.2.70.0050.00517.50
8.2.60.0000.00817.80
8.2.50.0000.00918.07
8.2.40.0050.00320.96
8.2.30.0000.00819.95
8.2.20.0070.00417.63
8.2.10.0040.00417.95
8.2.00.0050.00217.95
8.1.280.0040.01125.92
8.1.270.0050.00320.39
8.1.260.0030.00626.35
8.1.250.0100.00728.09
8.1.240.0030.00621.06
8.1.230.0060.00617.45
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0050.00517.35
8.1.190.0030.00617.22
8.1.180.0080.00018.10
8.1.170.0000.00818.50
8.1.160.0000.00721.91
8.1.150.0070.00018.86
8.1.140.0050.00217.43
8.1.130.0030.00317.72
8.1.120.0040.00417.54
8.1.110.0030.00617.55
8.1.100.0070.00017.52
8.1.90.0070.00317.36
8.1.80.0000.00817.43
8.1.70.0070.00017.37
8.1.60.0060.00317.59
8.1.50.0040.00417.54
8.1.40.0000.00817.47
8.1.30.0060.00317.52
8.1.20.0050.00317.59
8.1.10.0000.00817.50
8.1.00.0000.00817.48
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0000.00718.47
8.0.270.0070.00017.26
8.0.260.0030.00317.27
8.0.250.0000.00816.93
8.0.240.0040.00417.05
8.0.230.0030.00316.92
8.0.220.0030.00516.84
8.0.210.0030.00616.96
8.0.200.0000.00716.90
8.0.190.0090.00017.04
8.0.180.0080.00017.04
8.0.170.0050.00217.01
8.0.160.0030.00616.93
8.0.150.0070.00016.96
8.0.140.0000.00716.96
8.0.130.0070.00013.39
8.0.120.0040.00416.83
8.0.110.0050.00216.95
8.0.100.0000.00816.84
8.0.90.0040.00416.92
8.0.80.0090.00617.01
8.0.70.0040.00416.84
8.0.60.0000.00716.92
8.0.50.0040.00416.81
8.0.30.0100.00917.20
8.0.20.0090.01017.40
8.0.10.0070.00016.87
8.0.00.0120.00716.79
7.4.330.0020.00215.11
7.4.320.0000.00716.64
7.4.300.0000.00716.52
7.4.290.0070.00016.60
7.4.280.0030.00616.50
7.4.270.0000.00716.50
7.4.260.0030.00516.58
7.4.250.0040.00416.53
7.4.240.0040.00416.47
7.4.230.0040.00416.69
7.4.220.0090.01216.61
7.4.210.0000.01516.56
7.4.200.0050.00216.51
7.4.160.0060.01016.51
7.4.150.0090.00917.40
7.4.140.0100.01317.86
7.4.130.0170.00216.63
7.4.120.0090.01516.56
7.4.110.0080.00816.59
7.4.100.0160.00716.38
7.4.90.0030.01416.50
7.4.80.0080.00819.39
7.4.70.0110.00816.48
7.4.60.0130.00616.55
7.4.50.0040.00416.51
7.4.40.0030.01316.52
7.4.30.0090.01516.45
7.4.00.0040.00714.95
7.3.330.0050.00013.20
7.3.320.0000.00513.34
7.3.310.0030.00316.41
7.3.300.0000.00716.14
7.3.290.0080.00716.33
7.3.280.0110.00816.40
7.3.270.0090.00917.40
7.3.260.0100.01516.40
7.3.250.0090.01016.51
7.3.240.0130.00616.54
7.3.230.0130.01016.40
7.3.210.0030.01516.48
7.3.200.0140.00316.29
7.3.190.0120.00916.47
7.3.180.0120.00316.58
7.3.170.0120.00916.59
7.3.160.0030.01316.32
7.2.330.0070.01116.62
7.2.320.0060.01016.81
7.2.310.0100.00716.80
7.2.300.0120.01216.87
7.2.290.0130.01016.63
7.2.00.0030.01019.65
7.1.100.0100.00318.13
7.1.70.0030.00316.98
7.1.60.0040.00719.42
7.1.50.0070.01116.98
7.1.00.0030.09322.40
7.0.200.0640.00614.96
7.0.60.0000.08719.95
7.0.50.0070.04717.86
7.0.40.0100.05720.30
7.0.30.0200.03720.33
7.0.20.0230.04020.21
7.0.10.0300.05720.25
7.0.00.0100.08020.10
5.6.280.0000.03321.10
5.6.210.0030.04020.66
5.6.200.0030.08318.14
5.6.190.0030.04320.64
5.6.180.0230.04320.41
5.6.170.0430.07020.54
5.6.160.0130.07720.71
5.6.150.0030.08718.15
5.6.140.0100.07318.16
5.6.130.0130.07718.28
5.6.120.0070.06021.05
5.6.110.0130.07021.11
5.6.100.0070.08721.01
5.6.90.0130.07021.04
5.6.80.0070.06720.30
5.6.70.2500.03720.36
5.5.350.0230.08020.34
5.5.340.0200.06718.09
5.5.330.0030.04720.47
5.5.320.0330.03320.51
5.5.310.0200.04720.30
5.5.300.0100.07317.93
5.5.290.0100.05717.98
5.5.280.0070.08020.89
5.5.270.0070.04320.97
5.5.260.0170.07720.78
5.5.250.0100.07720.60
5.5.240.0070.08720.05
5.4.450.0030.08019.39
5.4.440.0700.05719.15
5.4.430.0570.05319.43
5.4.420.0630.06719.44
5.4.410.0470.07319.24
5.4.400.0500.06318.99
5.4.390.0670.05719.27
5.4.380.0370.06019.25
5.4.370.0670.06018.84
5.4.360.0630.06319.11
5.4.350.0530.05718.82
5.4.340.0270.08319.10
5.4.320.0770.07019.27
5.4.310.0630.06719.38
5.4.300.0430.06019.04
5.4.290.0570.06019.27
5.4.280.0500.06718.81
5.4.270.0300.06019.29
5.4.260.0670.06718.82
5.4.250.0630.07718.85
5.4.240.0600.08019.05
5.4.230.0530.05318.83
5.4.220.0500.07318.99
5.4.210.0400.06719.03
5.4.200.0500.07016.70
5.4.190.0530.06318.98
5.4.180.0700.04318.98
5.4.170.0270.07019.10
5.4.160.0730.05019.14
5.4.150.0670.05319.00
5.4.140.0400.07016.63
5.4.130.0700.05716.58
5.4.120.0830.06316.61
5.4.110.0570.05716.38
5.4.100.0700.06316.39
5.4.90.0530.07016.40
5.4.80.0570.06016.55
5.4.70.0600.06716.41
5.4.60.0170.03716.54
5.4.50.0100.05316.26
5.4.40.0230.07316.34
5.4.30.0070.04016.38
5.4.20.0000.06316.43

preferences:
84.63 ms | 401 KiB | 5 Q