PHPackages                             pecl/yaml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. pecl/yaml

ActivePhp-ext[Parsing &amp; Serialization](/categories/parsing)

pecl/yaml
=========

YAML-1.1 parser and emitter

2.3.0(7mo ago)767.5k↓14.8%34[6 issues](https://github.com/php/pecl-file_formats-yaml/issues)[1 PRs](https://github.com/php/pecl-file_formats-yaml/pulls)MITCPHP &gt;= 7.1.0CI passing

Since Nov 12Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/php/pecl-file_formats-yaml)[ Packagist](https://packagist.org/packages/pecl/yaml)[ RSS](/packages/pecl-yaml/feed)WikiDiscussions php7 Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

```
The Yaml PHP Extension provides a wrapper to the LibYAML library.

It gives the user the ability to parse YAML document streams into PHP
constructs and emit PHP constructs as valid YAML 1.1 documents.

For more information about LibYAML see http://pyyaml.org/wiki/LibYAML.
For more information about YAML see http://yaml.org/

Requirements:
  * libyaml 0.1.x

BUILDING ON UNIX etc.
=====================

To compile your new extension, you will have to execute the following steps:

1.  $ phpize
2.  $ ./configure [--with-yaml]
3.  $ make
4.  $ sudo make install

BUILDING ON WINDOWS
===================

The extension provides the VisualStudio V6 project file

  yaml.dsp
To compile the extension you open this file using VisualStudio,
select the apropriate configuration for your installation
(either "Release_TS" or "Debug_TS") and create "php_yaml.dll"

After successfull compilation you have to copy the newly
created "php_yaml.dll" to the PHP
extension directory (default: C:\PHP\extensions).

TESTING
========

You can now load the extension using a php.ini directive

  extension="php_yaml.[so|dll]"

or load it at runtime using the dl() function

  dl("php_yaml.[so|dll]");

The extension should now be available, you can test this
using the extension_loaded() function:

  if (extension_loaded(yaml))
    echo "yaml loaded :)";
  else
    echo "something is wrong :(";

The extension will also add its own block to the output
of phpinfo();

CONFIGURATION
=============
ini settings:
  yaml.decode_timestamp=0 for no timestamp parsing
  yaml.decode_timestamp=1 for strtotime parsing
  yaml.decode_timestamp=2 for date_create parsing

  yaml.decode_binary=0 for no binary decoding
  yaml.decode_binary=1 for base64 binary decoding

  yaml.decode_php=0 for no serialized object parsing
  yaml.decode_php=1 for serialized object parsing

/**
 * @param string $input String to parse as YAML document stream
 * @param int $pos Document to extract from stream (-1 for all, 0 for first, ...)
 * @param int $ndocs Number of documents found in stream
 * @param array $callbacks Content handlers for YAML nodes. Array of tag => handler
 * @return mixed Parsed data
 */
yaml_parse ($input, $pos=0, &$ndocs=null, $callbacks=null)

/**
 * @param mixed $data Data to encode
 * @param int $encoding Output encoding
 * @param int $linebreak Output linebreak
 * @return string Encoded data
 */
yaml_emit ($data, $encoding=YAML_ANY_ENCODING, $linebreak=YAML_ANY_BREAK)

CREDITS
========

php-yaml v0.1.0 through v0.3.0 was developed by Ryusuke Sekiyama.

Starting with v0.4.0 the extension has been maintained by Bryan Davis.
Development of versions v0.4.0 - v1.1.0 funded by Keynetics Inc
[http://keynetics.com/].

Inspiration and some implementation details have been taken from:
  * php-syck [http://pecl.php.net/package/syck]
  * MacRuby's libyaml wrapper
      [http://www.macruby.org/trac/browser/MacRuby/trunk/ext/libyaml]
  * LibYAML's examples [http://pyyaml.org/wiki/LibYAML]
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance73

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

234d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb7225bfe174e81de548c48d7ac39da81bcbd46a838fdede536b5b045ec85961?d=identicon)[bd808](/maintainers/bd808)

---

Top Contributors

[![bd808](https://avatars.githubusercontent.com/u/6469?v=4)](https://github.com/bd808 "bd808 (263 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (18 commits)")[![Sean-Der](https://avatars.githubusercontent.com/u/1302304?v=4)](https://github.com/Sean-Der "Sean-Der (15 commits)")[![cmb69](https://avatars.githubusercontent.com/u/2306138?v=4)](https://github.com/cmb69 "cmb69 (9 commits)")[![weltling](https://avatars.githubusercontent.com/u/22016?v=4)](https://github.com/weltling "weltling (9 commits)")[![andypost](https://avatars.githubusercontent.com/u/73713?v=4)](https://github.com/andypost "andypost (4 commits)")[![tomterl](https://avatars.githubusercontent.com/u/494717?v=4)](https://github.com/tomterl "tomterl (4 commits)")[![petk](https://avatars.githubusercontent.com/u/1614009?v=4)](https://github.com/petk "petk (3 commits)")[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (3 commits)")[![jabiinfante](https://avatars.githubusercontent.com/u/2393956?v=4)](https://github.com/jabiinfante "jabiinfante (3 commits)")[![gleb-svitelskiy](https://avatars.githubusercontent.com/u/9821577?v=4)](https://github.com/gleb-svitelskiy "gleb-svitelskiy (2 commits)")[![bocharov](https://avatars.githubusercontent.com/u/2346898?v=4)](https://github.com/bocharov "bocharov (2 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (2 commits)")[![pierrejoye](https://avatars.githubusercontent.com/u/282408?v=4)](https://github.com/pierrejoye "pierrejoye (2 commits)")[![rlerdorf](https://avatars.githubusercontent.com/u/54641?v=4)](https://github.com/rlerdorf "rlerdorf (1 commits)")[![TheStaticTurtle](https://avatars.githubusercontent.com/u/17061996?v=4)](https://github.com/TheStaticTurtle "TheStaticTurtle (1 commits)")[![ranvis](https://avatars.githubusercontent.com/u/139048?v=4)](https://github.com/ranvis "ranvis (1 commits)")[![KalleZ](https://avatars.githubusercontent.com/u/147050?v=4)](https://github.com/KalleZ "KalleZ (1 commits)")[![kbaryshnikov](https://avatars.githubusercontent.com/u/7947177?v=4)](https://github.com/kbaryshnikov "kbaryshnikov (1 commits)")[![neclimdul](https://avatars.githubusercontent.com/u/82823?v=4)](https://github.com/neclimdul "neclimdul (1 commits)")

---

Tags

peclphpyaml

### Embed Badge

![Health badge](/badges/pecl-yaml/health.svg)

```
[![Health](https://phpackages.com/badges/pecl-yaml/health.svg)](https://phpackages.com/packages/pecl-yaml)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
