Expand description
A reader for PHP array literals, enough for application config files such as
Nextcloud’s config/config.php (Phase 38.1, ADR-0148).
Nothing here executes anything. The file is data written in PHP syntax:
$CONFIG = array ( 'key' => 'value', ... );, with the short [ ... ] form
accepted too. What is understood is strings (single and double quoted),
integers, floats, true/false/null, nested arrays, and the three comment
styles. Anything else - a function call, a constant, a concatenation, a
variable - cannot be known without running PHP, so its value becomes null
and a warning naming the key and line is recorded instead of guessing.
Every length the file can control is bounded: nesting depth and total node count, so a hostile file cannot make this recurse or allocate without limit.
Structs§
- Parsed
- The parsed array and anything that could not be read.