|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-12-27 06:56 UTC] laruence@php.net
[2015-12-27 06:56 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2015-12-27 07:00 UTC] bugs dot php dot net at ss dot st dot tc
[2016-07-20 11:34 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ PHP 5 acts as expected, PHP 7 fails. Test script: --------------- <?php $post_data_1 = [ 'file' => new CURLFile('file.txt') ]; $curl_1 = curl_init(); curl_setopt($curl_1, CURLOPT_POSTFIELDS, $post_data_1); echo "OK\n"; // exactly the same as above + added a reference to 'file' element $post_data_2 = [ 'file' => new CURLFile('file.txt') ]; $ref = & $post_data_2['file']; // *** $curl_2 = curl_init(); curl_setopt($curl_2, CURLOPT_POSTFIELDS, $post_data_2); echo "OK\n"; Expected result: ---------------- PHP 5: OK OK PHP 7: OK OK Actual result: -------------- PHP 5: OK OK PHP 7: OK Catchable fatal error: Object of class CURLFile could not be converted to string in wtf.php on line 12