mustangostang / spyc

A simple YAML loader/dumper class for PHP
MIT License
701 stars 206 forks source link

spyc_load_file() incorrectly handles a missing file #50

Open jmikkola opened 8 years ago

jmikkola commented 8 years ago

spyc_load_file() makes dealing with missing files very confusing by returning a valid-looking value instead of reporting the error.

Steps to reproduce

  1. Run:
<?php
var_dump(spyc_load_file('/missing/file.yaml'));

Expected result

Some kind of error about the file not existing.

Actual result

array(1) {
  [0] =>
  string(18) "/missing/file.yaml"
}