Supported Versions: PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL json >= 1.2.0
Decodes a JSON string
<?php json_decode(    string $json,    ?bool $associative = null,    int $depth = 512,    int $flags = 0): mixed
<?php     public function __invoke(ShareReportRequest $request, ShareReportAction $shareReportAction)

    {

        try {

            return $shareReportAction->handle(json_decode($request->get('report'), true), $request->get('tabs'), $request->get('lineSelection'));

        } catch (UnableToShareErrorException $exception) {

            abort(500, 'Unable to share the error '.$exception->getMessage());

        }
<?php     protected function getNamespaces(): Collection

    {

        $details = json_decode(file_get_contents("https://packagist.org/packages/{$this->name}.json"), true);



        return collect($details['package']['versions'])

            ->map(function ($version) {
<?php         $url = 'https://packagist.org/search.json?q='.implode(' ', $queryParts);



        try {

            $packages = json_decode(file_get_contents($url));

        } catch (\Exception $e) {

            return [];

        }
<?php             ->getJson('will-fail');



        $this->assertStringStartsWith('application/json', $response->headers->get('Content-Type'));

        $this->assertEquals('My exception', json_decode($response->getContent(), true)['message']);

    }

}