php_stream_from_zval will verify the resource and return from the
function if it is not a resource.

If you just want to check and not have it return, use the
php_stream_from_zval_no_verify() macro instead (same parameters).

--Wez.

On Wed, 4 Jun 2003, Hartmut Holzgraefe wrote:

> +     switch (Z_TYPE_P(what)) {
> +     case IS_STRING:
> +             break;
> +     case IS_RESOURCE:
> +             {
> +                     php_stream *stream;
> +
> +                     php_stream_from_zval(stream, &what);
> +                     if (stream) {
> +                             break;
> +                     }
> +             }
> +             /* fallthru if not a stream resource */
> +     default:
> +             php_error_docref(NULL TSRMLS_CC, E_WARNING, "can only process string 
> or stream arguments");
> +             break;
> +     }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to