reactjs / react-php-v8js

PHP library that renders React components on the server
Other
1.33k stars 127 forks source link

Add JSON_NUMERIC_CHECK to convert strings to numerics #32

Open anwell opened 7 years ago

anwell commented 7 years ago

Many PHP database driver implementations return all query results as strings and do not do any type conversion. This is usually insignificant because PHP will perform implicit type conversions when necessary.

But for React/JSON we need these types to be explicit. The JSON_NUMERIC_CHECK flag for json_encode will detect strings that are like numbers and convert them.