Catch errors in example (bug #49378)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290719 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2009-11-13 22:41:57 +00:00
parent cadd9e4ccd
commit 0d5dafc709

View file

@ -80,7 +80,7 @@ $context = stream_context_create(array('http' => array(
)));
$file = file_get_contents("http://www.example.com/xmlrpc", false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
if ($response && xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);