Expand description
PHP value semantics (type juggling) on top of serde_json::Value.
Request parameters reach PHP code as PHP values. These functions answer
the questions libraries ask about them (is_numeric, truthiness, string
casts, ==) the way the engine does.
Enums§
- Number
- A PHP number after
$value + 0.
Functions§
- array_
len - Number of elements of a PHP array value.
- array_
values - Iterates the elements of a PHP array value (list or map) in order.
- compare_
numbers - PHP 8
<=>for two numbers. - empty
- PHP
empty($value). - is_
object - An empty JSON object: a
stdClassinstance in PHP. - json_
number - A JSON number as PHP sees it: integers beyond
i64are floats. - le_
numbers - PHP 8
$a <= $bfor two numbers (zend_is_smaller_or_equal): integers compare exactly; otherwise both are floats,ZEND_THREEWAY_COMPAREis not below zero forNAN, so any comparison withNANis false. - loose_
eq - PHP 8 loose equality (
$a == $b). - loose_
str_ eq - PHP
$a == $bfor two strings (zendi_smart_str_equals): two numeric strings compare as numbers, anything else byte for byte. Numeric strings are ASCII, so a string that is not UTF-8 only equals itself. - numeric
- PHP
is_numeric($v) ? $v + 0 : null. - numeric_
bytes_ ex numeric_str_exon bytes (a numeric string is ASCII, so bytes that are not UTF-8 are never numeric).- numeric_
str - PHP numeric-string parsing (
is_numeric++ 0). - numeric_
str_ ex - Like
numeric_str, also reporting integer overflow as the engine’sis_numeric_string_exdoes:1or-1when an integer-looking string did not fit ini64and became a float. - to_
string - PHP
(string) $valuefor scalars;Nonefor arrays and objects. - truthy
- PHP truthiness (
(bool) $value).