PHP code example of unicon / yaml

1. Go to this page and download the library: Download unicon/yaml library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

unicon / yaml example snippets


$reader = new Yaml(MyClass::class);
$object = $reader->read('my_yaml.yml');

class Simple
{
    public int $integerParameter = 1;
    /** @var positive-int */
    public int $positiveIntegerParameter;
    public ?bool $booleanOrNullParameter;
    public string $stringParameter = 'default';
}
boolean_or_null_parameter