public function toJson($options = 0, $depth = 512)
    {
        $params = [
            $this->elements,
            $options,
        ];

        if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
            $params[] = $depth;
        }

        // use call_user_func_array() here to fully cover this method in test
        return call_user_func_array('json_encode', $params);
    }
public function toJson($options = 0, $depth = 512)
    {
        $params = [
            $this->elements,
            $options,
        ];

        if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
            $params[] = $depth;
        }

        // use call_user_func_array() here to fully cover this method in test
        return call_user_func_array('json_encode', $params);
    }
public function toJson ( $ options = 0 , $ depth = 512 ) { $ params = [ $ this -> elements , $ options , ] ; if ( version_compare ( PHP_VERSION , '5.5.0' , '>=' ) ) { $ params [ ] = $ depth ; } // use call_user_func_array() here to fully cover this method in test return call_user_func_array ( 'json_encode' , $ params ) ; }
Encode the current array to a JSON string.

@param int $options The bitmask
@param int $depth The maximum depth (must be greater than zero)

@return string A JSON string representation of the current array

@link http://php.net/manual/en/function.json-encode.php
Encode the current array to a JSON string .