1--TEST--
2Test CURLMOPT_PUSHFUNCTION with non-existent callback function
3--CREDITS--
4Davey Shafik
5Kévin Dunglas
6Niels Dossche
7--EXTENSIONS--
8curl
9--SKIPIF--
10<?php
11include 'skipif-nocaddy.inc';
12
13$curl_version = curl_version();
14if ($curl_version['version_number'] < 0x080100) {
15    exit("skip: test may crash with curl < 8.1.0");
16}
17?>
18--FILE--
19<?php
20// Test adapted from curl_pushfunction.phpt
21
22$mh = curl_multi_init();
23
24curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
25curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, "nonexistent");
26
27$ch = curl_init();
28curl_setopt($ch, CURLOPT_URL, "https://localhost/serverpush");
29curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
30curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
31
32curl_multi_add_handle($mh, $ch);
33
34$active = null;
35while(true) {
36    $status = curl_multi_exec($mh, $active);
37
38    do {
39        $info = curl_multi_info_read($mh);
40        if (false !== $info && $info['msg'] == CURLMSG_DONE) {
41            $handle = $info['handle'];
42            if ($handle !== null) {
43                curl_multi_remove_handle($mh, $handle);
44                curl_close($handle);
45                break 2;
46            }
47        }
48    } while ($info);
49}
50
51curl_multi_close($mh);
52?>
53--EXPECTF--
54Warning: curl_multi_exec(): Cannot call the CURLMOPT_PUSHFUNCTION in %s on line %d
55