|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76309 Unexpected handling of strings that consist of numbers followed by a period
Submitted: 2018-05-07 16:00 UTC Modified: 2018-11-13 03:03 UTC
From: niklas dot laxstrom at gmail dot com Assigned: bd808 (profile)
Status: Closed Package: yaml (PECL)
PHP Version: 7.1.17 OS: Debian
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: niklas dot laxstrom at gmail dot com
New email:
PHP Version: OS:


 [2018-05-07 16:00 UTC] niklas dot laxstrom at gmail dot com
Strings matching pattern [0-9]+\. are emitted without quotes, which according to YAML 1.2 spec are floats. They should be quoted as strings.

I could not find a clear answer from YAML 1.1 spec (what the extensions claims to support) what is the expected behavior there.

Test script:
echo yaml_emit( [ 'a' => '1.0', 'b' => '2.', 'c' => '3'] );

Expected result:
a: "1.0"
b: "2."
c: "3"

Actual result:
a: "1.0"
b: 2.
c: "3"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-13 01:22 UTC]
-Assigned To: +Assigned To: bd808
 [2018-11-13 03:03 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jan 21 09:03:35 2022 UTC