this is a tricky one, not sure i’d recommend that flag.

the ideal solution is to cast the r-value when your schema defines the value as an int, allowing json_encode to guess type information could cause problems on the consumer side with type strict languages.

imagine a name field with the value of 1000, this would be converted to an int when the consumer is expecting a string.

echo json_encode( array( ‘event_id’ => (int)$event_id ) );

cheers

paul