get_headers_error_002.phpt [plain text]
--TEST--
Test get_headers() function: wrong type for argument format
--CREDITS--
June Henriksen <juneih@redpill-linpro.com>
#PHPTestFest2009 Norway 2009-06-09 \o/
--FILE--
<?php
echo "*** Testing get_headers() : error conditions ***\n";
$url = 'http://php.net';
echo "\n-- Testing get_headers() function with format argument as type string --\n";
var_dump( get_headers($url, "#PHPTestFest2009 Norway") );
echo "\n-- Testing get_headers() function with format argument as type array --\n";
var_dump( get_headers($url, array()) );
class testObject
{
}
$object = new testObject();
echo "\n-- Testing get_headers() function with format argument as type object --\n";
var_dump( get_headers($url, $object) );
echo "Done"
?>
--EXPECTF--
*** Testing get_headers() : error conditions ***
-- Testing get_headers() function with format argument as type string --
Warning: get_headers() expects parameter 2 to be long, string given in %s on line 13
NULL
-- Testing get_headers() function with format argument as type array --
Warning: get_headers() expects parameter 2 to be long, array given in %s on line 17
NULL
-- Testing get_headers() function with format argument as type object --
Warning: get_headers() expects parameter 2 to be long, object given in %s on line 26
NULL
Done