# TODO - phpef-runtime-core

This file tracks work that is still relevant for `phpef-runtime-core` itself. Zend/libphp-backed wrappers belong in `phpef-runtime-embed`; native standard-library replacements belong in native runtime packages.

## Before normal SVN / ebuild import

- Confirm the initial ebuild category/name/version and keep it aligned with `meson.build` `version: '0.1'` or deliberately bump both together.
- Verify the ebuild installs only Meson-managed artifacts: shared library, header, VAPI, `.deps`, and pkg-config file.
- Ensure the ebuild depends on `glib`, `gobject`, `vala`, `meson`, `ninja`, and `vala-stacktrace` as appropriate for build/runtime packaging.
- Keep the package free of `libphp`, `pwphpbytecode`, and Zend-header dependencies.

## Still relevant core-runtime work

- Replace bootstrap numeric parsing with PHP-compatible numeric-string handling. Current parsing is intentionally minimal and can throw on non-numeric strings if used outside the current compiler-tested paths.
- Add explicit scalar conversion helpers where compiler output needs them: `to_int`, `to_float`, and any missing PHP-compatible `to_bool` edge cases.
- Expand arithmetic/comparison behavior only together with PHP-vs-PHPEF semantic comparison tests.
- Define array/object/reference ownership rules before relying on the current bootstrap `Zval` container for broad PHP semantics.
- Decide the long-term ABI/versioning policy before promising stable external ABI beyond the pre-devel package.

## Stacktrace / debug metadata

- Keep native crash tests using `phpfunc_phpef_test_segfault()` isolated and explicit.
- Continue hardening binary `.phpef_stacktrace` lookup against optimized/stripped binaries and shared-library/module-offset edge cases.
- If `.debug_phpef` line rewrite metadata becomes a separate section/file format, document and implement that in the compiler/runtime boundary; runtime-core currently reads `.phpef_stacktrace` for compact frame-name maps.

## Later

- Full PHP array semantics: ordered maps, key casting edge cases, copy-on-write/separate, references, iteration, and by-reference updates.
- Full object semantics beyond registered class/method dispatch.
- Resource support if/when a Zend-independent resource abstraction is needed.
- Static/native value-shape helper APIs for compiler diagnostics and optimizer decisions.
- Zend bridge boundary types used by `phpef-runtime-embed`, without making core depend on Zend headers.
