public function toJson(int $options = 0, int $depth = 512): string
    {
        /** @noinspection PhpComposerExtensionStubsInspection */
        $return = \json_encode($this->getArray(), $options, $depth);
        if ($return === false) {
            return '';
        }

        return $return;
    }
public function toJson(int $options = 0, int $depth = 512): string
    {
        /** @noinspection PhpComposerExtensionStubsInspection */
        $return = \json_encode($this->getArray(), $options, $depth);
        if ($return === false) {
            return '';
        }

        return $return;
    }
public function toJson ( int $ options = 0 , int $ depth = 512 ) : string { /** @noinspection PhpComposerExtensionStubsInspection */ $ return = \ json_encode ( $ this -> getArray ( ) , $ options , $ depth ) ; if ( $ return === false ) { return '' ; } return $ return ; }
Convert the current array to JSON.

@param int $options [optional] <p>e.g. JSON_PRETTY_PRINT</p>
@param int $depth   [optional] <p>Set the maximum depth. Must be greater than zero.</p>

@return string
Convert the current array to JSON .