xref: /PHP-8.2/ext/curl/tests/curl_int_cast.phpt (revision 6600ad60)
1--TEST--
2Casting CurlHandle to int returns object ID
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7
8$handle1 = curl_init();
9var_dump((int) $handle1);
10$handle2 = curl_init();
11var_dump((int) $handle2);
12
13// NB: Unlike resource IDs, object IDs are reused.
14unset($handle2);
15$handle3 = curl_init();
16var_dump((int) $handle3);
17
18// Also works for CurlMultiHandle.
19$handle4 = curl_multi_init();
20var_dump((int) $handle4);
21
22?>
23--EXPECT--
24int(1)
25int(2)
26int(2)
27int(3)
28