Skip to main content

to_array_key

Function to_array_key 

Source
pub fn to_array_key(value: &PhpValue) -> Option<PhpKey>
Expand description

$array[ $value ]’s key: null is "", a bool 0 or 1, a float truncated toward zero (a finite float outside the int range wraps modulo 2^64, as PHP 8.5’s zend_dval_to_lval() does: 1e20 is 7766279631452241920, 2^63 is i64::MIN; NaN and infinities are 0), an integer-like string an int; None for an array or object, where PHP throws “Illegal offset type”.