Bug #78332 [Fbk->Opn]: Int in JSON message formatted as string

From: Date: Wed, 24 Jul 2019 14:14:54 +0000
Subject: Bug #78332 [Fbk->Opn]: Int in JSON message formatted as string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221930@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78332&edit=1 ID: 78332 User updated by: fi at facelift-bbt dot com Reported by: fi at facelift-bbt dot com Summary: Int in JSON message formatted as string -Status: Feedback +Status: Open Type: Bug Package: *General Issues PHP Version: 7.2.20 Block user comment: N Private report: N New Comment: Test script: --------------- <?php $message = '{"id":1639}'; $producer = new RdKafka\Producer(); $topic = $producer->newTopic('myTopic'); $topic->produce(RD_KAFKA_PARTITION_UA, 0, $message); ?> Previous Comments: ------------------------------------------------------------------------ [2019-07-24 13:54:32] requinix@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2019-07-24 13:40:40] fi at facelift-bbt dot com Description: ------------ When producing an encoded JSON object that contains an integer field, the consumer always receives the field as string. Producer: {"id":1639} Consumer: {"id":"1639"} Test script: --------------- $message = '{"id":1639}'; $producer = new RdKafka\Producer(); $topic = $producer->newTopic('myTopic'); $topic->produce(RD_KAFKA_PARTITION_UA, 0, $message); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78332&edit=1

« previous php.bugs (#221930) next »