This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Abuelo | |
{ | |
public $nombre = 'Jose Perez'; // variable de tipo privado | |
} | |
class Padre extends Abuelo | |
{ | |
function getNombreAbuelo() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Abuelo | |
{ | |
protected $nombre = 'Jose Perez'; // variable de tipo privado | |
} | |
class Padre extends Abuelo | |
{ | |
function getNombreAbuelo() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Abuelo | |
{ | |
private $nombre = 'Jose Perez'; // variable de tipo privado | |
private $totaldinero = 150000; | |
public function getNombreAbuelo() //funcion publica | |
{ | |
return $this->nombre; //la variable de tipo privado solo es usado en la clase | |
} |