3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User{ const GIVEN = 1; // class constants can't be labeled static nor assigned visibility public $a=2; public static $b=3; public function me(){ echo "print me"; } public static function you() { echo "print you"; } } class myUser extends User { } // Are properties and methods instantiated to an object of a class, & are they accessible? $object1= new User(); // uncomment this line with each of the following lines individually //echo $object1->GIVEN . ""; // yields nothing //echo $object1->GIVE . ""; // deliberately misnamed, still yields nothing //echo $object1->User::GIVEN . ""; // yields nothing //echo $object1->a . ""; // yields 2 //echo $object1->b . ""; // yields nothing //echo $object1->me() . ""; // yields print me //echo $object1->you() . ""; // yields print you // Are properties and methods instantiated to an object of a child class, & are accessible? //$object2= new myUser(); // uncomment this line with each of the following lines individually //echo $object2->GIVEN . ""; // yields nothing //echo $object2->a . ""; // yields 2 //echo $object2->b . ""; // yields nothing //echo $object2->me() . ""; // yields print me //echo $object2->you() . ""; // yields print you // Are the properties and methods accessible directly in the class? //echo User::GIVEN . ""; // yields 1 //echo User::$a . ""; // yields fatal error since it is not static //echo User::$b . ""; // yields 3 //echo User::me() . ""; // yields print me //echo User::you() . ""; // yields print you // Are the properties and methods copied to the child class and are they accessible? //echo myUser::GIVEN . ""; // yields 1 //echo myUser::$a . ""; // yields fatal error since it is not static echo myUser::$b . ""; // yields 3 //echo myUser::me() . ""; // yields print me //echo myUser::you() . ""; // yields print you

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.40.0110.01118.85
8.3.30.0030.01019.00
8.3.20.0090.00020.16
8.3.10.0090.00021.92
8.3.00.0050.00322.44
8.2.170.0130.01022.96
8.2.160.0080.00619.08
8.2.150.0030.00524.18
8.2.140.0050.01424.66
8.2.130.0050.00326.16
8.2.120.0040.00419.44
8.2.110.0030.00619.38
8.2.100.0090.00317.84
8.2.90.0000.00819.27
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0060.00318.22
8.2.30.0040.00417.94
8.2.20.0040.00417.71
8.2.10.0040.00417.50
8.2.00.0030.00717.67
8.1.270.0060.00318.54
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0060.00321.29
8.1.230.0060.00617.42
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0000.00917.47
8.1.190.0030.00517.25
8.1.180.0040.00418.72
8.1.170.0040.00418.64
8.1.160.0000.00822.16
8.1.150.0040.00418.68
8.1.140.0000.00717.44
8.1.130.0070.00317.82
8.1.120.0040.00317.38
8.1.110.0070.00317.44
8.1.100.0040.00417.51
8.1.90.0070.00017.48
8.1.80.0000.00717.48
8.1.70.0000.00717.46
8.1.60.0050.00317.59
8.1.50.0040.00417.48
8.1.40.0020.00517.52
8.1.30.0080.00017.64
8.1.20.0040.00417.49
8.1.10.0030.00617.64
8.1.00.0070.00017.49
8.0.300.0000.00718.77
8.0.290.0020.00516.75
8.0.280.0000.00718.48
8.0.270.0070.00017.13
8.0.260.0030.00316.72
8.0.250.0030.00316.84
8.0.240.0040.00616.95
8.0.230.0030.00316.95
8.0.220.0030.00316.79
8.0.210.0030.00316.82
8.0.200.0030.00716.93
8.0.190.0040.00416.98
8.0.180.0000.00716.84
8.0.170.0000.00916.96
8.0.160.0040.00416.84
8.0.150.0070.00016.86
8.0.140.0050.00216.84
8.0.130.0000.00513.25
8.0.120.0040.00416.89
8.0.110.0000.00716.84
8.0.100.0070.00016.79
8.0.90.0040.00416.96
8.0.80.0100.01016.85
8.0.70.0070.00016.78
8.0.60.0050.00216.86
8.0.50.0070.00016.89
8.0.30.0090.00916.95
8.0.20.0140.00617.40
8.0.10.0040.00416.91
8.0.00.0050.01316.64
7.4.330.0000.00515.00
7.4.320.0000.00616.54
7.4.300.0000.00716.43
7.4.290.0070.00016.39
7.4.280.0000.00916.44
7.4.270.0030.00316.57
7.4.260.0030.00616.41
7.4.250.0000.00716.45
7.4.240.0020.00516.52
7.4.230.0030.00316.55
7.4.220.0070.01716.50
7.4.210.0050.00916.53
7.4.200.0030.00316.19
7.4.190.0070.00016.35
7.4.160.0080.00816.39
7.4.150.0100.00717.40
7.4.140.0100.01317.86
7.4.130.0080.01116.45
7.4.120.0110.00616.35
7.4.110.0090.00916.28
7.4.100.0080.01216.52
7.4.90.0030.01316.32
7.4.80.0030.01319.39
7.4.70.0060.01216.47
7.4.60.0100.01316.39
7.4.50.0100.00316.51
7.4.40.0080.00822.77
7.4.30.0110.00416.49
7.4.00.0090.00914.64
7.3.330.0000.00513.03
7.3.320.0050.00013.23
7.3.310.0000.00716.19
7.3.300.0030.00316.26
7.3.290.0100.00716.25
7.3.280.0080.00916.20
7.3.270.0140.00317.40
7.3.260.0060.01016.47
7.3.250.0090.01216.33
7.3.240.0120.00616.25
7.3.230.0030.01316.45
7.3.210.0100.00716.44
7.3.200.0100.00619.39
7.3.190.0090.00616.16
7.3.180.0120.00316.43
7.3.170.0160.00316.27
7.3.160.0060.01016.21
7.3.120.0120.00014.96
7.2.330.0100.00716.55
7.2.320.0150.00316.67
7.2.310.0090.00916.75
7.2.300.0090.00616.74
7.2.290.0090.00616.42
7.2.00.0030.01319.46
7.1.100.0060.00617.90
7.1.70.0000.00916.94
7.1.60.0040.00816.86
7.1.50.0120.01816.75
7.1.00.0100.06322.30
7.0.200.0000.01616.57
7.0.140.0000.08021.97
7.0.70.4970.04019.91
7.0.60.0000.06719.78
7.0.50.0030.07317.84
7.0.40.0030.09020.09
7.0.30.0070.07020.06
7.0.20.0270.03320.16
7.0.10.0300.04720.07
7.0.00.0030.08320.12
5.6.280.0070.07020.82
5.6.210.0000.07320.71
5.6.200.0000.04718.18
5.6.190.0030.08720.51
5.6.180.0200.04320.45
5.6.170.0400.07720.62
5.6.160.0130.07720.39
5.6.150.0130.06018.14
5.6.140.0030.08718.27
5.6.130.0100.03318.15
5.6.120.0170.06721.02
5.6.110.0100.08021.03
5.6.100.0100.07320.97
5.6.90.0030.05020.98
5.6.80.0170.04320.54
5.6.70.0170.08320.37
5.5.350.0100.07720.43
5.5.340.0100.07718.08
5.5.330.0130.04320.40
5.5.320.0070.04720.31
5.5.310.0370.06020.26
5.5.300.0130.03318.08
5.5.290.0030.07718.01
5.5.280.0100.06720.77
5.5.270.0100.08720.79
5.5.260.0030.04020.65
5.5.250.0000.04320.78
5.5.240.0030.04320.36
5.4.450.0530.06019.73
5.4.440.0630.07019.70
5.4.430.1030.07719.57
5.4.420.0500.06719.38
5.4.410.1000.06019.03
5.4.400.0900.05019.38
5.4.390.0600.06019.15
5.4.380.0200.05718.77
5.4.370.0230.04318.80
5.4.360.0230.03718.55
5.4.350.0050.04412.02
5.4.340.0130.04412.02
5.4.320.0070.03812.50
5.4.310.0060.04312.50
5.4.300.0110.04812.50
5.4.290.0050.03912.50
5.4.280.0080.03412.39
5.4.270.0080.03912.39
5.4.260.0080.04512.40
5.4.250.0100.05718.73
5.4.240.0100.05718.95
5.4.230.0230.06318.89
5.4.220.0200.05319.02
5.4.210.0100.07018.96
5.4.200.0130.05718.90
5.4.190.0130.07319.01
5.4.180.0070.05318.93
5.4.170.0070.07018.94
5.4.160.0070.06018.74
5.4.150.0100.07019.00
5.4.140.0230.05316.56
5.4.130.0100.04716.41
5.4.120.0100.07016.51
5.4.110.0130.07316.46
5.4.100.0130.04716.56
5.4.90.0070.07716.66
5.4.80.0100.05016.65
5.4.70.0100.06316.58
5.4.60.0070.06016.36
5.4.50.0230.04016.38
5.4.40.0030.06016.41
5.4.30.0170.05316.46
5.4.20.0130.04316.37
5.4.10.0230.04716.45
5.4.00.0170.04715.82
5.3.290.0070.05512.80
5.3.280.0100.05314.67
5.3.270.0030.08014.68
5.3.260.0070.06314.61
5.3.250.0170.06714.69
5.3.240.0000.05714.62
5.3.230.0100.05314.68
5.3.220.0170.04714.57
5.3.210.0130.04714.79
5.3.200.0130.04714.64
5.3.190.0070.07314.55
5.3.180.0100.05014.72
5.3.170.0170.04014.73
5.3.160.0130.04314.59
5.3.150.0070.05314.66
5.3.140.0100.05014.54
5.3.130.0170.06014.73
5.3.120.0130.04714.64
5.3.110.0200.06014.64
5.3.100.0100.07014.10
5.3.90.0100.06314.03
5.3.80.0230.03714.10
5.3.70.0130.04714.11
5.3.60.0030.05314.03
5.3.50.0170.04014.04
5.3.40.0070.06014.12
5.3.30.0130.04713.90
5.3.20.0070.05013.79
5.3.10.0070.05013.63
5.3.00.0000.05313.54
5.2.170.0070.04311.11
5.2.160.0030.06011.23
5.2.150.0030.05011.22
5.2.140.0070.04011.10
5.2.130.0030.04011.33
5.2.120.0030.04011.18
5.2.110.0170.03711.09
5.2.100.0030.04011.18
5.2.90.0170.03711.10
5.2.80.0100.04311.09
5.2.70.0100.05311.18
5.2.60.0100.05711.13
5.2.50.0030.05711.11
5.2.40.0130.03310.96
5.2.30.0200.03310.96
5.2.20.0170.04011.06
5.2.10.0100.03710.93
5.2.00.0030.04710.95
5.1.60.0030.04710.04
5.1.50.0130.03310.07
5.1.40.0000.0409.90
5.1.30.0070.04010.55
5.1.20.0070.04710.33
5.1.10.0100.03310.32
5.1.00.0030.04310.23
5.0.50.0030.0408.46
5.0.40.0030.0378.48
5.0.30.0070.0408.15
5.0.20.0030.0278.03
5.0.10.0130.0208.02
5.0.00.0070.0478.00
4.4.90.0030.0307.40
4.4.80.0070.0177.40
4.4.70.0030.0277.40
4.4.60.0000.0237.40
4.4.50.0000.0237.40
4.4.40.0070.0337.39
4.4.30.0030.0207.39
4.4.20.0030.0237.39
4.4.10.0070.0177.40
4.4.00.0030.0337.40
4.3.110.0100.0177.40
4.3.100.0030.0277.40
4.3.90.0030.0307.39
4.3.80.0030.0407.39
4.3.70.0030.0207.39
4.3.60.0030.0207.39
4.3.50.0030.0307.39
4.3.40.0070.0377.39
4.3.30.0000.0237.39
4.3.20.0030.0277.39
4.3.10.0000.0307.39
4.3.00.0100.0237.54

preferences:
33.78 ms | 400 KiB | 5 Q