What I'm used to is variables being accessable from where they're declared and everything narrower than that, i.e. along the following psuedocode:
Code: Select all
int foo;
function display_foo()
{
echo foo;
}As should the following:
Code: Select all
class bar
{
private $foo = 50;
public function get_foo()
{
return $foo;
}
}Code: Select all
function herbert()
{
int taco = 20;
}
echo taco;Code: Select all
int tamale = 100;
function combo_plate
{
int tamale = 50;
echo tamale;
}
echo tamale;So, does what I'm saying make sense to anyone, or at least make enough sense to *not* make sense, so someone can explain to me where I'm wrong?
Thanks!