|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-07-29 06:36 UTC] redfoxli069 at gmail dot com
Description:
------------
CURLOPT_POSTFIELDS modify the type of param
e.g:the type of $post_data['a'] from int to string it the "TEST script"
Test script:
---------------
$ch = curl_init();
$post_data = array('a' => 1, 'b' => '2');
if($post_data['a'] === 1)
echo "yes\n";
else
echo "no\n";
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
if($post_data['a'] === 1)
echo "yes\n";
else
echo "no\n";
Expected result:
----------------
yes
yes
Actual result:
--------------
yes
no
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 18:00:01 2025 UTC |
CURLOPT_HTTPHEADER or CURLOPT_QUOTE or CURLOPT_HTTP200ALIASES or CURLOPT_POSTQUOTE or CURLOPT_PREQUOTE or CURLOPT_TELNETOPTIONS or CURLOPT_MAIL_RCPT or CURLOPT_RESOLVE has the sample problem, also modify the type of param Test script: --------------- $ch = curl_init(); $header = array('a' => 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); var_dump($header['a']); curl_close($ch); Expected result: ---------------- int(1) Actual result: -------------- string(1) "1"