Closed tomterl closed 1 year ago
Given the following yaml file test.yml
test.yml
--- This is a front-matter --- doc: - prop1: val1 prop2: val2 ...
The following code:
<?php $nd = 0; yaml_parse_file("./test.yml", -1, $nd); echo $nd;
Resulted in this output:
0
But I expected this output instead:
2
The documents are parsed correctly, but without the confirmation of $ndoc > 0, there's no way to tell (could be one document).
$ndoc > 0
yaml_parse behaves as expected:
yaml_parse
<?php $nd = 0; $yaml = file_get_contents("./test.yml"); yaml_parse($yaml, -1, $nd); echo $nd;
gives
as expected
PHP 8.1.14 / PHP 8.2.1
Ubuntu 22.04
Description
Given the following yaml file
test.yml
The following code:
Resulted in this output:
But I expected this output instead:
The documents are parsed correctly, but without the confirmation of
$ndoc > 0
, there's no way to tell (could be one document).yaml_parse
behaves as expected:gives
as expected
PHP Version
PHP 8.1.14 / PHP 8.2.1
Operating System
Ubuntu 22.04