Output of the "Converting a PHP stdClass object into an array" PHP snippet

Environment:

  • Strangebuzz Snippet VM: 6.4.9
  • PHP: 8.4

Code execution output:

----- Nominal case OK ✅
> original object:
object(stdClass)#1971 (2) {
  ["foo"]=>
  string(3) "bar"
  ["object_property"]=>
  object(stdClass)#1969 (1) {
    ["foo2"]=>
    string(4) "bar2"
  }
}
> as array:
array(2) {
  ["foo"]=>
  string(3) "bar"
  ["object_property"]=>
  array(1) {
    ["foo2"]=>
    string(4) "bar2"
  }
}

----- cast case, does not work ❌
array(2) {
  ["foo"]=>
  string(3) "bar"
  ["object_property"]=>
  object(stdClass)#1969 (1) {
    ["foo2"]=>
    string(4) "bar2"
  }
}