3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $foo; public function __construct($foo) { $this->foo = $foo; } protected function bar() { echo 'Accessed the protectd method.'; } } class Test2 { public function baz(Test $other) { // We can change the protected property: $other->foo = 'hello'; var_dump($other->foo); // We can also call the protected method: $other->bar(); } } $test = new Test2('test'); $test->baz(new Test('other'));

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.0070.01116.75
8.3.50.0150.01121.11
8.3.40.0070.00718.72
8.3.30.0070.00718.98
8.3.20.0080.00020.25
8.3.10.0060.00321.90
8.3.00.0040.00423.47
8.2.180.0160.00616.75
8.2.170.0130.00722.96
8.2.160.0130.00020.45
8.2.150.0030.00624.18
8.2.140.0030.00524.66
8.2.130.0050.00319.73
8.2.120.0040.00426.35
8.2.110.0100.00022.30
8.2.100.0060.00617.92
8.2.90.0030.00619.08
8.2.80.0080.00017.97
8.2.70.0060.00317.50
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0030.00522.14
8.2.30.0040.00419.36
8.2.20.0070.00017.62
8.2.10.0040.00418.05
8.2.00.0000.00818.00
8.1.280.0090.01225.92
8.1.270.0160.00323.79
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0060.00323.98
8.1.230.0060.00620.89
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0030.00617.25
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0040.00418.55
8.1.160.0070.00020.70
8.1.150.0030.00518.74
8.1.140.0040.00419.43
8.1.130.0050.00217.53
8.1.120.0000.00717.29
8.1.110.0030.00317.38
8.1.100.0050.00317.41
8.1.90.0030.00417.40
8.1.80.0000.00717.39
8.1.70.0000.00717.38
8.1.60.0090.00017.64
8.1.50.0000.01017.50
8.1.40.0080.00017.34
8.1.30.0000.00917.60
8.1.20.0030.00517.56
8.1.10.0050.00217.59
8.1.00.0040.00417.41
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0030.00318.43
8.0.270.0040.00417.07
8.0.260.0000.00717.11
8.0.250.0030.00316.98
8.0.240.0070.00016.98
8.0.230.0040.00416.91
8.0.220.0000.00816.76
8.0.210.0000.00816.80
8.0.200.0040.00416.97
8.0.190.0000.00716.99
8.0.180.0040.00416.80
8.0.170.0030.00516.84
8.0.160.0110.00016.93
8.0.150.0070.00016.75
8.0.140.0040.00416.73
8.0.130.0030.00313.32
8.0.120.0000.00816.68
8.0.110.0000.00816.93
8.0.100.0000.00716.88
8.0.90.0070.00016.75
8.0.80.0090.00616.80
8.0.70.0000.00716.77
8.0.60.0040.00416.77
8.0.50.0040.00416.93
8.0.30.0140.00716.96
8.0.20.0120.00717.40
8.0.10.0000.00716.97
8.0.00.0070.01016.86
7.4.330.0050.00016.85
7.4.320.0060.00016.44
7.4.300.0000.00816.50
7.4.290.0030.00316.57
7.4.280.0000.00916.62
7.4.270.0040.00416.53
7.4.260.0000.00716.57
7.4.250.0000.00816.52
7.4.240.0010.00616.62
7.4.230.0000.00716.67
7.4.220.0080.00816.41
7.4.210.0110.01116.54
7.4.200.0000.00716.59
7.4.160.0080.00816.38
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0110.01216.62
7.4.120.0140.00516.64
7.4.110.0080.00816.55
7.4.100.0100.00616.48
7.4.90.0100.00716.63
7.4.80.0100.00719.39
7.4.70.0100.01016.47
7.4.60.0090.01216.49
7.4.50.0070.01016.56
7.4.40.0070.01016.61
7.4.30.0030.02016.44
7.4.00.0080.01015.09
7.3.330.0050.00013.32
7.3.320.0040.00413.36
7.3.310.0000.00716.26
7.3.300.0070.00016.37
7.3.290.0060.01016.34
7.3.280.0090.00716.33
7.3.270.0060.01217.40
7.3.260.0070.01016.62
7.3.250.0130.00616.38
7.3.240.0130.00716.40
7.3.230.0060.00916.39
7.3.210.0080.00816.38
7.3.200.0040.01419.39
7.3.190.0080.00816.30
7.3.180.0090.00916.35
7.3.170.0150.00616.36
7.3.160.0030.01616.39
7.3.120.0070.01014.91
7.3.110.0030.01214.80
7.3.100.0080.00614.74
7.3.90.0000.01214.81
7.3.80.0070.00714.83
7.3.70.0070.00714.61
7.3.60.0030.00614.84
7.3.50.0100.00314.79
7.3.40.0000.00914.65
7.3.30.0030.01014.84
7.3.20.0070.00716.36
7.3.10.0090.00516.51
7.3.00.0050.00716.59
7.2.330.0150.00316.58
7.2.320.0040.01316.68
7.2.310.0110.00616.56
7.2.300.0070.01016.40
7.2.290.0140.00316.50
7.2.250.0070.01115.04
7.2.240.0100.01014.86
7.2.230.0000.01514.72
7.2.220.0070.01014.90
7.2.210.0030.01014.71
7.2.200.0000.01614.99
7.2.190.0030.01315.08
7.2.180.0020.01414.87
7.2.170.0060.00314.88
7.2.130.0060.00716.98
7.2.120.0060.00716.67
7.2.110.0030.00816.71
7.2.100.0080.00216.84
7.2.90.0050.00916.85
7.2.80.0050.00716.81
7.2.70.0040.00916.85
7.2.60.0040.00816.94
7.2.50.0050.00816.89
7.2.40.0080.00616.92
7.2.30.0050.00816.93
7.2.20.0060.00916.76
7.2.10.0060.00716.89
7.2.00.0060.00617.38
7.1.330.0000.01515.82
7.1.320.0040.00815.59
7.1.310.0070.00715.84
7.1.300.0060.00615.75
7.1.290.0090.00615.79
7.1.280.0060.00915.81
7.1.270.0060.00915.73
7.1.260.0030.00615.70
7.1.250.0060.00515.56
7.1.240.0080.00415.57
7.1.230.0100.00315.83
7.1.220.0000.01215.59
7.1.210.0060.00615.79
7.1.200.0030.00815.66
7.1.190.0030.00915.54
7.1.180.0030.00715.75
7.1.170.0030.00615.65
7.1.160.0100.00015.81
7.1.150.0070.00715.65
7.1.140.0040.00815.66
7.1.130.0110.00015.43
7.1.120.0030.01015.76
7.1.110.0070.00415.66
7.1.100.0120.00116.80
7.1.90.0080.00415.77
7.1.80.0070.00715.58
7.1.70.0080.00516.35
7.1.60.0050.01517.50
7.1.50.0110.00616.34
7.1.40.0040.00715.75
7.1.30.0000.01215.73
7.1.20.0000.01115.66
7.1.10.0040.00715.68
7.1.00.0080.03819.13
7.0.330.0030.00615.19
7.0.320.0030.00715.15
7.0.310.0070.00715.50
7.0.300.0070.00715.40
7.0.290.0060.00615.36
7.0.280.0090.00315.52
7.0.270.0040.01115.43
7.0.260.0060.00615.19
7.0.250.0030.01015.41
7.0.240.0000.01215.39
7.0.230.0070.00715.50
7.0.220.0000.01515.34
7.0.210.0040.00815.39
7.0.200.0000.01016.04
7.0.190.0030.00915.21
7.0.180.0100.00015.45
7.0.170.0060.00615.45
7.0.160.0000.01515.37
7.0.150.0030.00715.43
7.0.140.0100.00015.32
7.0.130.0060.00615.36
7.0.120.0040.00715.23
7.0.110.0070.00315.37
7.0.100.0030.01215.31
7.0.90.0040.00415.54
7.0.80.0030.00615.19
7.0.70.0060.00915.39
7.0.60.0090.02618.50
7.0.50.0050.04116.72
7.0.40.0070.03216.92
7.0.30.0210.03616.71
7.0.20.0200.04016.87
7.0.10.0030.02616.64
7.0.00.0070.03716.65
5.6.380.0120.00314.25
5.6.370.0000.01214.46
5.6.360.0040.01114.56
5.6.350.0040.00814.54
5.6.340.0060.00314.45
5.6.330.0080.00314.34
5.6.320.0060.00614.04
5.6.310.0060.00614.09
5.6.300.0090.00014.39
5.6.290.0040.00714.08
5.6.280.0030.02017.89
5.6.270.0080.00614.25
5.6.260.0060.00314.54
5.6.250.0120.00014.45
5.6.240.0000.01414.45
5.6.230.0000.01414.30
5.6.220.0140.00014.57
5.6.210.0090.04017.61
5.6.200.0070.02916.25
5.6.190.0050.03217.37
5.6.180.0280.03717.52
5.6.170.0120.03317.44
5.6.160.0020.04517.41
5.6.150.0050.02016.30
5.6.140.0070.02716.27
5.6.130.0070.04516.32
5.6.120.0100.04517.76
5.6.110.0030.04617.53
5.6.100.0050.04817.55
5.6.90.0030.03717.65
5.6.80.0110.03617.29
5.6.70.0030.00714.04
5.6.60.0080.00814.37
5.6.50.0070.00714.48
5.6.40.0070.00714.03
5.6.30.0060.01014.25
5.6.20.0040.00714.27
5.6.10.0050.00214.38
5.6.00.0030.01314.39
5.5.380.0000.01111.16
5.5.370.0070.00311.15
5.5.360.0000.00710.95
5.5.350.0100.03015.76
5.5.340.0070.04114.38
5.5.330.0050.02015.67
5.5.320.0310.02715.71
5.5.310.0250.03215.59
5.5.300.0050.03814.59
5.5.290.0050.03714.68
5.5.280.0070.03216.22
5.5.270.0060.04516.07
5.5.260.0080.04015.77
5.5.250.0050.04015.64
5.5.240.0120.03915.66
5.5.230.0000.00911.30
5.5.220.0030.00511.22
5.5.210.0000.00811.24
5.5.200.0030.00610.77
5.5.190.0000.01011.00
5.5.180.0030.00711.31
5.5.170.0000.00610.95
5.5.160.0000.01011.25
5.5.150.0030.00310.98
5.5.140.0080.00311.21
5.5.130.0000.00911.25
5.5.120.0060.00310.87
5.5.110.0000.01210.80
5.5.100.0030.00311.25
5.5.90.0050.00310.86
5.5.80.0000.01111.20
5.5.70.0030.00311.27
5.5.60.0070.00011.00
5.5.50.0060.00611.25
5.5.40.0030.00311.30
5.5.30.0000.00711.16
5.5.20.0040.00711.16
5.5.10.0030.00311.22
5.5.00.0060.00310.87

preferences:
62.44 ms | 401 KiB | 5 Q