summaryrefslogtreecommitdiff
path: root/ext/curl/tests/curl_handle_clone.phpt
blob: aa1251cbe01a95b99ffbfd97067e385d313f5253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Test that cloning of Curl objects is supported
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php

include 'server.inc';
$host = curl_cli_server_start();

$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, $host);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch1);

$ch2 = clone $ch1;
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 0);

var_dump(curl_getinfo($ch1, CURLINFO_EFFECTIVE_URL) === curl_getinfo($ch2, CURLINFO_EFFECTIVE_URL));
curl_exec($ch2);

?>
--EXPECT--
bool(true)
Hello World!
Hello World!