0
Pregunta
Una pregunta porque cuando heredó una clase de otra por ejemplo... class Carro { private $motor; function Carro { $this->motor=1; } } - class Gandola extends Carro { function Gandola { this-> motor=2; } } $mack= new Gandola; $fortuner=new Carro; echo $mack->motor; No entiendo porque a la hora de imprimir se visualiza el valor del motor de el camión que no no debería noestá heredando el private? Si lo coloco al revés así si funciona echo $fortuner-> motor; echo $mack->motor; Acá se visualiza
3 Respuestas
0
If you want to increase your chances of getting answer I recommend you to write your question in english.
0
I do not understand why at the time of printing is displayed the value of the engine of the camera that is not inheriting the private? If I put it backwards so it works
0
My question is because when I call the function that gives me the name of the engine that I value, if in fact I should not give me