php.net |  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
Votes:2
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: snebes at digitalbrandworks dot com
New email:
PHP Version: OS:

 

 [2014-06-23 13:57 UTC] snebes at digitalbrandworks dot com
Description:
------------
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:
---------------
<?php

// 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b2b2b43>
[2] <https://3v4l.org/QmrVH>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC