How would it be possible to access the $ foo attribute in the following inheritance example? I thought that by inheritance you could access properties and methods of the parent class but in this example I get an error.
<?php
class ClasePadre {
$foo= 5;
}
class ClaseHija extends ClasePadre {
public function miFuncion(){
echo $foo;
}
}
$nueva=new ClaseHija();
$nueva->miFuncion();