xref: /PHP-8.3/ext/curl/tests/bug79741.phpt (revision 6600ad60)
1--TEST--
2Bug #79741: curl_setopt CURLOPT_POSTFIELDS asserts on object with declared properties
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7
8class Test {
9    public $prop = "value";
10}
11
12$ch = curl_init();
13curl_setopt($ch, CURLOPT_POSTFIELDS, new Test);
14
15?>
16===DONE===
17--EXPECTF--
18Fatal error: Uncaught Error: Object of class Test could not be converted to string in %s:%d
19Stack trace:
20#0 %s(%d): curl_setopt(Object(CurlHandle), %d, Object(Test))
21#1 {main}
22  thrown in %s on line %d
23