|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65982 json_decode null result error
Submitted: 2013-10-28 12:51 UTC Modified: 2014-05-08 16:24 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: info at djdb dot be Assigned:
Status: No Feedback Package: json (PECL)
PHP Version: 5.4.21 OS: win
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-10-28 12:51 UTC] info at djdb dot be
From manual page:
when use json_decode in object (class) the function wil not works an gives a NULL

Test script:
    $string = '{"foo": "bar", "cool": "attr"}';
    $result = json_decode($string, true);
    // Result: array(2) { ["foo"]=> string(3) "bar" ["cool"]=> string(4) "attr" }

 class AddressWebservice_of_json extends AddressWebservice_of{
            public function __construct($debug=false,$IncERRORresolve){
             * AddressWebservice_of::getresult()
             * @param mixed $aso 
             * @return void
            public function getjsonresult(&$string){
                $array = json_decode($string,true);
                //$res =  parent::getresult("egon","","","","","","","");
                return json_encode($res);
             * AddressWebservice_of::setRemotservices()

             * @return void
            public function setRemotservices($asoArray){
                $this->list = $asoArray;

Expected result:
null @var_dump($array);

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-29 08:08 UTC]
-Status: Open +Status: Feedback
 [2013-10-29 08:08 UTC]
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.

That class is clearly part of a larger system. We need something smaller that we can execute that shows the problem, not to mention the actual values being passed around.
 [2014-05-08 16:24 UTC]
-Status: Feedback +Status: No Feedback
 [2014-05-08 16:24 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.

Also, from your code

                //$res =  parent::getresult("egon","","","","","","","");
                return json_encode($res);

$res is undefined
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Oct 01 02:05:54 2022 UTC