note 54865 deleted from language.oop5.static by tularis
| From: | tularis@php.net | Date: | Fri, 20 Jun 2008 18:22:21 +0000 |
| Subject: | note 54865 deleted from language.oop5.static by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140628@lists.php.net to get a copy of this message | ||
Note Submitter: daxxar
----
Just to point it out, this is slightly different from the C++ OO approach.
The following code compiles and runs fine using g++ with the options -W -Wall -pedantic :)
#include <iostream>
struct Foo { static void Bar() { std::cout << "Hi!" << std::endl; } };
int main() { Foo x; x.Bar(); return 0; }
Whereas accessing a static method via an instance of a class in PHP doesn't work.
It's not a problem, but it's perhaps worth noting, if you're used to C++ OO.