OOP | PHP | Instance | local Variable | global Variable
<?php
$test = "im testing";
class box{
public $name = "myboxasasas"; //local variable
public $code = " 112"; //lcv
function work(){
echo "this is my function";
}
}
$bigbox = new box();
echo $bigbox->code;
echo $test;
?>
$test = "im testing";
class box{
public $name = "myboxasasas"; //local variable
public $code = " 112"; //lcv
function work(){
echo "this is my function";
}
}
$bigbox = new box();
echo $bigbox->code;
echo $test;
?>
Comments
Post a Comment