public function isValid( &$exception = null )
    {
        $exception = null;
        // have we validated this before?
        if( $this->isValid === null ) {
            $this->decoded = @json_decode( $this->json, true );
            // have error?
            if( null === $this->decoded and JSON_ERROR_NONE !== $lastError = json_last_error() ) {
                // yep
                $this->isValid = new BadJsonException( $this->json, $lastError );
                $exception = $this->isValid;
            } else {
                // nope
                $this->isValid = true;
            }
        // is the isValid propety a exception
        } elseif ( $this->isValid !== true ) {
            $exception = $this->isValid;
        }

        return $this->isValid === true;
    }
public function isValid( &$exception = null )
    {
        $exception = null;
        // have we validated this before?
        if( $this->isValid === null ) {
            $this->decoded = @json_decode( $this->json, true );
            // have error?
            if( null === $this->decoded and JSON_ERROR_NONE !== $lastError = json_last_error() ) {
                // yep
                $this->isValid = new BadJsonException( $this->json, $lastError );
                $exception = $this->isValid;
            } else {
                // nope
                $this->isValid = true;
            }
        // is the isValid propety a exception
        } elseif ( $this->isValid !== true ) {
            $exception = $this->isValid;
        }

        return $this->isValid === true;
    }
public function isValid ( & $ exception = null ) { $ exception = null ; // have we validated this before? if ( $ this -> isValid === null ) { $ this -> decoded = @ json_decode ( $ this -> json , true ) ; // have error? if ( null === $ this -> decoded and JSON_ERROR_NONE !== $ lastError = json_last_error ( ) ) { // yep $ this -> isValid = new BadJsonException ( $ this -> json , $ lastError ) ; $ exception = $ this -> isValid ; } else { // nope $ this -> isValid = true ; } // is the isValid propety a exception } elseif ( $ this -> isValid !== true ) { $ exception = $ this -> isValid ; } return $ this -> isValid === true ; }
Does or json object contain valid json
@return bool
Does or json object contain valid json