Re: A quick consensus on magic method idea

From: Date: Fri, 04 Feb 2011 04:49:28 +0000
Subject: Re: A quick consensus on magic method idea
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-51427@lists.php.net to get a copy of this message
Hello, On Thu, Feb 3, 2011 at 8:38 PM, Ben Schmidt <mail_ben_schmidt@yahoo.com.au> wrote: > > Do you yourself have any situation where this is useful? Does it solve > some problem? Does it enable you to do things better than before? > > Ben. > It does not provide a solution to a currently unsolvable problem, it is simply a convenience for situations when you want a class to perform any kind of initialization directly after compilation/loading (whatever term you find easier on the ears). It provides a cleaner more encapsulated approach to a (not entirely uncommon) case such as: Foo.php: class Foo { // class body } Foo::registerSomeStuff(); Just a idea I wanted to share, -Chris

« previous php.internals (#51427) next »