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