Re: include_once/__autoload/namespace emulation ...



I think I messed up my example $obj = new XML_Parser(); should load
/classes/xml/parser.inc.php which simplifies things (if I did mess up
the website I quoted has it done right). And it also means allot less
typing. No more 10 lines of includes at the beginning of your scripts.
Just an autoload.

Again I have never heard of performance issues with autoload. In work I
do in php I don't even use that function though.

There are allot of improvements to php that need to be made. Class
level namespaces probably being one of them, removal of magic quotes
and register globals and so on. Where php is at the moment they can't
really change too much without the risk of breaking backwards
compatibility.

.



Relevant Pages

  • Re: include_once/__autoload/namespace emulation ...
    ... >to to huge class names (and a lot of typing). ... as __autoload only loads classes on demand. ... >namespaces. ... are simply not the issue in PHP as they are for other languages. ...
    (comp.lang.php)
  • Re: class_is_loadable?
    ... The problem is not the autoload but the implementation of such function. ... PHP should inspect some files, in some directories and list classes. ... "Larry Garfield" a écrit dans le message de ... $foo = new B; ...
    (php.general)
  • Re: [PHP] __autoload alternative
    ... Is there any way to auto load a class without using __autoload ... redeclare of __autoload function. ... return strtolower(str_replace('_', DIRECTORY_SEPARATOR, $classname). ...
    (php.general)
  • Re: class_is_loadable?
    ... If you really want to do it that way, you could check if the file which autoload will try to include exists and if it does, include it and create your object. ... "Larry Garfield" wrote in message ... $foo = new B; ... for PHP 5.2 and later. ...
    (php.general)
  • Re: [PHP] Classes - Dumb question
    ... I am not familiar with autoload. ... Stut also made mention of that, so I shall investigate post haste. ... code is heavily oop; i just use the php.ini auto_prepend_file directive. ... the excuse youve been looking for to get into oop w/ php:) ...
    (php.general)