From:             andreyp at dukascopy dot com
Operating system: linux
PHP version:      5.3.21
Package:          FPM related
Bug Type:         Bug
Bug description:Post/json_decode 

Description:
------------
Simple script give different result under php-fastcgi and php-fpm with
apache2.



Test script:
---------------
<?php
$data = $_POST["data"];
var_dump($data);
$data = json_decode($data);
var_dump($data);
?>

result with php-fastcgi
 curl -k https://localhost/json-test.php -X POST -d
data=[{\"datumType\":\"message\"}]
string(25) "[{"datumType":"message"}]"
array(1) {
  [0]=>
  object(stdClass)#1 (1) {
    ["datumType"]=>
    string(7) "message"
  }
}

result with php-fpm
curl -k https://localhost/json-test.php -X POST -d
data=[{\"datumType\":\"message\"}]
string(29) "[{\"datumType\":\"message\"}]"
NULL


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64042&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64042&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64042&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64042&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64042&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64042&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64042&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64042&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64042&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64042&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64042&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64042&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64042&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64042&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64042&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64042&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64042&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64042&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64042&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64042&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64042&r=mysqlcfg

Reply via email to