3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { protected $type = null; public function __construct($in) { $this->type = $in; } public function __toString() { return $this->type; } static function getInstanceA() { static $a = null; if ($a === null) { $a = new c('A'); } return $a; } static function getInstanceB() { static $b = null; if ($b === null) { $b = new c('B'); } return $b; } static function someA() { static $a = null; $a = 'this is fucked'; } } c::someA(); $my_a = c::getInstanceA(); $my_b = c::getInstanceB(); echo $my_a; echo $my_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.0090.00616.75
8.3.50.0080.01023.00
8.3.40.0140.00018.76
8.3.30.0110.00419.27
8.3.20.0040.00420.34
8.3.10.0080.00020.62
8.3.00.0030.00619.38
8.2.180.0150.00316.88
8.2.170.0140.00722.96
8.2.160.0120.00420.51
8.2.150.0020.00524.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0000.00721.02
8.2.110.0030.00719.30
8.2.100.0090.00317.91
8.2.90.0000.00819.22
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0090.00018.22
8.2.30.0050.00219.33
8.2.20.0000.00717.76
8.2.10.0040.00418.22
8.2.00.0000.00817.81
8.1.280.0070.01425.92
8.1.270.0060.00323.83
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0030.00720.93
8.1.230.0060.00617.42
8.1.220.0080.00017.78
8.1.210.0060.00318.77
8.1.200.0030.00917.47
8.1.190.0000.00817.25
8.1.180.0050.00318.10
8.1.170.0080.00018.65
8.1.160.0070.00021.98
8.1.150.0050.00218.91
8.1.140.0050.00217.43
8.1.130.0000.00717.79
8.1.120.0000.00717.50
8.1.110.0020.00517.51
8.1.100.0000.00717.49
8.1.90.0080.00017.45
8.1.80.0040.00417.37
8.1.70.0030.00317.43
8.1.60.0040.00417.57
8.1.50.0050.00217.44
8.1.40.0030.00617.48
8.1.30.0000.00817.64
8.1.20.0060.00317.61
8.1.10.0000.00817.54
8.1.00.0030.00617.61
8.0.300.0080.00018.77
8.0.290.0000.00716.63
8.0.280.0070.00018.40
8.0.270.0070.00017.27
8.0.260.0000.00817.19
8.0.250.0000.00716.93
8.0.240.0040.00416.97
8.0.230.0000.00716.95
8.0.220.0000.00816.94
8.0.210.0000.00716.92
8.0.200.0000.00716.91
8.0.190.0030.00316.90
8.0.180.0040.00416.89
8.0.170.0060.00316.82
8.0.160.0070.00016.98
8.0.150.0000.00716.88
8.0.140.0070.00016.74
8.0.130.0030.00513.36
8.0.120.0090.00016.87
8.0.110.0040.00416.89
8.0.100.0030.00516.82
8.0.90.0070.00016.98
8.0.80.0000.02116.85
8.0.70.0040.00416.80
8.0.60.0000.00717.03
8.0.50.0030.00516.79
8.0.30.0130.00717.03
8.0.20.0140.00717.40
8.0.10.0040.00416.91
8.0.00.0050.01316.68
7.4.330.0060.00015.00
7.4.320.0060.00016.44
7.4.300.0030.00316.57
7.4.290.0060.00016.50
7.4.280.0040.00416.43
7.4.270.0020.00516.54
7.4.260.0070.00416.61
7.4.250.0080.00016.49
7.4.240.0020.00516.66
7.4.230.0000.00716.64
7.4.220.0130.01016.63
7.4.210.0070.01316.70
7.4.200.0070.00016.51
7.4.160.0070.01016.48
7.4.150.0100.00717.40
7.4.140.0120.00517.86
7.4.130.0070.01016.48
7.4.120.0100.01016.51
7.4.110.0060.01716.49
7.4.100.0060.01216.57
7.4.90.0070.01116.42
7.4.80.0110.00619.39
7.4.70.0070.01116.51
7.4.60.0030.01316.53
7.4.50.0040.00416.44
7.4.40.0160.00916.68
7.4.30.0080.00816.63
7.4.00.0080.00814.81
7.3.330.0000.00713.31
7.3.320.0000.00513.30
7.3.310.0030.00316.41
7.3.300.0070.00016.18
7.3.290.0080.00616.23
7.3.280.0110.00716.31
7.3.270.0070.01017.40
7.3.260.0170.00016.46
7.3.250.0040.01416.36
7.3.240.0030.01316.43
7.3.230.0070.01016.39
7.3.210.0060.01616.25
7.3.200.0070.01119.39
7.3.190.0040.01816.33
7.3.180.0090.00616.60
7.3.170.0030.00416.27
7.3.160.0030.01816.25
7.3.120.0080.01214.87
7.3.110.0070.01114.96
7.3.100.0030.01614.96
7.3.90.0060.00614.66
7.3.80.0030.01214.68
7.3.70.0000.01414.80
7.3.60.0110.00414.78
7.3.50.0000.01214.89
7.3.40.0120.00314.85
7.3.30.0070.00714.55
7.3.20.0060.01116.80
7.3.10.0070.00716.46
7.3.00.0040.00716.56
7.2.330.0180.00616.84
7.2.320.0030.01416.77
7.2.310.0040.01416.61
7.2.300.0000.02216.66
7.2.290.0130.01016.84
7.2.250.0110.00714.91
7.2.240.0100.00615.00
7.2.230.0090.00615.23
7.2.220.0090.00615.08
7.2.210.0030.01515.13
7.2.200.0040.00814.94
7.2.190.0100.00715.01
7.2.180.0040.00815.03
7.2.170.0090.00015.15
7.2.160.0030.00814.80
7.2.150.0070.01316.82
7.2.140.0000.01516.93
7.2.130.0000.01717.09
7.2.120.0060.00616.77
7.2.110.0090.00616.66
7.2.100.0090.00016.72
7.2.90.0000.01417.21
7.2.80.0030.01016.96
7.2.70.0000.01216.92
7.2.60.0080.00817.04
7.2.50.0090.00416.63
7.2.40.0040.00816.82
7.2.30.0000.01017.16
7.2.20.0040.00717.09
7.2.10.0070.00716.93
7.2.00.0030.00918.16
7.1.330.0090.00315.83
7.1.320.0070.00715.74
7.1.310.0100.00615.79
7.1.300.0000.01115.55
7.1.290.0000.00815.64
7.1.280.0030.01415.52
7.1.270.0090.00615.79
7.1.260.0000.01515.77
7.1.250.0100.00615.40
7.1.240.0090.00615.92
7.1.230.0040.00915.84
7.1.220.0000.01015.59
7.1.210.0070.00715.66
7.1.200.0000.01515.43
7.1.190.0070.00315.53
7.1.180.0000.01515.75
7.1.170.0030.01015.76
7.1.160.0030.00815.57
7.1.150.0050.00315.70
7.1.140.0030.01215.89
7.1.130.0030.00915.55
7.1.120.0030.01015.85
7.1.110.0080.00315.45
7.1.100.0040.00916.91
7.1.90.0090.00615.65
7.1.80.0080.00415.85
7.1.70.0090.00316.25
7.1.60.0050.01417.69
7.1.50.0030.01516.22
7.1.40.0070.00715.28
7.1.30.0070.00715.76
7.1.20.0050.00315.68
7.1.10.0060.00315.81
7.1.00.0050.04019.19
7.0.330.0000.01215.44
7.0.320.0060.00915.41
7.0.310.0080.00015.34
7.0.300.0070.00315.46
7.0.290.0030.00615.27
7.0.280.0110.00415.26
7.0.270.0100.00415.23
7.0.260.0070.00715.34
7.0.250.0070.00715.31
7.0.240.0110.00415.56
7.0.230.0040.00815.52
7.0.220.0040.00715.57
7.0.210.0060.00315.52
7.0.200.0020.00716.03
7.0.190.0040.00815.49
7.0.180.0040.00815.48
7.0.170.0060.00615.50
7.0.160.0000.01615.34
7.0.150.0100.00315.54
7.0.140.0020.04218.70
7.0.130.0000.01115.45
7.0.120.0030.00615.49
7.0.110.0030.00915.51
7.0.100.0130.03817.76
7.0.90.0160.03617.67
7.0.80.0050.02817.58
7.0.70.0040.03517.77
7.0.60.0080.02617.71
7.0.50.0030.04018.01
7.0.40.0030.04716.82
7.0.30.0000.04716.56
7.0.20.0050.04116.75
7.0.10.0090.04116.76
7.0.00.0050.03116.73
5.6.400.0080.00614.45
5.6.390.0000.01414.51
5.6.380.0100.00314.52
5.6.370.0070.00714.19
5.6.360.0070.00714.73
5.6.350.0000.01314.35
5.6.340.0000.01314.50
5.6.330.0100.00314.36
5.6.320.0070.00714.58
5.6.310.0070.01014.60
5.6.300.0040.00414.04
5.6.290.0030.00914.60
5.6.280.0100.03417.80
5.6.270.0040.01114.37
5.6.260.0000.01314.68
5.6.250.0070.02717.58
5.6.240.0030.05017.66
5.6.230.0030.04417.50
5.6.220.0070.04217.58
5.6.210.0050.03717.45
5.6.200.0150.04217.69
5.6.190.0140.03917.77
5.6.180.0070.04517.88
5.6.170.0060.04017.75
5.6.160.0090.04317.68
5.6.150.0050.04917.62
5.6.140.0100.04517.81
5.6.130.0030.04417.81
5.6.120.0030.04517.56
5.6.110.0100.04217.61
5.6.100.0050.04817.62
5.6.90.0080.03817.77
5.6.80.0060.02517.49
5.6.70.0170.03217.45
5.6.60.0130.02317.20
5.6.50.0070.02817.26
5.6.40.0070.03817.35
5.6.30.0100.03917.25
5.6.20.0100.03817.48
5.6.10.0050.04417.31
5.6.00.0080.04017.23
5.5.380.0080.04317.35
5.5.370.0040.04717.29
5.5.360.0050.04517.42
5.5.350.0100.04517.30
5.5.340.0040.02917.62
5.5.330.0050.04317.64
5.5.320.0090.04117.68
5.5.310.0070.04717.46
5.5.300.0030.04417.68
5.5.290.0070.04917.60
5.5.280.0080.04517.73
5.5.270.0030.04717.30
5.5.260.0090.04417.70
5.5.250.0080.04317.58
5.5.240.0100.03817.25
5.5.230.0080.04417.27
5.5.220.0050.03017.27
5.5.210.0140.03717.22
5.5.200.0080.03717.22
5.5.190.0070.04217.21
5.5.180.0080.04017.37
5.5.170.0000.01414.44
5.5.160.0060.04317.25
5.5.150.0030.04817.13
5.5.140.0050.04617.11
5.5.130.0050.04317.17
5.5.120.0060.02017.16
5.5.110.0060.03316.94
5.5.100.0050.03117.17
5.5.90.0070.04417.19
5.5.80.0070.04217.15
5.5.70.0110.03717.09
5.5.60.0080.04017.18
5.5.50.0050.02917.18
5.5.40.0100.03817.03
5.5.30.0050.02317.08
5.5.20.0080.02717.16
5.5.10.0030.04317.00
5.5.00.0100.02017.00
5.4.450.0050.04415.27
5.4.440.0120.03715.17
5.4.430.0000.04515.22
5.4.420.0040.04715.16
5.4.410.0030.03615.18
5.4.400.0080.03814.97
5.4.390.0020.04415.21
5.4.380.0080.01714.96
5.4.370.0080.03315.15
5.4.360.0030.04515.04
5.4.350.0020.04515.03
5.4.340.0070.04015.06
5.4.330.0000.00711.01
5.4.320.0100.03314.86
5.4.310.0130.03614.92
5.4.300.0050.04315.01
5.4.290.0020.02915.12
5.4.280.0110.03014.96
5.4.270.0080.03815.00
5.4.260.0050.04215.01
5.4.250.0080.02515.12
5.4.240.0020.04815.07
5.4.230.0080.02515.04
5.4.220.0060.03815.03
5.4.210.0030.04315.06
5.4.200.0150.02115.10
5.4.190.0060.04215.09
5.4.180.0080.02515.13
5.4.170.0030.03215.07
5.4.160.0080.01614.98
5.4.150.0030.02614.90
5.4.140.0080.03513.60
5.4.130.0030.03313.63
5.4.120.0050.02713.62
5.4.110.0030.03013.74
5.4.100.0030.02813.80
5.4.90.0100.01313.71
5.4.80.0050.03513.73
5.4.70.0030.02313.63
5.4.60.0050.03813.52
5.4.50.0050.03313.81
5.4.40.0060.03313.75
5.4.30.0060.02113.77
5.4.20.0020.03513.65
5.4.10.0020.02313.72
5.4.00.0030.02213.40
5.3.290.0100.07314.80
5.3.280.0070.07014.67
5.3.270.0030.06314.67
5.3.260.0100.05314.55
5.3.250.0170.03714.72
5.3.240.0030.05314.68
5.3.230.0070.03714.75
5.3.220.0000.04014.56
5.3.210.0070.04014.70
5.3.200.0030.06014.52
5.3.190.0070.03314.61
5.3.180.0070.04014.55
5.3.170.0000.05014.56
5.3.160.0070.03314.59
5.3.150.0100.04314.61
5.3.140.0000.06014.50
5.3.130.0030.06714.49
5.3.120.0030.05714.68
5.3.110.0030.04714.63
5.3.100.0000.05014.19
5.3.90.0070.03314.06
5.3.80.0000.04014.01
5.3.70.0000.04014.02
5.3.60.0100.02714.04
5.3.50.0000.03713.96
5.3.40.0070.03314.04
5.3.30.0070.05313.80
5.3.20.0000.04013.81
5.3.10.0000.04313.72
5.3.00.0030.03013.66
5.2.170.0000.03011.30
5.2.160.0030.02711.18
5.2.150.0000.03311.18
5.2.140.0000.03011.18
5.2.130.0000.03311.23
5.2.120.0030.02711.18
5.2.110.0000.03011.18
5.2.100.0030.03011.22
5.2.90.0000.03011.21
5.2.80.0000.03011.18
5.2.70.0000.03711.18
5.2.60.0000.03011.20
5.2.50.0000.03011.18
5.2.40.0070.04711.18
5.2.30.0070.03011.18
5.2.20.0000.03011.18
5.2.10.0000.02711.18
5.2.00.0000.03011.18
5.1.60.0000.02711.18
5.1.50.0030.02711.18
5.1.40.0030.02311.18
5.1.30.0030.02311.18
5.1.20.0000.02711.18
5.1.10.0070.04711.18
5.1.00.0030.02311.18
5.0.50.0130.03011.18
5.0.40.0030.01711.18
5.0.30.0070.04011.18
5.0.20.0000.04311.18
5.0.10.0030.04011.18
5.0.00.0070.06011.18
4.4.90.0000.01711.18
4.4.80.0000.02311.18
4.4.70.0000.01711.18
4.4.60.0030.01311.18
4.4.50.0000.01311.18
4.4.40.0030.02311.18
4.4.30.0000.01311.18
4.4.20.0030.01311.18
4.4.10.0030.02011.18
4.4.00.0000.05011.18
4.3.110.0030.01711.18
4.3.100.0000.03711.18
4.3.90.0000.03711.18
4.3.80.0130.02011.18
4.3.70.0030.03711.18
4.3.60.0000.03011.18
4.3.50.0030.02311.18
4.3.40.0030.05011.18
4.3.30.0000.03711.18
4.3.20.0030.03311.18
4.3.10.0000.03711.18
4.3.00.0000.04011.18

preferences:
56.56 ms | 401 KiB | 5 Q