|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67503 PHP 5.3.10-1ubuntu3.11 with Suhosin-Patch
Submitted: 2014-06-23 13:57 UTC Modified: 2018-08-07 16:20 UTC
Avg. Score:4.0 ± 1.0
Reproduced:0 of 0 (0.0%)
From: snebes at digitalbrandworks dot com Assigned: cmb (profile)
Status: Closed Package: SimpleXML related
PHP Version: 5.5.13 OS: Ubuntu 12.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: snebes at digitalbrandworks dot com
New email:
PHP Version: OS:


 [2014-06-23 13:57 UTC] snebes at digitalbrandworks dot com
PHP:  PHP 5.3.10-1ubuntu3.11 with Suhosin-Patch and PHP 5.5.9-1ubuntu4 (my test env).  Appears to span multiple versions.

Description:  Using SimpleXML Nodes in mathematical equations doesn't correctly convert strings to floats, as expected, but only to integers (stopping at the decimal).

Modules:  aptitude managed, with cURL installed.  Everything else is vanilla.

FYI - the "PHP Version" can't be changed on the bug submitting form after an error occurs when submitting asking me to change it....

Test script:

// Does NOT work as expected.
$sxml = simplexml_load_string('<test><num>20.5</num><den>1</den></test>');
$ans = $sxml->num / $sxml->den;

echo "XML Test:\n";
echo "{$sxml->num} / {$sxml->den} = {$ans}\n";
// Output:  20.5 / 1 = 20

// Works as expected.
$num = "20.5";
$den = "1";
$ans = $num / $den;

echo "String Test:\n";
echo "{$num} / {$den} = {$ans}\n";
// Output:  20.5 / 1 = 20.5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-07 16:20 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-08-07 16:20 UTC]
Fixed via commit b2b2b43[1] for PHP 7.3[2].  Will not be backported
for BC reasons.

[1] <;a=commit;h=b2b2b43>
[2] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 11:01:30 2024 UTC