<?php namespace work; class Test1 {} $a = (object)[]; $b = new \stdClass(); $data = [$a, $b, new Test1()]; $result = json_encode($data); var_dump($result); echo str_repeat('-', 100) . PHP_EOL; $result1 = json_decode($result); $result2 = json_decode($result, true); $result1_1 = json_encode($result1); $result2_1 = json_encode($result2); var_dump($result1_1, $result2_1);
You have javascript disabled. You will not be able to edit any code.