ArrayKey
Read onlyYes
FinalYes
Methods
- coerce() : int|string
- PHP's canonical array-key coercion: a string whose integer round trip is byte-exact becomes an int ('0' -> 0), everything else stays as-is ('01', '1.5', '-0' stay strings) - the same rule the Rust extension applies in array_key_index().
Methods
coerce()
PHP's canonical array-key coercion: a string whose integer round trip is byte-exact becomes an int ('0' -> 0), everything else stays as-is ('01', '1.5', '-0' stay strings) - the same rule the Rust extension applies in array_key_index().
public
static coerce(int|string $key) : int|string
Parameters
- $key : int|string