Output of the "Validating array keys type and presence with Symfony" Symfony snippet

Environment:

  • Strangebuzz Snippet VM: 2.8.0
  • Symfony: 5.3.9

Code execution output:

✅ All needed keys of the array:
array (
  'bar' => 'string',
  'babar' => true,
  'john' => 555,
  'fab' => 
  array (
    0 => '4545',
  ),
)
are present and of the good type.

❌ needed keys of the array
\array (
  'bar' => false,
  'babar' => 'true',
  'john' => 0.1,
  'fab' => 
  (object) array(
  ),
  'extra' => NULL,
)
are NOT correct:
[bar]: This value should be of type string.
[babar]: This value should be of type bool.
[john]: This value should be of type int.
[fab]: This value should be of type array.
[extra]: This field was not expected.