note 112012 deleted from language.oop5.basic by aharvey
| From: | aharvey@php.net | Date: | Mon, 22 Apr 2013 16:25:12 +0000 |
| Subject: | note 112012 deleted from language.oop5.basic by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194598@lists.php.net to get a copy of this message | ||
Note Submitter: subramanya dot smg at gmail dot com
----
PHP Classnames are case in-sensitive. Check the below code and the output.
$vars= "from vars";
$VARS = "From VARS";
echo $vars."<br>";
echo $VARS."<br>";
class aA {
function foo(){
if(isset($this))
{
echo "this class is defined(";
echo get_class($this);
echo ")<br>";
}
else echo "class not defined<br>";
}
}
class Bb{
function bar(){
aa::foo();
}
}
$classname = 'aa';
$a=new aa();
$a->foo();
$classname::foo();
$classname = 'bb';
$b = new bb();
$b->bar();
Bb::bar();
-------------
output:
from vars
From VARS
this class is defined(aA)
class not defined
this class is defined(Bb)
class not defined
this class is defined(Bb)