Hi! > static class Foo { > function bar() { > echo do_something_with($this); > } > } > > Much nicer (and just as easy) for that to give a compile-time error of > "Static class Foo cannot contain non-static function bar" than for it to > autoload fine, and then give a less obvious error when Foo::bar() is run > (probably to do with a non-existent variable, since $this is always > undefined inside a static function).
This example is fit the narrow purpose of being the example, but you could have as easily written "static function bar" and be back to square one. I'm not sure how language-enforced "all methods must be static" is really useful - if you don't want to instantiate it, put a private ctor or make it abstract. If you want static methods, just make them static. It won't help you anyway if you use $this in static methods. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php