Skip to content

feat: scalar casts (string) / (array) / (bool) via ObjectCastInterface #9

Description

@lisachenko

Implement ObjectCastInterface::__cast() dispatching on CastObjectHook::getCastType() (ReflectionValue::IS_* constants):

  • (array) $matrixtoArray()
  • (string) $matrix → pretty-printed rows
  • (bool) $matrixtrue (a valid matrix is never empty by construction)

Unsupported cast types should fall through to $hook->proceed() so default engine behavior is preserved. The handler runs across the FFI boundary, so it must not throw (PHP 8.4 turns throws from FFI callbacks into fatal errors) — keep it allocation-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions