Edit report at http://bugs.php.net/bug.php?id=51991&edit=1

 ID:               51991
 Comment by:       grummfy at gmail dot com
 Reported by:      grummfy at gmail dot com
 Summary:          spl_autoload and *nix support with namespace
 Status:           Closed
 Type:             Bug
 Package:          SPL related
 Operating System: linux, mac, *nix
 PHP Version:      5.3.2
 Assigned To:      felipe

 New Comment:

thanks


Previous Comments:
------------------------------------------------------------------------
[2010-06-04 02:10:20] fel...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------
[2010-06-04 02:10:18] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=300176
Log: - Fixed bug #51991 (spl_autoload and *nix support with namespace)

------------------------------------------------------------------------
[2010-06-03 19:23:59] grummfy at gmail dot com

Description:
------------
On windows systems you can use spl_autload to load namespaced class and
it works!

On *nix system you can't!



Tested on linux (ubuntu 10.04 64 bit) with package : php5
5.3.2-1ubuntu4.2



You can test the next script on a windows and on a linux or a mac.



Test script:
---------------
create a file called index.php

------------------------------

use My\Framework\Test;

spl_autoload_register();

$test = new Test();

echo $test;

------------------------------

Another file in a subdir My/Framework called Test.php

------------------------------

namespace My\Framework;

class Test

{

    public function __toString()

    {

        return 'hi';

    }

}

------------------------------

Expected result:
----------------
Expected result :

script that produce :

hi

Actual result:
--------------
windows:

hi

Linux:

Fatal error: spl_autoload() [<a
href='function.spl-autoload'>function.spl-autoload</a>]: Class
My\Framework\Test could not be loaded in /.../index.php on line 7


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51991&edit=1

Reply via email to