1--TEST-- 2Test trampoline for curl option CURLOPT_FNMATCH_FUNCTION 3--EXTENSIONS-- 4curl 5--SKIPIF-- 6<?php 7exit("skip: cannot properly test CURLOPT_FNMATCH_FUNCTION"); 8?> 9--FILE-- 10<?php 11include 'server.inc'; 12$host = curl_cli_server_start(); 13 14class TrampolineTest { 15 public function __call(string $name, array $arguments) { 16 echo 'Trampoline for ', $name, PHP_EOL; 17 return CURL_FNMATCHFUNC_NOMATCH; 18 } 19} 20$o = new TrampolineTest(); 21$callback = [$o, 'trampoline']; 22 23$url = "ftp://{$host}/file*"; 24//$url = "ftp://ftp.example.com/file*"; 25$ch = curl_init($url); 26curl_setopt($ch, CURLOPT_WILDCARDMATCH, 1); 27curl_setopt($ch, CURLOPT_FNMATCH_FUNCTION, $callback); 28echo curl_exec($ch), PHP_EOL; 29 30?> 31--EXPECT-- 32Trampoline for trampoline 33Hello World! 34Hello World! 35