Hi,
on the last week's iSeminar Zeev said that in ZE2(php5) there will be new
interesting function
for implementing in userland. Its name will be __autoload(). It will be
called in case the code
wants to instantiate a class that is unknown. The function should
require/include the file where
the implementation of the class is.
AFAIK there won't be 4.4.0 but 5.0.0 after 4.3.0 and also new code won't be
introduced in 4.3.x
only bugfixes (if anyone has objections please correct me). Therefore in
php5 there will be similar functionality.

Regards,
Andrey

----- Original Message -----
From: "Brian T. Allen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 10:21 PM
Subject: [PHP-DEV] Feature Request: Auto Include a Function


> Hi,
>
> Please accept my apologies in advance if this is not the correct place
> for this request.
>
> This may exist, but I haven't been able to find it, and I think it would
> be REALLY helpful and convenient.
>
> The idea is this:
>
> When you write a script and call a function:
>
> <?php
>
> $whatever = previously_uncalled_function("one","two");
>
> ?>
>
> PHP could automatically look for a file named
> "previously_uncalled_function" in your /include/functions/ (or whatever)
> directory.
>
> This would eliminate a LOT of include() and require() calls (or at least
> make them automatic) in a script.  The function would only get read in
> if it was used.  Functions could still be explicitly included or
> required as they currently are.
>
> I *think* the overhead would be about the same as the initial include()
> or require() call would have been.
>
> This would be very convenient.  When you create a new function you drop
> it in that directory (with a very specific, unique name, of course), and
> it can immediately be called anywhere in the site.  And, you only incur
> the disk IO to read it when its used for the first time in a script.
>
> The 3 things I want to avoid are:
>
> 1)  Explicitly including every function, every time it's needed.
> 2)  Disk IO of including a function when it's not needed.
> 3)  Taking the easy route and including a file with a bunch of functions
> when most won't get called.
>
> Does this already exist, or is this a good idea (if not, any reasons
> why)?  I personally would love to see it implemented if it isn't
> already.
>
> One possibility for implementation is just prior to the "undeclared
> function" error message, try to auto include the function prior to
> generating the error message.
>
> Thanks,
> Brian Allen
> [EMAIL PROTECTED]
>
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to