|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-10-28 12:51 UTC] info at djdb dot be
Description: ------------ --- From manual page: http://www.php.net/function.json-decode --- 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" } var_dump($result); class AddressWebservice_of_json extends AddressWebservice_of{ public function __construct($debug=false,$IncERRORresolve){ parent::__construct($debug=false,$IncERRORresolve); } /** * AddressWebservice_of::getresult() * @param mixed $aso * @return void */ public function getjsonresult(&$string){ $array = json_decode($string,true); var_dump($array); //$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: -------------- array() PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 04:00:01 2025 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