php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45976 SPL fails to load if simplexml is not loaded
Submitted: 2008-09-02 16:52 UTC Modified: 2008-11-06 00:37 UTC
From: development at domain51 dot com Assigned: colder
Status: Closed Package: SPL related
PHP Version: 5.3CVS-2008-09-02 (CVS) OS: OS X
Private report: No CVE-ID:
 [2008-09-02 16:52 UTC] development at domain51 dot com
Description:
------------
When the SimpleXML extension is not loaded, SPL fails to load.

Reproduce code:
---------------
$ ./configure --disable-simplexml && make && make install
$ php -v

Expected result:
----------------
PHP 5.3.0alpha3-dev (cli) (built: Sep  2 2008 11:09:22) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies


Actual result:
--------------
PHP Warning:  Cannot load module 'SPL' because required module 'simplexml' is not loaded in Unknown on line 0
PHP 5.3.0alpha3-dev (cli) (built: Sep  2 2008 11:09:22) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-02 23:20 UTC] tularis@php.net
What exactly is bugged about this according to you?

SPL requires simpleXML, which you explicitly disallow. Seems pretty straightforward to me? enable simpleXML and SPL will load just fine again.
 [2008-09-02 23:40 UTC] development at domain51 dot com
The problem is that SimpleXML should not be something that can be 
disabled if it is required for SPL and SPL can not be disabled.  This 
will break all manner of debian packages that compile with --disable-all 
used.
 [2008-09-02 23:49 UTC] johannes@php.net
No, the behavior is wrong, the configure system should fail not create an invalid build.

The question is: Should we enforce the availability of SimpleXML or not? Without too much thinking I tend to say no, and thinking a bit more I'm wondering if it makes sense to move SimpleXMLIterator from SPL to SimpleXML then we could get rid of that dependency. Marcus, what's your opinion on this?
 [2008-09-03 15:15 UTC] development at domain51 dot com
Just my two cents: I agree with Johannes here.  If SimpleXMLIterator is 
the only requirement on SimpleXML, I would definitely move that to the 
SimpleXML extension and give SimpleXML a dependency on SPL - a 
dependency that should never fail as SPL is always on in versions >= 
5.3.
 [2008-11-06 00:37 UTC] colder@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 25 07:02:14 2014 UTC