is it possible to use autoload for interfaces ?

This is a discussion on is it possible to use autoload for interfaces ? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Is it possible to use __autoload for interfaces as well ? if file exists ($path . '/class.$name.php' require class else ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-25-2008
Pugi!
 
Posts: n/a
Default is it possible to use autoload for interfaces ?

Is it possible to use __autoload for interfaces as well ?

if file exists ($path . '/class.$name.php'
require class
else if file exists ($path . '/interface.$name.php'
require interface
else
throw exception

Pugi!
Reply With Quote
  #2 (permalink)  
Old 03-25-2008
Michael Fesser
 
Posts: n/a
Default Re: is it possible to use autoload for interfaces ?

..oO(Pugi!)

>Is it possible to use __autoload for interfaces as well ?


Sure.

But you should have a look at spl_autoload_register() instead. It's the
more portable way for autoloading, especially if you want to use third-
party scripts that might already have their own __autoload() function.

Micha
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:24 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0