I want to use a YAML configuration file, for that, I download symfony/yaml package using composer.
I create my test YAML file content:
testing:
test: 2
and to parse it I use this code :
$yaml = Yaml::parse(file_get_contents('test.yml'));
var_dump($yaml->testng);
But, I get this error 'Trying to get property 'testng' of non-object' because the parse return array and I want to get an object.
I tried to add (object) but it works just for the first attribute.
Is there any solution?