cvs: php-src(PHP_5_2) /ext/standard/tests/reg ereg_basic_001.phpt ereg_basic_002.phpt ereg_basic_003.phpt ereg_basic_004.phpt ereg_error_001.phpt
ereg_error_002.phpt ereg_replace_basic_001.phpt ereg_replace_basic_002.phpt ereg_replace_error_001.phpt ereg_replace_error_002.phpt
ereg_replace_variation_001.phpt ereg_replace_variation_002.phpt ereg_replace_variation_003.phpt ereg_variation_001.phpt ereg_variation_002.phpt
ereg_variation_003.phpt ereg_variation_004.phpt eregi_basic.phpt eregi_basic_001.phpt eregi_basic_002.phpt eregi_basic_003.phpt eregi_basic_004.phpt
eregi_error_001.phpt eregi_error_002.phpt eregi_replace_basic.phpt eregi_replace_basic_001.phpt eregi_replace_basic_002.phpt
eregi_replace_error_001.phpt eregi_replace_error_002.phpt eregi_replace_variation_001.phpt eregi_replace_variation_002.phpt
eregi_replace_variation_003.phpt eregi_variation_001.phpt eregi_variation_002.phpt eregi_variation_003.phpt eregi_variation_004.phpt
regular_expressions.inc spl! it_basic_001.phpt split_basic_002.phpt split_basic_003.phpt split_error_001.phpt split_error_002.phpt
split_variation_001.phpt split_variation_002.phpt split_variation_003.phpt split_variation_004.phpt spliti_basic_001.phpt spliti_basic_002.phpt
spliti_basic_003.phpt spliti_basic_004.phpt spliti_error_001.phpt spliti_error_002.phpt spliti_variation_001.phpt spliti_variation_002.phpt
spliti_variation_003.phpt spliti_variation_004.phpt sql_regcase_basic_001.phpt sql_regcase_error_001.phpt sql_regcase_variation_001.phpt
/ext/standard/tests/url base64_decode_basic_001.phpt base64_decode_basic_002.phpt base64_decode_error_001.phpt base64_decode_variation_001.phpt
base64_decode_variation_002.phpt base64_encode_basic_001.phpt base64_encode_error_001.phpt base64_encode_variation_001.phpt parse_url_basic_001.phpt
parse_url_basic_002.phpt parse_url_basic_003.phpt parse_url_basic_004.phpt parse_url_basic_005.phpt parse_url_basic_006.phpt parse_url_basic_007.phpt
parse_url_basic_008.p! hpt parse_url_basic_009.phpt parse_url_basic_010.phpt parse_url_error_001.phpt parse_url_error_002.phpt
parse_url_variation_001.phpt parse_url_variation_002.phpt rawurldecode_error_001.phpt rawurldecode_variation_001.phpt rawurlencode_error_001.phpt
rawurlencode_variation_001.phpt urldecode_error_001.phpt urldecode_variation

