1--TEST-- 2Use SEARCH as a HTTP verb 3--SKIPIF-- 4<?php 5include "skipif.inc"; 6?> 7--FILE-- 8<?php 9include "php_cli_server.inc"; 10php_cli_server_start('var_dump($_SERVER["REQUEST_METHOD"]);'); 11 12list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); 13$port = intval($port) ?: 80; 14 15$fp = fsockopen($host, $port, $errno, $errstr, 0.5); 16if (!$fp) { 17 die("connect failed"); 18} 19 20if(fwrite($fp, <<<HEADER 21SEARCH / HTTP/1.1 22Host: {$host} 23 24 25HEADER 26)) { 27 while (!feof($fp)) { 28 echo fgets($fp); 29 } 30} 31 32?> 33--EXPECTF-- 34HTTP/1.1 200 OK 35Host: %s 36Date: %s 37Connection: close 38X-Powered-By: PHP/%s 39Content-type: text/html; charset=UTF-8 40 41string(6) "SEARCH" 42