php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75029 Empty string should not return FALSE
Submitted: 2017-08-03 12:12 UTC Modified: 2018-11-13 03:03 UTC
From: Raffael dot Comi at elementare-teilchen dot de Assigned: bd808 (profile)
Status: Closed Package: yaml (PECL)
PHP Version: 7.1.7 OS: debian stretch
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 6 = ?
Subscribe to this entry?

 
 [2017-08-03 12:12 UTC] Raffael dot Comi at elementare-teilchen dot de
Description:
------------
I'm using version 2.0.0 of php-yaml.

According to http://www.yaml.org/spec/current.html#id2527268, empty streams are valid, they don't have to include a document.
Take the example provided in the spec, where the stream only consists of comments.

Test script:
---------------
yaml_parse('');

yaml_parse('#Only comment');

Expected result:
----------------
array(0) {
}

or

string(0) ""

or even

bool(true)

Actual result:
--------------
PHP Warning:  yaml_parse(): end of stream reached without finding document 0

bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-13 01:22 UTC] bd808@php.net
-Assigned To: +Assigned To: bd808
 [2018-11-13 03:03 UTC] bd808@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 01:01:30 2024 UTC