php-windows Digest 3 Apr 2009 23:36:05 -0000 Issue 3596
Topics (messages 29241 through 29241):
curl options constants have duplicated INTEGER values
29241 by: Todd Keup
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
I'm running PHP 5.2.9-1 for Windows and am seeing something that strikes me
rather odd in the curl setopt constants, collisions of sorts I guess you
might call them. The sample script below says it all ...
$curl = get_defined_constants(true);
$curl = $curl['curl'];
foreach($curl as $k => $v) {
if (strpos($k, 'CURLOPT_', 0) === false) {
unset($curl[$k]);
}
}
print count($curl) . "\n";
print_r($curl);
/**
2 dupes, 10009 and 10026
[CURLOPT_READDATA] => 10009
[CURLOPT_INFILE] => 10009
[CURLOPT_SSLKEYPASSWD] => 10026
[CURLOPT_SSLCERTPASSWD] => 10026
*/
I'm retrieving just the CURLOPT_* constants and was not expecting to see
duplicate integer values here. CURLOPT_READDATA is not documented in the
online manual. I can read into that value somewhat and assume that either
constant (CURLOPT_READDATA or CURLOPT_INFILE) might suggest that the value
supplied should be "The file that the transfer should be read from when
uploading"
However, the SSL constants don't make sense. I don't see how they could be
"interchangeable" like the first set.
Anybody have any further insight?
--- End Message ---