note 33098 modified in function.curl-setopt by torben

From: Date: Tue, 17 Jun 2003 03:10:52 +0000
Subject: note 33098 modified in function.curl-setopt by torben
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-50453@lists.php.net to get a copy of this message
[Ed. note: This is because PHP converts the unknown CURLOPT_NON_EXISTENT_OPTION into the string 'CURLOPT_NON_EXISTENT_OPTION', which is then passed to curl_setopt(). That value is then cast (PHP-style) into an integer, which gives it the value 0. This amounts to a noop within curl_setopt(), so the function does nothing, successfully. The return value is actually boolean TRUE in this case.] if (!curl_setopt($ch, CURLOPT_NON_EXISTENT_OPTION, 1)) echo 'invalid option'; 'invalid option' is never printed out. curl_setopt seems to fall silent (does not return anything). --was-- if (!curl_setopt($ch, CURLOPT_NON_EXISTENT_OPTION, 1)) echo 'invalid option'; 'invalid option' is never printed out. curl_setopt seems to fall silent (does not return anything). http://www.php.net/manual/en/function.curl-setopt.php

« previous php.notes (#50453) next »