Which “false” is it?
dionyziz@turing ~ $ cat test.php
<?php
class false {
}
$c = New false();
echo get_class( $c );
?>
dionyziz@turing ~ $ php test.php
false
dionyziz@turing ~ $
This entry was posted
on Tuesday, May 27th, 2008 at 8:38 pm and is filed under PHP.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
May 27th, 2008 at 8:49 pm
the one you created, as get_class( false ) does not return “false”
and $c = New false(); would be a fatal error if you did not
declare your own false class
May 27th, 2008 at 9:00 pm
Obviously, but that’s still kinda weird that it allows me to declare such a class, don’t you think?
June 3rd, 2008 at 3:47 pm
“true” and “false” are not reserved words in PHP. They are globally-defined constants according to PHP.net.
http://www.php.net/manual/en/reserved.php
June 4th, 2008 at 10:31 am
Neither in Python, “True” and “False” are reserved keywords. They are just two predefined variables, whose value can change during runtime, or new classes can be defined with their names, etc.