12 ini_set('http.only_exceptions', true);
15 HTTP_E_RUNTIME => 'Runtime',
16 HTTP_E_INVALID_PARAM => 'InvalidParam',
17 HTTP_E_HEADER => 'Header',
18 HTTP_E_MALFORMED_HEADERS => 'MalformedHeaders',
19 HTTP_E_REQUEST_METHOD => 'RequestMethod',
20 HTTP_E_MESSAGE_TYPE => 'MessageType',
21 HTTP_E_ENCODING => 'Encoding',
22 HTTP_E_REQUEST => 'Request',
23 HTTP_E_REQUEST_POOL => 'RequestPool',
24 HTTP_E_SOCKET => 'Socket',
25 HTTP_E_RESPONSE => 'Response',
29 foreach ($e as $i => $c) {
31 $n = "Http{$c}Exception";
33 } catch (HttpException $x) {
34 printf("%2d: %s\n", $i, get_class($x));
38 $tmp = http_get(null);
39 } catch (HttpRequestException $x) {
40 printf("%s (%d)\n", $x->getMessage(), $x->getCode());
46 1: HttpRuntimeException
47 2: HttpInvalidParamException
48 3: HttpHeaderException
49 4: HttpMalformedHeadersException
50 5: HttpRequestMethodException
51 6: HttpMessageTypeException
52 7: HttpEncodingException
53 8: HttpRequestException
54 9: HttpRequestPoolException
55 10: HttpSocketException
56 11: HttpResponseException
58 Could not perform request: URL using bad/illegal format or missing URL (8)