3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar { public function setup_pins() { for ($i = 0; $i < 4; $i++) { echo "Setting up pin " . $i . "\n"; $this->pin[$i] = new Pin; $this->pin[$i]->setup_unit(4, array()); } } } class Pin { protected static $c = 0; public function setup_unit($pin_no, $units) { $this->do_counter(); echo self::$c; } public function do_counter() { if (! isset(self::$c)) //this is kinda silly in this scenario { self::$c = 0; echo "Not set\n"; } else { self::$c++; echo "C is " . self::$c . "\n"; } } } $stuff = new bar; $stuff->setup_pins();

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.0140.00718.55
8.3.50.0060.00916.51
8.3.40.0140.00418.71
8.3.30.0150.00318.89
8.3.20.0050.00518.85
8.3.10.0080.00823.51
8.3.00.0040.00419.52
8.2.180.0070.01016.63
8.2.170.0110.00422.96
8.2.160.0090.00520.28
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0040.00419.79
8.2.120.0040.00426.35
8.2.110.0090.00021.00
8.2.100.0110.00418.22
8.2.90.0040.00417.88
8.2.80.0040.00417.97
8.2.70.0060.00318.05
8.2.60.0050.00318.16
8.2.50.0090.00018.10
8.2.40.0000.00819.34
8.2.30.0040.00419.20
8.2.20.0000.00718.12
8.2.10.0000.00719.57
8.2.00.0050.00317.53
8.1.280.0140.00425.92
8.1.270.0060.00318.87
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0120.00017.48
8.1.230.0080.00417.89
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0060.00317.38
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0030.00518.50
8.1.160.0050.00218.86
8.1.150.0040.00418.77
8.1.140.0050.00223.84
8.1.130.0030.00320.14
8.1.120.0020.00517.30
8.1.110.0040.00417.41
8.1.100.0000.00817.43
8.1.90.0040.00417.46
8.1.80.0050.00317.47
8.1.70.0070.00017.46
8.1.60.0030.00617.50
8.1.50.0000.00817.58
8.1.40.0030.00517.53
8.1.30.0050.00217.55
8.1.20.0040.00417.64
8.1.10.0070.00017.54
8.1.00.0020.00517.48
8.0.300.0020.00518.77
8.0.290.0060.00316.63
8.0.280.0000.00718.41
8.0.270.0030.00317.18
8.0.260.0030.00320.20
8.0.250.0000.00717.00
8.0.240.0000.00716.92
8.0.230.0000.00716.95
8.0.220.0040.00416.96
8.0.210.0000.00716.79
8.0.200.0000.00716.81
8.0.190.0040.00416.95
8.0.180.0000.00816.98
8.0.170.0030.00616.89
8.0.160.0060.00316.87
8.0.150.0040.00416.73
8.0.140.0000.00716.75
8.0.130.0070.00013.30
8.0.120.0030.00616.90
8.0.110.0040.00416.81
8.0.100.0000.00716.85
8.0.90.0040.00416.95
8.0.80.0100.00916.95
8.0.70.0040.00416.88
8.0.60.0040.00416.81
8.0.50.0000.00716.94
8.0.30.0090.00817.08
8.0.20.0090.01417.40
8.0.10.0040.00417.01
8.0.00.0100.00816.81
7.4.330.0030.00315.55
7.4.320.0080.00016.50
7.4.300.0030.00316.59
7.4.290.0040.00416.50
7.4.280.0060.00316.41
7.4.270.0070.00016.57
7.4.260.0070.00016.35
7.4.250.0000.00716.56
7.4.240.0030.00316.55
7.4.230.0000.00716.51
7.4.220.0040.00416.54
7.4.210.0050.01216.52
7.4.200.0070.00016.48
7.4.160.0080.00916.49
7.4.140.0110.00917.86
7.4.130.0130.00716.45
7.4.120.0100.00916.60
7.4.110.0140.00316.72
7.4.100.0090.00916.66
7.4.90.0120.00916.40
7.4.80.0100.01419.39
7.4.70.0100.00716.48
7.4.60.0070.01116.57
7.4.50.0070.00716.61
7.4.40.0120.00616.42
7.4.00.0030.01414.77
7.3.330.0050.00013.38
7.3.320.0000.00513.38
7.3.310.0030.00316.27
7.3.300.0000.00716.29
7.3.290.0070.00016.37
7.3.280.0040.01116.36
7.3.260.0090.01016.55
7.3.240.0090.01016.47
7.3.230.0120.00416.34
7.3.210.0100.00716.35
7.3.200.0160.00316.47
7.3.190.0070.01016.64
7.3.180.0090.01216.65
7.3.170.0150.00716.64
7.3.160.0070.01016.49
7.3.120.0100.01014.98
7.3.110.0030.01614.64
7.3.100.0100.01015.10
7.3.90.0040.00815.11
7.3.80.0000.01614.78
7.3.70.0040.00714.99
7.3.60.0030.01015.02
7.3.50.0030.00614.86
7.3.40.0040.00814.90
7.3.30.0040.01114.82
7.3.20.0060.00916.45
7.3.10.0060.00816.56
7.3.00.0030.00916.74
7.2.330.0050.01916.50
7.2.320.0100.00716.56
7.2.310.0070.01116.60
7.2.300.0060.01016.79
7.2.290.0110.00616.83
7.2.250.0040.01615.23
7.2.240.0060.00915.01
7.2.230.0030.01015.05
7.2.220.0110.00715.22
7.2.210.0030.00615.01
7.2.200.0090.00615.14
7.2.190.0040.01115.03
7.2.180.0060.00615.03
7.2.170.0040.01214.79
7.2.160.0030.00615.14
7.2.150.0110.00316.83
7.2.140.0000.01116.72
7.2.130.0030.01216.95
7.2.120.0060.00616.69
7.2.110.2100.00915.98
7.2.100.1510.01116.21
7.2.90.1950.00916.05
7.2.80.1460.00816.10
7.2.70.1280.00816.31
7.2.60.1770.00916.41
7.2.50.1640.00616.37
7.2.40.1470.00816.26
7.2.30.2050.01016.22
7.2.20.1520.00816.36
7.2.10.1940.00916.15
7.2.00.1710.00916.19
7.1.330.0070.01015.98
7.1.320.0110.00415.80
7.1.310.0030.00715.93
7.1.300.0030.00615.55
7.1.290.0060.00315.85
7.1.280.0030.01015.66
7.1.270.0070.00715.77
7.1.260.0070.00715.98
7.1.250.0050.00715.70
7.1.240.0030.00615.79
7.1.230.2410.00914.82
7.1.220.2370.01414.80
7.1.210.2250.00514.79
7.1.200.1890.01414.87
7.1.190.2120.00814.87
7.1.180.2760.00514.79
7.1.170.2260.00914.80
7.1.160.2170.00514.87
7.1.150.2760.00514.76
7.1.140.2280.00814.91
7.1.130.2300.00414.71
7.1.120.2320.00914.82
7.1.110.2210.01414.92
7.1.100.2200.00714.74
7.1.90.2250.00614.69
7.1.80.2020.00514.88
7.1.70.2060.01114.75
7.1.60.2370.01023.75
7.1.50.3390.00723.92
7.1.40.3800.00923.93
7.1.30.3650.00723.67
7.1.20.3030.01123.58
7.1.10.1710.00314.79
7.1.00.2110.01014.78
7.0.330.0060.00915.32
7.0.320.0030.00915.43
7.0.310.0030.00615.53
7.0.300.0030.00515.37
7.0.290.0100.00315.21
7.0.280.0090.00615.36
7.0.270.0080.00415.44
7.0.260.0050.00515.56
7.0.250.0030.01015.52
7.0.240.0000.01315.24
7.0.230.0090.00615.23
7.0.220.0060.00315.40
7.0.210.0040.00715.27
7.0.200.0090.00315.22
7.0.190.0100.00315.46
7.0.180.0100.00315.58
7.0.170.0060.00615.44
7.0.160.0040.01115.42
7.0.150.0090.00315.21
7.0.140.0030.01115.64
7.0.130.0040.00815.36
7.0.120.0060.00615.21
7.0.110.0100.00315.41
7.0.100.0080.00815.13
7.0.90.0000.01115.50
7.0.80.0070.01015.45
7.0.70.0070.00715.39
7.0.60.0000.01015.25
7.0.50.0040.01115.49
7.0.40.0040.00413.44
7.0.30.0000.01113.46
7.0.20.0070.00313.54
7.0.10.0030.00913.54
7.0.00.0090.00313.51
5.6.400.0030.01314.77
5.6.390.0090.00614.58
5.6.380.0110.00614.13
5.6.370.0090.00314.66
5.6.360.0060.00314.47
5.6.350.0100.00314.65
5.6.340.0070.01014.35
5.6.330.0000.01314.28
5.6.320.0130.00014.10
5.6.310.0030.01014.54
5.6.300.0070.00714.68
5.6.290.0040.00414.46
5.6.280.0030.00614.78
5.6.270.0060.00914.88
5.6.260.0040.01114.51
5.6.250.0070.00714.38
5.6.240.0030.01314.43
5.6.230.0030.01014.28
5.6.220.0070.00414.69
5.6.210.0070.00714.40
5.6.200.0070.00714.40
5.6.190.0000.01714.49
5.6.180.0070.00714.46
5.6.170.0060.01014.42
5.6.160.0000.00914.39
5.6.150.0060.00614.32
5.6.140.0030.00714.70
5.6.130.0090.00914.33
5.6.120.0030.01314.35
5.6.110.0070.00714.39
5.6.100.0000.01714.40
5.6.90.0100.00314.40
5.6.80.0040.00814.40
5.6.70.0070.00414.36
5.6.60.0100.00314.29
5.6.50.0070.00314.34
5.6.40.0070.00714.42
5.6.30.0000.01414.29
5.6.20.0070.00714.44
5.6.10.0030.00714.19
5.6.00.0080.00614.18

preferences:
61.2 ms | 400 KiB | 5 Q