Edit report at http://bugs.php.net/bug.php?id=51991&edit=1
ID: 51991
Updated by: felipe@php.net
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
Block user comment: N
New Comment:
Hi, make sure you are using the right version... (phpversion())
Previous Comments:
------------------------------------------------------------------------
[2010-07-26 23:01:53] xstansa at gmail dot com
I just upgraded to PHP 5.3.3 and this bug still persists.
Tested on Linux (Cent OS 5.5) with PHP 5.3.3.
Same Test Script and result as the original bug.
------------------------------------------------------------------------
[2010-06-04 02:44:01] grummfy at gmail dot com
thanks
------------------------------------------------------------------------
[2010-06-04 02:10:20] felipe@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] felipe@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