xref: /PHP-8.1/ext/curl/tests/bug80121.phpt (revision 6600ad60)
1--TEST--
2Bug #80121: Null pointer deref if CurlHandle directly instantiated
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7
8try {
9    new CurlHandle;
10} catch (Error $e) {
11    echo $e->getMessage(), "\n";
12}
13try {
14    new CurlMultiHandle;
15} catch (Error $e) {
16    echo $e->getMessage(), "\n";
17}
18try {
19    new CurlShareHandle;
20} catch (Error $e) {
21    echo $e->getMessage(), "\n";
22}
23
24?>
25--EXPECT--
26Cannot directly construct CurlHandle, use curl_init() instead
27Cannot directly construct CurlMultiHandle, use curl_multi_init() instead
28Cannot directly construct CurlShareHandle, use curl_share_init() instead
29