Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Terje Slettebø
> > In either of the above cases, you specify where a function belongs, both > > where it's defined, and where it's used (either through full qualification, > > or a shorter one, using "import"). I'm not arguing for a function to > > "magically" become a part of a class/module/whatever, if you thou

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Terje Slettebø
>On 9/11/06, Terje Slettebø <[EMAIL PROTECTED]> wrote: >> Please, people: The availability of free (non-member) functions in PHP (as >> in C/C++) is one advantage it has over Java, where everything _has_ to be a >> class. So in Java, instead of being able to write "sqrt()", you have >> to write "Ma

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Michael Walter
On 9/11/06, Terje Slettebø <[EMAIL PROTECTED]> wrote: Please, people: The availability of free (non-member) functions in PHP (as in C/C++) is one advantage it has over Java, where everything _has_ to be a class. So in Java, instead of being able to write "sqrt()", you have to write "Math::sqrt()"

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Stanislav Malyshev
> In either of the above cases, you specify where a function belongs, both > where it's defined, and where it's used (either through full qualification, > or a shorter one, using "import"). I'm not arguing for a function to > "magically" become a part of a class/module/whatever, if you thought so

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Terje Slettebø
> > Or "namespaces"... Or just plain "modules". Classes is not the only way to > > group things, and may not be the best (namespaces can typically be > > > Oh, of course it's not the only way. It's the only way native to PHP though. Yes. > > re-opened, so functions and classes belonging to a name

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Stanislav Malyshev
> Or "namespaces"... Or just plain "modules". Classes is not the only way to > group things, and may not be the best (namespaces can typically be > Oh, of course it's not the only way. It's the only way native to PHP though. > re-opened, so functions and classes belonging to a namespace can spa

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Terje Slettebø
> >> Maybe a dump question, but wouldn't it get considered only, AFTER PHP has > >> found that the function does not exist? > > Technically, this can be done - i.e. engine can be patched so that > instead of throwing an error or refusing the call it would call > appropriate function which would all

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Stanislav Malyshev
Maybe a dump question, but wouldn't it get considered only, AFTER PHP has found that the function does not exist? Technically, this can be done - i.e. engine can be patched so that instead of throwing an error or refusing the call it would call appropriate function which would allow for autolo

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Michael Walter
On 9/11/06, Richard Quadling <[EMAIL PROTECTED]> wrote: One way in useerland to solve this is to use an error handler to identify non existant function calls and then use an appropriate mechanism to find them. You can't catch fatal errors. Regards, Michael -- PHP Internals - PHP Runtime Devel

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Richard Quadling
On 10/09/06, dAniel hAhler <[EMAIL PROTECTED]> wrote: Marcus Boerger wrote: > it hasbeendiscussed and the conclusion is that it isfar too much of a > slowdown for every function call and thus we are not going to implement > it. Maybe a dump question, but wouldn't it get considered only, AFTER

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-10 Thread dAniel hAhler
Marcus Boerger wrote: > it hasbeendiscussed and the conclusion is that it isfar too much of a > slowdown for every function call and thus we are not going to implement > it. Maybe a dump question, but wouldn't it get considered only, AFTER PHP has found that the function does not exist? So, it

Re: [PHP-DEV] Multi-paradigm design (was: Re: [PHP-DEV] Re: __autoloading and functions)

2006-09-10 Thread Derick Rethans
On Sun, 10 Sep 2006, Terje Slettebø wrote: > > > P.S: As an aside: Why is everybody (?) replying to both the list > > > _and_ the poster? If you post, isn't it safe to assume you're > > > actually on the list, or am I missing something? > > > > It is a common usage here. Some uses nntp, other ma

Re: [PHP-DEV] Multi-paradigm design (was: Re: [PHP-DEV] Re: __autoloading and functions)

2006-09-10 Thread Terje Slettebø
Hi Pierre. > > P.S: As an aside: Why is everybody (?) replying to both the list _and_ the > > poster? If you post, isn't it safe to assume you're actually on the list, or > > am I missing something? > > It is a common usage here. Some uses nntp, other mails (and filters, etc..). Ok. It's just th

Re: [PHP-DEV] Multi-paradigm design (was: Re: [PHP-DEV] Re: __autoloading and functions)

2006-09-10 Thread Pierre
Hello, P.S: As an aside: Why is everybody (?) replying to both the list _and_ the poster? If you post, isn't it safe to assume you're actually on the list, or am I missing something? It is a common usage here. Some uses nntp, other mails (and filters, etc..). It is also nice to do not start

[PHP-DEV] Multi-paradigm design (was: Re: [PHP-DEV] Re: __autoloading and functions)

2006-09-10 Thread Terje Slettebø
e list, or am I missing something? - Original Message - From: "Marcus Boerger" <[EMAIL PROTECTED]> To: "Terje Slettebø" <[EMAIL PROTECTED]> Cc: "Hannes Magnusson" <[EMAIL PROTECTED]>; Sent: Sunday, September 10, 2006 5:35 PM Subject: Re: [PHP-DEV] R

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-10 Thread Marcus Boerger
Hello Terje, it hasbeendiscussed and the conclusion is that it isfar too much of a slowdown for every function call and thus we are not going to implement it. The speed reasoning put aside we also found that procedural techniques should not mix too much with the object oriented features. bes re

[PHP-DEV] Re: __autoloading and functions

2006-09-10 Thread Terje Slettebø
Hi Hannes. Ok, so I was wrong about the cause of the "symptom", good - so this is instead another problem: No autoloading of functions... I tried a similar example, where you switch the order of "new foo()" and "bar()" around, and it fails, as it doesn't find the definition of bar(), since class.p

[PHP-DEV] Re: __autoloading and functions

2006-09-10 Thread Hannes Magnusson
On 9/10/06, Hannes Magnusson <[EMAIL PROTECTED]> wrote: Hello Terje What are you talking about? --class.php-- Gah. I meant to say "Prints out 'hello world'" -Hannes On 9/10/06, Terje Slettebø <[EMAIL PROTECTED]> wrote: > Hi all. > > I don't know if this has been discussed before (I've not

[PHP-DEV] Re: __autoloading and functions

2006-09-10 Thread Hannes Magnusson
Hello Terje What are you talking about? --class.php-- wrote: Hi all. I don't know if this has been discussed before (I've not found it from doing a search), but if it has, please provide me with a link to the discussion. __autoload() is very convenient, but it has one problem: While classes d