public static function jsonEncode( $obj )
    {
        if ( self::$nativeJsonEncode === null )
            self::$nativeJsonEncode = function_exists( 'json_encode' );

        if ( self::$nativeJsonEncode === true )
            return json_encode( $obj );

        $inst = self::getInstance();
        return $inst->phpJsonEncode( $obj );    
    }
public static function jsonEncode( $obj )
    {
        if ( self::$nativeJsonEncode === null )
            self::$nativeJsonEncode = function_exists( 'json_encode' );

        if ( self::$nativeJsonEncode === true )
            return json_encode( $obj );

        $inst = self::getInstance();
        return $inst->phpJsonEncode( $obj );    
    }
public static function jsonEncode ( $ obj ) { if ( self :: $ nativeJsonEncode === null ) self :: $ nativeJsonEncode = function_exists ( 'json_encode' ) ; if ( self :: $ nativeJsonEncode === true ) return json_encode ( $ obj ) ; $ inst = self :: getInstance ( ) ; return $ inst -> phpJsonEncode ( $ obj ) ; }
Wrapper function for encoding to json with native or php version
depending on what the system supports

@param mixed $obj
@return string
Wrapper function for encoding to json with native or php version depending on what the system supports