Hi Adam,

On 14 June 2013 10:29, Adam Kazimierczak <kazym...@gmail.com> wrote:
>
> Try running this code:
> var_dump(curl_escape(0, 'test'), curl_unescape(0, 'test'));
>
> Both results are NULL and throws E_WARNINGs:
> Warning: curl_escape() expects parameter 1 to be resource, integer given
>

This falls under the "garbage in, garbage out" rule that we historically
don't document. When given incorrect arguments, most PHP functions will
return NULL and raise a warning. See the note about this on
http://php.net/functions.internal

NULL as return on failure is also documented in libcurl docs:
> http://curl.haxx.se/libcurl/c/**curl_escape.html<http://curl.haxx.se/libcurl/c/curl_escape.html>
>

If you check php-src, you'll see the functions return FALSE when cURL's
curl_easy_(un)escape() returns null.

As I said, they're minor issues and you look to be getting the hang of how
things work. I would support giving you commit karma, to be able to push
these changes to the docs yourself.

Cheers,
Peter

Reply via email to