Edit report at http://pear.php.net/bugs/bug.php?id=18675&edit=1
ID: 18675
Updated by: [email protected]
Reported By: lgillentine at gmail dot com
Summary: Strict Standards Errors with XML_Util in php 5.3.6
Status: Open
Type: Bug
Package: XML_Serializer
Operating System: Mac Os X 10.6
Package Version: 0.20.2
PHP Version: 5.3.6
Roadmap Versions:
New Comment:
Thanks for the patch Lee; but XML_Util is a bit of an old relic from the
PHP4 era. In
order to maintain compatability with PHP4 (there are folks who do use
it); we can't
apply the changes you've suggested directly.
If you wanted to make an XML_Util2 (basically your patch plus any other
PHP5+
fixes) and XML_Serializer2; that would be a different story. Take a look
@ http://pear.php.net/pepr for more details.
Previous Comments:
------------------------------------------------------------------------
[2011-07-20 23:36:41] lgillentine
Added #patch bug:18675;patch:XML_Util-singleton;revision:1311201401;.
------------------------------------------------------------------------
[2011-07-20 23:09:40] lgillentine
Description:
------------
When I try to seralize an array, php throws a bunch of
warnings. I'm pretty certain that this is because I'm running
version 5.3.6 and have Strict warnings turned on.
The warnings are about methods in the XML_Util class being
called non-statically from the XML_Serializer class.
I have resolved this by explicitly declaring the methods in
XML_Util as public static functions, which makes php happy. I
think this is the correct way to do it, as XML_Util is running as
a singleton.
Test script:
---------------
$foo = array(
'hi'=>'hello',
'bye' => 'goodbye'
);
$Serializer = new XML_Serializer($serializer_options);
$Serializer->serialize($foo);
echo $Serializer->getSerializedData();
Expected result:
----------------
Results return as expected, but I get a bunch of Strict standards
errors.
Actual result:
--------------
Here is an example of the error I am getting:
Strict standards: Non-static method
XML_Util::createTagFromArray() should not be called statically,
assuming $this from incompatible context in
/opt/local/lib/php/XML/Serializer.php on line 1231
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18675&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.