|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75213 Float/Exponential values incorrectly parsed
Submitted: 2017-09-15 15:32 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: neclimdul at gmail dot com Assigned:
Status: Open Package: yaml (PECL)
PHP Version: 7.1.9 OS: alpine
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-09-15 15:32 UTC] neclimdul at gmail dot com
There seems to be a bug with float values out of YAML files.

Originally found here:

"3.1415" is parsed as "3.1415900000001784" and "1.2e+34" is parsed as "1.2000000000000467E+34"

This is only happens in alpine. It is not present in ruby on alpine though so I'm not sure if its musl related or if ruby works around it.

Test script:

  - 3.1415
  - 1.2e+30

Expected result:
array(2) {

Actual result:
array(2) {


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-15 15:52 UTC] neclimdul at gmail dot com
Added a git repo that has some docker resources that help demonstrate this.
 [2017-09-15 16:26 UTC] neclimdul at gmail dot com
Addition note, I just confirmed that while the scripts provided are helpful for demonstrating the issue quickly and easily, running `make test` in alpine actually fails and catches this problem in a couple different tests.
 [2017-09-15 18:30 UTC] neclimdul at gmail dot com
Don't know if it is the right solution but this fixes the bug.
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Oct 21 16:01:26 2018 UTC