From: Date: Fri, 11 Apr 2008 08:57:12 +0000
Subject: cvs: php-src(PHP_5_2) /ext/standard/tests/reg ereg_basic_001.phpt ereg_basic_002.phpt ereg_basic_003.phpt ereg_basic_004.phpt ereg_error_001.phpt
ereg_error_002.phpt ereg_replace_basic_001.phpt ereg_replace_basic_002.phpt ereg_replace_error_001.phpt ereg_replace_error_002.phpt
ereg_replace_variation_001.phpt ereg_replace_variation_002.phpt ereg_replace_variation_003.phpt ereg_variation_001.phpt ereg_variation_002.phpt
ereg_variation_003.phpt ereg_variation_004.phpt eregi_basic.phpt eregi_basic_001.phpt eregi_basic_002.phpt eregi_basic_003.phpt eregi_basic_004.phpt
eregi_error_001.phpt eregi_error_002.phpt eregi_replace_basic.phpt eregi_replace_basic_001.phpt eregi_replace_basic_002.phpt
eregi_replace_error_001.phpt eregi_replace_error_002.phpt eregi_replace_variation_001.phpt eregi_replace_variation_002.phpt
eregi_replace_variation_003.phpt eregi_variation_001.phpt eregi_variation_002.phpt eregi_variation_003.phpt eregi_variation_004.phpt
regular_expressions.inc spl! it_basic_001.phpt split_basic_002.phpt split_basic_003.phpt split_error_001.phpt split_error_002.phpt
split_variation_001.phpt split_variation_002.phpt split_variation_003.phpt split_variation_004.phpt spliti_basic_001.phpt spliti_basic_002.phpt
spliti_basic_003.phpt spliti_basic_004.phpt spliti_error_001.phpt spliti_error_002.phpt spliti_variation_001.phpt spliti_variation_002.phpt
spliti_variation_003.phpt spliti_variation_004.phpt sql_regcase_basic_001.phpt sql_regcase_error_001.phpt sql_regcase_variation_001.phpt
/ext/standard/tests/url base64_decode_basic_001.phpt base64_decode_basic_002.phpt base64_decode_error_001.phpt base64_decode_variation_001.phpt
base64_decode_variation_002.phpt base64_encode_basic_001.phpt base64_encode_error_001.phpt base64_encode_variation_001.phpt parse_url_basic_001.phpt
parse_url_basic_002.phpt parse_url_basic_003.phpt parse_url_basic_004.phpt parse_url_basic_005.phpt parse_url_basic_006.phpt parse_url_basic_007.phpt
parse_url_basic_008.p! hpt parse_url_basic_009.phpt parse_url_basic_010.phpt parse_url_error_001.phpt parse_url_error_002.phpt
parse_url_variation_001.phpt parse_url_variation_002.phpt rawurldecode_error_001.phpt rawurldecode_variation_001.phpt rawurlencode_error_001.phpt
rawurlencode_variation_001.phpt urldecode_error_001.phpt urldecode_variation
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-49576@lists.php.net to get a copy of this message
robinf Fri Apr 11 08:57:12 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/reg spliti_error_002.phpt split_error_002.phpt eregi_basic.phpt eregi_replace_variation_003.phpt eregi_basic_004.phpt split_variation_004.phpt spliti_error_001.phpt spliti_variation_001.phpt split_variation_001.phpt ereg_basic_002.phpt spliti_basic_001.phpt regular_expressions.inc ereg_replace_error_001.phpt ereg_replace_variation_001.phpt eregi_replace_error_001.phpt eregi_replace_basic.phpt eregi_variation_001.phpt sql_regcase_variation_001.phpt ereg_variation_003.phpt eregi_variation_003.phpt ereg_variation_002.phpt spliti_variation_003.phpt eregi_replace_variation_002.phpt ereg_replace_variation_002.phpt split_basic_003.phpt eregi_replace_basic_002.phpt eregi_basic_003.phpt ereg_replace_variation_003.phpt ereg_basic_001.phpt split_variation_003.phpt split_basic_001.phpt eregi_variation_004.phpt ereg_replace_error_002.phpt spliti_variation_004.phpt split_basic_002.phpt ereg_error_002.phpt spliti_basic_002.phpt eregi_replace_variation_001.phpt split_variation_002.phpt spliti_variation_002.phpt ereg_replace_basic_002.phpt ereg_basic_004.phpt sql_regcase_error_001.phpt split_error_001.phpt ereg_replace_basic_001.phpt ereg_basic_003.phpt eregi_replace_basic_001.phpt ereg_variation_001.phpt spliti_basic_004.phpt ereg_error_001.phpt sql_regcase_basic_001.phpt eregi_basic_002.phpt eregi_basic_001.phpt eregi_error_002.phpt ereg_variation_004.phpt spliti_basic_003.phpt eregi_error_001.phpt eregi_variation_002.phpt eregi_replace_error_002.phpt /php-src/ext/standard/tests/url base64_encode_basic_001.phpt urldecode_error_001.phpt parse_url_error_001.phpt base64_decode_variation_001.phpt rawurldecode_variation_001.phpt parse_url_basic_003.phpt rawurlencode_variation_001.phpt parse_url_basic_008.phpt base64_decode_variation_002.phpt rawurlencode_error_001.phpt parse_url_variation_001.phpt base64_decode_basic_002.phpt parse_url_basic_004.phpt urls.inc base64_encode_error_001.phpt base64_decode_basic_001.phpt parse_url_basic_007.phpt parse_url_basic_010.phpt urldecode_variation_001.phpt rawurldecode_error_001.phpt parse_url_basic_001.phpt parse_url_basic_009.phpt urlencode_variation_001.phpt parse_url_basic_006.phpt parse_url_variation_002.phpt parse_url_error_002.phpt parse_url_basic_002.phpt base64_decode_error_001.phpt parse_url_basic_005.phpt urlencode_error_001.phpt base64_encode_variation_001.phpt Log: Adding some tests for ereg and url functions.

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_error_002.phpt +++ php-src/ext/standard/tests/reg/spliti_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_error_002.phpt +++ php-src/ext/standard/tests/reg/split_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_basic.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_basic.phpt +++ php-src/ext/standard/tests/reg/eregi_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_variation_003.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_basic_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_basic_004.phpt +++ php-src/ext/standard/tests/reg/eregi_basic_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_variation_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_variation_004.phpt +++ php-src/ext/standard/tests/reg/split_variation_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_error_001.phpt +++ php-src/ext/standard/tests/reg/spliti_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_variation_001.phpt +++ php-src/ext/standard/tests/reg/spliti_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_variation_001.phpt +++ php-src/ext/standard/tests/reg/split_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_basic_002.phpt +++ php-src/ext/standard/tests/reg/ereg_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_basic_001.phpt +++ php-src/ext/standard/tests/reg/spliti_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/regular_expressions.inc?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/regular_expressions.inc +++ php-src/ext/standard/tests/reg/regular_expressions.inc http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_error_001.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_variation_001.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_error_001.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_basic.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_basic.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_variation_001.phpt +++ php-src/ext/standard/tests/reg/eregi_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/sql_regcase_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/sql_regcase_variation_001.phpt +++ php-src/ext/standard/tests/reg/sql_regcase_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_variation_003.phpt +++ php-src/ext/standard/tests/reg/ereg_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_variation_003.phpt +++ php-src/ext/standard/tests/reg/eregi_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_variation_002.phpt +++ php-src/ext/standard/tests/reg/ereg_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_variation_003.phpt +++ php-src/ext/standard/tests/reg/spliti_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_variation_002.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_variation_002.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_basic_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_basic_003.phpt +++ php-src/ext/standard/tests/reg/split_basic_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_basic_002.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_basic_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_basic_003.phpt +++ php-src/ext/standard/tests/reg/eregi_basic_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_variation_003.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_basic_001.phpt +++ php-src/ext/standard/tests/reg/ereg_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_variation_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_variation_003.phpt +++ php-src/ext/standard/tests/reg/split_variation_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_basic_001.phpt +++ php-src/ext/standard/tests/reg/split_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_variation_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_variation_004.phpt +++ php-src/ext/standard/tests/reg/eregi_variation_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_error_002.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_variation_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_variation_004.phpt +++ php-src/ext/standard/tests/reg/spliti_variation_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_basic_002.phpt +++ php-src/ext/standard/tests/reg/split_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_error_002.phpt +++ php-src/ext/standard/tests/reg/ereg_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_basic_002.phpt +++ php-src/ext/standard/tests/reg/spliti_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_variation_001.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_variation_002.phpt +++ php-src/ext/standard/tests/reg/split_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_variation_002.phpt +++ php-src/ext/standard/tests/reg/spliti_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_basic_002.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_basic_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_basic_004.phpt +++ php-src/ext/standard/tests/reg/ereg_basic_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/sql_regcase_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/sql_regcase_error_001.phpt +++ php-src/ext/standard/tests/reg/sql_regcase_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/split_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/split_error_001.phpt +++ php-src/ext/standard/tests/reg/split_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_replace_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_replace_basic_001.phpt +++ php-src/ext/standard/tests/reg/ereg_replace_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_basic_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_basic_003.phpt +++ php-src/ext/standard/tests/reg/ereg_basic_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_basic_001.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_variation_001.phpt +++ php-src/ext/standard/tests/reg/ereg_variation_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_basic_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_basic_004.phpt +++ php-src/ext/standard/tests/reg/spliti_basic_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_error_001.phpt +++ php-src/ext/standard/tests/reg/ereg_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/sql_regcase_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/sql_regcase_basic_001.phpt +++ php-src/ext/standard/tests/reg/sql_regcase_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_basic_002.phpt +++ php-src/ext/standard/tests/reg/eregi_basic_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_basic_001.phpt +++ php-src/ext/standard/tests/reg/eregi_basic_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_error_002.phpt +++ php-src/ext/standard/tests/reg/eregi_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/ereg_variation_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/ereg_variation_004.phpt +++ php-src/ext/standard/tests/reg/ereg_variation_004.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/spliti_basic_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/spliti_basic_003.phpt +++ php-src/ext/standard/tests/reg/spliti_basic_003.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_error_001.phpt +++ php-src/ext/standard/tests/reg/eregi_error_001.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_variation_002.phpt +++ php-src/ext/standard/tests/reg/eregi_variation_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/reg/eregi_replace_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/reg/eregi_replace_error_002.phpt +++ php-src/ext/standard/tests/reg/eregi_replace_error_002.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_encode_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_encode_basic_001.phpt +++ php-src/ext/standard/tests/url/base64_encode_basic_001.phpt --TEST-- Test base64_encode() function : basic functionality --FILE-- <?php /* Prototype : proto string base64_encode(string str) * Description: Encodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ /* * Test base64_encode with single byte values. */ echo "*** Testing base64_encode() : basic functionality ***\n"; for ($i=0; $i<256; $i++) { $str = pack("c", $i); $enc = base64_encode($str); printf("0x%X: %s\n", $i, $enc); } echo "Done"; ?> --EXPECTF-- *** Testing base64_encode() : basic functionality *** 0x0: AA== 0x1: AQ== 0x2: Ag== 0x3: Aw== 0x4: BA== 0x5: BQ== 0x6: Bg== 0x7: Bw== 0x8: CA== 0x9: CQ== 0xA: Cg== 0xB: Cw== 0xC: DA== 0xD: DQ== 0xE: Dg== 0xF: Dw== 0x10: EA== 0x11: EQ== 0x12: Eg== 0x13: Ew== 0x14: FA== 0x15: FQ== 0x16: Fg== 0x17: Fw== 0x18: GA== 0x19: GQ== 0x1A: Gg== 0x1B: Gw== 0x1C: HA== 0x1D: HQ== 0x1E: Hg== 0x1F: Hw== 0x20: IA== 0x21: IQ== 0x22: Ig== 0x23: Iw== 0x24: JA== 0x25: JQ== 0x26: Jg== 0x27: Jw== 0x28: KA== 0x29: KQ== 0x2A: Kg== 0x2B: Kw== 0x2C: LA== 0x2D: LQ== 0x2E: Lg== 0x2F: Lw== 0x30: MA== 0x31: MQ== 0x32: Mg== 0x33: Mw== 0x34: NA== 0x35: NQ== 0x36: Ng== 0x37: Nw== 0x38: OA== 0x39: OQ== 0x3A: Og== 0x3B: Ow== 0x3C: PA== 0x3D: PQ== 0x3E: Pg== 0x3F: Pw== 0x40: QA== 0x41: QQ== 0x42: Qg== 0x43: Qw== 0x44: RA== 0x45: RQ== 0x46: Rg== 0x47: Rw== 0x48: SA== 0x49: SQ== 0x4A: Sg== 0x4B: Sw== 0x4C: TA== 0x4D: TQ== 0x4E: Tg== 0x4F: Tw== 0x50: UA== 0x51: UQ== 0x52: Ug== 0x53: Uw== 0x54: VA== 0x55: VQ== 0x56: Vg== 0x57: Vw== 0x58: WA== 0x59: WQ== 0x5A: Wg== 0x5B: Ww== 0x5C: XA== 0x5D: XQ== 0x5E: Xg== 0x5F: Xw== 0x60: YA== 0x61: YQ== 0x62: Yg== 0x63: Yw== 0x64: ZA== 0x65: ZQ== 0x66: Zg== 0x67: Zw== 0x68: aA== 0x69: aQ== 0x6A: ag== 0x6B: aw== 0x6C: bA== 0x6D: bQ== 0x6E: bg== 0x6F: bw== 0x70: cA== 0x71: cQ== 0x72: cg== 0x73: cw== 0x74: dA== 0x75: dQ== 0x76: dg== 0x77: dw== 0x78: eA== 0x79: eQ== 0x7A: eg== 0x7B: ew== 0x7C: fA== 0x7D: fQ== 0x7E: fg== 0x7F: fw== 0x80: gA== 0x81: gQ== 0x82: gg== 0x83: gw== 0x84: hA== 0x85: hQ== 0x86: hg== 0x87: hw== 0x88: iA== 0x89: iQ== 0x8A: ig== 0x8B: iw== 0x8C: jA== 0x8D: jQ== 0x8E: jg== 0x8F: jw== 0x90: kA== 0x91: kQ== 0x92: kg== 0x93: kw== 0x94: lA== 0x95: lQ== 0x96: lg== 0x97: lw== 0x98: mA== 0x99: mQ== 0x9A: mg== 0x9B: mw== 0x9C: nA== 0x9D: nQ== 0x9E: ng== 0x9F: nw== 0xA0: oA== 0xA1: oQ== 0xA2: og== 0xA3: ow== 0xA4: pA== 0xA5: pQ== 0xA6: pg== 0xA7: pw== 0xA8: qA== 0xA9: qQ== 0xAA: qg== 0xAB: qw== 0xAC: rA== 0xAD: rQ== 0xAE: rg== 0xAF: rw== 0xB0: sA== 0xB1: sQ== 0xB2: sg== 0xB3: sw== 0xB4: tA== 0xB5: tQ== 0xB6: tg== 0xB7: tw== 0xB8: uA== 0xB9: uQ== 0xBA: ug== 0xBB: uw== 0xBC: vA== 0xBD: vQ== 0xBE: vg== 0xBF: vw== 0xC0: wA== 0xC1: wQ== 0xC2: wg== 0xC3: ww== 0xC4: xA== 0xC5: xQ== 0xC6: xg== 0xC7: xw== 0xC8: yA== 0xC9: yQ== 0xCA: yg== 0xCB: yw== 0xCC: zA== 0xCD: zQ== 0xCE: zg== 0xCF: zw== 0xD0: 0A== 0xD1: 0Q== 0xD2: 0g== 0xD3: 0w== 0xD4: 1A== 0xD5: 1Q== 0xD6: 1g== 0xD7: 1w== 0xD8: 2A== 0xD9: 2Q== 0xDA: 2g== 0xDB: 2w== 0xDC: 3A== 0xDD: 3Q== 0xDE: 3g== 0xDF: 3w== 0xE0: 4A== 0xE1: 4Q== 0xE2: 4g== 0xE3: 4w== 0xE4: 5A== 0xE5: 5Q== 0xE6: 5g== 0xE7: 5w== 0xE8: 6A== 0xE9: 6Q== 0xEA: 6g== 0xEB: 6w== 0xEC: 7A== 0xED: 7Q== 0xEE: 7g== 0xEF: 7w== 0xF0: 8A== 0xF1: 8Q== 0xF2: 8g== 0xF3: 8w== 0xF4: 9A== 0xF5: 9Q== 0xF6: 9g== 0xF7: 9w== 0xF8: +A== 0xF9: +Q== 0xFA: +g== 0xFB: +w== 0xFC: /A== 0xFD: /Q== 0xFE: /g== 0xFF: /w== Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/urldecode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/urldecode_error_001.phpt +++ php-src/ext/standard/tests/url/urldecode_error_001.phpt --TEST-- Test urldecode() function : error conditions --FILE-- <?php /* Prototype : proto string urldecode(string str) * Description: Decodes URL-encoded string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt echo "*** Testing urldecode() : error conditions ***\n"; // Zero arguments echo "\n-- Testing urldecode() function with Zero arguments --\n"; var_dump( urldecode() ); //Test urldecode with one more than the expected number of arguments echo "\n-- Testing urldecode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $extra_arg = 10; var_dump( urldecode($str, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing urldecode() : error conditions *** -- Testing urldecode() function with Zero arguments -- Warning: urldecode() expects exactly 1 parameter, 0 given in %s on line 14 NULL -- Testing urldecode() function with more than expected no. of arguments -- Warning: urldecode() expects exactly 1 parameter, 2 given in %s on line 20 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_error_001.phpt +++ php-src/ext/standard/tests/url/parse_url_error_001.phpt --TEST-- Test parse_url() function : error conditions - wrong number of args --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ echo "*** Testing parse_url() : error conditions ***\n"; // Zero arguments echo "\n-- Testing parse_url() function with Zero arguments --\n"; var_dump( parse_url() ); //Test parse_url with one more than the expected number of arguments echo "\n-- Testing parse_url() function with more than expected no. of arguments --\n"; $url = 'string_val'; $url_component = 10; $extra_arg = 10; var_dump( parse_url($url, $url_component, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing parse_url() : error conditions *** -- Testing parse_url() function with Zero arguments -- Warning: parse_url() expects at least 1 parameter, 0 given in %s on line 12 NULL -- Testing parse_url() function with more than expected no. of arguments -- Warning: parse_url() expects at most 2 parameters, 3 given in %s on line 19 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_decode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_decode_variation_001.phpt +++ php-src/ext/standard/tests/url/base64_decode_variation_001.phpt --TEST-- Test base64_decode() function : usage variations - unexpected types for arg 1 --FILE-- <?php /* Prototype : proto string base64_decode(string str[, bool strict]) * Description: Decodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing base64_decode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) $strict = true; //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( base64_decode($value, $strict) ); }; echo "Done"; ?> --EXPECTF-- *** Testing base64_decode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(63) Error: 8 - Undefined variable: unset_var, %s(66) Arg value 0 string(0) "" Arg value 1 string(0) "" Arg value 12345 string(3) "×mø" Arg value -2345 bool(false) Arg value 10.5 bool(false) Arg value -10.5 bool(false) Arg value 101234567000 string(9) "×MvߎzïM4" Arg value 1.07654321E-9 bool(false) Arg value 0.5 bool(false) Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(0) "" Arg value string(0) "" Arg value 1 string(0) "" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(72) Arg value Error: 2 - base64_decode() expects parameter 1 to be string, object given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing base64_decode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(63) Error: 8 - Undefined variable: unset_var, %s(66) Arg value 0 string(0) "" Arg value 1 string(0) "" Arg value 12345 string(3) "×mø" Arg value -2345 bool(false) Arg value 10.5 bool(false) Arg value -10.5 bool(false) Arg value 101234567000 string(9) "×MvߎzïM4" Arg value 1.07654321E-9 bool(false) Arg value 0.5 bool(false) Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_decode() expects parameter 1 to be binary string, array given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(0) "" Arg value string(0) "" Arg value 1 string(0) "" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(72) Arg value Error: 2 - base64_decode() expects parameter 1 to be binary string, object given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/rawurldecode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/rawurldecode_variation_001.phpt +++ php-src/ext/standard/tests/url/rawurldecode_variation_001.phpt --TEST-- Test rawurldecode() function : usage variations - unexpected type for arg 1. --FILE-- <?php /* Prototype : proto string rawurldecode(string str) * Description: Decodes URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing rawurldecode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( rawurldecode($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing rawurldecode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - rawurldecode() expects parameter 1 to be string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing rawurldecode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value Error: 2 - rawurldecode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Arg value Error: 2 - rawurldecode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - rawurldecode() expects parameter 1 to be binary string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_003.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_003.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_003.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_HOST as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_HOST as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_HOST)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : string(12) "64.246.30.37" --> http://64.246.30.37/ : string(12) "64.246.30.37" --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : string(12) "64.246.30.37" --> php.net : NULL --> php.net/ : NULL --> http://php.net : string(7) "php.net" --> http://php.net/ : string(7) "php.net" --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : string(11) "www.php.net" --> http://www.php.net/ : string(11) "www.php.net" --> www.php.net:80 : string(11) "www.php.net" --> http://www.php.net:80 : string(11) "www.php.net" --> http://www.php.net:80/ : string(11) "www.php.net" --> http://www.php.net/index.php : string(11) "www.php.net" --> www.php.net/? : NULL --> www.php.net:80/? : string(11) "www.php.net" --> http://www.php.net/? : string(11) "www.php.net" --> http://www.php.net:80/? : string(11) "www.php.net" --> http://www.php.net:80/index.php : string(11) "www.php.net" --> http://www.php.net:80/foo/bar/index.php : string(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : string(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(11) "www.php.net" --> http://www.php.net:80/this/../a/../deep/directory : string(11) "www.php.net" --> http://www.php.net:80/this/../a/../deep/directory/ : string(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(11) "www.php.net" --> http://www.php.net:80/index.php : string(11) "www.php.net" --> http://www.php.net:80/index.php? : string(11) "www.php.net" --> http://www.php.net:80/#foo : string(11) "www.php.net" --> http://www.php.net:80/?# : string(11) "www.php.net" --> http://www.php.net:80/?test=1 : string(11) "www.php.net" --> http://www.php.net/?test=1& : string(11) "www.php.net" --> http://www.php.net:80/?& : string(11) "www.php.net" --> http://www.php.net:80/index.php?test=1& : string(11) "www.php.net" --> http://www.php.net/index.php?& : string(11) "www.php.net" --> http://www.php.net:80/index.php?foo& : string(11) "www.php.net" --> http://www.php.net/index.php?&foo : string(11) "www.php.net" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(11) "www.php.net" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" --> nntp://news.php.net : string(12) "news.php.net" --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(11) "ftp.gnu.org" --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : string(3) "bar" --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(15) "www.example.com" --> file:///path/to/file : NULL --> file://path/to/file : string(4) "path" --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : string(7) "1.2.3.4" --> http://foo.com#bar : string(7) "foo.com" --> scheme: : NULL --> foo+bar://baz@bang/bla : string(4) "bang" --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : string(4) "host" --> http://10.10.10.10/:80 : string(11) "10.10.10.10" --> http://x:? : string(1) "x" --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : string(1) ":" --> http://::? : string(1) ":" --> x://::6.5 : string(1) ":" --> http://?:/ : string(1) "?" --> http://@?:/ : string(1) "?" --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : string(6) "[x:80]" --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : unicode(12) "64.246.30.37" --> http://64.246.30.37/ : unicode(12) "64.246.30.37" --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : unicode(12) "64.246.30.37" --> php.net : NULL --> php.net/ : NULL --> http://php.net : unicode(7) "php.net" --> http://php.net/ : unicode(7) "php.net" --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : unicode(11) "www.php.net" --> http://www.php.net/ : unicode(11) "www.php.net" --> www.php.net:80 : unicode(11) "www.php.net" --> http://www.php.net:80 : unicode(11) "www.php.net" --> http://www.php.net:80/ : unicode(11) "www.php.net" --> http://www.php.net/index.php : unicode(11) "www.php.net" --> www.php.net/? : NULL --> www.php.net:80/? : unicode(11) "www.php.net" --> http://www.php.net/? : unicode(11) "www.php.net" --> http://www.php.net:80/? : unicode(11) "www.php.net" --> http://www.php.net:80/index.php : unicode(11) "www.php.net" --> http://www.php.net:80/foo/bar/index.php : unicode(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : unicode(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : unicode(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(11) "www.php.net" --> http://www.php.net:80/this/../a/../deep/directory : unicode(11) "www.php.net" --> http://www.php.net:80/this/../a/../deep/directory/ : unicode(11) "www.php.net" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : unicode(11) "www.php.net" --> http://www.php.net:80/index.php : unicode(11) "www.php.net" --> http://www.php.net:80/index.php? : unicode(11) "www.php.net" --> http://www.php.net:80/#foo : unicode(11) "www.php.net" --> http://www.php.net:80/?# : unicode(11) "www.php.net" --> http://www.php.net:80/?test=1 : unicode(11) "www.php.net" --> http://www.php.net/?test=1& : unicode(11) "www.php.net" --> http://www.php.net:80/?& : unicode(11) "www.php.net" --> http://www.php.net:80/index.php?test=1& : unicode(11) "www.php.net" --> http://www.php.net/index.php?& : unicode(11) "www.php.net" --> http://www.php.net:80/index.php?foo& : unicode(11) "www.php.net" --> http://www.php.net/index.php?&foo : unicode(11) "www.php.net" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : unicode(11) "www.php.net" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(11) "www.php.net" --> nntp://news.php.net : unicode(12) "news.php.net" --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : unicode(11) "ftp.gnu.org" --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : unicode(3) "bar" --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : unicode(15) "www.example.com" --> file:///path/to/file : NULL --> file://path/to/file : unicode(4) "path" --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : unicode(7) "1.2.3.4" --> http://foo.com#bar : unicode(7) "foo.com" --> scheme: : NULL --> foo+bar://baz@bang/bla : unicode(4) "bang" --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : unicode(4) "host" --> http://10.10.10.10/:80 : unicode(11) "10.10.10.10" --> http://x:? : unicode(1) "x" --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : unicode(1) ":" --> http://::? : unicode(1) ":" --> x://::6.5 : unicode(1) ":" --> http://?:/ : unicode(1) "?" --> http://@?:/ : unicode(1) "?" --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : unicode(6) "[x:80]" --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/rawurlencode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/rawurlencode_variation_001.phpt +++ php-src/ext/standard/tests/url/rawurlencode_variation_001.phpt --TEST-- Test rawurlencode() function : usage variations - unexpected type for arg 1. --FILE-- <?php /* Prototype : proto string rawurlencode(string str) * Description: URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing rawurlencode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( rawurlencode($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing rawurlencode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - rawurlencode() expects parameter 1 to be string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing rawurlencode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - rawurlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value Error: 2 - rawurlencode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Arg value Error: 2 - rawurlencode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - rawurlencode() expects parameter 1 to be binary string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_008.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_008.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_008.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_QUERY as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_QUERY as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_QUERY)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : string(37) "lots=1&of=2&parameters=3&too=4&here=5" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : string(6) "test=1" --> http://www.php.net/?test=1& : string(7) "test=1&" --> http://www.php.net:80/?& : string(1) "&" --> http://www.php.net:80/index.php?test=1& : string(7) "test=1&" --> http://www.php.net/index.php?& : string(1) "&" --> http://www.php.net:80/index.php?foo& : string(4) "foo&" --> http://www.php.net/index.php?&foo : string(4) "&foo" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(31) "test=1&test2=char&test3=mixesCI" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : string(7) "a=b&c=d" --> foo.php?a=b&c=d : string(7) "a=b&c=d" --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(12) "bar=1&boom=0" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : string(7) "a=1&b=2" --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : string(14) "argument?value" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : unicode(37) "lots=1&of=2&parameters=3&too=4&here=5" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : unicode(6) "test=1" --> http://www.php.net/?test=1& : unicode(7) "test=1&" --> http://www.php.net:80/?& : unicode(1) "&" --> http://www.php.net:80/index.php?test=1& : unicode(7) "test=1&" --> http://www.php.net/index.php?& : unicode(1) "&" --> http://www.php.net:80/index.php?foo& : unicode(4) "foo&" --> http://www.php.net/index.php?&foo : unicode(4) "&foo" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : unicode(31) "test=1&test2=char&test3=mixesCI" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(31) "test=1&test2=char&test3=mixesCI" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : unicode(7) "a=b&c=d" --> foo.php?a=b&c=d : unicode(7) "a=b&c=d" --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : unicode(12) "bar=1&boom=0" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : unicode(7) "a=1&b=2" --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : unicode(14) "argument?value" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_decode_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_decode_variation_002.phpt +++ php-src/ext/standard/tests/url/base64_decode_variation_002.phpt --TEST-- Test base64_decode() function : usage variations - unexpected types for arg 2 --FILE-- <?php /* Prototype : proto string base64_decode(string str[, bool strict]) * Description: Decodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing base64_decode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) $str = 'aGVsbG8gd29ybGQh!'; //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // string data "string", 'string', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for strict foreach($values as $value) { echo "\nArg value $value \n"; var_dump( base64_decode($str, $value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing base64_decode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(67) Error: 8 - Undefined variable: unset_var, %s(70) Arg value 0 string(12) "hello world!" Arg value 1 bool(false) Arg value 12345 bool(false) Arg value -2345 bool(false) Arg value 10.5 bool(false) Arg value -10.5 bool(false) Arg value 101234567000 bool(false) Arg value 1.07654321E-9 bool(false) Arg value 0.5 bool(false) Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value 1 bool(false) Arg value string(12) "hello world!" Arg value 1 bool(false) Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value string bool(false) Arg value string bool(false) Error: 4096 - Object of class stdClass could not be converted to string, %s(76) Arg value Error: 2 - base64_decode() expects parameter 2 to be boolean, object given, %s(77) NULL Arg value string(12) "hello world!" Arg value string(12) "hello world!" Done --UEXPECTF-- *** Testing base64_decode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(67) Error: 8 - Undefined variable: unset_var, %s(70) Arg value 0 string(12) "hello world!" Arg value 1 bool(false) Arg value 12345 bool(false) Arg value -2345 bool(false) Arg value 10.5 bool(false) Arg value -10.5 bool(false) Arg value 101234567000 bool(false) Arg value 1.07654321E-9 bool(false) Arg value 0.5 bool(false) Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Error: 8 - Array to string conversion, %s(76) Arg value Array Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) NULL Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value 1 bool(false) Arg value string(12) "hello world!" Arg value 1 bool(false) Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value string(12) "hello world!" Arg value string bool(false) Arg value string bool(false) Error: 4096 - Object of class stdClass could not be converted to string, %s(76) Arg value Error: 2 - base64_decode() expects parameter 2 to be boolean, object given, %s(77) NULL Arg value string(12) "hello world!" Arg value string(12) "hello world!" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/rawurlencode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/rawurlencode_error_001.phpt +++ php-src/ext/standard/tests/url/rawurlencode_error_001.phpt --TEST-- Test rawurlencode() function : error conditions --FILE-- <?php /* Prototype : proto string rawurlencode(string str) * Description: URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt echo "*** Testing rawurlencode() : error conditions ***\n"; // Zero arguments echo "\n-- Testing rawurlencode() function with Zero arguments --\n"; var_dump( rawurlencode() ); //Test rawurlencode with one more than the expected number of arguments echo "\n-- Testing rawurlencode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $extra_arg = 10; var_dump( rawurlencode($str, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing rawurlencode() : error conditions *** -- Testing rawurlencode() function with Zero arguments -- Warning: rawurlencode() expects exactly 1 parameter, 0 given in %s on line 14 NULL -- Testing rawurlencode() function with more than expected no. of arguments -- Warning: rawurlencode() expects exactly 1 parameter, 2 given in %s on line 20 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_variation_001.phpt +++ php-src/ext/standard/tests/url/parse_url_variation_001.phpt --TEST-- Test parse_url() function : usage variations - unexpected type for arg 1 --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing parse_url() : usage variations ***\n"; //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for url foreach($values as $value) { echo "\nArg value $value \n"; var_dump( parse_url($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing parse_url() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(60) Error: 8 - Undefined variable: unset_var, %s(63) Arg value 0 array(1) { ["path"]=> string(1) "0" } Arg value 1 array(1) { ["path"]=> string(1) "1" } Arg value 12345 array(1) { ["path"]=> string(5) "12345" } Arg value -2345 array(1) { ["path"]=> string(5) "-2345" } Arg value 10.5 array(1) { ["path"]=> string(4) "10.5" } Arg value -10.5 array(1) { ["path"]=> string(5) "-10.5" } Arg value 101234567000 array(1) { ["path"]=> string(12) "101234567000" } Arg value 1.07654321E-9 array(1) { ["path"]=> string(13) "1.07654321E-9" } Arg value 0.5 array(1) { ["path"]=> string(3) "0.5" } Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Arg value array(1) { ["path"]=> string(0) "" } Arg value array(1) { ["path"]=> string(0) "" } Arg value 1 array(1) { ["path"]=> string(1) "1" } Arg value array(1) { ["path"]=> string(0) "" } Arg value 1 array(1) { ["path"]=> string(1) "1" } Arg value array(1) { ["path"]=> string(0) "" } Arg value array(1) { ["path"]=> string(0) "" } Arg value array(1) { ["path"]=> string(0) "" } Error: 4096 - Object of class stdClass could not be converted to string, %s(69) Arg value Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), object given, %s(70) NULL Arg value array(1) { ["path"]=> string(0) "" } Arg value array(1) { ["path"]=> string(0) "" } Done --UEXPECTF-- *** Testing parse_url() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(60) Error: 8 - Undefined variable: unset_var, %s(63) Arg value 0 array(1) { [u"path"]=> unicode(1) "0" } Arg value 1 array(1) { [u"path"]=> unicode(1) "1" } Arg value 12345 array(1) { [u"path"]=> unicode(5) "12345" } Arg value -2345 array(1) { [u"path"]=> unicode(5) "-2345" } Arg value 10.5 array(1) { [u"path"]=> unicode(4) "10.5" } Arg value -10.5 array(1) { [u"path"]=> unicode(5) "-10.5" } Arg value 101234567000 array(1) { [u"path"]=> unicode(12) "101234567000" } Arg value 1.07654321E-9 array(1) { [u"path"]=> unicode(13) "1.07654321E-9" } Arg value 0.5 array(1) { [u"path"]=> unicode(3) "0.5" } Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Error: 8 - Array to string conversion, %s(69) Arg value Array Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), array given, %s(70) NULL Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value 1 array(1) { [u"path"]=> unicode(1) "1" } Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value 1 array(1) { [u"path"]=> unicode(1) "1" } Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value array(1) { [u"path"]=> unicode(0) "" } Error: 4096 - Object of class stdClass could not be converted to string, %s(69) Arg value Error: 2 - parse_url() expects parameter 1 to be string (Unicode or binary), object given, %s(70) NULL Arg value array(1) { [u"path"]=> unicode(0) "" } Arg value array(1) { [u"path"]=> unicode(0) "" } Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_decode_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_decode_basic_002.phpt +++ php-src/ext/standard/tests/url/base64_decode_basic_002.phpt --TEST-- Test base64_decode() function : basic functionality - strict vs non-strict with non-base64 chars. --FILE-- <?php /* Prototype : proto string base64_decode(string str[, bool strict]) * Description: Decodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ echo "Decode 'hello world!':\n"; $noWhiteSpace = "aGVsbG8gd29ybGQh"; var_dump(base64_decode($noWhiteSpace)); var_dump(base64_decode($noWhiteSpace, false)); var_dump(base64_decode($noWhiteSpace, true)); echo "\nWhitespace does not affect base64_decode, even with \$strict===true:\n"; $withWhiteSpace = "a GVs bG8gd2 9ybGQh"; var_dump(base64_decode($withWhiteSpace)); var_dump(base64_decode($withWhiteSpace, false)); var_dump(base64_decode($withWhiteSpace, true)); echo "\nOther chars outside the base64 alphabet are ignored when \$strict===false, but cause failure with \$strict===true:\n"; $badChars = $noWhiteSpace . '*'; var_dump(base64_decode($badChars)); var_dump(base64_decode($badChars, false)); var_dump(base64_decode($badChars, true)); echo "Done"; ?> --EXPECTF-- Decode 'hello world!': string(12) "hello world!" string(12) "hello world!" string(12) "hello world!" Whitespace does not affect base64_decode, even with $strict===true: string(12) "hello world!" string(12) "hello world!" string(12) "hello world!" Other chars outside the base64 alphabet are ignored when $strict===false, but cause failure with $strict===true: string(12) "hello world!" string(12) "hello world!" bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_004.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_004.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_004.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PORT as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_PORT as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_PORT)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : int(80) --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : int(80) --> http://www.php.net:80 : int(80) --> http://www.php.net:80/ : int(80) --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : int(80) --> http://www.php.net/? : NULL --> http://www.php.net:80/? : int(80) --> http://www.php.net:80/index.php : int(80) --> http://www.php.net:80/foo/bar/index.php : int(80) --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : int(80) --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : int(80) --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : int(80) --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : int(80) --> http://www.php.net:80/this/../a/../deep/directory : int(80) --> http://www.php.net:80/this/../a/../deep/directory/ : int(80) --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : int(80) --> http://www.php.net:80/index.php : int(80) --> http://www.php.net:80/index.php? : int(80) --> http://www.php.net:80/#foo : int(80) --> http://www.php.net:80/?# : int(80) --> http://www.php.net:80/?test=1 : int(80) --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : int(80) --> http://www.php.net:80/index.php?test=1& : int(80) --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : int(80) --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : int(80) --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : int(8080) --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : NULL --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : int(6) --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/urls.inc?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/urls.inc +++ php-src/ext/standard/tests/url/urls.inc <?php $urls = array( // Parsable URLs: '64.246.30.37', 'http://64.246.30.37', 'http://64.246.30.37/', '64.246.30.37/', '64.246.30.37:80/', 'php.net', 'php.net/', 'http://php.net', 'http://php.net/', 'www.php.net', 'www.php.net/', 'http://www.php.net', 'http://www.php.net/', 'www.php.net:80', 'http://www.php.net:80', 'http://www.php.net:80/', 'http://www.php.net/index.php', 'www.php.net/?', 'www.php.net:80/?', 'http://www.php.net/?', 'http://www.php.net:80/?', 'http://www.php.net:80/index.php', 'http://www.php.net:80/foo/bar/index.php', 'http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php', 'http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5', 'http://www.php.net:80/this/is/a/very/deep/directory/structure/and/', 'http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php', 'http://www.php.net:80/this/../a/../deep/directory', 'http://www.php.net:80/this/../a/../deep/directory/', 'http://www.php.net:80/this/is/a/very/deep/directory/../file.php', 'http://www.php.net:80/index.php', 'http://www.php.net:80/index.php?', 'http://www.php.net:80/#foo', 'http://www.php.net:80/?#', 'http://www.php.net:80/?test=1', 'http://www.php.net/?test=1&', 'http://www.php.net:80/?&', 'http://www.php.net:80/index.php?test=1&', 'http://www.php.net/index.php?&', 'http://www.php.net:80/index.php?foo&', 'http://www.php.net/index.php?&foo', 'http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI', 'www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', 'nntp://news.php.net', 'ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz', 'zlib:http://foo@bar', 'zlib:filename.txt', 'zlib:/path/to/my/file/file.txt', 'foo://foo@bar', 'mailto:me@mydomain.com', '/foo.php?a=b&c=d', 'foo.php?a=b&c=d', 'http://user:passwd@www.example.com:8080?bar=1&boom=0', 'file:///path/to/file', 'file://path/to/file', 'file:/path/to/file', 'http://1.2.3.4:/abc.asp?a=1&b=2', 'http://foo.com#bar', 'scheme:', 'foo+bar://baz@bang/bla', 'gg:9130731', 'http://user:@pass@host/path?argument?value#etc', 'http://10.10.10.10/:80', 'http://x:?', 'x:blah.com', 'x:/blah.com', 'x://::abc/?', 'http://::?', 'x://::6.5', 'http://?:/', 'http://@?:/', 'file:///:', 'file:///a:/', 'file:///ab:/', 'file:///a:/', 'file:///@:/', 'file:///:80/', '[]', 'http://[x:80]/', '', '/', // Severely malformed URLs that do not parse: 'http:///blah.com', 'http://:80', 'http://user@:80', 'http://user:pass@:80', 'http://:', 'http://@/', 'http://@:/', 'http://:/', 'http://?', 'http://?:', 'http://:?', 'http://blah.com:123456', 'http://blah.com:abcdef', ); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_encode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_encode_error_001.phpt +++ php-src/ext/standard/tests/url/base64_encode_error_001.phpt --TEST-- Test base64_encode() function : error conditions - wrong number of args --FILE-- <?php /* Prototype : proto string base64_encode(string str) * Description: Encodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ echo "*** Testing base64_encode() : error conditions - wrong number of args ***\n"; // Zero arguments echo "\n-- Testing base64_encode() function with Zero arguments --\n"; var_dump( base64_encode() ); //Test base64_encode with one more than the expected number of arguments echo "\n-- Testing base64_encode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $extra_arg = 10; var_dump( base64_encode($str, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing base64_encode() : error conditions - wrong number of args *** -- Testing base64_encode() function with Zero arguments -- Warning: base64_encode() expects exactly 1 parameter, 0 given in %s on line 12 NULL -- Testing base64_encode() function with more than expected no. of arguments -- Warning: base64_encode() expects exactly 1 parameter, 2 given in %s on line 18 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_decode_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_decode_basic_001.phpt +++ php-src/ext/standard/tests/url/base64_decode_basic_001.phpt --TEST-- Test base64_decode() function : basic functionality - ensure all base64 alphabet is supported. --FILE-- <?php /* Prototype : proto string base64_decode(string str[, bool strict]) * Description: Decodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ echo "Decode an input string containing the whole base64 alphabet:\n"; $allbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var_dump(bin2hex(base64_decode($allbase64))); var_dump(bin2hex(base64_decode($allbase64, false))); var_dump(bin2hex(base64_decode($allbase64, true))); echo "Done"; ?> --EXPECTF-- Decode an input string containing the whole base64 alphabet: string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" Done --UEXPECTF-- Decode an input string containing the whole base64 alphabet: unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_007.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_007.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_007.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PATH as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_PATH as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_PATH)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : string(12) "64.246.30.37" --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : string(1) "/" --> 64.246.30.37/ : string(13) "64.246.30.37/" --> 64.246.30.37:80/ : string(1) "/" --> php.net : string(7) "php.net" --> php.net/ : string(8) "php.net/" --> http://php.net : NULL --> http://php.net/ : string(1) "/" --> www.php.net : string(11) "www.php.net" --> www.php.net/ : string(12) "www.php.net/" --> http://www.php.net : NULL --> http://www.php.net/ : string(1) "/" --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : string(1) "/" --> http://www.php.net/index.php : string(10) "/index.php" --> www.php.net/? : string(12) "www.php.net/" --> www.php.net:80/? : string(1) "/" --> http://www.php.net/? : string(1) "/" --> http://www.php.net:80/? : string(1) "/" --> http://www.php.net:80/index.php : string(10) "/index.php" --> http://www.php.net:80/foo/bar/index.php : string(18) "/foo/bar/index.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(45) "/this/is/a/very/deep/directory/structure/and/" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/../a/../deep/directory : string(28) "/this/../a/../deep/directory" --> http://www.php.net:80/this/../a/../deep/directory/ : string(29) "/this/../a/../deep/directory/" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(42) "/this/is/a/very/deep/directory/../file.php" --> http://www.php.net:80/index.php : string(10) "/index.php" --> http://www.php.net:80/index.php? : string(10) "/index.php" --> http://www.php.net:80/#foo : string(1) "/" --> http://www.php.net:80/?# : string(1) "/" --> http://www.php.net:80/?test=1 : string(1) "/" --> http://www.php.net/?test=1& : string(1) "/" --> http://www.php.net:80/?& : string(1) "/" --> http://www.php.net:80/index.php?test=1& : string(10) "/index.php" --> http://www.php.net/index.php?& : string(10) "/index.php" --> http://www.php.net:80/index.php?foo& : string(10) "/index.php" --> http://www.php.net/index.php?&foo : string(10) "/index.php" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(10) "/index.php" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(22) "/gnu/glic/glibc.tar.gz" --> zlib:http://foo@bar : string(14) "http://foo@bar" --> zlib:filename.txt : string(12) "filename.txt" --> zlib:/path/to/my/file/file.txt : string(25) "/path/to/my/file/file.txt" --> foo://foo@bar : NULL --> mailto:me@mydomain.com : string(15) "me@mydomain.com" --> /foo.php?a=b&c=d : string(8) "/foo.php" --> foo.php?a=b&c=d : string(7) "foo.php" --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL --> file:///path/to/file : string(13) "/path/to/file" --> file://path/to/file : string(8) "/to/file" --> file:/path/to/file : string(13) "/path/to/file" --> http://1.2.3.4:/abc.asp?a=1&b=2 : string(8) "/abc.asp" --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : string(4) "/bla" --> gg:9130731 : string(7) "9130731" --> http://user:@pass@host/path?argument?value#etc : string(5) "/path" --> http://10.10.10.10/:80 : string(4) "/:80" --> http://x:? : NULL --> x:blah.com : string(8) "blah.com" --> x:/blah.com : string(9) "/blah.com" --> x://::abc/? : string(1) "/" --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : string(1) "/" --> http://@?:/ : string(1) "/" --> file:///: : string(2) "/:" --> file:///a:/ : string(3) "a:/" --> file:///ab:/ : string(5) "/ab:/" --> file:///a:/ : string(3) "a:/" --> file:///@:/ : string(3) "@:/" --> file:///:80/ : string(5) "/:80/" --> [] : string(2) "[]" --> http://[x:80]/ : string(1) "/" --> : string(0) "" --> / : string(1) "/" --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : unicode(12) "64.246.30.37" --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : unicode(1) "/" --> 64.246.30.37/ : unicode(13) "64.246.30.37/" --> 64.246.30.37:80/ : unicode(1) "/" --> php.net : unicode(7) "php.net" --> php.net/ : unicode(8) "php.net/" --> http://php.net : NULL --> http://php.net/ : unicode(1) "/" --> www.php.net : unicode(11) "www.php.net" --> www.php.net/ : unicode(12) "www.php.net/" --> http://www.php.net : NULL --> http://www.php.net/ : unicode(1) "/" --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : unicode(1) "/" --> http://www.php.net/index.php : unicode(10) "/index.php" --> www.php.net/? : unicode(12) "www.php.net/" --> www.php.net:80/? : unicode(1) "/" --> http://www.php.net/? : unicode(1) "/" --> http://www.php.net:80/? : unicode(1) "/" --> http://www.php.net:80/index.php : unicode(10) "/index.php" --> http://www.php.net:80/foo/bar/index.php : unicode(18) "/foo/bar/index.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : unicode(45) "/this/is/a/very/deep/directory/structure/and/" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" --> http://www.php.net:80/this/../a/../deep/directory : unicode(28) "/this/../a/../deep/directory" --> http://www.php.net:80/this/../a/../deep/directory/ : unicode(29) "/this/../a/../deep/directory/" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : unicode(42) "/this/is/a/very/deep/directory/../file.php" --> http://www.php.net:80/index.php : unicode(10) "/index.php" --> http://www.php.net:80/index.php? : unicode(10) "/index.php" --> http://www.php.net:80/#foo : unicode(1) "/" --> http://www.php.net:80/?# : unicode(1) "/" --> http://www.php.net:80/?test=1 : unicode(1) "/" --> http://www.php.net/?test=1& : unicode(1) "/" --> http://www.php.net:80/?& : unicode(1) "/" --> http://www.php.net:80/index.php?test=1& : unicode(10) "/index.php" --> http://www.php.net/index.php?& : unicode(10) "/index.php" --> http://www.php.net:80/index.php?foo& : unicode(10) "/index.php" --> http://www.php.net/index.php?&foo : unicode(10) "/index.php" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : unicode(10) "/index.php" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(10) "/index.php" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : unicode(22) "/gnu/glic/glibc.tar.gz" --> zlib:http://foo@bar : unicode(14) "http://foo@bar" --> zlib:filename.txt : unicode(12) "filename.txt" --> zlib:/path/to/my/file/file.txt : unicode(25) "/path/to/my/file/file.txt" --> foo://foo@bar : NULL --> mailto:me@mydomain.com : unicode(15) "me@mydomain.com" --> /foo.php?a=b&c=d : unicode(8) "/foo.php" --> foo.php?a=b&c=d : unicode(7) "foo.php" --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL --> file:///path/to/file : unicode(13) "/path/to/file" --> file://path/to/file : unicode(8) "/to/file" --> file:/path/to/file : unicode(13) "/path/to/file" --> http://1.2.3.4:/abc.asp?a=1&b=2 : unicode(8) "/abc.asp" --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : unicode(4) "/bla" --> gg:9130731 : unicode(7) "9130731" --> http://user:@pass@host/path?argument?value#etc : unicode(5) "/path" --> http://10.10.10.10/:80 : unicode(4) "/:80" --> http://x:? : NULL --> x:blah.com : unicode(8) "blah.com" --> x:/blah.com : unicode(9) "/blah.com" --> x://::abc/? : unicode(1) "/" --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : unicode(1) "/" --> http://@?:/ : unicode(1) "/" --> file:///: : unicode(2) "/:" --> file:///a:/ : unicode(3) "a:/" --> file:///ab:/ : unicode(5) "/ab:/" --> file:///a:/ : unicode(3) "a:/" --> file:///@:/ : unicode(3) "@:/" --> file:///:80/ : unicode(5) "/:80/" --> [] : unicode(2) "[]" --> http://[x:80]/ : unicode(1) "/" --> : unicode(0) "" --> / : unicode(1) "/" --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_010.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_010.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_010.phpt --TEST-- Test parse_url() function : check values of URL related constants --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * check values of URL related constants */ foreach(get_defined_constants() as $constantName => $constantValue) { if (strpos($constantName, 'PHP_URL')===0) { echo "$constantName: $constantValue \n"; } } echo "Done"; ?> --EXPECTF-- PHP_URL_SCHEME: 0 PHP_URL_HOST: 1 PHP_URL_PORT: 2 PHP_URL_USER: 3 PHP_URL_PASS: 4 PHP_URL_PATH: 5 PHP_URL_QUERY: 6 PHP_URL_FRAGMENT: 7 Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/urldecode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/urldecode_variation_001.phpt +++ php-src/ext/standard/tests/url/urldecode_variation_001.phpt --TEST-- Test urldecode() function : usage variations - <type here specifics of this variation> --FILE-- <?php /* Prototype : proto string urldecode(string str) * Description: Decodes URL-encoded string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing urldecode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( urldecode($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing urldecode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - urldecode() expects parameter 1 to be string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing urldecode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urldecode() expects parameter 1 to be binary string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value Error: 2 - urldecode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Arg value Error: 2 - urldecode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - urldecode() expects parameter 1 to be binary string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/rawurldecode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/rawurldecode_error_001.phpt +++ php-src/ext/standard/tests/url/rawurldecode_error_001.phpt --TEST-- Test rawurldecode() function : error conditions - wrong number of args --FILE-- <?php /* Prototype : proto string rawurldecode(string str) * Description: Decodes URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt echo "*** Testing rawurldecode() : error conditions ***\n"; // Zero arguments echo "\n-- Testing rawurldecode() function with Zero arguments --\n"; var_dump( rawurldecode() ); //Test rawurldecode with one more than the expected number of arguments echo "\n-- Testing rawurldecode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $extra_arg = 10; var_dump( rawurldecode($str, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing rawurldecode() : error conditions *** -- Testing rawurldecode() function with Zero arguments -- Warning: rawurldecode() expects exactly 1 parameter, 0 given in %s on line 14 NULL -- Testing rawurldecode() function with more than expected no. of arguments -- Warning: rawurldecode() expects exactly 1 parameter, 2 given in %s on line 20 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_001.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_001.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying the component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying the component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "\n--> $url: "; var_dump(parse_url($url)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37: array(1) { ["path"]=> string(12) "64.246.30.37" } --> http://64.246.30.37: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(12) "64.246.30.37" } --> http://64.246.30.37/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(12) "64.246.30.37" ["path"]=> string(1) "/" } --> 64.246.30.37/: array(1) { ["path"]=> string(13) "64.246.30.37/" } --> 64.246.30.37:80/: array(3) { ["host"]=> string(12) "64.246.30.37" ["port"]=> int(80) ["path"]=> string(1) "/" } --> php.net: array(1) { ["path"]=> string(7) "php.net" } --> php.net/: array(1) { ["path"]=> string(8) "php.net/" } --> http://php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "php.net" } --> http://php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "php.net" ["path"]=> string(1) "/" } --> www.php.net: array(1) { ["path"]=> string(11) "www.php.net" } --> www.php.net/: array(1) { ["path"]=> string(12) "www.php.net/" } --> http://www.php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" } --> http://www.php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(1) "/" } --> www.php.net:80: array(2) { ["host"]=> string(11) "www.php.net" ["port"]=> int(80) } --> http://www.php.net:80: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) } --> http://www.php.net:80/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" } --> http://www.php.net/index.php: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(10) "/index.php" } --> www.php.net/?: array(1) { ["path"]=> string(12) "www.php.net/" } --> www.php.net:80/?: array(3) { ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" } --> http://www.php.net/?: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(1) "/" } --> http://www.php.net:80/?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" } --> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" } --> http://www.php.net:80/foo/bar/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(18) "/foo/bar/index.php" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" ["query"]=> string(37) "lots=1&of=2&parameters=3&too=4&here=5" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(45) "/this/is/a/very/deep/directory/structure/and/" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } --> http://www.php.net:80/this/../a/../deep/directory: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(28) "/this/../a/../deep/directory" } --> http://www.php.net:80/this/../a/../deep/directory/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(29) "/this/../a/../deep/directory/" } --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(42) "/this/is/a/very/deep/directory/../file.php" } --> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" } --> http://www.php.net:80/index.php?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" } --> http://www.php.net:80/#foo: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" ["fragment"]=> string(3) "foo" } --> http://www.php.net:80/?#: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" } --> http://www.php.net:80/?test=1: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" ["query"]=> string(6) "test=1" } --> http://www.php.net/?test=1&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(1) "/" ["query"]=> string(7) "test=1&" } --> http://www.php.net:80/?&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(1) "/" ["query"]=> string(1) "&" } --> http://www.php.net:80/index.php?test=1&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" ["query"]=> string(7) "test=1&" } --> http://www.php.net/index.php?&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(10) "/index.php" ["query"]=> string(1) "&" } --> http://www.php.net:80/index.php?foo&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" ["query"]=> string(4) "foo&" } --> http://www.php.net/index.php?&foo: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["path"]=> string(10) "/index.php" ["query"]=> string(4) "&foo" } --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" } --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["user"]=> string(6) "secret" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["pass"]=> string(7) "hideout" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" ["pass"]=> string(7) "hideout" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["user"]=> string(14) "secret@hideout" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["user"]=> string(6) "secret" ["pass"]=> string(7) "hid:out" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> nntp://news.php.net: array(2) { ["scheme"]=> string(4) "nntp" ["host"]=> string(12) "news.php.net" } --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { ["scheme"]=> string(3) "ftp" ["host"]=> string(11) "ftp.gnu.org" ["path"]=> string(22) "/gnu/glic/glibc.tar.gz" } --> zlib:http://foo@bar: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(14) "http://foo@bar" } --> zlib:filename.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(12) "filename.txt" } --> zlib:/path/to/my/file/file.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(25) "/path/to/my/file/file.txt" } --> foo://foo@bar: array(3) { ["scheme"]=> string(3) "foo" ["host"]=> string(3) "bar" ["user"]=> string(3) "foo" } --> mailto:me@mydomain.com: array(2) { ["scheme"]=> string(6) "mailto" ["path"]=> string(15) "me@mydomain.com" } --> /foo.php?a=b&c=d: array(2) { ["path"]=> string(8) "/foo.php" ["query"]=> string(7) "a=b&c=d" } --> foo.php?a=b&c=d: array(2) { ["path"]=> string(7) "foo.php" ["query"]=> string(7) "a=b&c=d" } --> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { ["scheme"]=> string(4) "http" ["host"]=> string(15) "www.example.com" ["port"]=> int(8080) ["user"]=> string(4) "user" ["pass"]=> string(6) "passwd" ["query"]=> string(12) "bar=1&boom=0" } --> file:///path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } --> file://path/to/file: array(3) { ["scheme"]=> string(4) "file" ["host"]=> string(4) "path" ["path"]=> string(8) "/to/file" } --> file:/path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } --> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "1.2.3.4" ["path"]=> string(8) "/abc.asp" ["query"]=> string(7) "a=1&b=2" } --> http://foo.com#bar: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "foo.com" ["fragment"]=> string(3) "bar" } --> scheme:: array(1) { ["scheme"]=> string(6) "scheme" } --> foo+bar://baz@bang/bla: array(4) { ["scheme"]=> string(7) "foo+bar" ["host"]=> string(4) "bang" ["user"]=> string(3) "baz" ["path"]=> string(4) "/bla" } --> gg:9130731: array(2) { ["scheme"]=> string(2) "gg" ["path"]=> string(7) "9130731" } --> http://user:@pass@host/path?argument?value#etc: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(4) "host" ["user"]=> string(4) "user" ["pass"]=> string(5) "@pass" ["path"]=> string(5) "/path" ["query"]=> string(14) "argument?value" ["fragment"]=> string(3) "etc" } --> http://10.10.10.10/:80: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "10.10.10.10" ["path"]=> string(4) "/:80" } --> http://x:?: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(1) "x" } --> x:blah.com: array(2) { ["scheme"]=> string(1) "x" ["path"]=> string(8) "blah.com" } --> x:/blah.com: array(2) { ["scheme"]=> string(1) "x" ["path"]=> string(9) "/blah.com" } --> x://::abc/?: array(3) { ["scheme"]=> string(1) "x" ["host"]=> string(1) ":" ["path"]=> string(1) "/" } --> http://::?: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(1) ":" } --> x://::6.5: array(3) { ["scheme"]=> string(1) "x" ["host"]=> string(1) ":" ["port"]=> int(6) } --> http://?:/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(1) "?" ["path"]=> string(1) "/" } --> http://@?:/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(1) "?" ["user"]=> string(0) "" ["path"]=> string(1) "/" } --> file:///:: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(2) "/:" } --> file:///a:/: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(3) "a:/" } --> file:///ab:/: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(5) "/ab:/" } --> file:///a:/: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(3) "a:/" } --> file:///@:/: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(3) "@:/" } --> file:///:80/: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(5) "/:80/" } --> []: array(1) { ["path"]=> string(2) "[]" } --> http://[x:80]/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(6) "[x:80]" ["path"]=> string(1) "/" } --> : array(1) { ["path"]=> string(0) "" } --> /: array(1) { ["path"]=> string(1) "/" } --> http:///blah.com: Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80: Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80: Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80: Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://:: Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/: Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/: Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/: Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://?: Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?:: Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:?: Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456: Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef: Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37: array(1) { [u"path"]=> unicode(12) "64.246.30.37" } --> http://64.246.30.37: array(2) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(12) "64.246.30.37" } --> http://64.246.30.37/: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(12) "64.246.30.37" [u"path"]=> unicode(1) "/" } --> 64.246.30.37/: array(1) { [u"path"]=> unicode(13) "64.246.30.37/" } --> 64.246.30.37:80/: array(3) { [u"host"]=> unicode(12) "64.246.30.37" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" } --> php.net: array(1) { [u"path"]=> unicode(7) "php.net" } --> php.net/: array(1) { [u"path"]=> unicode(8) "php.net/" } --> http://php.net: array(2) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(7) "php.net" } --> http://php.net/: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(7) "php.net" [u"path"]=> unicode(1) "/" } --> www.php.net: array(1) { [u"path"]=> unicode(11) "www.php.net" } --> www.php.net/: array(1) { [u"path"]=> unicode(12) "www.php.net/" } --> http://www.php.net: array(2) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" } --> http://www.php.net/: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(1) "/" } --> www.php.net:80: array(2) { [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) } --> http://www.php.net:80: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) } --> http://www.php.net:80/: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" } --> http://www.php.net/index.php: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(10) "/index.php" } --> www.php.net/?: array(1) { [u"path"]=> unicode(12) "www.php.net/" } --> www.php.net:80/?: array(3) { [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" } --> http://www.php.net/?: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(1) "/" } --> http://www.php.net:80/?: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" } --> http://www.php.net:80/index.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" } --> http://www.php.net:80/foo/bar/index.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(18) "/foo/bar/index.php" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" [u"query"]=> unicode(37) "lots=1&of=2&parameters=3&too=4&here=5" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(45) "/this/is/a/very/deep/directory/structure/and/" } --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(53) "/this/is/a/very/deep/directory/structure/and/file.php" } --> http://www.php.net:80/this/../a/../deep/directory: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(28) "/this/../a/../deep/directory" } --> http://www.php.net:80/this/../a/../deep/directory/: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(29) "/this/../a/../deep/directory/" } --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(42) "/this/is/a/very/deep/directory/../file.php" } --> http://www.php.net:80/index.php: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" } --> http://www.php.net:80/index.php?: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" } --> http://www.php.net:80/#foo: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" [u"fragment"]=> unicode(3) "foo" } --> http://www.php.net:80/?#: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" } --> http://www.php.net:80/?test=1: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" [u"query"]=> unicode(6) "test=1" } --> http://www.php.net/?test=1&: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(1) "/" [u"query"]=> unicode(7) "test=1&" } --> http://www.php.net:80/?&: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(1) "/" [u"query"]=> unicode(1) "&" } --> http://www.php.net:80/index.php?test=1&: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(7) "test=1&" } --> http://www.php.net/index.php?&: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(1) "&" } --> http://www.php.net:80/index.php?foo&: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(4) "foo&" } --> http://www.php.net/index.php?&foo: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(4) "&foo" } --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" } --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"user"]=> unicode(6) "secret" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"user"]=> unicode(6) "secret" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"pass"]=> unicode(7) "hideout" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"user"]=> unicode(6) "secret" [u"pass"]=> unicode(7) "hideout" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"user"]=> unicode(14) "secret@hideout" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"user"]=> unicode(6) "secret" [u"pass"]=> unicode(7) "hid:out" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> nntp://news.php.net: array(2) { [u"scheme"]=> unicode(4) "nntp" [u"host"]=> unicode(12) "news.php.net" } --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { [u"scheme"]=> unicode(3) "ftp" [u"host"]=> unicode(11) "ftp.gnu.org" [u"path"]=> unicode(22) "/gnu/glic/glibc.tar.gz" } --> zlib:http://foo@bar: array(2) { [u"scheme"]=> unicode(4) "zlib" [u"path"]=> unicode(14) "http://foo@bar" } --> zlib:filename.txt: array(2) { [u"scheme"]=> unicode(4) "zlib" [u"path"]=> unicode(12) "filename.txt" } --> zlib:/path/to/my/file/file.txt: array(2) { [u"scheme"]=> unicode(4) "zlib" [u"path"]=> unicode(25) "/path/to/my/file/file.txt" } --> foo://foo@bar: array(3) { [u"scheme"]=> unicode(3) "foo" [u"host"]=> unicode(3) "bar" [u"user"]=> unicode(3) "foo" } --> mailto:me@mydomain.com: array(2) { [u"scheme"]=> unicode(6) "mailto" [u"path"]=> unicode(15) "me@mydomain.com" } --> /foo.php?a=b&c=d: array(2) { [u"path"]=> unicode(8) "/foo.php" [u"query"]=> unicode(7) "a=b&c=d" } --> foo.php?a=b&c=d: array(2) { [u"path"]=> unicode(7) "foo.php" [u"query"]=> unicode(7) "a=b&c=d" } --> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(15) "www.example.com" [u"port"]=> int(8080) [u"user"]=> unicode(4) "user" [u"pass"]=> unicode(6) "passwd" [u"query"]=> unicode(12) "bar=1&boom=0" } --> file:///path/to/file: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(13) "/path/to/file" } --> file://path/to/file: array(3) { [u"scheme"]=> unicode(4) "file" [u"host"]=> unicode(4) "path" [u"path"]=> unicode(8) "/to/file" } --> file:/path/to/file: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(13) "/path/to/file" } --> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(7) "1.2.3.4" [u"path"]=> unicode(8) "/abc.asp" [u"query"]=> unicode(7) "a=1&b=2" } --> http://foo.com#bar: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(7) "foo.com" [u"fragment"]=> unicode(3) "bar" } --> scheme:: array(1) { [u"scheme"]=> unicode(6) "scheme" } --> foo+bar://baz@bang/bla: array(4) { [u"scheme"]=> unicode(7) "foo+bar" [u"host"]=> unicode(4) "bang" [u"user"]=> unicode(3) "baz" [u"path"]=> unicode(4) "/bla" } --> gg:9130731: array(2) { [u"scheme"]=> unicode(2) "gg" [u"path"]=> unicode(7) "9130731" } --> http://user:@pass@host/path?argument?value#etc: array(7) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(4) "host" [u"user"]=> unicode(4) "user" [u"pass"]=> unicode(5) "@pass" [u"path"]=> unicode(5) "/path" [u"query"]=> unicode(14) "argument?value" [u"fragment"]=> unicode(3) "etc" } --> http://10.10.10.10/:80: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "10.10.10.10" [u"path"]=> unicode(4) "/:80" } --> http://x:?: array(2) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(1) "x" } --> x:blah.com: array(2) { [u"scheme"]=> unicode(1) "x" [u"path"]=> unicode(8) "blah.com" } --> x:/blah.com: array(2) { [u"scheme"]=> unicode(1) "x" [u"path"]=> unicode(9) "/blah.com" } --> x://::abc/?: array(3) { [u"scheme"]=> unicode(1) "x" [u"host"]=> unicode(1) ":" [u"path"]=> unicode(1) "/" } --> http://::?: array(2) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(1) ":" } --> x://::6.5: array(3) { [u"scheme"]=> unicode(1) "x" [u"host"]=> unicode(1) ":" [u"port"]=> int(6) } --> http://?:/: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(1) "?" [u"path"]=> unicode(1) "/" } --> http://@?:/: array(4) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(1) "?" [u"user"]=> unicode(0) "" [u"path"]=> unicode(1) "/" } --> file:///:: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(2) "/:" } --> file:///a:/: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(3) "a:/" } --> file:///ab:/: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(5) "/ab:/" } --> file:///a:/: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(3) "a:/" } --> file:///@:/: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(3) "@:/" } --> file:///:80/: array(2) { [u"scheme"]=> unicode(4) "file" [u"path"]=> unicode(5) "/:80/" } --> []: array(1) { [u"path"]=> unicode(2) "[]" } --> http://[x:80]/: array(3) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(6) "[x:80]" [u"path"]=> unicode(1) "/" } --> : array(1) { [u"path"]=> unicode(0) "" } --> /: array(1) { [u"path"]=> unicode(1) "/" } --> http:///blah.com: Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80: Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80: Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80: Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://:: Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/: Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/: Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/: Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://?: Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?:: Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:?: Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456: Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef: Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_009.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_009.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_009.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_FRAGMENT as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_FRAGMENT as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_FRAGMENT)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : string(3) "foo" --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : string(3) "bar" --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : string(3) "etc" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : unicode(3) "foo" --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(16) "some_page_ref123" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : unicode(3) "bar" --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : unicode(3) "etc" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/urlencode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/urlencode_variation_001.phpt +++ php-src/ext/standard/tests/url/urlencode_variation_001.phpt --TEST-- Test urlencode() function : usage variations - <type here specifics of this variation> --FILE-- <?php /* Prototype : proto string urlencode(string str) * Description: URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing urlencode() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( urlencode($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing urlencode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - urlencode() expects parameter 1 to be string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing urlencode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(64) Error: 8 - Undefined variable: unset_var, %s(67) Arg value 0 string(1) "0" Arg value 1 string(1) "1" Arg value 12345 string(5) "12345" Arg value -2345 string(5) "-2345" Arg value 10.5 string(4) "10.5" Arg value -10.5 string(5) "-10.5" Arg value 101234567000 string(12) "101234567000" Arg value 1.07654321E-9 string(13) "1.07654321E-9" Arg value 0.5 string(3) "0.5" Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Error: 8 - Array to string conversion, %s(73) Arg value Array Error: 2 - urlencode() expects parameter 1 to be binary string, array given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value 1 string(1) "1" Arg value string(0) "" Arg value Error: 2 - urlencode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Arg value Error: 2 - urlencode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(74) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(73) Arg value Error: 2 - urlencode() expects parameter 1 to be binary string, object given, %s(74) NULL Arg value string(0) "" Arg value string(0) "" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_006.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_006.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_006.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PASS as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_PASS as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_PASS)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hid:out" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(6) "passwd" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : string(5) "@pass" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(7) "hideout" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(7) "hideout" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(7) "hid:out" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : NULL --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : unicode(6) "passwd" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : NULL --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : unicode(5) "@pass" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_variation_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_variation_002.phpt +++ php-src/ext/standard/tests/url/parse_url_variation_002.phpt --TEST-- Test parse_url() function : usage variations - unexpected type for arg 2 --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); echo "*** Testing parse_url() : usage variations ***\n"; // Initialise function arguments not being substituted (if any) $url = 'http://secret:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123'; //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // string data "string", 'string', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for url_component foreach($values as $value) { echo "\nArg value $value \n"; var_dump( parse_url($url, $value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing parse_url() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(61) Error: 8 - Undefined variable: unset_var, %s(64) Arg value 10.5 Error: 2 - parse_url(): Invalid URL component identifier 10, %s(71) bool(false) Arg value -10.5 array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["user"]=> string(6) "secret" ["pass"]=> string(7) "hideout" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } Arg value 101234567000 Error: 2 - parse_url(): Invalid URL component identifier 2147483647, %s(71) bool(false) Arg value 1.07654321E-9 string(4) "http" Arg value 0.5 string(4) "http" Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Arg value string(4) "http" Arg value string(4) "http" Arg value 1 string(11) "www.php.net" Arg value string(4) "http" Arg value 1 string(11) "www.php.net" Arg value string(4) "http" Arg value Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) NULL Arg value Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) NULL Arg value string Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) NULL Arg value string Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(70) Arg value Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(71) NULL Arg value string(4) "http" Arg value string(4) "http" Done --UEXPECTF-- *** Testing parse_url() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(61) Error: 8 - Undefined variable: unset_var, %s(64) Arg value 10.5 Error: 2 - parse_url(): Invalid URL component identifier 10, %s(71) bool(false) Arg value -10.5 array(8) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"user"]=> unicode(6) "secret" [u"pass"]=> unicode(7) "hideout" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } Arg value 101234567000 Error: 2 - parse_url(): Invalid URL component identifier 2147483647, %s(71) bool(false) Arg value 1.07654321E-9 unicode(4) "http" Arg value 0.5 unicode(4) "http" Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Error: 8 - Array to string conversion, %s(70) Arg value Array Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) NULL Arg value unicode(4) "http" Arg value unicode(4) "http" Arg value 1 unicode(11) "www.php.net" Arg value unicode(4) "http" Arg value 1 unicode(11) "www.php.net" Arg value unicode(4) "http" Arg value Error: 2 - parse_url() expects parameter 2 to be long, Unicode string given, %s(71) NULL Arg value Error: 2 - parse_url() expects parameter 2 to be long, Unicode string given, %s(71) NULL Arg value string Error: 2 - parse_url() expects parameter 2 to be long, Unicode string given, %s(71) NULL Arg value string Error: 2 - parse_url() expects parameter 2 to be long, Unicode string given, %s(71) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(70) Arg value Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(71) NULL Arg value unicode(4) "http" Arg value unicode(4) "http" Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_error_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_error_002.phpt +++ php-src/ext/standard/tests/url/parse_url_error_002.phpt --TEST-- Test parse_url() function: url component specifier out of range --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ echo "*** Testing parse_url() : error conditions: url component specifier out of range ***\n"; $url = 'http://secret:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123'; echo "--> Below range:"; var_dump(parse_url($url, -1)); echo "\n\n--> Above range:"; var_dump(parse_url($url, 99)); echo "Done" ?> --EXPECTF-- *** Testing parse_url() : error conditions: url component specifier out of range *** --> Below range:array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) ["user"]=> string(6) "secret" ["pass"]=> string(7) "hideout" ["path"]=> string(10) "/index.php" ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" ["fragment"]=> string(16) "some_page_ref123" } --> Above range: Warning: parse_url(): Invalid URL component identifier 99 in %s on line 15 bool(false) Done --UEXPECTF-- *** Testing parse_url() : error conditions: url component specifier out of range *** --> Below range:array(8) { [u"scheme"]=> unicode(4) "http" [u"host"]=> unicode(11) "www.php.net" [u"port"]=> int(80) [u"user"]=> unicode(6) "secret" [u"pass"]=> unicode(7) "hideout" [u"path"]=> unicode(10) "/index.php" [u"query"]=> unicode(31) "test=1&test2=char&test3=mixesCI" [u"fragment"]=> unicode(16) "some_page_ref123" } --> Above range: Warning: parse_url(): Invalid URL component identifier 99 in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_002.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_002.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_002.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_SCHEME)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : string(4) "http" --> http://64.246.30.37/ : string(4) "http" --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : string(4) "http" --> http://php.net/ : string(4) "http" --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : string(4) "http" --> http://www.php.net/ : string(4) "http" --> www.php.net:80 : NULL --> http://www.php.net:80 : string(4) "http" --> http://www.php.net:80/ : string(4) "http" --> http://www.php.net/index.php : string(4) "http" --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : string(4) "http" --> http://www.php.net:80/? : string(4) "http" --> http://www.php.net:80/index.php : string(4) "http" --> http://www.php.net:80/foo/bar/index.php : string(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : string(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http" --> http://www.php.net:80/this/../a/../deep/directory : string(4) "http" --> http://www.php.net:80/this/../a/../deep/directory/ : string(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(4) "http" --> http://www.php.net:80/index.php : string(4) "http" --> http://www.php.net:80/index.php? : string(4) "http" --> http://www.php.net:80/#foo : string(4) "http" --> http://www.php.net:80/?# : string(4) "http" --> http://www.php.net:80/?test=1 : string(4) "http" --> http://www.php.net/?test=1& : string(4) "http" --> http://www.php.net:80/?& : string(4) "http" --> http://www.php.net:80/index.php?test=1& : string(4) "http" --> http://www.php.net/index.php?& : string(4) "http" --> http://www.php.net:80/index.php?foo& : string(4) "http" --> http://www.php.net/index.php?&foo : string(4) "http" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(4) "http" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" --> nntp://news.php.net : string(4) "nntp" --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(3) "ftp" --> zlib:http://foo@bar : string(4) "zlib" --> zlib:filename.txt : string(4) "zlib" --> zlib:/path/to/my/file/file.txt : string(4) "zlib" --> foo://foo@bar : string(3) "foo" --> mailto:me@mydomain.com : string(6) "mailto" --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "http" --> file:///path/to/file : string(4) "file" --> file://path/to/file : string(4) "file" --> file:/path/to/file : string(4) "file" --> http://1.2.3.4:/abc.asp?a=1&b=2 : string(4) "http" --> http://foo.com#bar : string(4) "http" --> scheme: : string(6) "scheme" --> foo+bar://baz@bang/bla : string(7) "foo+bar" --> gg:9130731 : string(2) "gg" --> http://user:@pass@host/path?argument?value#etc : string(4) "http" --> http://10.10.10.10/:80 : string(4) "http" --> http://x:? : string(4) "http" --> x:blah.com : string(1) "x" --> x:/blah.com : string(1) "x" --> x://::abc/? : string(1) "x" --> http://::? : string(4) "http" --> x://::6.5 : string(1) "x" --> http://?:/ : string(4) "http" --> http://@?:/ : string(4) "http" --> file:///: : string(4) "file" --> file:///a:/ : string(4) "file" --> file:///ab:/ : string(4) "file" --> file:///a:/ : string(4) "file" --> file:///@:/ : string(4) "file" --> file:///:80/ : string(4) "file" --> [] : NULL --> http://[x:80]/ : string(4) "http" --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : unicode(4) "http" --> http://64.246.30.37/ : unicode(4) "http" --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : unicode(4) "http" --> http://php.net/ : unicode(4) "http" --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : unicode(4) "http" --> http://www.php.net/ : unicode(4) "http" --> www.php.net:80 : NULL --> http://www.php.net:80 : unicode(4) "http" --> http://www.php.net:80/ : unicode(4) "http" --> http://www.php.net/index.php : unicode(4) "http" --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : unicode(4) "http" --> http://www.php.net:80/? : unicode(4) "http" --> http://www.php.net:80/index.php : unicode(4) "http" --> http://www.php.net:80/foo/bar/index.php : unicode(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : unicode(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : unicode(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : unicode(4) "http" --> http://www.php.net:80/this/../a/../deep/directory : unicode(4) "http" --> http://www.php.net:80/this/../a/../deep/directory/ : unicode(4) "http" --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : unicode(4) "http" --> http://www.php.net:80/index.php : unicode(4) "http" --> http://www.php.net:80/index.php? : unicode(4) "http" --> http://www.php.net:80/#foo : unicode(4) "http" --> http://www.php.net:80/?# : unicode(4) "http" --> http://www.php.net:80/?test=1 : unicode(4) "http" --> http://www.php.net/?test=1& : unicode(4) "http" --> http://www.php.net:80/?& : unicode(4) "http" --> http://www.php.net:80/index.php?test=1& : unicode(4) "http" --> http://www.php.net/index.php?& : unicode(4) "http" --> http://www.php.net:80/index.php?foo& : unicode(4) "http" --> http://www.php.net/index.php?&foo : unicode(4) "http" --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : unicode(4) "http" --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(4) "http" --> nntp://news.php.net : unicode(4) "nntp" --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : unicode(3) "ftp" --> zlib:http://foo@bar : unicode(4) "zlib" --> zlib:filename.txt : unicode(4) "zlib" --> zlib:/path/to/my/file/file.txt : unicode(4) "zlib" --> foo://foo@bar : unicode(3) "foo" --> mailto:me@mydomain.com : unicode(6) "mailto" --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : unicode(4) "http" --> file:///path/to/file : unicode(4) "file" --> file://path/to/file : unicode(4) "file" --> file:/path/to/file : unicode(4) "file" --> http://1.2.3.4:/abc.asp?a=1&b=2 : unicode(4) "http" --> http://foo.com#bar : unicode(4) "http" --> scheme: : unicode(6) "scheme" --> foo+bar://baz@bang/bla : unicode(7) "foo+bar" --> gg:9130731 : unicode(2) "gg" --> http://user:@pass@host/path?argument?value#etc : unicode(4) "http" --> http://10.10.10.10/:80 : unicode(4) "http" --> http://x:? : unicode(4) "http" --> x:blah.com : unicode(1) "x" --> x:/blah.com : unicode(1) "x" --> x://::abc/? : unicode(1) "x" --> http://::? : unicode(4) "http" --> x://::6.5 : unicode(1) "x" --> http://?:/ : unicode(4) "http" --> http://@?:/ : unicode(4) "http" --> file:///: : unicode(4) "file" --> file:///a:/ : unicode(4) "file" --> file:///ab:/ : unicode(4) "file" --> file:///a:/ : unicode(4) "file" --> file:///@:/ : unicode(4) "file" --> file:///:80/ : unicode(4) "file" --> [] : NULL --> http://[x:80]/ : unicode(4) "http" --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_decode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_decode_error_001.phpt +++ php-src/ext/standard/tests/url/base64_decode_error_001.phpt --TEST-- Test base64_decode() function : error conditions - wrong number of args --FILE-- <?php /* Prototype : proto string base64_decode(string str[, bool strict]) * Description: Decodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ echo "*** Testing base64_decode() : error conditions ***\n"; // Zero arguments echo "\n-- Testing base64_decode() function with Zero arguments --\n"; var_dump( base64_decode() ); //Test base64_decode with one more than the expected number of arguments echo "\n-- Testing base64_decode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $strict = true; $extra_arg = 10; var_dump( base64_decode($str, $strict, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing base64_decode() : error conditions *** -- Testing base64_decode() function with Zero arguments -- Warning: base64_decode() expects at least 1 parameter, 0 given in %s on line 12 NULL -- Testing base64_decode() function with more than expected no. of arguments -- Warning: base64_decode() expects at most 2 parameters, 3 given in %s on line 19 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/parse_url_basic_005.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/parse_url_basic_005.phpt +++ php-src/ext/standard/tests/url/parse_url_basic_005.phpt --TEST-- Test parse_url() function: Parse a load of URLs without specifying PHP_URL_USER as the URL component --FILE-- <?php /* Prototype : proto mixed parse_url(string url, [int url_component]) * Description: Parse a URL and return its components * Source code: ext/standard/url.c * Alias to functions: */ /* * Parse a load of URLs without specifying PHP_URL_USER as the URL component */ include_once(dirname(__FILE__) . '/urls.inc'); foreach ($urls as $url) { echo "--> $url : "; var_dump(parse_url($url, PHP_URL_USER)); } echo "Done"; ?> --EXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : string(3) "foo" --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "user" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : string(3) "baz" --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : string(4) "user" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : string(0) "" --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done --UEXPECTF-- --> 64.246.30.37 : NULL --> http://64.246.30.37 : NULL --> http://64.246.30.37/ : NULL --> 64.246.30.37/ : NULL --> 64.246.30.37:80/ : NULL --> php.net : NULL --> php.net/ : NULL --> http://php.net : NULL --> http://php.net/ : NULL --> www.php.net : NULL --> www.php.net/ : NULL --> http://www.php.net : NULL --> http://www.php.net/ : NULL --> www.php.net:80 : NULL --> http://www.php.net:80 : NULL --> http://www.php.net:80/ : NULL --> http://www.php.net/index.php : NULL --> www.php.net/? : NULL --> www.php.net:80/? : NULL --> http://www.php.net/? : NULL --> http://www.php.net:80/? : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/foo/bar/index.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5 : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL --> http://www.php.net:80/this/../a/../deep/directory : NULL --> http://www.php.net:80/this/../a/../deep/directory/ : NULL --> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL --> http://www.php.net:80/index.php : NULL --> http://www.php.net:80/index.php? : NULL --> http://www.php.net:80/#foo : NULL --> http://www.php.net:80/?# : NULL --> http://www.php.net:80/?test=1 : NULL --> http://www.php.net/?test=1& : NULL --> http://www.php.net:80/?& : NULL --> http://www.php.net:80/index.php?test=1& : NULL --> http://www.php.net/index.php?& : NULL --> http://www.php.net:80/index.php?foo& : NULL --> http://www.php.net/index.php?&foo : NULL --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(6) "secret" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(6) "secret" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(6) "secret" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(14) "secret@hideout" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : unicode(6) "secret" --> nntp://news.php.net : NULL --> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL --> zlib:http://foo@bar : NULL --> zlib:filename.txt : NULL --> zlib:/path/to/my/file/file.txt : NULL --> foo://foo@bar : unicode(3) "foo" --> mailto:me@mydomain.com : NULL --> /foo.php?a=b&c=d : NULL --> foo.php?a=b&c=d : NULL --> http://user:passwd@www.example.com:8080?bar=1&boom=0 : unicode(4) "user" --> file:///path/to/file : NULL --> file://path/to/file : NULL --> file:/path/to/file : NULL --> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL --> http://foo.com#bar : NULL --> scheme: : NULL --> foo+bar://baz@bang/bla : unicode(3) "baz" --> gg:9130731 : NULL --> http://user:@pass@host/path?argument?value#etc : unicode(4) "user" --> http://10.10.10.10/:80 : NULL --> http://x:? : NULL --> x:blah.com : NULL --> x:/blah.com : NULL --> x://::abc/? : NULL --> http://::? : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : unicode(0) "" --> file:///: : NULL --> file:///a:/ : NULL --> file:///ab:/ : NULL --> file:///a:/ : NULL --> file:///@:/ : NULL --> file:///:80/ : NULL --> [] : NULL --> http://[x:80]/ : NULL --> : NULL --> / : NULL --> http:///blah.com : Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 bool(false) --> http://:80 : Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 bool(false) --> http://user@:80 : Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 bool(false) --> http://user:pass@:80 : Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 bool(false) --> http://: : Warning: parse_url(http://:): Unable to parse URL in %s on line 15 bool(false) --> http://@/ : Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 bool(false) --> http://@:/ : Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 bool(false) --> http://:/ : Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 bool(false) --> http://? : Warning: parse_url(http://?): Unable to parse URL in %s on line 15 bool(false) --> http://?: : Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 bool(false) --> http://:? : Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:123456 : Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 bool(false) --> http://blah.com:abcdef : Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/urlencode_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/urlencode_error_001.phpt +++ php-src/ext/standard/tests/url/urlencode_error_001.phpt --TEST-- Test urlencode() function : error conditions --FILE-- <?php /* Prototype : proto string urlencode(string str) * Description: URL-encodes string * Source code: ext/standard/url.c * Alias to functions: */ // NB: basic functionality tested in tests/strings/001.phpt echo "*** Testing urlencode() : error conditions ***\n"; // Zero arguments echo "\n-- Testing urlencode() function with Zero arguments --\n"; var_dump( urlencode() ); //Test urlencode with one more than the expected number of arguments echo "\n-- Testing urlencode() function with more than expected no. of arguments --\n"; $str = 'string_val'; $extra_arg = 10; var_dump( urlencode($str, $extra_arg) ); echo "Done"; ?> --EXPECTF-- *** Testing urlencode() : error conditions *** -- Testing urlencode() function with Zero arguments -- Warning: urlencode() expects exactly 1 parameter, 0 given in %s on line 14 NULL -- Testing urlencode() function with more than expected no. of arguments -- Warning: urlencode() expects exactly 1 parameter, 2 given in %s on line 20 NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/base64_encode_variation_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/url/base64_encode_variation_001.phpt +++ php-src/ext/standard/tests/url/base64_encode_variation_001.phpt --TEST-- Test base64_encode() function : usage variations - unexpected types for argument 1 --FILE-- <?php /* Prototype : proto string base64_encode(string str) * Description: Encodes string using MIME base64 algorithm * Source code: ext/standard/base64.c * Alias to functions: */ echo "*** Testing base64_encode() : usage variations ***\n"; function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } set_error_handler('test_error_handler'); // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); //array of values to iterate over $values = array( // int data 0, 1, 12345, -2345, // float data 10.5, -10.5, 10.1234567e10, 10.7654321E-10, .5, // array data array(), array(0), array(1), array(1, 2), array('color' => 'red', 'item' => 'pen'), // null data NULL, null, // boolean data true, false, TRUE, FALSE, // empty data "", '', // object data new stdclass(), // undefined data $undefined_var, // unset data $unset_var, ); // loop through each element of the array for str foreach($values as $value) { echo "\nArg value $value \n"; var_dump( base64_encode($value) ); }; echo "Done"; ?> --EXPECTF-- *** Testing base64_encode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(63) Error: 8 - Undefined variable: unset_var, %s(66) Arg value 0 string(4) "MA==" Arg value 1 string(4) "MQ==" Arg value 12345 string(8) "MTIzNDU=" Arg value -2345 string(8) "LTIzNDU=" Arg value 10.5 string(8) "MTAuNQ==" Arg value -10.5 string(8) "LTEwLjU=" Arg value 101234567000 string(16) "MTAxMjM0NTY3MDAw" Arg value 1.07654321E-9 string(20) "MS4wNzY1NDMyMUUtOQ==" Arg value 0.5 string(4) "MC41" Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(4) "MQ==" Arg value string(0) "" Arg value 1 string(4) "MQ==" Arg value string(0) "" Arg value string(0) "" Arg value string(0) "" Error: 4096 - Object of class stdClass could not be converted to string, %s(72) Arg value Error: 2 - base64_encode() expects parameter 1 to be string, object given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Done --UEXPECTF-- *** Testing base64_encode() : usage variations *** Error: 8 - Undefined variable: undefined_var, %s(63) Error: 8 - Undefined variable: unset_var, %s(66) Arg value 0 string(4) "MA==" Arg value 1 string(4) "MQ==" Arg value 12345 string(8) "MTIzNDU=" Arg value -2345 string(8) "LTIzNDU=" Arg value 10.5 string(8) "MTAuNQ==" Arg value -10.5 string(8) "LTEwLjU=" Arg value 101234567000 string(16) "MTAxMjM0NTY3MDAw" Arg value 1.07654321E-9 string(20) "MS4wNzY1NDMyMUUtOQ==" Arg value 0.5 string(4) "MC41" Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be binary string, array given, %s(73) NULL Error: 8 - Array to string conversion, %s(72) Arg value Array Error: 2 - base64_encode() expects parameter 1 to be binary string, array given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Arg value 1 string(4) "MQ==" Arg value string(0) "" Arg value 1 string(4) "MQ==" Arg value string(0) "" Arg value Error: 2 - base64_encode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(73) NULL Arg value Error: 2 - base64_encode() expects parameter 1 to be strictly a binary string, Unicode string given, %s(73) NULL Error: 4096 - Object of class stdClass could not be converted to string, %s(72) Arg value Error: 2 - base64_encode() expects parameter 1 to be binary string, object given, %s(73) NULL Arg value string(0) "" Arg value string(0) "" Done
« previous php.cvs (#49576) next »