diff options
Diffstat (limited to 'ext/standard')
28 files changed, 297 insertions, 1311 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 646005ebc7..528e4f65b9 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -128,6 +128,8 @@ typedef struct _user_tick_function_entry { static void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry); static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry); +static HashTable basic_submodules; + #undef sprintf /* {{{ arginfo */ @@ -3513,6 +3515,34 @@ PHPAPI double php_get_inf(void) /* {{{ */ } /* }}} */ +#define BASIC_MINIT_SUBMODULE(module) \ + if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) == SUCCESS) {\ + BASIC_ADD_SUBMODULE(module); \ + } + +#define BASIC_ADD_SUBMODULE(module) \ + zend_hash_add_empty_element(&basic_submodules, #module, strlen(#module)); + +#define BASIC_RINIT_SUBMODULE(module) \ + if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \ + PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU); \ + } + +#define BASIC_MINFO_SUBMODULE(module) \ + if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \ + PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); \ + } + +#define BASIC_RSHUTDOWN_SUBMODULE(module) \ + if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \ + PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \ + } + +#define BASIC_MSHUTDOWN_SUBMODULE(module) \ + if (zend_hash_exists(&basic_submodules, #module, strlen(#module))) { \ + PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \ + } + PHP_MINIT_FUNCTION(basic) /* {{{ */ { #ifdef ZTS @@ -3527,6 +3557,8 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ #endif #endif + zend_hash_init(&basic_submodules, 0, NULL, NULL, 1); + BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C); REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT); @@ -3586,39 +3618,41 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ register_html_constants(INIT_FUNC_ARGS_PASSTHRU); register_string_constants(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(standard_filters)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(user_filters)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_ADD_SUBMODULE(dl) + BASIC_ADD_SUBMODULE(mail) + BASIC_MINIT_SUBMODULE(file) + BASIC_MINIT_SUBMODULE(pack) + BASIC_MINIT_SUBMODULE(browscap) + BASIC_MINIT_SUBMODULE(standard_filters) + BASIC_MINIT_SUBMODULE(user_filters) #if defined(HAVE_LOCALECONV) && defined(ZTS) - PHP_MINIT(localeconv)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(localeconv) #endif #if defined(HAVE_NL_LANGINFO) - PHP_MINIT(nl_langinfo)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(nl_langinfo) #endif #if HAVE_CRYPT - PHP_MINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(crypt) #endif - PHP_MINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(lcg) - PHP_MINIT(dir)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(dir) #ifdef HAVE_SYSLOG_H - PHP_MINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(syslog) #endif - PHP_MINIT(array)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(assert)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(array) + BASIC_MINIT_SUBMODULE(assert) + BASIC_MINIT_SUBMODULE(url_scanner_ex) #ifdef PHP_CAN_SUPPORT_PROC_OPEN - PHP_MINIT(proc_open)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(proc_open) #endif - PHP_MINIT(user_streams)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(imagetypes)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(user_streams) + BASIC_MINIT_SUBMODULE(imagetypes) php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC); php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC); @@ -3633,7 +3667,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS - PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_MINIT_SUBMODULE(dns) # endif #endif @@ -3664,19 +3698,20 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */ php_unregister_url_stream_wrapper("ftp" TSRMLS_CC); #endif - PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(file)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(standard_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_MSHUTDOWN_SUBMODULE(browscap) + BASIC_MSHUTDOWN_SUBMODULE(array) + BASIC_MSHUTDOWN_SUBMODULE(assert) + BASIC_MSHUTDOWN_SUBMODULE(url_scanner_ex) + BASIC_MSHUTDOWN_SUBMODULE(file) + BASIC_MSHUTDOWN_SUBMODULE(standard_filters) #if defined(HAVE_LOCALECONV) && defined(ZTS) - PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_MSHUTDOWN_SUBMODULE(localeconv) #endif #if HAVE_CRYPT - PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_MSHUTDOWN_SUBMODULE(crypt) #endif + zend_hash_destroy(&basic_submodules); return SUCCESS; } /* }}} */ @@ -3705,10 +3740,10 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU); #ifdef HAVE_SYSLOG_H - PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_RINIT_SUBMODULE(syslog) #endif - PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU); - PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU); + BASIC_RINIT_SUBMODULE(dir) + BASIC_RINIT_SUBMODULE(url_scanner_ex) /* Setup default context */ FG(default_context) = NULL; @@ -3756,14 +3791,14 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */ PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #ifdef HAVE_SYSLOG_H #ifdef PHP_WIN32 - PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_RSHUTDOWN_SUBMODULE(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif #endif - PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_RSHUTDOWN(streams)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_RSHUTDOWN_SUBMODULE(assert) + BASIC_RSHUTDOWN_SUBMODULE(url_scanner_ex) + BASIC_RSHUTDOWN_SUBMODULE(streams) #ifdef PHP_WIN32 - PHP_RSHUTDOWN(win32_core_globals)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_RSHUTDOWN_SUBMODULE(win32_core_globals) #endif if (BG(user_tick_functions)) { @@ -3772,8 +3807,8 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */ BG(user_tick_functions) = NULL; } - PHP_RSHUTDOWN(user_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_RSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU); + BASIC_RSHUTDOWN_SUBMODULE(user_filters) + BASIC_RSHUTDOWN_SUBMODULE(browscap) BG(page_uid) = -1; BG(page_gid) = -1; @@ -3784,10 +3819,10 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */ PHP_MINFO_FUNCTION(basic) /* {{{ */ { php_info_print_table_start(); - PHP_MINFO(dl)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); - PHP_MINFO(mail)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + BASIC_MINFO_SUBMODULE(dl) + BASIC_MINFO_SUBMODULE(mail) php_info_print_table_end(); - PHP_MINFO(assert)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); + BASIC_MINFO_SUBMODULE(assert) } /* }}} */ @@ -5050,12 +5085,12 @@ void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ } /* }}} */ -/* {{{ proto void register_shutdown_function(string function_name) U +/* {{{ proto void register_shutdown_function(callback function) U Register a user-level function to be called on request termination */ PHP_FUNCTION(register_shutdown_function) { php_shutdown_function_entry shutdown_function_entry; - char *function_name = NULL; + char *callback_name = NULL; int i; shutdown_function_entry.arg_count = ZEND_NUM_ARGS(); @@ -5072,8 +5107,8 @@ PHP_FUNCTION(register_shutdown_function) } /* Prevent entering of anything but valid callback (syntax check only!) */ - if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &function_name TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", function_name); + if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name); efree(shutdown_function_entry.arguments); RETVAL_FALSE; } else { @@ -5087,8 +5122,8 @@ PHP_FUNCTION(register_shutdown_function) } zend_hash_next_index_insert(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL); } - if (function_name) { - efree(function_name); + if (callback_name) { + efree(callback_name); } } /* }}} */ diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h index 7bdb41e608..22ac822527 100644 --- a/ext/standard/credits_ext.h +++ b/ext/standard/credits_ext.h @@ -17,8 +17,8 @@ CREDIT_LINE("COM and .Net", "Wez Furlong"); CREDIT_LINE("ctype", "Hartmut Holzgraefe"); CREDIT_LINE("cURL", "Sterling Hughes"); CREDIT_LINE("Date/Time Support", "Derick Rethans"); -CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann"); CREDIT_LINE("DBA", "Sascha Schumann, Marcus Boerger"); +CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann"); CREDIT_LINE("DOM", "Christian Stocker, Rob Richards, Marcus Boerger"); CREDIT_LINE("enchant", "Pierre-Alain Joye, Ilia Alshanetsky"); CREDIT_LINE("ereg", "Rasmus Lerdorf, Jim Winstead, Jaakko Hyvätti"); @@ -41,9 +41,9 @@ CREDIT_LINE("mcrypt", "Sascha Schumann, Derick Rethans"); CREDIT_LINE("MS SQL", "Frank M. Kromann"); CREDIT_LINE("Multibyte String Functions", "Tsukada Takuya, Rui Hirokawa"); CREDIT_LINE("MySQL driver for PDO", "George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter"); -CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter"); CREDIT_LINE("MySQLi", "Zak Greant, Georg Richter, Andrey Hristov, Ulf Wendel"); -CREDIT_LINE("MySQLnd", "Andrey Hristov, Ulf Wendel, Georg Richter"); +CREDIT_LINE("MySQLnd", "Georg Richter, Andrey Hristov, Ulf Wendel"); +CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter"); CREDIT_LINE("OCI8", "Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation"); CREDIT_LINE("ODBC driver for PDO", "Wez Furlong"); CREDIT_LINE("ODBC", "Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky"); @@ -64,12 +64,12 @@ CREDIT_LINE("Reflection", "Marcus Boerger, Timm Friebe, George Schlossnagle, And CREDIT_LINE("Sessions", "Sascha Schumann, Andrei Zmievski"); CREDIT_LINE("Shared Memory Operations", "Slava Poliakov, Ilia Alshanetsky"); CREDIT_LINE("SimpleXML", "Sterling Hughes, Marcus Boerger, Rob Richards"); -CREDIT_LINE("SNMP", "Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin"); +CREDIT_LINE("SNMP", "Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne"); CREDIT_LINE("SOAP", "Brad Lafountain, Shane Caraveo, Dmitry Stogov"); CREDIT_LINE("Sockets", "Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene"); CREDIT_LINE("SPL", "Marcus Boerger, Etienne Kneuss"); +CREDIT_LINE("SQLite3", "Scott MacVicar, Ilia Alshanetsky"); CREDIT_LINE("SQLite 3.x driver for PDO", "Wez Furlong"); -CREDIT_LINE("SQLite3", "Scott MacVicar, Ilia Alshanetsky, Brad Dewar"); CREDIT_LINE("Sybase-CT", "Zeev Suraski, Tom May, Timm Friebe"); CREDIT_LINE("System V Message based IPC", "Wez Furlong"); CREDIT_LINE("System V Semaphores", "Tom May"); @@ -77,9 +77,9 @@ CREDIT_LINE("System V Shared Memory", "Christian Cartus"); CREDIT_LINE("tidy", "John Coggeshall, Ilia Alshanetsky"); CREDIT_LINE("tokenizer", "Andrei Zmievski, Johannes Schlueter"); CREDIT_LINE("WDDX", "Andrei Zmievski"); -CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes"); CREDIT_LINE("XMLReader", "Rob Richards"); CREDIT_LINE("xmlrpc", "Dan Libby"); +CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes"); CREDIT_LINE("XMLWriter", "Rob Richards, Pierre-Alain Joye"); CREDIT_LINE("XSL", "Christian Stocker, Rob Richards"); CREDIT_LINE("Zip", "Pierre-Alain Joye"); diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 2251ed0e0f..6645ac6fc4 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -97,9 +97,9 @@ PHPAPI PHP_FUNCTION(dl) #define USING_ZTS 0 #endif -/* {{{ php_dl +/* {{{ php_load_extension */ -PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) /* {{{ */ +PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) { void *handle; char *libpath; diff --git a/ext/standard/file.c b/ext/standard/file.c index 7d01d31350..8bc556653f 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2053,11 +2053,11 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char char *tmp = bptr; while ((*tmp != delimiter) && isspace((int)*(unsigned char *)tmp)) { tmp++; - } + } if (*tmp == enclosure) { bptr = tmp; } - } + } if (first_field && bptr == line_end) { add_next_index_null(return_value); diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 142ca9bdcf..4e5f768381 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -803,7 +803,7 @@ PHP_FUNCTION(touch) PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC) { /* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL - * as it may contains outdated data (e.g. "nlink" for a directory when deleting a file + * as it may contain outdated data (e.g. "nlink" for a directory when deleting a file * in this directory, as shown by lstat_stat_variation9.phpt) */ if (BG(CurrentStatFile)) { efree(BG(CurrentStatFile)); diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 65a5c00cc4..61228a63df 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -99,7 +99,7 @@ static void php_pack(zval **val, int size, int *map, char *output) /* }}} */ /* pack() idea stolen from Perl (implemented formats behave the same as there) - * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. */ /* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]]) Takes one or more arguments and packs them into a binary string according to the format argument */ @@ -170,6 +170,7 @@ PHP_FUNCTION(pack) /* Always uses one arg */ case 'a': case 'A': + case 'Z': case 'h': case 'H': if (currentarg >= num_args) { @@ -186,6 +187,12 @@ PHP_FUNCTION(pack) } convert_to_string_ex(argv[currentarg]); arg = Z_STRLEN_PP(argv[currentarg]); + if (code == 'Z') { + /* add one because Z is always NUL-terminated: + * pack("Z*", "aa") === "aa\0" + * pack("Z2", "aa") === "a\0" */ + arg++; + } } currentarg++; @@ -250,6 +257,7 @@ PHP_FUNCTION(pack) case 'a': case 'A': + case 'Z': case 'c': case 'C': case 'x': @@ -315,16 +323,19 @@ PHP_FUNCTION(pack) switch ((int) code) { case 'a': case 'A': - memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg); + case 'Z': { + int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1); + memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg); val = argv[currentarg++]; if (Z_ISREF_PP(val)) { SEPARATE_ZVAL(val); } convert_to_string_ex(val); memcpy(&output[outputpos], Z_STRVAL_PP(val), - (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg); + (Z_STRLEN_PP(val) < arg_cp) ? Z_STRLEN_PP(val) : arg_cp); outputpos += arg; break; + } case 'h': case 'H': { @@ -511,7 +522,7 @@ static long php_unpack(char *data, int size, int issigned, int *map) * chars1, chars2, and ints. * Numeric pack types will return numbers, a and A will return strings, * f and d will return doubles. - * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. */ /* {{{ proto array unpack(string format, string input) Unpack binary string into named array elements according to format argument */ @@ -586,6 +597,7 @@ PHP_FUNCTION(unpack) case 'a': case 'A': + case 'Z': size = arg; arg = 1; break; @@ -662,9 +674,24 @@ PHP_FUNCTION(unpack) if ((inputpos + size) <= inputlen) { switch ((int) type) { - case 'a': + case 'a': { + /* a will not strip any trailing whitespace or null padding */ + char pad = ' '; + int len = inputlen - inputpos; /* Remaining string */ + + /* If size was given take minimum of len and size */ + if ((size >= 0) && (len > size)) { + len = size; + } + + size = len; + + add_assoc_stringl(return_value, n, &input[inputpos], len, 1); + break; + } case 'A': { - char pad = (type == 'a') ? '\0' : ' '; + /* A will strip any trailing whitespace */ + char padn = '\0'; char pads = ' '; char padt = '\t'; char padc = '\r'; char padl = '\n'; int len = inputlen - inputpos; /* Remaining string */ /* If size was given take minimum of len and size */ @@ -674,15 +701,46 @@ PHP_FUNCTION(unpack) size = len; - /* Remove padding chars from unpacked data */ + /* Remove trailing white space and nulls chars from unpacked data */ while (--len >= 0) { - if (input[inputpos + len] != pad) + if (input[inputpos + len] != padn + && input[inputpos + len] != pads + && input[inputpos + len] != padt + && input[inputpos + len] != padc + && input[inputpos + len] != padl + ) break; } add_assoc_stringl(return_value, n, &input[inputpos], len + 1, 1); break; } + /* New option added for Z to remain in-line with the Perl implementation */ + case 'Z': { + /* Z will strip everything after the first null character */ + char pad = '\0'; + int s, + len = inputlen - inputpos; /* Remaining string */ + + /* If size was given take minimum of len and size */ + if ((size >= 0) && (len > size)) { + len = size; + } + + size = len; + + /* Remove everything after the first null */ + s = 0; + while (s++ <= len) { + if (input[inputpos + s] == pad) + break; + } + len = s; + + add_assoc_stringl(return_value, n, &input[inputpos], len, 1); + break; + } + case 'h': case 'H': { diff --git a/ext/standard/tests/array/compact.phpt b/ext/standard/tests/array/compact.phpt index 4b4bfbb732..02df44ebd8 100644 --- a/ext/standard/tests/array/compact.phpt +++ b/ext/standard/tests/array/compact.phpt @@ -1,8 +1,5 @@ --TEST-- compact() ---INI-- -unicode.script_encoding=UTF-8 -unicode.output_encoding=UTF-8 --FILE-- <?php diff --git a/ext/standard/tests/array/locale_sort.phpt b/ext/standard/tests/array/locale_sort.phpt index 1db96042e8..c2f66c01df 100644 --- a/ext/standard/tests/array/locale_sort.phpt +++ b/ext/standard/tests/array/locale_sort.phpt @@ -9,9 +9,6 @@ if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) { die("skip setlocale() failed\n"); } ?> ---INI-- -unicode.script_encoding=ISO8859-1 -unicode.output_encoding=ISO8859-1 --FILE-- <?php setlocale(LC_ALL, 'fr_FR.ISO8859-1', 'fr_FR'); diff --git a/ext/standard/tests/dir/dir_variation1-win32.phpt b/ext/standard/tests/dir/dir_variation1-win32.phpt deleted file mode 100644 index 1f7f4a2cf3..0000000000 --- a/ext/standard/tests/dir/dir_variation1-win32.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Test dir() function : usage variations - unexpected value for 'dir' argument ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* - * Prototype : object dir(string $directory[, resource $context]) - * Description: Directory class with properties, handle and class and methods read, rewind and close - * Source code: ext/standard/dir.c - */ - -/* - * Passing non string values to 'directory' argument of dir() and see - * that the function outputs proper warning messages wherever expected. - */ - -echo "*** Testing dir() : unexpected values for \$directory argument ***\n"; - -// get an unset variable -$unset_var = 10; -unset($unset_var); - -class A -{ - public $var; - public function init() { - $this->var = 10; - } -} - -// get a resource variable -$fp = fopen(__FILE__, "r"); // get a file handle -$dfp = opendir( dirname(__FILE__) ); // get a dir handle - -// unexpected values to be passed to $directory argument -$unexpected_values = array ( - - // array data -/*1*/ array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data -/*6*/ NULL, - null, - - // boolean data -/*8*/ true, - false, - TRUE, - FALSE, - - // empty data -/*12*/ "", - '', - - // undefined data -/*14*/ @$undefined_var, - - // unset data -/*15*/ @$unset_var, - - // resource variable(dir and file handle) -/*16*/ $fp, - $dfp, - - // object data -/*18*/ new A() -); - -// loop through various elements of $unexpected_values to check the behavior of dir() -$iterator = 1; -foreach( $unexpected_values as $unexpected_value ) { - echo "\n-- Iteration $iterator --\n"; - var_dump( dir($unexpected_value) ); - $iterator++; -} - -fclose($fp); -closedir($dfp); -echo "Done"; -?> ---EXPECTF-- -*** Testing dir() : unexpected values for $directory argument *** - --- Iteration 1 -- - -Warning: dir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 2 -- - -Warning: dir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 3 -- - -Warning: dir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 4 -- - -Warning: dir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 5 -- - -Warning: dir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- - -Warning: dir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: dir(1): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- - -Warning: dir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: dir(1): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- - -Warning: dir() expects parameter 1 to be string, resource given in %s on line %d -NULL - --- Iteration 17 -- - -Warning: dir() expects parameter 1 to be string, resource given in %s on line %d -NULL - --- Iteration 18 -- - -Warning: dir() expects parameter 1 to be string, object given in %s on line %d -NULL -Done
\ No newline at end of file diff --git a/ext/standard/tests/dir/dir_variation5-win32.phpt b/ext/standard/tests/dir/dir_variation5-win32.phpt deleted file mode 100644 index e70b9d3533..0000000000 --- a/ext/standard/tests/dir/dir_variation5-win32.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test dir() function : usage variations - open a file instead of directory ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* - * Prototype : object dir(string $directory[, resource $context]) - * Description: Directory class with properties, handle and class and methods read, rewind and close - * Source code: ext/standard/dir.c - */ - -/* - * Passing a file as argument to dir() function instead of a directory - * and checking if proper warning message is generated. - */ - -echo "*** Testing dir() : open a file instead of a directory ***\n"; - -// open the file instead of directory -$d = dir(__FILE__); -var_dump( $d ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing dir() : open a file instead of a directory *** - -Warning: dir(%s): The directory name is invalid. (code: %d) in %s on line %d - -Warning: dir(%s): failed to open dir: %s in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/dir/dir_variation6-win32.phpt b/ext/standard/tests/dir/dir_variation6-win32.phpt deleted file mode 100644 index e0e4749809..0000000000 --- a/ext/standard/tests/dir/dir_variation6-win32.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test dir() function : usage variations - non-existent directory ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* - * Prototype : object dir(string $directory[, resource $context]) - * Description: Directory class with properties, handle and class and methods read, rewind and close - * Source code: ext/standard/dir.c - */ - -/* - * Passing a non-existent directory as argument to dir() function - * and checking to see if proper warning message is output. - */ -echo "*** Testing dir() : open a non-existent directory ***\n"; - -// create the temporary directory -$file_path = dirname(__FILE__); -$dir_path = $file_path."/dir_variation6"; -@mkdir($dir_path); - -// open existent directory -$d = dir($dir_path); -$d->close(); //close the dir - -// remove directory and try to open the same(non-existent) directory again -rmdir($dir_path); -clearstatcache(); - -echo "-- opening previously removed directory --\n"; -var_dump( dir($dir_path) ); - -// point to a non-existent directory -$non_existent_dir = $file_path."/non_existent_dir"; -echo "-- opening non-existent directory --\n"; -$d = dir($non_existent_dir); -var_dump( $d ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing dir() : open a non-existent directory *** --- opening previously removed directory -- - -Warning: dir(%s): The system cannot find the file specified. (code: %d) in %s on line %d - -Warning: dir(%s): failed to open dir: %s in %s on line %d -bool(false) --- opening non-existent directory -- - -Warning: dir(%s): The system cannot find the file specified. (code: %d) in %s on line %d - -Warning: dir(%s): failed to open dir: %s in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/dir/dir_variation8-win32.phpt b/ext/standard/tests/dir/dir_variation8-win32.phpt deleted file mode 100644 index a56c98b880..0000000000 --- a/ext/standard/tests/dir/dir_variation8-win32.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test dir() function : usage variations - checking with wildcard characters ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* - * Prototype : object dir(string $directory[, resource $context]) - * Description: Directory class with properties, handle and class and methods read, rewind and close - * Source code: ext/standard/dir.c - */ - -/* - * Create more than one temporary directory & subdirectory and check if dir() function can open - * those directories when wildcard characters are used to refer to them. - */ - -echo "*** Testing dir() : checking with wildcard characters ***\n"; - -// create the temporary directories -$file_path = dirname(__FILE__); -$dir_path = $file_path."/dir_variation81"; -$sub_dir_path = $dir_path."/sub_dir1"; - -@mkdir($dir_path1); -@mkdir($sub_dir_path); - -/* with different wildcard characters */ - -echo "-- wildcard = '*' --\n"; -var_dump( dir($file_path."/dir_var*") ); -var_dump( dir($file_path."/*") ); - -echo "-- wildcard = '?' --\n"; -var_dump( dir($dir_path."/sub_dir?") ); -var_dump( dir($dir_path."/sub?dir1") ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing dir() : checking with wildcard characters *** --- wildcard = '*' -- - -Warning: dir(%s/dir_var*,%s/dir_var*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d - -Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(%s/*,%s/*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d - -Warning: dir(%s/*): failed to open dir: %s in %s on line %d -bool(false) --- wildcard = '?' -- - -Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d - -Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d - -Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/dir/dir_variation9-win32.phpt b/ext/standard/tests/dir/dir_variation9-win32.phpt deleted file mode 100644 index 32b0bd946b..0000000000 --- a/ext/standard/tests/dir/dir_variation9-win32.phpt +++ /dev/null @@ -1,125 +0,0 @@ ---TEST-- -Test dir() function : usage variations - relative valid and invalid paths ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* - * Prototype : object dir(string $directory[, resource $context]) - * Description: Directory class with properties, handle and class and methods read, rewind and close - * Source code: ext/standard/dir.c - */ - -/* - * Checking the behavior of dir() function by passing directories which - * have valid and invalid relative path. - */ - -echo "*** Testing dir() : checking with valid and invalid paths ***\n"; - -/* create the temporary directories */ - -$file_path = dirname(__FILE__); - -// directory dir_variation91 with one sub-directory sub_dir11 and sub-sub-directory sub_dir111 -$dir_path1 = $file_path."/dir_variation91"; -$sub_dir11 = $dir_path1."/sub_dir11"; -$sub_dir111 = $sub_dir11."/sub_dir111"; - -// directory dir_variation92 with one sub-directory sub_dir21 -$dir_path2 = $file_path."/dir_variation92"; -$sub_dir21 = $dir_path2."/sub_dir21"; - -@mkdir($dir_path1); -@mkdir($dir_path2); -@mkdir($sub_dir11); -@mkdir($sub_dir111); -@mkdir($sub_dir21); - -// open the directory with valid paths -echo "\n-- With valid paths --\n"; -var_dump( dir("$dir_path1/sub_dir11/sub_dir111/..") ); -var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91") ); -var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91/sub_dir11/..") ); -var_dump( dir("$dir_path1/sub_dir11/sub_dir111/../../../dir_variation92/sub_dir21/..") ); - -// open the directory with invalid path -echo "\n-- With invalid paths --\n"; -var_dump( dir("$dir_path1/sub_dir12/sub_dir111/..") ); -var_dump( dir("$dir_path2/sub_dir21/../dir_variation91") ); -var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91/sub_dir12/..") ); -var_dump( dir("$dir_path1/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..") ); - -echo "Done"; -?> ---CLEAN-- -<?php -$file_path = dirname(__FILE__); - -$dir_path1 = $file_path."/dir_variation91"; -$sub_dir11 = $dir_path1."/sub_dir11"; -$sub_dir111 = $sub_dir11."/sub_dir111"; -$dir_path2 = $file_path."/dir_variation92"; -$sub_dir21 = $dir_path2."/sub_dir21"; - -rmdir($sub_dir21); -rmdir($sub_dir111); -rmdir($sub_dir11); -rmdir($dir_path1); -rmdir($dir_path2); -?> ---EXPECTF-- -*** Testing dir() : checking with valid and invalid paths *** - --- With valid paths -- -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/dir_variation91/sub_dir11/sub_dir111/.." - ["handle"]=> - resource(%d) of type (stream) -} -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/dir_variation92/sub_dir21/../../dir_variation91" - ["handle"]=> - resource(%d) of type (stream) -} -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir11/.." - ["handle"]=> - resource(%d) of type (stream) -} -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/dir_variation91/sub_dir11/sub_dir111/../../../dir_variation92/sub_dir21/.." - ["handle"]=> - resource(%d) of type (stream) -} - --- With invalid paths -- - -Warning: dir(%sdir_variation91/sub_dir12/sub_dir111/..,%sdir_variation91/sub_dir12/sub_dir111/..): The system cannot find the path specified. (code: 3) in %sdir_variation9-win32.php on line %d - -Warning: dir(%s/dir_variation91/sub_dir12/sub_dir111/..): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(%sdir_variation92/sub_dir21/../dir_variation91,%sdir_variation92/sub_dir21/../dir_variation91): The system cannot find the file specified. (code: 2) in %sdir_variation9-win32.php on line %d - -Warning: dir(%s/dir_variation92/sub_dir21/../dir_variation91): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(%sdir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..,%sdir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): The system cannot find the file specified. (code: 2) in %sdir_variation9-win32.php on line %d - -Warning: dir(%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(%sdir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..,%sdir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): The system cannot find the path specified. (code: 3) in %sdir_variation9-win32.php on line %d - -Warning: dir(%s/dir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): failed to open dir: %s in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/dir/opendir_error2-win32.phpt b/ext/standard/tests/dir/opendir_error2-win32.phpt deleted file mode 100644 index c3ecd35349..0000000000 --- a/ext/standard/tests/dir/opendir_error2-win32.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test opendir() function : error conditions - Non-existent directory ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* Prototype : mixed opendir(string $path[, resource $context]) - * Description: Open a directory and return a dir_handle - * Source code: ext/standard/dir.c - */ - -/* - * Pass a non-existent directory as $path argument to opendir() to test behaviour - */ - -echo "*** Testing opendir() : error conditions ***\n"; - -echo "\n-- Pass a non-existent absolute path: --\n"; -$path = dirname(__FILE__) . "/idonotexist"; -var_dump(opendir($path)); - -echo "\n-- Pass a non-existent relative path: --\n"; -chdir(dirname(__FILE__)); -var_dump(opendir('idonotexist')); -?> -===DONE=== ---EXPECTF-- -*** Testing opendir() : error conditions *** - --- Pass a non-existent absolute path: -- - -Warning: opendir(%s/idonotexist,%s/idonotexist): The system cannot find the file specified. (code: %d) in %s on line %d - -Warning: opendir(%s/idonotexist): failed to open dir: %s in %s on line %d -bool(false) - --- Pass a non-existent relative path: -- - -Warning: opendir(idonotexist,idonotexist): The system cannot find the file specified. (code: %d) in %s on line %d - -Warning: opendir(idonotexist): failed to open dir: %s in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/dir/opendir_variation1-win32.phpt b/ext/standard/tests/dir/opendir_variation1-win32.phpt deleted file mode 100644 index 9a75a5b6a7..0000000000 --- a/ext/standard/tests/dir/opendir_variation1-win32.phpt +++ /dev/null @@ -1,248 +0,0 @@ ---TEST-- -Test opendir() function : usage variations - different data types as $path arg ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* Prototype : mixed opendir(string $path[, resource $context]) - * Description: Open a directory and return a dir_handle - * Source code: ext/standard/dir.c - */ - -/* - * Pass different data types as $path argument to opendir() to test behaviour - * Where possible, an existing directory has been entered as a string value - */ - -echo "*** Testing opendir() : usage variations ***\n"; - -// create directory to be passed as string value where possible -$path = dirname(__FILE__) . "/opendir_variation1"; -mkdir($path); - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA { - - var $path; - function __construct($path) { - $this->path = $path; - } - public function __toString() { - return $this->path; - } -} - -// heredoc string -$heredoc = <<<EOT -$path -EOT; - -// get a resource variable -$fp = fopen(__FILE__, "r"); - -// unexpected values to be passed to $path argument -$inputs = array( - - // int data -/*1*/ 0, - 1, - 12345, - -2345, - - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - - // null data -/*10*/ NULL, - null, - - // boolean data -/*12*/ true, - false, - TRUE, - FALSE, - - // empty data -/*16*/ "", - '', - array(), - - // string data -/*19*/ "$path", - 'string', - $heredoc, - - // object data -/*22*/ new classA($path), - - // undefined data -/*23*/ @$undefined_var, - - // unset data -/*24*/ @$unset_var, - - // resource variable -/*25*/ $fp -); - -// loop through each element of $inputs to check the behavior of opendir() -$iterator = 1; -foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( $dh = opendir($input) ); - if ($dh) { - closedir($dh); - } - $iterator++; -}; - -fclose($fp); -?> -===DONE=== ---CLEAN-- -<?php -$path = dirname(__FILE__) . "/opendir_variation1"; -rmdir($path); -?> ---EXPECTF-- -*** Testing opendir() : usage variations *** - --- Iteration 1 -- - -Warning: opendir(0,0): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(0): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 2 -- - -Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(1): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 3 -- - -Warning: opendir(12345,12345): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(12345): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 4 -- - -Warning: opendir(-2345,-2345): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(-2345): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 5 -- - -Warning: opendir(10.5,10.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(10.5): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 6 -- - -Warning: opendir(-10.5,-10.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(-10.5): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 7 -- - -Warning: opendir(123456789000,123456789000): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(123456789000): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 8 -- - -Warning: opendir(1.23456789E-9,1.23456789E-9): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(1.23456789E-9): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 9 -- - -Warning: opendir(0.5,0.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(0.5): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- - -Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(1): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- - -Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(1): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- - -Warning: opendir() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 19 -- -resource(%d) of type (stream) - --- Iteration 20 -- - -Warning: opendir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: opendir(string): failed to open dir: %s in %s on line %d -bool(false) - --- Iteration 21 -- -resource(%d) of type (stream) - --- Iteration 22 -- -resource(%d) of type (stream) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- - -Warning: opendir() expects parameter 1 to be string, resource given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/dir/scandir_error2-win32.phpt b/ext/standard/tests/dir/scandir_error2-win32.phpt deleted file mode 100644 index 9920be747d..0000000000 --- a/ext/standard/tests/dir/scandir_error2-win32.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test scandir() function : error conditions - Non-existent directory ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]]) - * Description: List files & directories inside the specified path - * Source code: ext/standard/dir.c - */ - -/* - * Pass a directory that does not exist to scandir() to test error messages - */ - -echo "*** Testing scandir() : error conditions ***\n"; - -$directory = dirname(__FILE__) . '/idonotexist'; - -echo "\n-- Pass scandir() an absolute path that does not exist --\n"; -var_dump(scandir($directory)); - -echo "\n-- Pass scandir() a relative path that does not exist --\n"; -var_dump(scandir('/idonotexist')); -?> -===DONE=== ---EXPECTF-- -*** Testing scandir() : error conditions *** - --- Pass scandir() an absolute path that does not exist -- - -Warning: scandir(%s/idonotexist,%s/idonotexist): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(%s/idonotexist): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Pass scandir() a relative path that does not exist -- - -Warning: scandir(/idonotexist,/idonotexist): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(/idonotexist): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation1-win32.phpt b/ext/standard/tests/dir/scandir_variation1-win32.phpt deleted file mode 100644 index a2b5bd4672..0000000000 --- a/ext/standard/tests/dir/scandir_variation1-win32.phpt +++ /dev/null @@ -1,289 +0,0 @@ ---TEST-- -Test scandir() function : usage variations - different data types as $dir arg ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]]) - * Description: List files & directories inside the specified path - * Source code: ext/standard/dir.c - */ - -/* - * Pass different data types as $dir argument to test behaviour of scandir() - */ - -echo "*** Testing scandir() : usage variations ***\n"; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -// get a class -class classA -{ - public function __toString() { - return "Class A object"; - } -} - -// heredoc string -$heredoc = <<<EOT -hello world -EOT; - -// get a resource variable -$fp = fopen(__FILE__, "r"); - -// unexpected values to be passed to $dir argument -$inputs = array( - - // int data -/*1*/ 0, - 1, - 12345, - -2345, - - // float data -/*5*/ 10.5, - -10.5, - 12.3456789000e10, - 12.3456789000E-10, - .5, - - // null data -/*10*/ NULL, - null, - - // boolean data -/*12*/ true, - false, - TRUE, - FALSE, - - // empty data -/*16*/ "", - '', - array(), - - // string data -/*19*/ "string", - 'string', - $heredoc, - - // object data -/*22*/ new classA(), - - // undefined data -/*23*/ @$undefined_var, - - // unset data -/*24*/ @$unset_var, - - // resource variable -/*25*/ $fp -); - -// loop through each element of $inputs to check the behavior of scandir() -$iterator = 1; -foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( scandir($input) ); - $iterator++; -}; - -fclose($fp); -?> -===DONE=== ---EXPECTF-- -*** Testing scandir() : usage variations *** - --- Iteration 1 -- - -Warning: scandir(0,0): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(0): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 2 -- - -Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 3 -- - -Warning: scandir(12345,12345): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(12345): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 4 -- - -Warning: scandir(-2345,-2345): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(-2345): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 5 -- - -Warning: scandir(10.5,10.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(10.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 6 -- - -Warning: scandir(-10.5,-10.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(-10.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 7 -- - -Warning: scandir(123456789000,123456789000): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(123456789000): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 8 -- - -Warning: scandir(1.23456789E-9,1.23456789E-9): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(1.23456789E-9): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 9 -- - -Warning: scandir(0.5,0.5): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(0.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 10 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 11 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 12 -- - -Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 13 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 14 -- - -Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 15 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 16 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 17 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 18 -- - -Warning: scandir() expects parameter 1 to be a valid path, array given in %s on line %d -NULL - --- Iteration 19 -- - -Warning: scandir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(string): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 20 -- - -Warning: scandir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(string): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 21 -- - -Warning: scandir(hello world,hello world): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(hello world): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 22 -- - -Warning: scandir(Class A object,Class A object): The system cannot find the file specified. (code: 2) in %s on line %d - -Warning: scandir(Class A object): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Iteration 23 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 24 -- - -Warning: scandir(): Directory name cannot be empty in %s on line %d -bool(false) - --- Iteration 25 -- - -Warning: scandir() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation6-win32.phpt b/ext/standard/tests/dir/scandir_variation6-win32.phpt deleted file mode 100644 index 040dc787cc..0000000000 --- a/ext/standard/tests/dir/scandir_variation6-win32.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Test scandir() function : usage variations - Wildcards in directory path ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die("skip Valid only on Windows"); -} -?> ---FILE-- -<?php -/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]]) - * Description: List files & directories inside the specified path - * Source code: ext/standard/dir.c - */ - -/* - * Pass a directory path using wildcards as $dir argument to test how scandir() behaves - */ - -echo "*** Testing scandir() : usage variations ***\n"; - -// create the temporary directories -$file_path = dirname(__FILE__); -$dir_path = $file_path . "/scandir_variation6"; -$sub_dir_path = $dir_path . "/sub_dir1"; - -mkdir($dir_path); -mkdir($sub_dir_path); - -// with different wildcard characters - -echo "\n-- Wildcard = '*' --\n"; -var_dump( scandir($file_path . "/scandir_var*") ); -var_dump( scandir($file_path . "/*") ); - -echo "\n-- Wildcard = '?' --\n"; -var_dump( scandir($dir_path . "/sub_dir?") ); -var_dump( scandir($dir_path . "/sub?dir1") ); - -?> -===DONE=== ---CLEAN-- -<?php -$dir_path = dirname(__FILE__) . "/scandir_variation6"; -$sub_dir_path = $dir_path . "/sub_dir1"; - -rmdir($sub_dir_path); -rmdir($dir_path); -?> ---EXPECTF-- -*** Testing scandir() : usage variations *** - --- Wildcard = '*' -- - -Warning: scandir(%s/scandir_var*,%s/scandir_var*): No such file or directory in %s on line %d - -Warning: scandir(%s/scandir_var*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - -Warning: scandir(%s/*,%s/*): No such file or directory in %s on line %d - -Warning: scandir(%s/*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - --- Wildcard = '?' -- - -Warning: scandir(%s/scandir_variation6/sub_dir?,%s/scandir_variation6/sub_dir?): No such file or directory in %s on line %d - -Warning: scandir(%s/scandir_variation6/sub_dir?): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) - -Warning: scandir(%s/scandir_variation6/sub?dir1,%s/scandir_variation6/sub?dir1): No such file or directory in %s on line %d - -Warning: scandir(%s/scandir_variation6/sub?dir1): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d - -Warning: scandir(): (errno %d): %s in %s on line %d -bool(false) -===DONE=== diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index 9538c8ede8..fcd85489f3 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -7,7 +7,7 @@ output_handler= $php = getenv('TEST_PHP_EXECUTABLE'); $tmpfile = tempnam(__DIR__, 'phpt'); - $args = ' -n '; + $args = ' -n -dsafe_mode=off '; /* Regular Data Test */ passthru($php . $args . ' -r " echo \"HELLO\"; "'); diff --git a/ext/standard/tests/network/ip2long_variation1.phpt b/ext/standard/tests/network/ip2long_variation1.phpt index f87282ae75..ca67aa41a8 100644 --- a/ext/standard/tests/network/ip2long_variation1.phpt +++ b/ext/standard/tests/network/ip2long_variation1.phpt @@ -201,4 +201,4 @@ bool(false) --resource-- Error: 2 - ip2long() expects parameter 1 to be string, resource given, %s(%d) NULL -===DONE=== +===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/strings/bug61038.phpt b/ext/standard/tests/strings/bug61038.phpt new file mode 100644 index 0000000000..7130804fa4 --- /dev/null +++ b/ext/standard/tests/strings/bug61038.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #61038: unpack("a5", "str\0\0") does not work as expected +--FILE-- +<?php +var_dump(unpack("a4", "str\0\0")); +var_dump(unpack("a5", "str\0\0")); +var_dump(unpack("a6", "str\0\0")); +var_dump(unpack("a*", "str\0\0")); +?> +--EXPECTF-- +array(1) { + [1]=> + string(4) "str%c" +} +array(1) { + [1]=> + string(5) "str%c%c" +} + +Warning: unpack(): Type a: not enough input, need 6, have 5 in %s on line %d +bool(false) +array(1) { + [1]=> + string(5) "str%c%c" +} + diff --git a/ext/standard/tests/strings/pack_A.phpt b/ext/standard/tests/strings/pack_A.phpt new file mode 100644 index 0000000000..59fc22e122 --- /dev/null +++ b/ext/standard/tests/strings/pack_A.phpt @@ -0,0 +1,25 @@ +--TEST-- +pack()/unpack(): "A" modifier +--FILE-- +<?php +var_dump( + pack("A5", "foo "), + pack("A4", "fooo"), + pack("A4", "foo"), + unpack("A*", "foo\0\rbar\0 \t\r\n"), + unpack("A4", "foo\0\rbar\0 \t\r\n") +); +?> +--EXPECTF-- +string(5) "foo " +string(4) "fooo" +string(4) "foo " +array(1) { + [1]=> + string(8) "foo%c%cbar" +} +array(1) { + [1]=> + string(3) "foo" +} + diff --git a/ext/standard/tests/strings/pack_Z.phpt b/ext/standard/tests/strings/pack_Z.phpt new file mode 100644 index 0000000000..8a2ee67767 --- /dev/null +++ b/ext/standard/tests/strings/pack_Z.phpt @@ -0,0 +1,27 @@ +--TEST-- +pack()/unpack(): "Z" format +--FILE-- +<?php +var_dump( + pack("Z0", "f"), + pack("Z5", "foo\0"), + pack("Z4", "fooo"), + pack("Z4", "foo"), + pack("Z*", "foo"), + unpack("Z*", "foo\0\rbar\0 \t\r\n"), + unpack("Z9", "foo\0\rbar\0 \t\r\n") +); +--EXPECTF-- +string(0) "" +string(5) "foo%c%c" +string(4) "foo%c" +string(4) "foo%c" +string(4) "foo%c" +array(1) { + [1]=> + string(3) "foo" +} +array(1) { + [1]=> + string(3) "foo" +} diff --git a/ext/standard/tests/strings/parse_str_basic3.phpt b/ext/standard/tests/strings/parse_str_basic3.phpt Binary files differindex 619b1476ab..84f6a53bb1 100644 --- a/ext/standard/tests/strings/parse_str_basic3.phpt +++ b/ext/standard/tests/strings/parse_str_basic3.phpt diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt index 43b2df1c0a..1ef97ccbaf 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -19,7 +19,7 @@ var_dump(unpack("I", pack("I", 65534), $extra_arg)); echo "\n-- Testing unpack() function with invalid format character --\n"; $extra_arg = 10; -var_dump(unpack("Z", pack("I", 65534))); +var_dump(unpack("G", pack("I", 65534))); ?> ===DONE=== --EXPECTF-- @@ -37,6 +37,6 @@ NULL -- Testing unpack() function with invalid format character -- -Warning: unpack(): Invalid format type Z in %s on line %d +Warning: unpack(): Invalid format type G in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/time/bug60222.phpt b/ext/standard/tests/time/bug60222.phpt index 8053a81dea..8053a81dea 100755..100644 --- a/ext/standard/tests/time/bug60222.phpt +++ b/ext/standard/tests/time/bug60222.phpt diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index d883d4dfa3..d106d95a36 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon May 23 12:29:55 2011 */ +/* Generated by re2c 0.13.5 on Sun Jan 1 10:36:29 2012 */ #line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -63,6 +63,7 @@ static PHP_INI_MH(OnUpdateTags) return FAILURE; } } + zend_hash_init(ctx->tags, 0, NULL, NULL, 1); for (key = php_strtok_r(tmp, ",", &lasts); @@ -94,7 +95,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) PHP_INI_END() -#line 98 "ext/standard/url_scanner_ex.re" +#line 102 "ext/standard/url_scanner_ex.re" #define YYFILL(n) goto done @@ -113,7 +114,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st scan: -#line 114 "ext/standard/url_scanner_ex.c" +#line 118 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -159,19 +160,19 @@ scan: if (yych <= '9') goto yy6; if (yych >= ';') goto yy4; ++YYCURSOR; -#line 116 "ext/standard/url_scanner_ex.re" +#line 120 "ext/standard/url_scanner_ex.re" { smart_str_append(dest, url); return; } -#line 162 "ext/standard/url_scanner_ex.c" +#line 166 "ext/standard/url_scanner_ex.c" yy4: ++YYCURSOR; -#line 117 "ext/standard/url_scanner_ex.re" +#line 121 "ext/standard/url_scanner_ex.re" { sep = separator; goto scan; } -#line 167 "ext/standard/url_scanner_ex.c" +#line 171 "ext/standard/url_scanner_ex.c" yy6: ++YYCURSOR; -#line 118 "ext/standard/url_scanner_ex.re" +#line 122 "ext/standard/url_scanner_ex.re" { bash = p - 1; goto done; } -#line 172 "ext/standard/url_scanner_ex.c" +#line 176 "ext/standard/url_scanner_ex.c" yy8: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -179,11 +180,11 @@ yy8: if (yybm[0+yych] & 128) { goto yy8; } -#line 119 "ext/standard/url_scanner_ex.re" +#line 123 "ext/standard/url_scanner_ex.re" { goto scan; } -#line 182 "ext/standard/url_scanner_ex.c" +#line 186 "ext/standard/url_scanner_ex.c" } -#line 120 "ext/standard/url_scanner_ex.re" +#line 124 "ext/standard/url_scanner_ex.re" done: @@ -363,7 +364,7 @@ state_plain_begin: state_plain: start = YYCURSOR; -#line 364 "ext/standard/url_scanner_ex.c" +#line 368 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -406,9 +407,9 @@ state_plain: goto yy15; } ++YYCURSOR; -#line 299 "ext/standard/url_scanner_ex.re" +#line 303 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 409 "ext/standard/url_scanner_ex.c" +#line 413 "ext/standard/url_scanner_ex.c" yy15: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -416,17 +417,17 @@ yy15: if (yybm[0+yych] & 128) { goto yy15; } -#line 300 "ext/standard/url_scanner_ex.re" +#line 304 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain; } -#line 419 "ext/standard/url_scanner_ex.c" +#line 423 "ext/standard/url_scanner_ex.c" } -#line 301 "ext/standard/url_scanner_ex.re" +#line 305 "ext/standard/url_scanner_ex.re" state_tag: start = YYCURSOR; -#line 427 "ext/standard/url_scanner_ex.c" +#line 431 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -477,14 +478,14 @@ yy20: yych = *YYCURSOR; goto yy25; yy21: -#line 306 "ext/standard/url_scanner_ex.re" +#line 310 "ext/standard/url_scanner_ex.re" { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } -#line 480 "ext/standard/url_scanner_ex.c" +#line 484 "ext/standard/url_scanner_ex.c" yy22: ++YYCURSOR; -#line 307 "ext/standard/url_scanner_ex.re" +#line 311 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 485 "ext/standard/url_scanner_ex.c" +#line 489 "ext/standard/url_scanner_ex.c" yy24: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -495,7 +496,7 @@ yy25: } goto yy21; } -#line 308 "ext/standard/url_scanner_ex.re" +#line 312 "ext/standard/url_scanner_ex.re" state_next_arg_begin: @@ -504,7 +505,7 @@ state_next_arg_begin: state_next_arg: start = YYCURSOR; -#line 505 "ext/standard/url_scanner_ex.c" +#line 509 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -564,27 +565,27 @@ state_next_arg: } } ++YYCURSOR; -#line 316 "ext/standard/url_scanner_ex.re" +#line 320 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 567 "ext/standard/url_scanner_ex.c" +#line 571 "ext/standard/url_scanner_ex.c" yy30: ++YYCURSOR; yych = *YYCURSOR; goto yy37; yy31: -#line 317 "ext/standard/url_scanner_ex.re" +#line 321 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg; } -#line 575 "ext/standard/url_scanner_ex.c" +#line 579 "ext/standard/url_scanner_ex.c" yy32: ++YYCURSOR; -#line 318 "ext/standard/url_scanner_ex.re" +#line 322 "ext/standard/url_scanner_ex.re" { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 580 "ext/standard/url_scanner_ex.c" +#line 584 "ext/standard/url_scanner_ex.c" yy34: ++YYCURSOR; -#line 319 "ext/standard/url_scanner_ex.re" +#line 323 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 585 "ext/standard/url_scanner_ex.c" +#line 589 "ext/standard/url_scanner_ex.c" yy36: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -595,13 +596,13 @@ yy37: } goto yy31; } -#line 320 "ext/standard/url_scanner_ex.re" +#line 324 "ext/standard/url_scanner_ex.re" state_arg: start = YYCURSOR; -#line 602 "ext/standard/url_scanner_ex.c" +#line 606 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -649,14 +650,14 @@ yy40: yych = *YYCURSOR; goto yy45; yy41: -#line 325 "ext/standard/url_scanner_ex.re" +#line 329 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 652 "ext/standard/url_scanner_ex.c" +#line 656 "ext/standard/url_scanner_ex.c" yy42: ++YYCURSOR; -#line 326 "ext/standard/url_scanner_ex.re" +#line 330 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 657 "ext/standard/url_scanner_ex.c" +#line 661 "ext/standard/url_scanner_ex.c" yy44: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -667,13 +668,13 @@ yy45: } goto yy41; } -#line 327 "ext/standard/url_scanner_ex.re" +#line 331 "ext/standard/url_scanner_ex.re" state_before_val: start = YYCURSOR; -#line 674 "ext/standard/url_scanner_ex.c" +#line 678 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -720,17 +721,17 @@ yy48: if (yych == ' ') goto yy55; if (yych == '=') goto yy53; yy49: -#line 333 "ext/standard/url_scanner_ex.re" +#line 337 "ext/standard/url_scanner_ex.re" { --YYCURSOR; goto state_next_arg_begin; } -#line 723 "ext/standard/url_scanner_ex.c" +#line 727 "ext/standard/url_scanner_ex.c" yy50: ++YYCURSOR; yych = *YYCURSOR; goto yy54; yy51: -#line 332 "ext/standard/url_scanner_ex.re" +#line 336 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 731 "ext/standard/url_scanner_ex.c" +#line 735 "ext/standard/url_scanner_ex.c" yy52: yych = *++YYCURSOR; goto yy49; @@ -752,14 +753,14 @@ yy55: YYCURSOR = YYMARKER; goto yy49; } -#line 334 "ext/standard/url_scanner_ex.re" +#line 338 "ext/standard/url_scanner_ex.re" state_val: start = YYCURSOR; -#line 760 "ext/standard/url_scanner_ex.c" +#line 764 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -820,9 +821,9 @@ state_val: yych = *(YYMARKER = ++YYCURSOR); goto yy77; yy61: -#line 342 "ext/standard/url_scanner_ex.re" +#line 346 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } -#line 823 "ext/standard/url_scanner_ex.c" +#line 827 "ext/standard/url_scanner_ex.c" yy62: yych = *(YYMARKER = ++YYCURSOR); goto yy69; @@ -831,9 +832,9 @@ yy63: goto yy67; yy64: ++YYCURSOR; -#line 343 "ext/standard/url_scanner_ex.re" +#line 347 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 834 "ext/standard/url_scanner_ex.c" +#line 838 "ext/standard/url_scanner_ex.c" yy66: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -858,9 +859,9 @@ yy69: goto yy66; } yy71: -#line 341 "ext/standard/url_scanner_ex.re" +#line 345 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 861 "ext/standard/url_scanner_ex.c" +#line 865 "ext/standard/url_scanner_ex.c" yy72: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -890,9 +891,9 @@ yy77: goto yy66; } yy79: -#line 340 "ext/standard/url_scanner_ex.re" +#line 344 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 893 "ext/standard/url_scanner_ex.c" +#line 897 "ext/standard/url_scanner_ex.c" yy80: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -905,7 +906,7 @@ yy80: yych = *YYCURSOR; goto yy79; } -#line 344 "ext/standard/url_scanner_ex.re" +#line 348 "ext/standard/url_scanner_ex.re" stop: diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index e1ac636d04..be10bc49dd 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Wed Nov 9 19:37:48 2011 */ +/* Generated by re2c 0.13.5 on Sun Jan 1 10:36:31 2012 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ |
