|  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: 2018-11-13 03:02 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: neclimdul at gmail dot com Assigned: bd808 (profile)
Status: Closed Package: yaml (PECL)
PHP Version: 7.1.9 OS: alpine
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: neclimdul at gmail dot com
New email:
PHP Version: OS:


 [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.
 [2018-11-13 01:23 UTC]
-Assigned To: +Assigned To: bd808
 [2018-11-13 03:02 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 18:01:25 2023 UTC