note 49298 deleted from language.oop by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 19:03:38 +0000 |
| Subject: | note 49298 deleted from language.oop by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162565@lists.php.net to get a copy of this message | ||
Note Submitter: spam at modem-help dot com
----
Although the php 4.2.2 parser and variable storage are case-sensitive, classes + class-function +
function declaration *storage* are not.
To example this, consider the following:
[note: constructor is
sendfile()', not SendFile()' nor `sendFile()']
<?php
class SendFile {
// variables declared here
function SendFile() {
// function defined here
}
function sendFile() {
// function defined here
}
function sendfile() {
// function defined here
}
} // end class SendFile
?>
This was eventually illuminated by:
<?php
print_r( get_declared_classes());
?>
...in which a snippet of the result is:
Array
(
[0] => stdClass
[1] => __PHP_Incomplete_Class
[2] => Directory
[3] => DomNode
[4] => DomDocument
[5] => DomParser
...
[24] => sendfile
)
Specifically, it appears that php has used initial-caps for all of it`s own (internal) classes, but
that all user-classes are stored lower-cased, as are class + ordinary functions.
Written in the hope of saving someone else time & grief from this interesting `feature'.