3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { private $attr = [1,2,3]; } $t = function(){ var_dump($this->attr); return $this; }; $t->bindTo(new T(), 'T'); //$c1 = Closure::bind($t, new T(), 'T'); $t(); var_dump($t()); die; abstract class T { static public $instanses; final private function __construct(){ } public static function getInstance() { var_dump(static::$instanses); if (!(static::$instanses instanceof static)) { static::$instanses = new static; } var_dump(static::$instanses); return static::$instanses; } } class A extends T { static public $instanses; } class B extends A { static public $instanses; } $t = A::getInstance(); var_dump($t); $t1 = B::getInstance(); var_dump($t1); new B(); ?>

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.0150.00418.43
8.3.50.0120.00721.14
8.3.40.0070.01118.80
8.3.30.0080.00818.84
8.3.20.0100.00319.90
8.3.10.0050.00323.54
8.3.00.0060.00322.39
8.2.180.0120.00916.35
8.2.170.0150.00022.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0090.00017.74
8.2.110.0030.00721.25
8.2.100.0000.01217.63
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0030.00617.67
8.2.50.0070.00518.07
8.2.40.0000.00821.04
8.2.30.0030.00619.85
8.2.20.0040.00417.70
8.2.10.0000.00718.16
8.2.00.0040.00418.13
8.1.280.0120.00925.92
8.1.270.0040.00420.33
8.1.260.0070.00326.35
8.1.250.0070.00728.09
8.1.240.0100.01023.97
8.1.230.0040.00717.42
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0100.00017.25
8.1.190.0030.00617.25
8.1.180.0030.00618.10
8.1.170.0060.00318.65
8.1.160.0060.00323.84
8.1.150.0080.00018.96
8.1.140.0000.00817.53
8.1.130.0000.00817.80
8.1.120.0080.00017.56
8.1.110.0000.00817.38
8.1.100.0000.00917.38
8.1.90.0070.00017.38
8.1.80.0030.00617.39
8.1.70.0000.00717.47
8.1.60.0030.00617.66
8.1.50.0040.00417.61
8.1.40.0030.00517.45
8.1.30.0050.00317.66
8.1.20.0030.00517.57
8.1.10.0040.00417.65
8.1.00.0080.00017.57
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0040.00418.38
8.0.270.0000.00717.09
8.0.260.0000.00617.20
8.0.250.0040.00416.97
8.0.240.0000.00716.85
8.0.230.0000.00816.93
8.0.220.0080.00016.93
8.0.210.0040.00416.80
8.0.200.0030.00317.09
8.0.190.0040.00417.04
8.0.180.0040.00416.96
8.0.170.0040.00417.00
8.0.160.0000.00816.96
8.0.150.0050.00316.98
8.0.140.0070.00016.94
8.0.130.0000.00713.37
8.0.120.0030.00716.96
8.0.110.0000.00716.93
8.0.100.0030.00616.93
8.0.90.0050.00216.87
8.0.80.0030.01216.98
8.0.70.0000.00716.95
8.0.60.0070.00016.98
8.0.50.0000.00716.85
8.0.30.0120.00917.01
8.0.20.0110.01117.40
8.0.10.0070.00017.16
8.0.00.0140.00516.79
7.4.330.0030.00315.12
7.4.320.0060.00016.54
7.4.300.0060.00016.63
7.4.290.0030.00316.63
7.4.280.0070.00016.54
7.4.270.0040.00416.54
7.4.260.0000.00716.43
7.4.250.0050.00316.58
7.4.240.0000.00716.67
7.4.230.0040.00416.73
7.4.220.0090.00916.57
7.4.210.0060.01216.50
7.4.200.0040.00416.50
7.4.160.0040.01216.46
7.4.150.0070.01717.40
7.4.140.0120.00917.86
7.4.130.0110.00716.45
7.4.120.0060.01316.46
7.4.110.0160.00016.61
7.4.100.0180.00016.45
7.4.90.0100.00716.67
7.4.80.0090.00919.39
7.4.70.0140.00716.62
7.4.60.0090.00616.54
7.4.50.0000.00616.59
7.4.40.0120.00416.66
7.4.30.0120.00616.66
7.4.00.0090.00914.79
7.3.330.0000.00513.36
7.3.320.0050.00013.34
7.3.310.0080.00016.43
7.3.300.0030.00316.21
7.3.290.0030.00316.30
7.3.280.0090.01116.36
7.3.270.0030.01417.40
7.3.260.0090.01216.38
7.3.250.0060.01216.44
7.3.240.0070.01316.40
7.3.230.0140.00316.53
7.3.210.0130.00316.46
7.3.200.0140.00619.39
7.3.190.0090.01016.45
7.3.180.0140.00616.63
7.3.170.0140.00716.51
7.3.160.0070.01416.59
7.3.120.0070.01114.88
7.3.110.0060.01214.80
7.3.100.0090.00614.88
7.3.90.0030.01114.94
7.3.80.0120.00014.83
7.3.70.0070.00314.66
7.3.60.0040.00814.74
7.3.50.0030.00914.69
7.3.40.0100.00314.91
7.3.30.0030.01014.90
7.3.20.0110.00416.66
7.3.10.0120.00616.63
7.3.00.0060.00616.36
7.2.330.0070.01116.82
7.2.320.0070.01016.70
7.2.310.0080.00816.61
7.2.300.0170.00416.71
7.2.290.0100.00716.45
7.2.250.0070.01014.99
7.2.240.0030.01315.06
7.2.230.0060.01315.19
7.2.220.0070.00315.16
7.2.210.0040.01214.88
7.2.200.0060.00914.87
7.2.190.0100.00314.94
7.2.180.0100.00715.05
7.2.170.0040.01115.11
7.2.80.0100.00016.63
7.2.60.0070.00716.66
7.2.00.0120.00319.49
7.1.330.0070.01015.78
7.1.320.0000.01315.55
7.1.310.0030.00615.42
7.1.300.0070.00415.52
7.1.290.0030.01015.46
7.1.280.0030.00815.72
7.1.270.0070.00715.69
7.1.260.0000.00915.87
7.1.200.0030.00915.49
7.1.100.0090.00618.02
7.1.70.0030.00617.16
7.1.60.0090.01620.03
7.1.50.0160.00616.87
7.1.00.0070.07322.32
7.0.200.0180.01116.45
7.0.60.0070.05719.98
7.0.50.0100.07717.84
7.0.40.0070.05720.23
7.0.30.0330.06720.08
7.0.20.0230.08320.21
7.0.10.0270.07320.12
7.0.00.0170.06720.06
5.6.280.0100.06721.16
5.6.210.0100.07020.57
5.6.200.0100.07318.14
5.6.190.0000.09720.61
5.6.180.0270.08020.55
5.6.170.0200.04020.47
5.6.160.0030.07720.61
5.6.150.0030.04018.25
5.6.140.0100.08018.17
5.6.130.0100.08718.25
5.6.120.0100.06321.00
5.6.110.0100.08021.09
5.6.100.0070.06021.04
5.6.90.0070.06021.01
5.6.80.0100.08020.32
5.5.350.0030.09020.50
5.5.340.0030.07018.05
5.5.330.0100.05320.30
5.5.320.0400.06320.32
5.5.310.0300.07720.31
5.5.300.0100.06317.98
5.5.290.0200.07017.98
5.5.280.0170.08020.98
5.5.270.0170.06320.87
5.5.260.0130.06720.88
5.5.250.0200.06720.59
5.5.240.0130.03320.08
5.4.450.0970.06319.57
5.4.440.0930.06019.59
5.4.430.0700.04719.63
5.4.420.0800.06019.45
5.4.410.0870.05019.34
5.4.400.0970.06019.25
5.4.390.0530.06319.22
5.4.380.0570.06019.18
5.4.370.0730.05019.25
5.4.360.0770.06719.12
5.4.350.0600.06019.25
5.4.340.0830.04719.30
5.4.320.0770.05319.14
5.4.310.0600.06019.23
5.4.300.0870.06019.22
5.4.290.0970.04719.11
5.4.280.1200.06019.20
5.4.270.0900.06019.06
5.4.260.0530.06319.22
5.4.250.0770.05318.85
5.4.240.0870.06319.33
5.4.230.0730.05719.07
5.4.220.0730.06019.24
5.4.210.0600.05319.21
5.4.200.0570.05016.95
5.4.190.0570.06719.25
5.4.180.1230.07019.21
5.4.170.0770.07319.31
5.4.160.0230.05318.98
5.4.150.0200.05319.09
5.4.140.0200.05316.43
5.4.130.0370.07716.62
5.4.120.0130.05716.50
5.4.110.0330.04316.61
5.4.100.0230.07016.62
5.4.90.1130.05716.37
5.4.80.0470.05316.34
5.4.70.0200.05316.59
5.4.60.0370.05316.33
5.4.50.0070.05716.34
5.4.40.0030.05716.26
5.4.30.0000.03316.51
5.4.20.0300.06716.32

preferences:
44.48 ms | 401 KiB | 5 Q