I'm looking for a simple YAML parser I can use in my PHP scripts. Requirements:

  • lightweight. I don't want to install a complete framework just to parse a few simple YAML files.
  • independent. I don't want some strange dependencies (like having to manually compile and install some system library first as PECL seems to expect), and I don't want to use special installers just to get it running (like Symfony expects me to use composer).
  • compact. Ideally a single (class) file, maximally a small directory. Size should be in the kilobyte range (yes, 200k or even 400k would be OK, but rather not beyond that)

It's sufficient if it understands to decode YAML "objects" (i.e. the entire YAML fed to it as a string) and returns a PHP object/array representing it. Direct methods to just pass it a file name are nice-to-have (and easy to add by myself if missing). Manipulating and writing YAML isn't required, but welcome if above criteria are still met.

Ideally FOSS under an OSI license.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.