diff --git a/.travis.yml b/.travis.yml index d149772e3144..4d127fe02016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,7 @@ notifications: email: false env: - global: - - MYSQL_TEST_HOST=127.0.0.1 - - MYSQL_TEST_USER=travis - - PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" - - PDO_MYSQL_TEST_USER=travis - - PDO_MYSQL_TEST_PASS= - - PDO_MYSQL_TEST_HOST=127.0.0.1 - matrix: - - REPORT_EXIT_STATUS=1 + - REPORT_EXIT_STATUS=1 before_script: # Compile PHP diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 16ec36b68130..7413be453ca6 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -259,10 +259,7 @@ The file labelled 'EXPERIMENTAL' should include the following information:: Any authoring information (known bugs, future directions of the module). - Ongoing status notes which may not be appropriate for Git comments. - -In general new features should go to PECL or experimental branches until -there are specific reasons for directly adding it to the core distribution. + Ongoing status notes which may not be appropriate for SVN comments. Aliases & Legacy Documentation ----------------------------------- diff --git a/EXTENSIONS b/EXTENSIONS index 61a1688b3c94..530858202352 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -147,7 +147,7 @@ STATUS: Working COMMENT: Tested on phpts and isapi versions ------------------------------------------------------------------------------- EXTENSION: mysql -PRIMARY MAINTAINER: Zak Greant , Georg Richter , Andrey Hristov , Johannes Schlüter , Ulf Wendel +PRIMARY MAINTAINER: Zak Greant , Georg Richter , Johannes Schlüter , Ulf Wendel MAINTENANCE: Maintained STATUS: Working ------------------------------------------------------------------------------- @@ -158,7 +158,7 @@ STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- EXTENSION: mysqlnd -PRIMARY MAINTAINER: Andrey Hristov , Johannes Schlüter , Ulf Wendel +PRIMARY MAINTAINER: Georg Richter , Andrey Hristov , Johannes Schlüter , Ulf Wendel MAINTENANCE: Maintained STATUS: Working SINCE: 5.3 diff --git a/INSTALL b/INSTALL index 141e4f8312f6..c0cbe5f2c15c 100644 --- a/INSTALL +++ b/INSTALL @@ -1819,7 +1819,7 @@ Installation set of HTTP headers. The headers it did return are: 10. Windows: I've followed all the instructions, but still can't get PHP and IIS to work together! - 11. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get + 11. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the following error: Security Alert! PHP CGI cannot be accessed directly.. 12. How do I know if my php.ini is being found and read? It seems like @@ -2007,7 +2007,7 @@ cgi error: And for IIS4 you need to tell it that PHP is a script engine. Also, you will want to read this faq. - When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get the + When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the following error: Security Alert! PHP CGI cannot be accessed directly.. You must set the cgi.force_redirect directive to 0. It defaults diff --git a/Makefile.global b/Makefile.global index bd82daf4d891..5118de83fe45 100644 --- a/Makefile.global +++ b/Makefile.global @@ -10,7 +10,7 @@ all: $(all_targets) @echo "Build complete." @echo "Don't forget to run 'make test'." @echo - + build-modules: $(PHP_MODULES) $(PHP_ZEND_EX) build-binaries: $(PHP_BINARIES) @@ -115,19 +115,10 @@ clean: find . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf - rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/* + rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/* distclean: clean - rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h - rm -f php5.spec main/build-defs.h scripts/phpize - rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak - rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1 - rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html - rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h - rm -f ext/phar/phar.phar ext/phar/phar.php - if test "$(srcdir)" != "$(builddir)"; then \ - rm -f ext/phar/phar/phar.inc; \ - fi + rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f .PHONY: all clean install distclean test diff --git a/NEWS b/NEWS index bc3912602b4d..2b99143f4b64 100644 --- a/NEWS +++ b/NEWS @@ -1,47 +1,6993 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 201?, PHP 5.6.0 +11 Apr 2013, PHP 5.3.24 + +- Core + . Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']). + (Anatol) + . Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle + exceptions properly). (Jeff Welch) + . Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry) + +- PCRE: + . Merged PCRE 8.32). (Anatol) + +- mysqlnd + . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc + for stmt->param_bind). (Andrey) + +- DateTime + . Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol) + +- Zip: + . Bug #64452 (Zip crash intermittently). (Anatol) + + +14 Mar 2013, PHP 5.3.23 + +- Phar: + . Fixed timestamp update on Phar contents modification. (Dmitry) + +- SPL: + . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) + . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). + (patch by kriss@krizalys.com, Laruence) + . Fixed bug #52861 (unset fails with ArrayObject and deep arrays). + (Mike Willbanks) + +21 Feb 2013, PHP 5.3.22 + +- Zend Engine: + . Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes) + . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) + +- Core + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). + (Laruence) + +- Date: + . Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV). + (Laruence, Derick) + +- FPM: + . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) + +- SOAP + . Added check that soap.wsdl_cache_dir conforms to open_basedir + (CVE-2013-1635). (Dmitry) + . Disabled external entities loading (CVE-2013-1643). (Dmitry) + +- SPL: + . Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). (Nikita Popov) + +17 Jan 2013, PHP 5.3.21 + +- Zend Engine: + . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). + (Johannes) + +- cURL extension: + . Fixed bug (segfault due to libcurl connection caching). (Pierrick) + . Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for + CURLOPT_SSL_VERIFYHOST). (Pierrick) + . Fixed bug #63352 (Can't enable hostname validation when using curl stream + wrappers). (Pierrick) + . Fixed bug #55438 (Curlwapper is not sending http header randomly). + (phpnet@lostreality.org, Pierrick) + +20 Dec 2012, PHP 5.3.20 + +- Zend Engine: + . Fixed bug #63635 (Segfault in gc_collect_cycles). (Dmitry) + . Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes + from value). (Pierrick) + . Fixed bug #63468 (wrong called method as callback with inheritance). + (Laruence) - Core: - . Improved IS_VAR operands fetching. (Laruence, Dmitry) - . Implemented internal operator overloading - (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) - . Made calls from incompatible context issue an E_DEPRECATED warning instead - of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). - (Gustavo) + . Fixed bug #63451 (config.guess file does not have AIX 7 defined, + shared objects are not created). (kemcline at au1 dot ibm dot com) + . Fixed bug #63377 (Segfault on output buffer). + (miau dot jp at gmail dot com, Laruence) + +- Apache2 Handler SAPI: + . Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy) + +- Date: + . Fixed bug #63435 (Datetime::format('u') sometimes wrong by 1 microsecond). + (Remi) + +- Fileinfo: + . Fixed bug #63248 (Load multiple magic files from a directory under Windows). + (Anatoliy) + . Fixed bug #63590 (Different results in TS and NTS under Windows). + (Anatoliy) + +- FPM: + . Fixed bug #63581 (Possible null dereference and buffer overflow). (Remi) + +- Imap: + . Fixed bug #63126 (DISABLE_AUTHENTICATOR ignores array). (Remi) + +- MySQLnd: + . Fixed bug #63398 (Segfault when polling closed link). (Laruence) + +- Reflection: + . Fixed Bug #63614 (Fatal error on Reflection). (Laruence) + +- SOAP + . Fixed bug #63271 (SOAP wsdl cache is not enabled after initial requests). + (John Jawed, Dmitry) + +22 Nov 2012, PHP 5.3.19 + +- Core + . Fixed bug #63241 (PHP fails to open Windows deduplicated files). + (daniel dot stelter-gliese at innogames dot de) + . Fixed bug #62444 (Handle leak in is_readable on windows). + (krazyest at seznam dot cz) + +- Libxml + . Fixed bug #63389 (Missing context check on libxml_set_streams_context() + causes memleak). (Laruence) + +- Mbstring: + . Fixed bug #63447 (max_input_vars doesn't filter variables when + mbstring.encoding_translation = On). (Laruence) + +- MySQL: + . Fixed compilation failure on mixed 32/64 bit systems. (Andrey) + +- OCI8: + . Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro) + (Chris Jones) + +- PCRE: + . Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite). + (Dmitry, Laruence) + . Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy) + +- PDO: + . Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec). + (Martin Osvald, Remi) + +- PDO_pgsql: + . Fixed bug #62593 (Emulate prepares behave strangely with PARAM_BOOL). + (Will Fitch) + +- Streams: + . Fixed bug #63240 (stream_get_line() return contains delimiter string). + (Tjerk, Gustavo) + +- Phar: + . Fixed bug #63297 (Phar fails to write an openssl based signature). + (Anatoliy) + +18 Oct 2012, PHP 5.3.18 + +- Core: + . Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry) + . Fixed bug #63093 (Segfault while load extension failed in zts-build). + (Laruence) + . Fixed bug #62976 (Notice: could not be converted to int when comparing + some builtin classes). (Laruence) + . Fixed bug #61767 (Shutdown functions not called in certain error + situation). (Dmitry) + . Fixed bug #61442 (exception threw in __autoload can not be catched). + (Laruence) + . Fixed bug #60909 (custom error handler throwing Exception + fatal error + = no shutdown function). (Dmitry) - cURL: - . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir - or safe_mode). (Adam) + . Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will + cause cpu Soaring). (Pierrick) + +- FPM: + . Fixed bug #62954 (startup problems fpm / php-fpm). (fat) + . Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat) + . Fixed bug #63085 (Systemd integration and daemonize). (remi, fat) + . Fixed bug #62947 (Unneccesary warnings on FPM). (fat) + . Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat) + . Fixed bug #62216 (Add PID to php-fpm init.d script). (fat) + +- Intl: + . Fix bug #62915 (defective cloning in several intl classes). (Gustavo) + +- OCI8: + . Fixed bug #60901 (Improve "tail" syntax for AIX installation) (Chris Jones) + +- SOAP + . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice). + (Dmitry) + +- SPL: + . Bug #62987 (Assigning to ArrayObject[null][something] overrides all + undefined variables). (Laruence) + +13 Sep 2012, PHP 5.3.17 + +- Core: + . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence) + . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values" + Windows registry). (aserbulov at parallels dot com) + . Fixed bug #62763 (register_shutdown_function and extending class). + (Laruence) + . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence) + . Fixed bug #62716 (munmap() is called with the incorrect length). + (slangley@google.com) + . Fixed bug ##62460 (php binaries installed as binary.dSYM). (Reeze Xia) + +- CURL: + . Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick) + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). + (r.hampartsumyan@gmail.com, Laruence) + + - DateTime: + . Fixed bug #62852 (Unserialize invalid DateTime causes crash). + (reeze.xia@gmail.com) + . Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence) + +- MySQLnd: + . Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence) + +- PDO: + . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) - Session: - . Fixed Bug #65315 (session.hash_function silently fallback to default md5) - (Yasuo) - . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) - . Implemented Request #17860 (Session write short circuit). (Yasuo) - . Implemented Request #20421 (session_abort() and session_reset() function). - (Yasuo) - . Implemented Request #11100 (session_gc() function). (Yasuo) - -- mysqlnd: - . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively - supported by the overlying APIs. (Andrey) - -- OPcache: - . Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL. - (Laruence, Dmitry) - . Added an optimization pass to merged identical constants (and related - cache_slots) in op_array->literals table. (Laruence, Dmitry) - . Added script level constant replacement optimization pass. (Dmitry) + . Fixed bug (segfault due to retval is not initialized). (Laruence) -- PDO_pgsql: - . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo) - . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 - syntax). (Matteo) +- SPL: + . Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) + (Laruence) + +- Enchant: + . Fixed bug #62838 (enchant_dict_quick_check() destroys zval, but fails to + initialize it). (Tony, Mateusz Goik). + +16 Aug 2012, PHP 5.3.16 + +- Core: + . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK + with run-test.php). (Laruence) + +- CURL: + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false). + (r.hampartsumyan@gmail.com, Laruence) + +- DateTime: + . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + +- Reflection: + . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong + result). (Laruence) + +- SPL: + . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance + gives Segmentation fault). (Laruence, Gustavo) + + +19 Jul 2012, PHP 5.3.15 + +- Zend Engine: + . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that + includes a semi-colon). (Pierrick) + +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) + +- Core: + . Fixed potential overflow in _php_stream_scandir, CVE-2012-2688. (Jason + Powell, Stas) + . Fixed bug #62432 (ReflectionMethod random corrupt memory on high + concurrent). (Johannes) + . Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed + Salt). (Anthony Ferrara) + +- Fileinfo: + . Fixed magic file regex support. (Felipe) + +- FPM: + . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat) + . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat) + . Fixed bug #61295 (php-fpm should not fail with commented 'user' + for non-root start). (fat) + . Fixed bug #61026 (FPM pools can listen on the same address). (fat) + . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start). + (fat) + . Fixed bug #62153 (when using unix sockets, multiples FPM instances + can be launched without errors). (fat) + . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat) + . Fixed bug #61218 (FPM drops connection while receiving some binary values + in FastCGI requests). (fat) + . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat) + +- Intl: + . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo) + . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called + twice). (Gustavo) + . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo) + . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks + pattern). (Gustavo) + . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo) + +- JSON: + . Reverted fix for bug #61537. (Johannes) + +- Phar: + . Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe) + +- Reflection: + . Fixed bug #62384 (Attempting to invoke a Closure more than once causes + segfault). (Felipe) + . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks + with constant). (Laruence) + +- SPL: + . Fixed bug #62262 (RecursiveArrayIterator does not implement Countable). + (Nikita Popov) + +- SQLite: + . Fixed open_basedir bypass, CVE-2012-3365. (Johannes, reported by Yury + Maryshev) + +- XML Writer: + . Fixed bug #62064 (memory leak in the XML Writer module). + (jean-pierre dot lozi at lip6 dot fr) + +- Zip: + . Upgraded libzip to 0.10.1 (Anatoliy) + +14 Jun 2012, PHP 5.3.14 + +- CLI SAPI: + . Fixed bug #61546 (functions related to current script failed when chdir() + in cli sapi). (Laruence, reeze.xia@gmail.com) + +- CURL: + . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction). + (Laruence) + +- COM: + . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes) + +- Core: + . Fixed CVE-2012-2143. (Solar Designer) + . Fixed missing bound check in iptcparse(). (chris at chiappa.net) + . Fixed bug #62373 (serialize() generates wrong reference to the object). + (Moriyoshi) + . Fixed bug #62005 (unexpected behavior when incrementally assigning to a + member of a null object). (Laruence) + . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy) + . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo) + . Fixed bug #61730 (Segfault from array_walk modifying an array passed by + reference). (Laruence) + . Fixed bug #61713 (Logic error in charset detection for htmlentities). + (Anatoliy) + . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename + set to null). (Anatoliy) + . Changed php://fd to be available only for CLI. + +- Fileinfo: + . Fixed bug #61812 (Uninitialised value used in libmagic). + (Laruence, Gustavo) + +- Iconv extension: + . Fixed a bug that iconv extension fails to link to the correct library + when another extension makes use of a library that links to the iconv + library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail. + (Moriyoshi) + +- Intl: + . Fixed bug #62082 (Memory corruption in internal function + get_icu_disp_value_src_php()). (Gustavo) + +- JSON + . Fixed bug #61537 (json_encode() incorrectly truncates/discards + information). (Adam) + +- PDO: + . Fixed bug #61755 (A parsing bug in the prepared statements can lead to + access violations). (Johannes) + +- Phar: + . Fix bug #61065 (Secunia SA44335). (Rasmus) + +- Streams: + . Fixed bug #61961 (file_get_contents leaks when access empty file with + maxlen set). (Reeze) + +08 May 2012, PHP 5.3.13 +- CGI + . Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311. + (Stas) + +03 May 2012, PHP 5.3.12 +- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus) + +26 Apr 2012, PHP 5.3.11 + +- Core: + . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables + (without apache2)). (Laruence) + . Fixed bug #61273 (call_user_func_array with more than 16333 arguments + leaks / crashes). (Laruence) + . Fixed bug #61165 (Segfault - strip_tags()). (Laruence) + . Improved max_input_vars directive to check nested variables (Dmitry). + . Fixed bug #61095 (Incorect lexing of 0x00*+). (Etienne) + . Fixed bug #61087 (Memory leak in parse_ini_file when specifying + invalid scanner mode). (Nikic, Laruence) + . Fixed bug #61072 (Memory leak when restoring an exception handler). + (Nikic, Laruence) + . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX). + (Laruence) + . Fixed bug #61043 (Regression in magic_quotes_gpc fix for CVE-2012-0831). + (OndÅ™ej Surý) + . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical + vars). (Laruence) + . Fixed bug #60895 (Possible invalid handler usage in windows random + functions). (Pierre) + . Fixed bug #60825 (Segfault when running symfony 2 tests). + (Dmitry, Laruence) + . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam) + . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia) + . Fixed bug #60227 (header() cannot detect the multi-line header with CR). + (rui, Gustavo) + . Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia) + . Fixed bug #54374 (Insufficient validating of upload name leading to + corrupted $_FILES indices). (CVE-2012-1172). (Stas, lekensteyn at + gmail dot com, Pierre) + . Fixed bug #52719 (array_walk_recursive crashes if third param of the + function is by reference). (Nikita Popov) + . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry) + +- DOM + . Added debug info handler to DOM objects. (Gustavo, Joey Smith) + +- FPM + . Fixed bug #61430 (Transposed memset() params in sapi/fpm/fpm/fpm_shm.c). + (michaelhood at gmail dot com, Ilia) + +- Ibase + . Fixed bug #60947 (Segmentation fault while executing ibase_db_info). + (Ilia) + +- Installation + . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones) + +- Fileinfo + . Upgraded libmagic to 5.11 (Pierre, Anatoliy) + . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a + directory descriptor under windows. (Anatoliy) + . Fixed bug #61566 failure caused by the posix lseek and read versions + under windows in cdf_read(). (Anatoliy) + . Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo) + +- Firebird Database extension (ibase): + . Fixed bug #60802 (ibase_trans() gives segfault when passing params). + +- Libxml: + . Fixed bug #61367 (open_basedir bypass using libxml RSHUTDOWN). + (Tim Starling) + +- mysqli + . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes). + +- PDO_mysql + . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't + always work). (Johannes) + . Fixed bug #61194 (PDO should export compression flag with myslqnd). + (Johannes) + +- PDO_odbc + . Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO). (Ilia) + +- PDO_pgsql + . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed + rows on postgresql >= 9). (ben dot pineau at gmail dot com) + +- PDO_Sqlite extension: + . Add createCollation support. (Damien) + +- pgsql: + . Fixed bug #60718 (Compile problem with libpq (PostgreSQL 7.3 or less). + (Yasuo Ohgaki) + +- Phar: + . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL + bytes). (Nikic) + +- PHP-FPM SAPI: + . Fixed bug #60811 (php-fpm compilation problem). (rasmus) + +- Readline: + . Fixed bug #61088 (Memory leak in readline_callback_handler_install). + (Nikic, Laruence) + . Add open_basedir checks to readline_write_history and readline_read_history. + (Rasmus, reported by Mateusz Goik) + +- Reflection: + . Fixed bug #61388 (ReflectionObject:getProperties() issues invalid reads + when get_properties returns a hash table with (inaccessible) dynamic + numeric properties). (Gustavo) + . Fixed bug #60968 (Late static binding doesn't work with + ReflectionMethod::invokeArgs()). (Laruence) + +- SOAP + . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry) + . Fixed bug #60887 (SoapClient ignores user_agent option and sends no + User-Agent header). (carloschilazo at gmail dot com) + . Fixed bug #60842, #51775 (Chunked response parsing error when + chunksize length line is > 10 bytes). (Ilia) + . Fixed bug #49853 (Soap Client stream context header option ignored). + (Dmitry) + +- SPL + . Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe) + . Fixed bug #61418 (Segmentation fault when DirectoryIterator's or + FilesystemIterator's iterators are requested more than once without + having had its dtor callback called in between). (Gustavo) + . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence) + . Fixed bug #61326 (ArrayObject comparison). (Gustavo) + +- SQLite3 extension: + . Add createCollation() method. (Brad Dewar) + +- Session: + . Fixed bug #60860 (session.save_handler=user without defined function core + dumps). (Felipe) + . Fixed bug #60634 (Segmentation fault when trying to die() in + SessionHandler::write()). (Ilia) + +- Streams: + . Fixed bug #61371 (stream_context_create() causes memory leaks on use + streams_socket_create). (Gustavo) + . Fixed bug #61253 (Wrappers opened with errors concurrency problem on ZTS). + (Gustavo) + . Fixed bug #61115 (stream related segfault on fatal error in + php_stream_context_link). (Gustavo) + . Fixed bug #60817 (stream_get_line() reads from stream even when there is + already sufficient data buffered). stream_get_line() now behaves more like + fgets(), as is documented. (Gustavo) + . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not + detected together with the last read). (Gustavo) + . Fixed bug #60106 (stream_socket_server silently truncates long unix + socket paths). (Ilia) + +- Tidy: + . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra) + +- XMLRPC: + . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary + variable). (Nikita Popov) + . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic) + +- Zlib: + . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic) + +02 Feb 2012, PHP 5.3.10 + +- Core: + . Fixed arbitrary remote code execution vulnerability reported by Stefan + Esser, CVE-2012-0830. (Stas, Dmitry) + +10 Jan 2012, PHP 5.3.9 + +- Core: + . Added max_input_vars directive to prevent attacks based on hash collisions + (CVE-2011-4885) (Dmitry). + . Fixed bug #60205 (possible integer overflow in content_length). (Laruence) + . Fixed bug #60139 (Anonymous functions create cycles not detected by the + GC). (Dmitry) + . Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) + (Dmitry). + . Fixed bug #60120 (proc_open's streams may hang with stdin/out/err when + the data exceeds or is equal to 2048 bytes). (Pierre, Pascal Borreli) + . Fixed bug #60099 (__halt_compiler() works in braced namespaces). (Felipe) + . Fixed bug #60019 (Function time_nanosleep() is undefined on OS X). (Ilia) + . Fixed bug #55874 (GCC does not provide __sync_fetch_and_add on some archs). + (klightspeed at netspace dot net dot au) + . Fixed bug #55798 (serialize followed by unserialize with numeric object + prop. gives integer prop). (Gustavo) + . Fixed bug #55749 (TOCTOU issue in getenv() on Windows builds). (Pierre) + . Fixed bug #55707 (undefined reference to `__sync_fetch_and_add_4' on Linux + parisc). (Felipe) + . Fixed bug #55674 (fgetcsv & str_getcsv skip empty fields in some + tab-separated records). (Laruence) + . Fixed bug #55649 (Undefined function Bug()). (Laruence) + . Fixed bug #55622 (memory corruption in parse_ini_string). (Pierre) + . Fixed bug #55576 (Cannot conditionally move uploaded file without race + condition). (Gustavo) + . Fixed bug #55510: $_FILES 'name' missing first character after upload. + (Arpad) + . Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) + . Fixed bug #55504 (Content-Type header is not parsed correctly on + HTTP POST request). (Hannes) + . Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to + is_a and is_subclass_of). (alan_k) + . Fixed bug #52461 (Incomplete doctype and missing xmlns). + (virsacer at web dot de, Pierre) + . Fixed bug #55366 (keys lost when using substr_replace an array). (Arpad) + . Fixed bug #55273 (base64_decode() with strict rejects whitespace after + pad). (Ilia) + . Fixed bug #52624 (tempnam() by-pass open_basedir with nonnexistent + directory). (Felipe) + . Fixed bug #50982 (incorrect assumption of PAGE_SIZE size). (Dmitry) + . Fixed invalid free in call_user_method() function. (Felipe) + . Fixed bug #43200 (Interface implementation / inheritence not possible in + abstract classes). (Felipe) + + +- BCmath: + . Fixed bug #60377 (bcscale related crashes on 64bits platforms). (shm) + +- Calendar: + . Fixed bug #55797 (Integer overflow in SdnToGregorian leads to segfault (in + optimized builds). (Gustavo) + +- cURL: + . Fixed bug #60439 (curl_copy_handle segfault when used with + CURLOPT_PROGRESSFUNCTION). (Pierrick) + . Fixed bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed + before calling curl_exec). (Hannes) + . Fixed issues were curl_copy_handle() would sometimes lose copied + preferences. (Hannes) + +- DateTime: + . Fixed bug #60373 (Startup errors with log_errors on cause segfault). + (Derick) + . Fixed bug #60236 (TLA timezone dates are not converted properly from + timestamp). (Derick) + . Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with + time zone type 2). (Derick) + . Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret "D"). + (Derick) + . Fixed bug #53502 (strtotime with timezone memory leak). (Derick) + . Fixed bug #52062 (large timestamps with DateTime::getTimestamp and + DateTime::setTimestamp). (Derick) + . Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz' + format). (Derick) + . Fixed bug #52113 (Seg fault while creating (by unserialization) + DatePeriod). (Derick) + . Fixed bug #48476 (cloning extended DateTime class without calling + parent::__constr crashed PHP). (Hannes) + +- EXIF: + . Fixed bug #60150 (Integer overflow during the parsing of invalid exif + header). (CVE-2011-4566) (Stas, flolechaud at gmail dot com) + +- Fileinfo: + . Fixed bug #60094 (C++ comment fails in c89). (Laruence) + . Fixed possible memory leak in finfo_open(). (Felipe) + . Fixed memory leak when calling the Finfo constructor twice. (Felipe) + +- Filter: + . Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized + domain name addresses containing >1 -). (Ilia) + +- FTP: + . Fixed bug #60183 (out of sync ftp responses). (bram at ebskamp dot me, + rasmus) + +- Gd: + . Fixed bug #60160 (imagefill() doesn't work correctly + for small images). (Florian) + +- Intl: + . Fixed bug #61487 (Incorrent bounds checking in grapheme_strpos). + (Stas) + . Fixed bug #60192 (SegFault when Collator not constructed + properly). (Florian) + . Fixed memory leak in several Intl locale functions. (Felipe) + +- Json: + . Fixed bug #55543 (json_encode() with JSON_NUMERIC_CHECK fails on objects + with numeric string properties). (Ilia, dchurch at sciencelogic dot com) + +- Mbstring: + . Fixed possible crash in mb_ereg_search_init() using empty pattern. (Felipe) + +- MS SQL: + . Fixed bug #60267 (Compile failure with freetds 0.91). (Felipe) + +- MySQL: + . Fixed bug #55550 (mysql.trace_mode miscounts result sets). (Johannes) + +- MySQLi extension: + . Fixed bug #55859 (mysqli->stat property access gives error). (Andrey) + . Fixed bug #55582 (mysqli_num_rows() returns always 0 for unbuffered, when + mysqlnd is used). (Andrey) + . Fixed bug #55703 (PHP crash when calling mysqli_fetch_fields). + (eran at zend dot com, Laruence) + +- mysqlnd + . Fixed bug #55609 (mysqlnd cannot be built shared). (Johannes) + . Fixed bug #55067 (MySQL doesn't support compression - wrong config option). + (Andrey) + +- NSAPI SAPI: + . Don't set $_SERVER['HTTPS'] on unsecure connection (bug #55403). (Uwe + Schindler) + +- OpenSSL: + . Fixed bug #60279 (Fixed NULL pointer dereference in + stream_socket_enable_crypto, case when ssl_handle of session_stream is not + initialized.) (shm) + . Fix segfault with older versions of OpenSSL. (Scott) + +- Oracle Database extension (OCI8): + . Fixed bug #59985 (show normal warning text for OCI_NO_DATA). + (Chris Jones) + . Increased maximum Oracle error message buffer length for new 11.2.0.3 size. + (Chris Jones) + . Improve internal initalization failure error messages. (Chris Jones) + +- PDO + . Fixed bug #55776 (PDORow to session bug). (Johannes) + +- PDO Firebird: + . Fixed bug #48877 ("bindValue" and "bindParam" do not work for PDO Firebird). + (Mariuz) + . Fixed bug #47415 (PDO_Firebird segfaults when passing lowercased column name to bindColumn). + . Fixed bug #53280 (PDO_Firebird segfaults if query column count less than param count). + (Mariuz) + +- PDO MySQL driver: + . Fixed bug #60155 (pdo_mysql.default_socket ignored). (Johannes) + . Fixed bug #55870 (PDO ignores all SSL parameters when used with mysql + native driver). (Pierre) + . Fixed bug #54158 (MYSQLND+PDO MySQL requires #define + MYSQL_OPT_LOCAL_INFILE). (Andrey) + +- PDO OCI driver: + . Fixed bug #55768 (PDO_OCI can't resume Oracle session after it's been + killed). (mikhail dot v dot gavrilov at gmail dot com, Chris Jones, Tony) + +- Phar: + . Fixed bug #60261 (NULL pointer dereference in phar). (Felipe) + . Fixed bug #60164 (Stubs of a specific length break phar_open_from_fp + scanning for __HALT_COMPILER). (Ralph Schindler) + . Fixed bug #53872 (internal corruption of phar). (Hannes) + . Fixed bug #52013 (Unable to decompress files in a compressed phar). (Hannes) + +- PHP-FPM SAPI: + . Dropped restriction of not setting the same value multiple times, the last + one holds. (giovanni at giacobbi dot net, fat) + . Added .phar to default authorized extensions. (fat) + . Fixed bug #60659 (FPM does not clear auth_user on request accept). + (bonbons at linux-vserver dot org) + . Fixed bug #60629 (memory corruption when web server closed the fcgi fd). + (fat) + . Enhance error log when the primary script can't be open. FR #60199. (fat) + . Fixed bug #60179 (php_flag and php_value does not work properly). (fat) + . Fixed bug #55577 (status.html does not install). (fat) + . Fixed bug #55533 (The -d parameter doesn't work). (fat) + . Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat) + . Fixed bug #55486 (status show BIG processes number). (fat) + . Enhanced security by limiting access to user defined extensions. + FR #55181. (fat) + . Added process.max to control the number of process FPM can fork. FR #55166. + (fat) + . Implemented FR #54577 (Enhanced status page with full status and details + about each processes. Also provide a web page (status.html) for + real-time FPM status. (fat) + . Lowered default value for Process Manager. FR #54098. (fat) + . Implemented FR #52569 (Add the "ondemand" process-manager + to allow zero children). (fat) + . Added partial syslog support (on error_log only). FR #52052. (fat) + +- Postgres: + . Fixed bug #60244 (pg_fetch_* functions do not validate that row param + is >0). (Ilia) + +- Reflection: + . Fixed bug #60367 (Reflection and Late Static Binding). (Laruence) + +- Session: + . Fixed bug #55267 (session_regenerate_id fails after header sent). (Hannes) + +- SimpleXML: + . Reverted the SimpleXML->query() behaviour to returning empty arrays + instead of false when no nodes are found as it was since 5.3.3 + (bug #48601). (chregu, rrichards) + +- SOAP + . Fixed bug #54911 (Access to a undefined member in inherit SoapClient may + cause Segmentation Fault). (Dmitry) + . Fixed bug #48216 (PHP Fatal error: SOAP-ERROR: Parsing WSDL: + Extra content at the end of the doc, when server uses chunked transfer + encoding with spaces after chunk size). (Dmitry) + . Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references). (Dmitry) + +- Sockets: + . Fixed bug #60048 (sa_len a #define on IRIX). (china at thewrittenword dot + com) + +- SPL: + . Fixed bug #60082 (Crash in ArrayObject() when using recursive references). + (Tony) + . Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY). + (jgotti at modedemploi dot fr, Hannes) + . Fixed bug #54304 (RegexIterator::accept() doesn't work with scalar values). + (Hannes) + +- Streams: + . Fixed bug #60455 (stream_get_line misbehaves if EOF is not detected together + with the last read). (Gustavo) + +- Tidy: + . Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference). + (Maksymilian Arciemowicz, Felipe) + +- XSL: + . Added xsl.security_prefs ini option to define forbidden operations within + XSLT stylesheets, default is not to enable write operations. This option + won't be in 5.4, since there's a new method. Fixes Bug #54446. (Chregu, + Nicolas Gregoire) + +23 Aug 2011, PHP 5.3.8 + +- Core: + . Fixed bug #55439 (crypt() returns only the salt for MD5). (Stas) + +- OpenSSL: + . Reverted a change in timeout handling restoring PHP 5.3.6 behavior, + as the new behavior caused mysqlnd SSL connections to hang (#55283). + (Pierre, Andrey, Johannes) + +18 Aug 2011, PHP 5.3.7 +- Upgraded bundled SQLite to version 3.7.7.1. (Scott) +- Upgraded bundled PCRE to version 8.12. (Scott) + +- Zend Engine: + . Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even + though the class has none). (Felipe) + . Fixed bug #55007 (compiler fail after previous fail). (Felipe) + . Fixed bug #54910 (Crash when calling call_user_func with unknown function + name). (Dmitry) + . Fixed bug #54804 (__halt_compiler and imported namespaces). + (Pierrick, Felipe) + . Fixed bug #54624 (class_alias and type hint). (Felipe) + . Fixed bug #54585 (track_errors causes segfault). (Dmitry) + . Fixed bug #54423 (classes from dl()'ed extensions are not destroyed). + (Tony, Dmitry) + . Fixed bug #54372 (Crash accessing global object itself returned from its + __get() handle). (Dmitry) + . Fixed bug #54367 (Use of closure causes problem in ArrayAccess). (Dmitry) + . Fixed bug #54358 (Closure, use and reference). (Dmitry) + . Fixed bug #54262 (Crash when assigning value to a dimension in a non-array). + (Dmitry) + . Fixed bug #54039 (use() of static variables in lambda functions can break + staticness). (Dmitry) + +- Core + . Updated crypt_blowfish to 1.2. ((CVE-2011-2483) (Solar Designer) + . Removed warning when argument of is_a() or is_subclass_of() is not + a known class. (Stas) + . Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski. + . Added PHP_MANDIR constant telling where the manpages were installed into, + and an --man-dir argument to php-config. (Hannes) + . Fixed a crash inside dtor for error handling. (Ilia) + . Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas) + . Implemented FR #54459 (Range function accuracy). (Adam) + + . Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path). + (Ilia) + . Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off). + (Dmitry) + . Fixed bug #55295 [NEW]: popen_ex on windows, fixed possible heap overflow + (Pierre) + . Fixed bug #55258 (Windows Version Detecting Error). + ( xiaomao5 at live dot com, Pierre) + . Fixed bug #55187 (readlink returns weird characters when false result). + (Pierre) + . Fixed bug #55082 (var_export() doesn't escape properties properly). + (Gustavo) + . Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia) + . Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload + filename). (Felipe) Reported by Krzysztof Kotowicz. (CVE-2011-2202) + . Fixed bug #54935 php_win_err can lead to crash. (Pierre) + . Fixed bug #54924 (assert.* is not being reset upon request shutdown). (Ilia) + . Fixed bug #54895 (Fix compiling with older gcc version without need for + membar_producer macro). (mhei at heimpold dot de) + . Fixed bug #54866 (incorrect accounting for realpath_cache_size). + (Dustin Ward) + . Fixed bug #54723 (getimagesize() doesn't check the full ico signature). + (Scott) + . Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt + size). (Pierre, os at irj dot ru) + . Fixed bug #54580 (get_browser() segmentation fault when browscap ini + directive is set through php_admin_value). (Gustavo) + . Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry) + . Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry) + . Fixed bug #54238 (use-after-free in substr_replace()). (Stas) + (CVE-2011-1148) + . Fixed bug #54204 (Can't set a value with a PATH section in php.ini). + (Pierre) + . Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment). + (tomas dot brastavicius at quantum dot lt, Pierrick) + . Fixed bug #54137 (file_get_contents POST request sends additional line + break). (maurice-php at mertinkat dot net, Ilia) + . Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). (Ilia) + . Alternative fix for bug #52550, as applied to the round() function (signed + overflow), as the old fix impacted the algorithm for numbers with magnitude + smaller than 0. (Gustavo) + . Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces) + (Ralph Schindler, Dmitry) + . Fixed bug #52935 (call exit in user_error_handler cause stream relate + core). (Gustavo) + . Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). (Ilia) + . Fixed bug #50816 (Using class constants in array definition fails). + (Pierrick, Dmitry) + . Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode + filter). (slusarz at curecanti dot org) + . Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using + TMPDIR on Windows). (Pierre) + +- Apache2 Handler SAPI: + . Fixed bug #54529 (SAPI crashes on apache_config.c:197). + (hebergement at riastudio dot fr) + +- CLI SAPI: + . Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia) + +- cURL extension: + . Added ini option curl.cainfo (support for custom cert db). (Pierre) + . Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre) + . Added support for CURLOPT_MAX_RECV_SPEED_LARGE and + CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick) + +- DateTime extension: + . Fixed bug where the DateTime object got changed while using date_diff(). + (Derick) + . Fixed bug #54340 (DateTime::add() method bug). (Adam) + . Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|' + correctly). (Adam) + . Fixed bug #54283 (new DatePeriod(NULL) causes crash). (Felipe) + . Fixed bug #51819 (Case discrepancy in timezone names cause Uncaught + exception and fatal error). (Hannes) + +- DBA extension: + . Supress warning on non-existent file open with Berkeley DB 5.2. (Chris Jones) + . Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe) + +- Exif extesion: + . Fixed bug #54121 (error message format string typo). (Ilia) + +- Fileinfo extension: + . Fixed bug #54934 (Unresolved symbol strtoull in HP-UX 11.11). (Felipe) + +- Filter extension: + . Added 3rd parameter to filter_var_array() and filter_input_array() + functions that allows disabling addition of empty elements. (Ilia) + . Fixed bug #53037 (FILTER_FLAG_EMPTY_STRING_NULL is not implemented). (Ilia) + +- Interbase extension: + . Fixed bug #54269 (Short exception message buffer causes crash). (Felipe) + +- intl extension: + . Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia) + . Implemented FR #54540 (Allow loading of arbitrary resource bundles when + fallback is disabled). (David Zuelke, Stas) + +- Imap extension: + . Fixed bug #55313 (Number of retries not set when params specified). + (kevin at kevinlocke dot name) + +- json extension: + . Fixed bug #54484 (Empty string in json_decode doesn't reset + json_last_error()). (Ilia) + +- LDAP extension: + . Fixed bug #53339 (Fails to build when compilng with gcc 4.5 and DSO + libraries). (Clint Byrum, Raphael) + +- libxml extension: + . Fixed bug #54601 (Removing the doctype node segfaults). (Hannes) + . Fixed bug #54440 (libxml extension ignores default context). (Gustavo) + +- mbstring extension: + . Fixed bug #54494 (mb_substr() mishandles UTF-32LE and UCS-2LE). (Gustavo) + +- MCrypt extension: + . Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data + has been fetched (Windows). (Pierre) + . Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random + data on Windows). (Pierre) + +- mysqlnd + . Fixed crash when using more than 28,000 bound parameters. Workaround is to + set mysqlnd.net_cmd_buffer_size to at least 9000. (Andrey) + . Fixed bug #54674 mysqlnd valid_sjis_(head|tail) is using invalid operator + and range). (nihen at megabbs dot com, Andrey) + +- MySQLi extension: + . Fixed bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi + persistent connections). (Andrey) + . Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries). + (Andrey) + +- OpenSSL extension: + . openssl_encrypt()/openssl_decrypt() truncated keys of variable length + ciphers to the OpenSSL default for the algorithm. (Scott) + . On blocking SSL sockets respect the timeout option where possible. + (Scott) + . Fixed bug #54992 (Stream not closed and error not returned when SSL + CN_match fails). (Gustavo, laird_ngrps at dodo dot com dot au) + +- Oracle Database extension (OCI8): + . Added oci_client_version() returning the runtime Oracle client library + version. (Chris Jones) + +. PCRE extension: + . Increased the backtrack limit from 100000 to 1000000 (Rasmus) + +- PDO extension: + . Fixed bug #54929 (Parse error with single quote in sql comment). (Felipe) + . Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE + settings). (Ilia) + +- PDO DBlib driver: + . Fixed bug #54329 (MSSql extension memory leak). + (dotslashpok at gmail dot com) + . Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field). + (mjh at hodginsmedia dot com, Felipe) + +- PDO ODBC driver: + . Fixed data type usage in 64bit. (leocsilva at gmail dot com) + +- PDO MySQL driver: + . Fixed bug #54644 (wrong pathes in php_pdo_mysql_int.h). (Tony, Johannes) + . Fixed bug #53782 (foreach throws irrelevant exception). (Johannes, Andrey) + . Implemented FR #48587 (MySQL PDO driver doesn't support SSL connections). + (Rob) + +- PDO PostgreSQL driver: + . Fixed bug #54318 (Non-portable grep option used in PDO pgsql + configuration). (bwalton at artsci dot utoronto dot ca) + +- PDO Oracle driver: + . Fixed bug #44989 (64bit Oracle RPMs still not supported by pdo-oci). + (jbnance at tresgeek dot net) + +- Phar extension: + . Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters). + (Felipe) + +- PHP-FPM SAPI: + . Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat) + . Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat) + . Fixed missing Expires and Cache-Control headers for ping and status pages. + (fat) + . Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi. + . Fixed wrong value of log_level when invoking fpm with -tt. (fat) + . Added xml format to the status page. (fat) + . Removed timestamp in logs written by children processes. (fat) + . Fixed exit at FPM startup on fpm_resources_prepare() errors. (fat) + . Added master rlimit_files and rlimit_core in the global configuration + settings. (fat) + . Removed pid in debug logs written by chrildren processes. (fat) + . Added custom access log (also added per request %CPU and memory + mesurement). (fat) + . Added a real scoreboard and several improvements to the status page. (fat) + +- Reflection extension: + . Fixed bug #54347 (reflection_extension does not lowercase module function + name). (Felipe, laruence at yahoo dot com dot cn) + +- SOAP extension: + . Fixed bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION + contains itself). (Dmitry) + . Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org) + +- Sockets extension: + . Fixed stack buffer overflow in socket_connect(). (CVE-2011-1938) + Found by Mateusz Kocielski, Marek Kroemeke and Filip Palian. (Felipe) + . Changed socket_set_block() and socket_set_nonblock() so they emit warnings + on error. (Gustavo) + . Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo) + +- SPL extension: + . Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys + on true). (Pierrick) + . Fixed bug #54970 (SplFixedArray::setSize() isn't resizing). (Felipe) + . Fixed bug #54609 (Certain implementation(s) of SplFixedArray cause hard + crash). (Felipe) + . Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and + SplTempFileObject crash when user-space classes don't call the paren + constructor). (Gustavo) + . Fixed bug #54292 (Wrong parameter causes crash in + SplFileObject::__construct()). (Felipe) + . Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting + with \0). (Gustavo) + . Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator). + (Felipe) + +- Streams: + . Fixed bug #54946 (stream_get_contents infinite loop). (Hannes) + . Fixed bug #54623 (Segfault when writing to a persistent socket after + closing a copy of the socket). (Gustavo) + . Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe) + + +17 Mar 2011, PHP 5.3.6 +- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia) +- Upgraded bundled PCRE to version 8.11. (Ilia) + +- Zend Engine: + . Indirect reference to $this fails to resolve if direct $this is never used + in method. (Scott) + . Added options to debug backtrace functions. (Stas) + . Fixed bug numerous crashes due to setlocale (crash on error, pcre, mysql + etc.) on Windows in thread safe mode. (Pierre) + . Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime + error). (Dmitry) + . Fixed Bug #53958 (Closures can't 'use' shared variables by value and by + reference). (Dmitry) + . Fixed Bug #53629 (memory leak inside highlight_string()). (Hannes, Ilia) + . Fixed Bug #51458 (Lack of error context with nested exceptions). (Stas) + . Fixed Bug #47143 (Throwing an exception in a destructor causes a fatal + error). (Stas) + . Fixed bug #43512 (same parameter name can be used multiple times in + method/function definition). (Felipe) + +- Core: + . Added ability to connect to HTTPS sites through proxy with basic + authentication using stream_context/http/header/Proxy-Authorization (Dmitry) + . Changed default value of ini directive serialize_precision from 100 to 17. + (Gustavo) + . Fixed bug #54055 (buffer overrun with high values for precision ini + setting). (Gustavo) + . Fixed bug #53959 (reflection data for fgetcsv out-of-date). (Richard) + . Fixed bug #53577 (Regression introduced in 5.3.4 in open_basedir with a + trailing forward slash). (lekensteyn at gmail dot com, Pierre) + . Fixed bug #53682 (Fix compile on the VAX). (Rasmus, jklos) + . Fixed bug #48484 (array_product() always returns 0 for an empty array). + (Ilia) + . Fixed bug #48607 (fwrite() doesn't check reply from ftp server before + exiting). (Ilia) + + +- Calendar extension: + . Fixed bug #53574 (Integer overflow in SdnToJulian, sometimes leading to + segfault). (Gustavo) + +- DOM extension: + . Implemented FR #39771 (Made DOMDocument::saveHTML accept an optional DOMNode + like DOMDocument::saveXML). (Gustavo) + +- DateTime extension: + . Fixed a bug in DateTime->modify() where absolute date/time statements had + no effect. (Derick) + . Fixed bug #53729 (DatePeriod fails to initialize recurrences on 64bit + big-endian systems). (Derick, rein@basefarm.no) + . Fixed bug #52808 (Segfault when specifying interval as two dates). (Stas) + . Fixed bug #52738 (Can't use new properties in class extended from + DateInterval). (Stas) + . Fixed bug #52290 (setDate, setISODate, setTime works wrong when DateTime + created from timestamp). (Stas) + . Fixed bug #52063 (DateTime constructor's second argument doesn't have a + null default value). (Gustavo, Stas) + +- Exif extension: + . Fixed bug #54002 (crash on crafted tag, reported by Luca Carettoni). + (Pierre) (CVE-2011-0708) + +- Filter extension: + . Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number). + (Ilia, Gustavo) + . Fixed bug #53150 (FILTER_FLAG_NO_RES_RANGE is missing some IP ranges). + (Ilia) + . Fixed bug #52209 (INPUT_ENV returns NULL for set variables (CLI)). (Ilia) + . Fixed bug #47435 (FILTER_FLAG_NO_RES_RANGE don't work with ipv6). + (Ilia, valli at icsurselva dot ch) + +- Fileinfo extension: + . Fixed bug #54016 (finfo_file() Cannot determine filetype in archives). + (Hannes) + +- Gettext + . Fixed bug #53837 (_() crashes on Windows when no LANG or LANGUAGE + environment variable are set). (Pierre) + +- IMAP extension: + . Implemented FR #53812 (get MIME headers of the part of the email). (Stas) + . Fixed bug #53377 (imap_mime_header_decode() doesn't ignore \t during long + MIME header unfolding). (Adam) + +- Intl extension: + . Fixed bug #53612 (Segmentation fault when using cloned several intl + objects). (Gustavo) + . Fixed bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values). + (Felipe) + . Implemented clone functionality for number, date & message formatters. + (Stas). + +- JSON extension: + . Fixed bug #53963 (Ensure error_code is always set during some failed + decodings). (Scott) + +- mysqlnd + . Fixed problem with always returning 0 as num_rows for unbuffered sets. + (Andrey, Ulf) + +- MySQL Improved extension: + . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847). + (Kalle) + . Fixed buggy counting of affected rows when using the text protocol. The + collected statistics were wrong when multi_query was used with mysqlnd + (Andrey) + . Fixed bug #53795 (Connect Error from MySqli (mysqlnd) when using SSL). + (Kalle) + . Fixed bug #53503 (mysqli::query returns false after successful LOAD DATA + query). (Kalle, Andrey) + . Fixed bug #53425 (mysqli_real_connect() ignores client flags when built to + call libmysql). (Kalle, tre-php-net at crushedhat dot com) + +- OpenSSL extension: + . Fixed stream_socket_enable_crypto() not honoring the socket timeout in + server mode. (Gustavo) + . Fixed bug #54060 (Memory leaks when openssl_encrypt). (Pierre) + . Fixed bug #54061 (Memory leaks when openssl_decrypt). (Pierre) + . Fixed bug #53592 (stream_socket_enable_crypto() busy-waits in client mode). + (Gustavo) + . Implemented FR #53447 (Cannot disable SessionTicket extension for servers + that do not support it) by adding a no_ticket SSL context option. (Adam, + Tony) + +- PDO MySQL driver: + . Fixed bug #53551 (PDOStatement execute segfaults for pdo_mysql driver). + (Johannes) + . Implemented FR #47802 (Support for setting character sets in DSN strings). + (Kalle) + +- PDO Oracle driver: + . Fixed bug #39199 (Cannot load Lob data with more than 4000 bytes on + ORACLE 10). (spatar at mail dot nnov dot ru) + +- PDO PostgreSQL driver: + . Fixed bug #53517 (segfault in pgsql_stmt_execute() when postgres is down). + (gyp at balabit dot hu) + +- Phar extension: + . Fixed bug #54247 (format-string vulnerability on Phar). (Felipe) + (CVE-2011-1153) + . Fixed bug #53541 (format string bug in ext/phar). + (crrodriguez at opensuse dot org, Ilia) + . Fixed bug #53898 (PHAR reports invalid error message, when the directory + does not exist). (Ilia) + +- PHP-FPM SAPI: + . Enforce security in the fastcgi protocol parsing. + (ef-lists at email dotde) + . Fixed bug #53777 (php-fpm log format now match php_error log format). (fat) + . Fixed bug #53527 (php-fpm --test doesn't set a valuable return value). (fat) + . Fixed bug #53434 (php-fpm slowlog now also logs the original request). (fat) + +- Readline extension: + . Fixed bug #53630 (Fixed parameter handling inside readline() function). + (jo at feuersee dot de, Ilia) + +- Reflection extension: + . Fixed bug #53915 (ReflectionClass::getConstant(s) emits fatal error on + constants with self::). (Gustavo) + +- Shmop extension: + . Fixed bug #54193 (Integer overflow in shmop_read()). (Felipe) + Reported by Jose Carlos Norte (CVE-2011-1092) + +- SNMP extension: + . Fixed bug #51336 (snmprealwalk (snmp v1) does not handle end of OID tree + correctly). (Boris Lytochkin) + +- SOAP extension: + . Fixed possible crash introduced by the NULL poisoning patch. + (Mateusz Kocielski, Pierre) + +- SPL extension: + . Fixed memory leak in DirectoryIterator::getExtension() and + SplFileInfo::getExtension(). (Felipe) + . Fixed bug #53914 (SPL assumes HAVE_GLOB is defined). (Chris Jones) + . Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0 + values). (Felipe) + . Fixed bug #49608 (Using CachingIterator on DirectoryIterator instance + segfaults). (Felipe) + + . Added SplFileInfo::getExtension(). FR #48767. (Peter Cowburn) + +- SQLite3 extension: + . Fixed memory leaked introduced by the NULL poisoning patch. + (Mateusz Kocielski, Pierre) + . Fixed memory leak on SQLite3Result and SQLite3Stmt when assigning to a + reference. (Felipe) + . Add SQlite3_Stmt::readonly() for checking if a statement is read only. + (Scott) + . Implemented FR #53466 (SQLite3Result::columnType() should return false after + all of the rows have been fetched). (Scott) + +- Streams: + . Fixed bug #54092 (Segmentation fault when using HTTP proxy with the FTP + wrapper). (Gustavo) + . Fixed bug #53913 (Streams functions assume HAVE_GLOB is defined). (Chris + Jones) + . Fixed bug #53903 (userspace stream stat callback does not separate the + elements of the returned array before converting them). (Gustavo) + . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) + +- Tokenizer Extension + . Fixed bug #54089 (token_get_all() does not stop after __halt_compiler). + (Nikita Popov, Ilia) + +- XSL extension: + . Fixed memory leaked introduced by the NULL poisoning patch. + (Mateusz Kocielski, Pierre) + +- Zip extension: + . Added the filename into the return value of stream_get_meta_data(). (Hannes) + . Fixed bug #53923 (Zip functions assume HAVE_GLOB is defined). (Adam) + . Fixed bug #53893 (Wrong return value for ZipArchive::extractTo()). (Pierre) + . Fixed bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive). + (Stas, Maksymilian Arciemowicz). (CVE-2011-0421) + . Fixed bug #53854 (Missing constants for compression type). (Richard, Adam) + . Fixed bug #53603 (ZipArchive should quiet stat errors). (brad dot froehle at + gmail dot com, Gustavo) + . Fixed bug #53579 (stream_get_contents() segfaults on ziparchive streams). + (Hannes) + . Fixed bug #53568 (swapped memset arguments in struct initialization). + (crrodriguez at opensuse dot org) + . Fixed bug #53166 (Missing parameters in docs and reflection definition). + (Richard) + . Fixed bug #49072 (feof never returns true for damaged file in zip). + (Gustavo, Richard Quadling) + +06 Jan 2011, PHP 5.3.5 +- Fixed Bug #53632 (infinite loop with x87 fpu). (CVE-2010-4645) (Scott, + Rasmus) + +09 Dec 2010, PHP 5.3.4 +- Upgraded bundled Sqlite3 to version 3.7.3. (Ilia) +- Upgraded bundled PCRE to version 8.10. (Ilia) + +- Security enhancements: + . Fixed crash in zip extract method (possible CWE-170). + (Maksymilian Arciemowicz, Pierre) + . Paths with NULL in them (foo\0bar.txt) are now considered as invalid. + (Rasmus) + . Fixed a possible double free in imap extension (Identified by Mateusz + Kocielski). (CVE-2010-4150). (Ilia) + . Fixed NULL pointer dereference in ZipArchive::getArchiveComment. + (CVE-2010-3709). (Maksymilian Arciemowicz) + . Fixed possible flaw in open_basedir (CVE-2010-3436). (Pierre) + . Fixed MOPS-2010-24, fix string validation. (CVE-2010-2950). (Pierre) + . Fixed symbolic resolution support when the target is a DFS share. (Pierre) + . Fixed bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with + large amount of data) (CVE-2010-3710). (Adam) + +- General improvements: + . Added stat support for zip stream. (Pierre) + . Added follow_location (enabled by default) option for the http stream + support. (Pierre) + . Improved support for is_link and related functions on Windows. (Pierre) + . Added a 3rd parameter to get_html_translation_table. It now takes a charset + hint, like htmlentities et al. (Gustavo) + +- Implemented feature requests: + . Implemented FR #52348, added new constant ZEND_MULTIBYTE to detect + zend multibyte at runtime. (Kalle) + . Implemented FR #52173, added functions pcntl_get_last_error() and + pcntl_strerror(). (nick dot telford at gmail dot com, Arnaud) + . Implemented symbolic links support for open_basedir checks. (Pierre) + . Implemented FR #51804, SplFileInfo::getLinkTarget on Windows. (Pierre) + . Implemented FR #50692, not uploaded files don't count towards + max_file_uploads limit. As a side improvement, temporary files are not + opened for empty uploads and, in debug mode, 0-length uploads. (Gustavo) + +- Improved MySQLnd: + . Added new character sets to mysqlnd, which are available in MySQL 5.5 + (Andrey) + +- Improved PHP-FPM SAPI: + . Added '-p/--prefix' to php-fpm to use a custom prefix and run multiple + instances. (fat) + . Added custom process title for FPM. (fat) + . Added '-t/--test' to php-fpm to check and validate FPM conf file. (fat) + . Added statistics about listening socket queue length for FPM. + (andrei dot nigmatulin at gmail dot com, fat) + +- Core: + . Fixed extract() to do not overwrite $GLOBALS and $this when using + EXTR_OVERWRITE. (jorto at redhat dot com) + . Fixed bug in the Windows implementation of dns_get_record, where the two + last parameters wouldn't be filled unless the type were DNS_ANY (Gustavo). + . Changed the $context parameter on copy() to actually have an effect. (Kalle) + . Fixed htmlentities/htmlspecialchars accepting certain ill-formed UTF-8 + sequences. (Gustavo) + . Fixed bug #53409 (sleep() returns NULL on Windows). (Pierre) + . Fixed bug #53319 (strip_tags() may strip '
' incorrectly). (Felipe) + . Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits). + (Ilia, daniel dot mueller at inexio dot net) + . Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char). + (Justin Martin) + . Fixed bug #53226 (file_exists fails on big filenames). (Adam) + . Fixed bug #53198 (changing INI setting "from" with ini_set did not have any + effect). (Gustavo) + . Fixed bug #53180 (post_max_size=0 not disabling the limit when the content + type is application/x-www-form-urlencoded or is not registered with PHP). + (gm at tlink dot de, Gustavo) + . Fixed bug #53141 (autoload misbehaves if called from closing session). + (ladislav at marek dot su) + . Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities + with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of + ENT_NOQUOTES in html_entity_decode that had introduced the bug (rev + #185591) to other encodings. Additionaly, html_entity_decode() now doesn't + decode " if ENT_NOQUOTES is given. (Gustavo) + . Fixed bug #52931 (strripos not overloaded with function overloading + enabled). (Felipe) + . Fixed bug #52772 (var_dump() doesn't check for the existence of + get_class_name before calling it). (Kalle, Gustavo) + . Fixed bug #52534 (var_export array with negative key). (Felipe) + . Fixed bug #52327 (base64_decode() improper handling of leading padding in + strict mode). (Ilia) + . Fixed bug #52260 (dns_get_record fails with non-existing domain on Windows). + (a_jelly_doughnut at phpbb dot com, Pierre) + . Fixed bug #50953 (socket will not connect to IPv4 address when the host has + both IPv4 and IPv6 addresses, on Windows). (Gustavo, Pierre) + . Fixed bug #50524 (proc_open on Windows does not respect cwd as it does on + other platforms). (Pierre) + . Fixed bug #49687 (utf8_decode vulnerabilities and deficiencies in the number + of reported malformed sequences). (CVE-2010-3870) (Gustavo) + . Fixed bug #49407 (get_html_translation_table doesn't handle UTF-8). + (Gustavo) + . Fixed bug #48831 (php -i has different output to php --ini). (Richard, + Pierre) + . Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4). + (Felipe) + . Fixed bug #47168 (printf of floating point variable prints maximum of 40 + decimal places). (Ilia) + . Fixed bug #46587 (mt_rand() does not check that max is greater than min). + (Ilia) + . Fixed bug #29085 (bad default include_path on Windows). (Pierre) + . Fixed bug #25927 (get_html_translation_table calls the ' ' instead of + '). (Gustavo) + +- Zend engine: + . Reverted fix for bug #51176 (Static calling in non-static method behaves + like $this->). (Felipe) + . Changed deprecated ini options on startup from E_WARNING to E_DEPRECATED. + (Kalle) + . Fixed NULL dereference in lex_scan on zend multibyte builds where the script + had a flex incompatible encoding and there was no converter. (Gustavo) + . Fixed covariance of return-by-ref constraints. (Etienne) + . Fixed bug #53305 (E_NOTICE when defining a constant starts with + __COMPILER_HALT_OFFSET__). (Felipe) + . Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF). + (Dmitry) + . Fixed bug #52879 (Objects unreferenced in __get, __set, __isset or __unset + can be freed too early). (mail_ben_schmidt at yahoo dot com dot au, Dmitry) + . Fixed bug #52786 (PHP should reset section to [PHP] after ini sections). + (Fedora at famillecollet dot com) + . Fixed bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW). + (Felipe) + . Fixed bug #52484 (__set() ignores setting properties with empty names). + (Felipe) + . Fixed bug #52361 (Throwing an exception in a destructor causes invalid + catching). (Dmitry) + . Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry) + +- Build issues: + . Fixed bug #52436 (Compile error if systems do not have stdint.h) + (Sriram Natarajan) + . Fixed bug #50345 (nanosleep not detected properly on some solaris versions). + (Ulf, Tony) + . Fixed bug #49215 (make fails on glob_wrapper). (Felipe) + +- Calendar extension: + . Fixed bug #52744 (cal_days_in_month incorrect for December 1 BCE). + (gpap at internet dot gr, Adam) + +- cURL extension: + . Fixed bug #52828 (curl_setopt does not accept persistent streams). + (Gustavo, Ilia) + . Fixed bug #52827 (cURL leaks handle and causes assertion error + (CURLOPT_STDERR)). (Gustavo) + . Fixed bug #52202 (CURLOPT_PRIVATE gets corrupted). (Ilia) + . Fixed bug #50410 (curl extension slows down PHP on Windows). (Pierre) + +- DateTime extension: + . Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return + 1 million microsecs). (ped at 7gods dot org) + . Fixed bug #52668 (Iterating over a dateperiod twice is broken). (Derick) + . Fixed bug #52454 (Relative dates and getTimestamp increments by one day). + (Derick) + . Fixed bug #52430 (date_parse parse 24:xx:xx as valid time). (Derick) + . Added support for the ( and ) delimiters/separators to + DateTime::createFromFormat(). (Derick) + +- DBA extension: + . Added Berkeley DB 5.1 support to the DBA extension. (Oracle Corp.) + +- DOM extension: + . Fixed bug #52656 (DOMCdataSection does not work with splitText). (Ilia) + +- Filter extension: + . Fixed the filter extension accepting IPv4 octets with a leading 0 as that + belongs to the unsupported "dotted octal" representation. (Gustavo) + . Fixed bug #53236 (problems in the validation of IPv6 addresses with leading + and trailing :: in the filter extension). (Gustavo) + . Fixed bug #50117 (problems in the validation of IPv6 addresses with IPv4 + addresses and ::). (Gustavo) + +- GD extension: + . Fixed bug #53492 (fix crash if anti-aliasing steps are invalid). (Pierre) + . Fixed potential memory leak on a png error (Rasmus, Paul Saab) + +- GMP extension: + . Fixed bug #52906 (gmp_mod returns negative result when non-negative is + expected). (Stas) + . Fixed bug #52849 (GNU MP invalid version match). (Adam) + +- Hash extension: + . Fixed bug #51003 (unaligned memory access in ext/hash/hash_tiger.c). + (Mike, Ilia) + +- Iconv extension: + . Fixed bug #52941 (The 'iconv_mime_decode_headers' function is skipping + headers). (Adam) + . Fixed bug #52599 (iconv output handler outputs incorrect content type + when flags are used). (Ilia) + . Fixed bug #51250 (iconv_mime_decode() does not ignore malformed Q-encoded + words). (Ilia) + +- Intl extension: + . Fixed crashes on invalid parameters in intl extension. (CVE-2010-4409). + (Stas, Maksymilian Arciemowicz) + . Added support for formatting the timestamp stored in a DateTime object. + (Stas) + . Fixed bug #50590 (IntlDateFormatter::parse result is limited to the integer + range). (Stas) + +- Mbstring extension: + . Fixed bug #53273 (mb_strcut() returns garbage with the excessive length + parameter). (CVE-2010-4156) (Mateusz Kocielski, Pierre, Moriyoshi) + . Fixed bug #52981 (Unicode casing table was out-of-date. Updated with + UnicodeData-6.0.0d7.txt and included the source of the generator program + with the distribution) (Gustavo). + . Fixed bug #52681 (mb_send_mail() appends an extra MIME-Version header). + (Adam) + +- MSSQL extension: + . Fixed possible crash in mssql_fetch_batch(). (Kalle) + . Fixed bug #52843 (Segfault when optional parameters are not passed in to + mssql_connect). (Felipe) + +- MySQL extension: + . Fixed bug #52636 (php_mysql_fetch_hash writes long value into int). + (Kalle, rein at basefarm dot no) + +- MySQLi extension: + . Fixed bug #52891 (Wrong data inserted with mysqli/mysqlnd when using + mysqli_stmt_bind_param and value> PHP_INT_MAX). (Andrey) + . Fixed bug #52686 (mysql_stmt_attr_[gs]et argument points to incorrect type). + (rein at basefarm dot no) + . Fixed bug #52654 (mysqli doesn't install headers with structures it uses). + (Andrey) + . Fixed bug #52433 (Call to undefined method mysqli::poll() - must be static). + (Andrey) + . Fixed bug #52417 (MySQLi build failure with mysqlnd on MacOS X). (Andrey) + . Fixed bug #52413 (MySQLi/libmysql build failure on OS X, FreeBSD). (Andrey) + . Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle) + . Fixed bug #52302 (mysqli_fetch_all does not work with MYSQLI_USE_RESULT). + (Andrey) + . Fixed bug #52221 (Misbehaviour of magic_quotes_runtime (get/set)). (Andrey) + . Fixed bug #45921 (Can't initialize character set hebrew). (Andrey) + +- MySQLnd: + . Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey) + +- ODBC extension: + - Fixed bug #52512 (Broken error handling in odbc_execute). + (mkoegler at auto dot tuwien dot ac dot at) + +- Openssl extension: + . Fixed possible blocking behavior in openssl_random_pseudo_bytes on Windows. + (Pierre) + . Fixed bug #53136 (Invalid read on openssl_csr_new()). (Felipe) + . Fixed bug #52947 (segfault when ssl stream option capture_peer_cert_chain + used). (Felipe) + +- Oracle Database extension (OCI8): + . Fixed bug #53284 (Valgrind warnings in oci_set_* functions) (Oracle Corp.) + . Fixed bug #51610 (Using oci_connect causes PHP to take a long time to + exit). Requires Oracle 11.2.0.2 client libraries (or Oracle bug fix + 9891199) for this patch to have an effect. (Oracle Corp.) + +- PCNTL extension: + . Fixed bug #52784 (Race condition when handling many concurrent signals). + (nick dot telford at gmail dot com, Arnaud) + +- PCRE extension: + . Fixed bug #52971 (PCRE-Meta-Characters not working with utf-8). (Felipe) + . Fixed bug #52732 (Docs say preg_match() returns FALSE on error, but it + returns int(0)). (slugonamission at gmail dot com) + +- PHAR extension: + . Fixed bug #50987 (unaligned memory access in phar.c). + (geissert at debian dot org, Ilia) + +- PHP-FPM SAPI: + . Fixed bug #53412 (segfault when using -y). (fat) + . Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat) + . Fixed bug #52501 (libevent made FPM crashed when forking -- libevent has + been removed). (fat) + . Fixed bug #52725 (gcc builtin atomic functions were sometimes used when they + were not available). (fat) + . Fixed bug #52693 (configuration file errors are not logged to stderr). (fat) + . Fixed bug #52674 (FPM Status page returns inconsistent Content-Type + headers). (fat) + . Fixed bug #52498 (libevent was not only linked to php-fpm). (fat) + +- PDO: + . Fixed bug #52699 (PDO bindValue writes long int 32bit enum). + (rein at basefarm dot no) + . Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe) + +- PDO DBLib driver: + . Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values). + (Felipe) + +- PDO Firebird driver: + . Restored firebird support (VC9 builds only). (Pierre) + . Fixed bug #53335 (pdo_firebird did not implement rowCount()). + (preeves at ibphoenix dot com) + . Fixed bug #53323 (pdo_firebird getAttribute() crash). + (preeves at ibphoenix dot com) + +- PDO MySQL driver: + . Fixed bug #52745 (Binding params doesn't work when selecting a date inside a + CASE-WHEN). (Andrey) + +- PostgreSQL extension: + . Fixed bug #47199 (pg_delete() fails on NULL). (ewgraf at gmail dot com) + +- Reflection extension: + . Fixed ReflectionProperty::isDefault() giving a wrong result for properties + obtained with ReflectionClass::getProperties(). (Gustavo) +- Reflection extension: + . Fixed bug #53366 (Reflection doesnt get dynamic property value from + getProperty()). (Felipe) + . Fixed bug #52854 (ReflectionClass::newInstanceArgs does not work for classes + without constructors). (Johannes) + +- SOAP extension: + . Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy + with SoapClient object). (Dmitry) + +- SPL extension: + . Fixed bug #53362 (Segmentation fault when extending SplFixedArray). (Felipe) + . Fixed bug #53279 (SplFileObject doesn't initialise default CSV escape + character). (Adam) + . Fixed bug #53144 (Segfault in SplObjectStorage::removeAll()). (Felipe) + . Fixed bug #53071 (SPLObjectStorage defeats gc_collect_cycles). (Gustavo) + . Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe) + . Fixed bug #51763 (SplFileInfo::getType() does not work symbolic link + and directory). (Pierre) + . Fixed bug #50481 (Storing many SPLFixedArray in an array crashes). (Felipe) + . Fixed bug #50579 (RegexIterator::REPLACE doesn't work). (Felipe) + +- SQLite3 extension: + . Fixed bug #53463 (sqlite3 columnName() segfaults on bad column_number). + (Felipe) + +- Streams: + . Fixed forward stream seeking emulation in streams that don't support seeking + in situations where the read operation gives back less data than requested + and when there was data in the buffer before the emulation started. Also + made more consistent its behavior -- should return failure every time less + data than was requested was skipped. (Gustavo) + . Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails + with streams opened with, inter alia, the 'xb' mode). (Gustavo) + . Fixed bug #53006 (stream_get_contents has an unpredictable behavior when the + underlying stream does not support seeking). (Gustavo) + . Fixed bug #52944 (Invalid write on second and subsequent reads with an + inflate filter fed invalid data). (Gustavo) + . Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the + stream). (Gustavo) + +- WDDX extension: + . Fixed bug #52468 (wddx_deserialize corrupts integer field value when left + empty). (Felipe) + +- Zlib extension: + . Fixed bug #52926 (zlib fopen wrapper does not use context). (Gustavo) + +22 Jul 2010, PHP 5.3.3 +- Upgraded bundled sqlite to version 3.6.23.1. (Ilia) +- Upgraded bundled PCRE to version 8.02. (Ilia) + +- Added support for JSON_NUMERIC_CHECK option in json_encode() that converts + numeric strings to integers. (Ilia) +- Added stream_set_read_buffer, allows to set the buffer for read operation. + (Pierre) +- Added stream filter support to mcrypt extension (ported from + mcrypt_filter). (Stas) +- Added full_special_chars filter to ext/filter. (Rasmus) +- Added backlog socket context option for stream_socket_server(). (Mike) +- Added fifth parameter to openssl_encrypt()/openssl_decrypt() + (string $iv) to use non-NULL IV. + Made implicit use of NULL IV a warning. (Sara) +- Added openssl_cipher_iv_length(). (Sara) +- Added FastCGI Process Manager (FPM) SAPI. (Tony) +- Added recent Windows versions to php_uname and fix undefined windows + version support. (Pierre) +- Added Berkeley DB 5 support to the DBA extension. (Johannes, Chris Jones) +- Added support for copy to/from array/file for pdo_pgsql extension. + (Denis Gasparin, Ilia) +- Added inTransaction() method to PDO, with specialized support for Postgres. + (Ilia, Denis Gasparin) + +- Changed namespaced classes so that the ctor can only be named + __construct now. (Stas) +- Reset error state in PDO::beginTransaction() reset error state. (Ilia) + +- Implemented FR#51295 (SQLite3::busyTimeout not existing). (Mark) +- Implemented FR#35638 (Adding udate to imap_fetch_overview results). + (Charles_Duffy at dell dot com ) +- Rewrote var_export() to use smart_str rather than output buffering, prevents + data disclosure if a fatal error occurs (CVE-2010-2531). (Scott) +- Fixed possible buffer overflows in mysqlnd_list_fields, mysqlnd_change_user. + (Andrey) +- Fixed possible buffer overflows when handling error packets in mysqlnd. + Reported by Stefan Esser. (Andrey) +- Fixed very rare memory leak in mysqlnd, when binding thousands of columns. + (Andrey) +- Fixed a crash when calling an inexistent method of a class that inherits + PDOStatement if instantiated directly instead of doing by the PDO methods. + (Felipe) + +- Fixed memory leak on error in mcrypt_create_iv on Windows. (Pierre) +- Fixed a possible crash because of recursive GC invocation. (Dmitry) +- Fixed a possible resource destruction issues in shm_put_var(). + Reported by Stefan Esser. (Dmitry) +- Fixed a possible information leak because of interruption of XOR operator. + Reported by Stefan Esser. (Dmitry) +- Fixed a possible memory corruption because of unexpected call-time pass by + refernce and following memory clobbering through callbacks. + Reported by Stefan Esser. (Dmitry) +- Fixed a possible memory corruption in ArrayObject::uasort(). Reported by + Stefan Esser. (Dmitry) +- Fixed a possible memory corruption in parse_str(). Reported by Stefan Esser. + (Dmitry) +- Fixed a possible memory corruption in pack(). Reported by Stefan Esser. + (Dmitry) +- Fixed a possible memory corruption in substr_replace(). Reported by Stefan + Esser. (Dmitry) +- Fixed a possible memory corruption in addcslashes(). Reported by Stefan + Esser. (Dmitry) +- Fixed a possible stack exhaustion inside fnmatch(). Reported by Stefan + Esser. (Ilia) +- Fixed a possible dechunking filter buffer overflow. Reported by Stefan Esser. + (Pierre) +- Fixed a possible arbitrary memory access inside sqlite extension. Reported + by Mateusz Kocielski. (Ilia) +- Fixed string format validation inside phar extension. Reported by Stefan + Esser. (Ilia) +- Fixed handling of session variable serialization on certain prefix + characters. Reported by Stefan Esser. (Ilia) +- Fixed a NULL pointer dereference when processing invalid XML-RPC + requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) +- Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas) +- Fixed SplObjectStorage unserialization problems (CVE-2010-2225). (Stas) +- Fixed the mail.log ini setting when no filename was given. (Johannes) + +- Fixed bug #52317 (Segmentation fault when using mail() on a rhel 4.x (only 64 + bit)). (Adam) +- Fixed bug #52262 (json_decode() shows no errors on invalid UTF-8). + (Scott) +- Fixed bug #52240 (hash_copy() does not copy the HMAC key, causes wrong + results and PHP crashes). (Felipe) +- Fixed bug #52238 (Crash when an Exception occured in iterator_to_array). + (Johannes) +- Fixed bug #52193 (converting closure to array yields empty array). (Felipe) +- Fixed bug #52183 (Reflectionfunction reports invalid number of arguments for + function aliases). (Felipe) +- Fixed bug #52162 (custom request header variables with numbers are removed). + (Sriram Natarajan) +- Fixed bug #52160 (Invalid E_STRICT redefined constructor error). (Felipe) +- Fixed bug #52138 (Constants are parsed into the ini file for section names). + (Felipe) +- Fixed bug #52115 (mysqli_result::fetch_all returns null, not an empty array). + (Andrey) +- Fixed bug #52101 (dns_get_record() garbage in 'ipv6' field on Windows). + (Pierre) +- Fixed bug #52082 (character_set_client & character_set_connection reset after + mysqli_change_user()). (Andrey) +- Fixed bug #52043 (GD doesn't recognize latest libJPEG versions). + (php at group dot apple dot com, Pierre) +- Fixed bug #52041 (Memory leak when writing on uninitialized variable returned + from function). (Dmitry) +- Fixed bug #52060 (Memory leak when passing a closure to method_exists()). + (Felipe) +- Fixed bug #52057 (ReflectionClass fails on Closure class). (Felipe) +- Fixed bug #52051 (handling of case sensitivity of old-style constructors + changed in 5.3+). (Felipe) +- Fixed bug #52037 (Concurrent builds fail in install-programs). (seanius at + debian dot org, Kalle) +- Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick) +- Fixed bug #52010 (open_basedir restrictions mismatch on vacuum command). + (Ilia) +- Fixed bug #52001 (Memory allocation problems after using variable variables). + (Dmitry) +- Fixed bug #51991 (spl_autoload and *nix support with namespace). (Felipe) +- Fixed bug #51943 (AIX: Several files are out of ANSI spec). (Kalle, + coreystup at gmail dot com) +- Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with + constant array). (Felipe) +- Fixed bug #51905 (ReflectionParameter fails if default value is an array + with an access to self::). (Felipe) +- Fixed bug #51899 (Parse error in parse_ini_file() function when empy value + followed by no newline). (Felipe) +- Fixed bug #51844 (checkdnsrr does not support types other than MX). (Pierre) +- Fixed bug #51827 (Bad warning when register_shutdown_function called with + wrong num of parameters). (Felipe) +- Fixed bug #51822 (Segfault with strange __destruct() for static class + variables). (Dmitry) +- Fixed bug #51791 (constant() aborts execution when fail to check undefined + constant). (Felipe) +- Fixed bug #51732 (Fileinfo __construct or open does not work with NULL). + (Pierre) +- Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike) +- Fixed bug #51723 (Content-length header is limited to 32bit integer with + Apache2 on Windows). (Pierre) +- Fixed bug #51721 (mark DOMNodeList and DOMNamedNodeMap as Traversable). + (David Zuelke) +- Fixed bug #51712 (Test mysql_mysqlnd_read_timeout_long must fail on MySQL4). + (Andrey) +- Fixed bug #51697 (Unsafe operations in free_storage of SPL iterators, + causes crash during shutdown). (Etienne) +- Fixed bug #51690 (Phar::setStub looks for case-sensitive + __HALT_COMPILER()). (Ilia) +- Fixed bug #51688 (ini per dir crashes when invalid document root are given). + (Pierre) +- Fixed bug #51671 (imagefill does not work correctly for small images). + (Pierre) +- Fixed bug #51670 (getColumnMeta causes segfault when re-executing query + after calling nextRowset). (Pierrick) +- Fixed bug #51647 Certificate file without private key (pk in another file) + doesn't work. (Andrey) +- Fixed bug #51629 (CURLOPT_FOLLOWLOCATION error message is misleading). + (Pierre) +- Fixed bug #51627 (script path not correctly evaluated). + (russell dot tempero at rightnow dot com) +- Fixed bug #51624 (Crash when calling mysqli_options()). (Felipe) +- Fixed bug #51615 (PHP crash with wrong HTML in SimpleXML). (Felipe) +- Fixed bug #51609 (pg_copy_to: Invalid results when using fourth parameter). + (Felipe) +- Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string + literal). (cbandy at jbandy dot com) +- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename + argument). (cbandy at jbandy dot com) +- Fixed bug #51605 (Mysqli - zombie links). (Andrey) +- Fixed bug #51604 (newline in end of header is shown in start of message). + (Daniel Egeberg) +- Fixed bug #51590 (JSON_ERROR_UTF8 is undefined). (Felipe) +- Fixed bug #51583 (Bus error due to wrong alignment in mysqlnd). (Rainer Jung) +- Fixed bug #51582 (Don't assume UINT64_C it's ever available). + (reidrac at usebox dot net, Pierre) +- Fixed bug #51577 (Uninitialized memory reference with oci_bind_array_by_name) + (Oracle Corp.) +- Fixed bug #51562 (query timeout in mssql can not be changed per query). + (ejsmont dot artur at gmail dot com) +- Fixed bug #51552 (debug_backtrace() causes segmentation fault and/or memory + issues). (Dmitry) +- Fixed bug #51445 (var_dump() invalid/slow *RECURSION* detection). (Felipe) +- Fixed bug #51435 (Missing ifdefs / logic bug in crypt code cause compile + errors). (Felipe) +- Fixed bug #51424 (crypt() function hangs after 3rd call). (Pierre, Sriram) +- Fixed bug #51394 (Error line reported incorrectly if error handler throws an + exception). (Stas) +- Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains + timezone). (Adam) +- Fixed bug #51347 (mysqli_close / connection memory leak). (Andrey, Johannes) +- Fixed bug #51338 (URL-Rewriter is still enabled if use_only_cookies is + on). (Ilia, j dot jeising at gmail dot com) +- Fixed bug #51291 (oci_error doesn't report last error when called two times) + (Oracle Corp.) +- Fixed bug #51276 (php_load_extension() is missing when HAVE_LIBDL is + undefined). (Tony) +- Fixed bug #51273 (Faultstring property does not exist when the faultstring is + empty) (Ilia, dennis at transip dot nl) +- Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam) +- Fixed bug #51257 (CURL_VERSION_LARGEFILE incorrectly used after libcurl + version 7.10.1). (aron dot ujvari at microsec dot hu) +- Fixed bug #51242 (Empty mysql.default_port does not default to 3306 anymore, + but 0). (Adam) +- Fixed bug #51237 (milter SAPI crash on startup). (igmar at palsenberg dot com) +- Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia, + alexr at oplot dot com) +- Fixed bug #51190 (ftp_put() returns false when transfer was successful). + (Ilia) +- Fixed bug #51183 (ext/date/php_date.c fails to compile with Sun Studio). + (Sriram Natarajan) +- Fixed bug #51176 (Static calling in non-static method behaves like $this->). + (Felipe) +- Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when + an invalid option is provided). (Ilia) +- Fixed bug #51128 (imagefill() doesn't work with large images). (Pierre) +- Fixed bug #51096 ('last day' and 'first day' are handled incorrectly when + parsing date strings). (Derick) +- Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones) +- Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris + Jones) +- Fixed bug #51026 (mysqli_ssl_set not working). (Andrey) +- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4). + (Raphael Geissert) +- Fixed bug #50999 (unaligned memory access in dba_fetch()). (Felipe) +- Fixed bug #50976 (Soap headers Authorization not allowed). + (Brain France, Dmitry) +- Fixed bug #50828 (DOMNotation is not subclass of DOMNode). (Rob) +- Fixed bug #50810 (property_exists does not work for private). (Felipe) +- Fixed bug #50762 (in WSDL mode Soap Header handler function only being called + if defined in WSDL). (mephius at gmail dot com) +- Fixed bug #50731 (Inconsistent namespaces sent to functions registered with + spl_autoload_register). (Felipe) +- Fixed bug #50563 (removing E_WARNING from parse_url). (ralph at smashlabs dot + com, Pierre) +- Fixed bug #50578 (incorrect shebang in phar.phar). (Fedora at FamilleCollet + dot com) +- Fixed bug #50392 (date_create_from_format enforces 6 digits for 'u' format + character). (Derick) +- Fixed bug #50383 (Exceptions thrown in __call / __callStatic do not include + file and line in trace). (Felipe) +- Fixed bug #50358 (Compile failure compiling ext/phar/util.lo). (Felipe) +- Fixed bug #50101 (name clash between global and local variable). + (patch by yoarvi at gmail dot com) +- Fixed bug #50055 (DateTime::sub() allows 'relative' time modifications). + (Derick) +- Fixed bug #51002 (fix possible memory corruption with very long names). + (Pierre) +- Fixed bug #49893 (Crash while creating an instance of Zend_Mail_Storage_Pop3). + (Dmitry) +- Fixed bug #49819 (STDOUT losing data with posix_isatty()). (Mike) +- Fixed bug #49778 (DateInterval::format("%a") is always zero when an interval + is created from an ISO string). (Derick) +- Fixed bug #49700 (memory leaks in php_date.c if garbage collector is + enabled). (Dmitry) +- Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus) +- Fixed bug #49490 (XPath namespace prefix conflict). (Rob) +- Fixed bug #49429 (odbc_autocommit doesn't work). (Felipe) +- Fixed bug #49320 (PDO returns null when SQLite connection fails). (Felipe) +- Fixed bug #49234 (mysqli_ssl_set not found). (Andrey) +- Fixed bug #49216 (Reflection doesn't seem to work properly on MySqli). + (Andrey) +- Fixed bug #49192 (PHP crashes when GC invoked on COM object). (Stas) +- Fixed bug #49081 (DateTime::diff() mistake if start in January and interval > + 28 days). (Derick) +- Fixed bug #49059 (DateTime::diff() repeats previous sub() operation). + (yoarvi@gmail.com, Derick) +- Fixed bug #48983 (DomDocument : saveHTMLFile wrong charset). (Rob) +- Fixed bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP >= 5.3). (Felipe) +- Fixed bug #48902 (Timezone database fallback map is outdated). (Derick) +- Fixed bug #48781 (Cyclical garbage collector memory leak). (Dmitry) +- Fixed bug #48601 (xpath() returns FALSE for legitimate query). (Rob) +- Fixed bug #48361 (SplFileInfo::getPathInfo should return the + parent dir). (Etienne) +- Fixed bug #48289 (iconv_mime_encode() quoted-printable scheme is broken). + (Adam, patch from hiroaki dot kawai at gmail dot com). +- Fixed bug #47842 (sscanf() does not support 64-bit values). (Mike) +- Fixed bug #46111 (Some timezone identifiers can not be parsed). (Derick) +- Fixed bug #45808 (stream_socket_enable_crypto() blocks and eats CPU). + (vincent at optilian dot com) +- Fixed bug #43233 (sasl support for ldap on Windows). (Pierre) +- Fixed bug #35673 (formatOutput does not work with saveHTML). (Rob) +- Fixed bug #33210 (getimagesize() fails to detect width/height on certain + JPEGs). (Ilia) + +04 Mar 2010, PHP 5.3.2 + +- Upgraded bundled sqlite to version 3.6.22. (Ilia) +- Upgraded bundled libmagic to version 5.03. (Mikko) +- Upgraded bundled PCRE to version 8.00. (Scott) +- Updated timezone database to version 2010.3. (Derick) + +- Improved LCG entropy. (Rasmus, Samy Kamkar) +- Improved crypt support for edge cases (UFC compatibility). (Solar Designer, + Joey, Pierre) + +- Reverted fix for bug #49521 (PDO fetchObject sets values before calling + constructor). (Pierrick, Johannes) + +- Changed gmp_strval() to use full range from 2 to 62, and -2 to -36. FR #50283 + (David Soria Parra) +- Changed "post_max_size" php.ini directive to allow unlimited post size by + setting it to 0. (Rasmus) +- Changed tidyNode class to disallow manual node creation. (Pierrick) + +- Removed automatic file descriptor unlocking happening on shutdown and/or + stream close (on all OSes). (Tony, Ilia) + +- Added libpng 1.4.0 support. (Pierre) +- Added support for DISABLE_AUTHENTICATOR for imap_open. (Pierre) +- Added missing host validation for HTTP urls inside FILTER_VALIDATE_URL. + (Ilia) +- Added stream_resolve_include_path(). (Mikko) +- Added INTERNALDATE support to imap_append. (nick at mailtrust dot com) +- Added support for SHA-256 and SHA-512 to php's crypt. (Pierre) +- Added realpath_cache_size() and realpath_cache_get() functions. (Stas) +- Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. (Ilia) +- Added protection for $_SESSION from interrupt corruption and improved + "session.save_path" check. (Stas) +- Added LIBXML_PARSEHUGE constant to override the maximum text size of a + single text node when using libxml2.7.3+. (Kalle) +- Added ReflectionMethod::setAccessible() for invoking non-public methods + through the Reflection API. (Sebastian) +- Added Collator::getSortKey for intl extension. (Stas) +- Added support for CURLOPT_POSTREDIR. FR #49571. (Sriram Natarajan) +- Added support for CURLOPT_CERTINFO. FR #49253. + (Linus Nielsen Feltzing ) +- Added client-side server name indication support in openssl. (Arnaud) + +- Improved fix for bug #50006 (Segfault caused by uksort()). (Stas) + +- Fixed mysqlnd hang when queries exactly 16777214 bytes long are sent. (Andrey) +- Fixed incorrect decoding of 5-byte BIT sequences in mysqlnd. (Andrey) +- Fixed error_log() to be binary safe when using message_type 3. (Jani) +- Fixed unnecessary invocation of setitimer when timeouts have been disabled. + (Arvind Srinivasan) +- Fixed memory leak in extension loading when an error occurs on Windows. + (Pierre) +- Fixed safe_mode validation inside tempnam() when the directory path does + not end with a /). (Martin Jansen) +- Fixed a possible open_basedir/safe_mode bypass in session extension + identified by Grzegorz Stachowiak. (Ilia) +- Fixed possible crash when a error/warning is raised during php startup. + (Pierre) +- Fixed possible bad behavior of rename on windows when used with symbolic + links or invalid paths. (Pierre) +- Fixed error output to stderr on Windows. (Pierre) +- Fixed memory leaks in is_writable/readable/etc on Windows. (Pierre) +- Fixed memory leaks in the ACL function on Windows. (Pierre) +- Fixed memory leak in the realpath cache on Windows. (Pierre) +- Fixed memory leak in zip_close. (Pierre) +- Fixed crypt's blowfish sanity check of the "setting" string, to reject + iteration counts encoded as 36 through 39. (Solar Designer, Joey, Pierre) + +- Fixed bug #51059 (crypt crashes when invalid salt are given). (Pierre) +- Fixed bug #50952 (allow underscore _ in constants parsed in php.ini files). + (Jani) +- Fixed bug #50940 (Custom content-length set incorrectly in Apache SAPIs). + (Brian France, Rasmus) +- Fixed bug #50930 (Wrong date by php_date.c patch with ancient gcc/glibc + versions). (Derick) +- Fixed bug #50907 (X-PHP-Originating-Script adding two new lines in *NIX). + (Ilia) +- Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation). + (Ilia, hanno at hboeck dot de) +- Fixed bug #50847 (strip_tags() removes all tags greater then 1023 bytes + long). (Ilia) +- Fixed bug #50829 (php.ini directive pdo_mysql.default_socket is ignored). + (Ilia) +- Fixed bug #50832 (HTTP fopen wrapper does not support passwordless HTTP + authentication). (Jani) +- Fixed bug #50787 (stream_set_write_buffer() has no effect on socket streams). + (vnegrier at optilian dot com, Ilia) +- Fixed bug #50761 (system.multiCall crashes in xmlrpc extension). + (hiroaki dot kawai at gmail dot com, Ilia) +- Fixed bug #50756 (CURLOPT_FTP_SKIP_PASV_IP does not exist). (Sriram) +- Fixed bug #50732 (exec() adds single byte twice to $output array). (Ilia) +- Fixed bug #50728 (All PDOExceptions hardcode 'code' property to 0). + (Joey, Ilia) +- Fixed bug #50723 (Bug in garbage collector causes crash). (Dmitry) +- Fixed bug #50690 (putenv does not set ENV when the value is only one char). + (Pierre) +- Fixed bug #50680 (strtotime() does not support eighth ordinal number). (Ilia) +- Fixed bug #50661 (DOMDocument::loadXML does not allow UTF-16). (Rob) +- Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but + returns false). (Ilia) +- Fixed bug #50636 (MySQLi_Result sets values before calling constructor). + (Pierrick) +- Fixed bug #50632 (filter_input() does not return default value if the + variable does not exist). (Ilia) +- Fixed bug #50576 (XML_OPTION_SKIP_TAGSTART option has no effect). (Pierrick) +- Fixed bug #50558 (Broken object model when extending tidy). (Pierrick) +- Fixed bug #50540 (Crash while running ldap_next_reference test cases). + (Sriram) +- Fixed bug #50519 (segfault in garbage collection when using set_error_handler + and DomDocument). (Dmitry) +- Fixed bug #50508 (compile failure: Conflicting HEADER type declarations). + (Jani) +- Fixed bug #50496 (Use of is valid only in a c99 compilation + environment. (Sriram) +- Fixed bug #50464 (declare encoding doesn't work within an included file). + (Felipe) +- Fixed bug #50458 (PDO::FETCH_FUNC fails with Closures). (Felipe, Pierrick) +- Fixed bug #50445 (PDO-ODBC stored procedure call from Solaris 64-bit causes + seg fault). (davbrown4 at yahoo dot com, Felipe) +- Fixed bug #50416 (PROCEDURE db.myproc can't return a result set in the given + context). (Andrey) +- Fixed bug #50394 (Reference argument converted to value in __call). (Stas) +- Fixed bug #50351 (performance regression handling objects, ten times slower + in 5.3 than in 5.2). (Dmitry) +- Fixed bug #50392 (date_create_from_format() enforces 6 digits for 'u' + format character). (Ilia) +- Fixed bug #50345 (nanosleep not detected properly on some solaris versions). + (Jani) +- Fixed bug #50340 (php.ini parser does not allow spaces in ini keys). (Jani) +- Fixed bug #50334 (crypt ignores sha512 prefix). (Pierre) +- Fixed bug #50323 (Allow use of ; in values via ;; in PDO DSN). + (Ilia, Pierrick) +- Fixed bug #50285 (xmlrpc does not preserve keys in encoded indexed arrays). + (Felipe) +- Fixed bug #50282 (xmlrpc_encode_request() changes object into array in + calling function). (Felipe) +- Fixed bug #50267 (get_browser(null) does not use HTTP_USER_AGENT). (Jani) +- Fixed bug #50266 (conflicting types for llabs). (Jani) +- Fixed bug #50261 (Crash When Calling Parent Constructor with + call_user_func()). (Dmitry) +- Fixed bug #50255 (isset() and empty() silently casts array to object). + (Felipe) +- Fixed bug #50240 (pdo_mysql.default_socket in php.ini shouldn't used + if it is empty). (foutrelis at gmail dot com, Ilia) +- Fixed bug #50231 (Socket path passed using --with-mysql-sock is ignored when + mysqlnd is enabled). (Jani) +- Fixed bug #50219 (soap call Segmentation fault on a redirected url). + (Pierrick) +- Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT). + (Ilia, shigeru_kitazaki at cybozu dot co dot jp) +- Fixed bug #50209 (Compiling with libedit cannot find readline.h). + (tcallawa at redhat dot com) +- Fixed bug #50207 (segmentation fault when concatenating very large strings on + 64bit linux). (Ilia) +- Fixed bug #50196 (stream_copy_to_stream() produces warning when source is + not file). (Stas) +- Fixed bug #50195 (pg_copy_to() fails when table name contains schema. (Ilia) +- Fixed bug #50185 (ldap_get_entries() return false instead of an empty array + when there is no error). (Jani) +- Fixed bug #50174 (Incorrectly matched docComment). (Felipe) +- Fixed bug #50168 (FastCGI fails with wrong error on HEAD request to + non-existant file). (Dmitry) +- Fixed bug #50162 (Memory leak when fetching timestamp column from Oracle + database). (Felipe) +- Fixed bug #50159 (wrong working directory in symlinked files). (Dmitry) +- Fixed bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses + containing = or ?). (Pierrick) +- Fixed bug #50152 (ReflectionClass::hasProperty behaves like isset() not + property_exists). (Felipe) +- Fixed bug #50146 (property_exists: Closure object cannot have properties). + (Felipe) +- Fixed bug #50145 (crash while running bug35634.phpt). (Felipe) +- Fixed bug #50140 (With default compilation option, php symbols are unresolved + for nsapi). (Uwe Schindler) +- Fixed bug #50087 (NSAPI performance improvements). (Uwe Schindler) +- Fixed bug #50073 (parse_url() incorrect when ? in fragment). (Ilia) +- Fixed bug #50023 (pdo_mysql doesn't use PHP_MYSQL_UNIX_SOCK_ADDR). (Ilia) +- Fixed bug #50005 (Throwing through Reflection modified Exception object + makes segmentation fault). (Felipe) +- Fixed bug #49990 (SNMP3 warning message about security level printed twice). + (Jani) +- Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted + transaction). (ben dot pineau at gmail dot com, Ilia, Matteo) +- Fixed bug #49938 (Phar::isBuffering() returns inverted value). (Greg) +- Fixed bug #49936 (crash with ftp stream in php_stream_context_get_option()). + (Pierrick) +- Fixed bug #49921 (Curl post upload functions changed). (Ilia) +- Fixed bug #49866 (Making reference on string offsets crashes PHP). (Dmitry) +- Fixed bug #49855 (import_request_variables() always returns NULL). (Ilia, + sjoerd at php dot net) +- Fixed bug #49851, #50451 (http wrapper breaks on 1024 char long headers). + (Ilia) +- Fixed bug #49800 (SimpleXML allow (un)serialize() calls without warning). + (Ilia, wmeler at wp-sa dot pl) +- Fixed bug #49719 (ReflectionClass::hasProperty returns true for a private + property in base class). (Felipe) +- Fixed bug #49677 (ini parser crashes with apache2 and using ${something} + ini variables). (Jani) +- Fixed bug #49660 (libxml 2.7.3+ limits text nodes to 10MB). (Felipe) +- Fixed bug #49647 (DOMUserData does not exist). (Rob) +- Fixed bug #49600 (imageTTFText text shifted right). (Takeshi Abe) +- Fixed bug #49585 (date_format buffer not long enough for >4 digit years). + (Derick, Adam) +- Fixed bug #49560 (oci8: using LOBs causes slow PHP shutdown). (Oracle Corp.) +- Fixed bug #49521 (PDO fetchObject sets values before calling constructor). + (Pierrick) +- Fixed bug #49472 (Constants defined in Interfaces can be overridden). + (Felipe) +- Fixed bug #49463 (setAttributeNS fails setting default namespace). (Rob) +- Fixed bug #49244 (Floating point NaN cause garbage characters). (Sjoerd) +- Fixed bug #49224 (Compile error due to old DNS functions on AIX systems). + (Scott) +- Fixed bug #49174 (crash when extending PDOStatement and trying to set + queryString property). (Felipe) +- Fixed bug #48811 (Directives in PATH section do not get applied to + subdirectories). (Patch by: ct at swin dot edu dot au) +- Fixed bug #48590 (SoapClient does not honor max_redirects). (Sriram) +- Fixed bug #48190 (Content-type parameter "boundary" is not case-insensitive + in HTTP uploads). (Ilia) +- Fixed bug #47848 (importNode doesn't preserve attribute namespaces). (Rob) +- Fixed bug #47409 (extract() problem with array containing word "this"). + (Ilia, chrisstocktonaz at gmail dot com) +- Fixed bug #47281 ($php_errormsg is limited in size of characters) + (Oracle Corp.) +- Fixed bug #46478 (htmlentities() uses obsolete mapping table for character + entity references). (Moriyoshi) +- Fixed bug #45599 (strip_tags() truncates rest of string with invalid + attribute). (Ilia, hradtke) +- Fixed bug #45120 (PDOStatement->execute() returns true then false for same + statement). (Pierrick) +- Fixed bug #44827 (define() allows :: in constant names). (Ilia) +- Fixed bug #44098 (imap_utf8() returns only capital letters). + (steffen at dislabs dot de, Pierre) +- Fixed bug #34852 (Failure in odbc_exec() using oracle-supplied odbc + driver). (tim dot tassonis at trivadis dot com) + +19 Nov 2009, PHP 5.3.1 +- Upgraded bundled sqlite to version 3.6.19. (Scott) +- Updated timezone database to version 2009.17 (2009q). (Derick) + +- Changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case + insensitive. (garretts) + +- Restored shebang line check to CGI sapi (not checked by scanner anymore). + (Jani) + +- Added "max_file_uploads" INI directive, which can be set to limit the + number of file uploads per-request to 20 by default, to prevent possible + DOS via temporary file exhaustion. (Ilia) +- Added missing sanity checks around exif processing. (Ilia) +- Added error constant when json_encode() detects an invalid UTF-8 sequence. + (Scott) +- Added support for ACL on Windows for thread safe SAPI (Apache2 for example) + and fix its support on NTS. (Pierre) + +- Improved symbolic, mounted volume and junctions support for realpath on + Windows. (Pierre) +- Improved readlink on Windows, suppress \??\ and use the drive syntax only. + (Pierre) +- Improved dns_get_record() AAAA support on windows. Always available when + IPv6 is support is installed, format is now the same than on unix. (Pierre) +- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API + where available on other platforms. (Scott) +- Improved shared extension loading on OSX to use the standard Unix dlopen() + API. (Scott) + +- Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre) +- Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak. + (Rasmus) +- Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz + Stachowiak. (Rasmus) +- Fixed certificate validation inside php_openssl_apply_verification_policy + (Ryan Sleevi, Ilia) +- Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() + when calling using Reflection. (Felipe) +- Fixed crash when instantiating PDORow and PDOStatement through Reflection. + (Felipe) +- Fixed sanity check for the color index in imagecolortransparent. (Pierre) +- Fixed scandir/readdir when used mounted points on Windows. (Pierre) +- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani) +- Fixed leak on error in popen/exec (and related functions) on Windows. + (Pierre) +- Fixed possible bad caching of symlinked directories in the realpath cache + on Windows. (Pierre) +- Fixed atime and mtime in stat related functions on Windows. (Pierre) +- Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and + Functors. (Christian Seiler) +- Fixed open_basedir circumvention for "mail.log" ini directive. + (Maksymilian Arciemowicz, Stas) +- Fixed signature generation/validation for zip archives in ext/phar. (Greg) +- Fixed memory leak in stream_is_local(). (Felipe, Tony) +- Fixed BC break in mime_content_type(), removes the content encoding. (Scott) + +- Fixed PECL bug #16842 (oci_error return false when NO_DATA_FOUND is raised). + (Chris Jones) + +- Fixed bug #50063 (safe_mode_include_dir fails). (Johannes, christian at + elmerot dot se) +- Fixed bug #50052 (Different Hashes on Windows and Linux on wrong Salt size). + (Pierre) +- Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre) +- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar + tar support). (Greg) +- Fixed bug #49908 (throwing exception in __autoload crashes when interface + is not defined). (Felipe) +- Fixed bug #49847 (exec() fails to return data inside 2nd parameter, given + output lines >4095 bytes). (Ilia) +- Fixed bug #49809 (time_sleep_until() is not available on OpenSolaris). (Jani) +- Fixed bug #49757 (long2ip() can return wrong value in a multi-threaded + applications). (Ilia, Florian Anderiasch) +- Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes). + (Sriram Natarajan) +- Fixed bug #49732 (crashes when using fileinfo when timestamp conversion + fails). (Pierre) +- Fixed bug #49698 (Unexpected change in strnatcasecmp()). (Rasmus) +- Fixed bug #49630 (imap_listscan function missing). (Felipe) +- Fixed bug #49572 (use of C++ style comments causes build failure). + (Sriram Natarajan) +- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE + cannot be set"). (Felipe) +- Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after + fclose). (Ilia) +- Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters). + (Ilia) +- Fixed bug #49447 (php engine need to correctly check for socket API + return status on windows). (Sriram Natarajan) +- Fixed bug #49391 (ldap.c utilizing deprecated ldap_modify_s). (Ilia) +- Fixed bug #49372 (segfault in php_curl_option_curl). (Pierre) +- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries). + (Ilia, code-it at mail dot ru) +- Fixed bug #49306 (inside pdo_mysql default socket settings are ignored). + (Ilia) +- Fixed bug #49289 (bcmath module doesn't compile with phpize configure). + (Jani) +- Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani) +- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside + foreach declaration). (Etienne, Dmitry) +- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) +- Fixed bug #49223 (Inconsistency using get_defined_constants). (Garrett) +- Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies + wrong type in declaration). (Ilia) +- Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre) +- Fixed bug #49144 (Import of schema from different host transmits original + authentication details). (Dmitry) +- Fixed bug #49142 (crash when exception thrown from __tostring()). + (David Soria Parra) +- Fixed bug #49132 (posix_times returns false without error). + (phpbugs at gunnu dot us) +- Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu) +- Fixed bug #49122 (undefined reference to mysqlnd_stmt_next_result on compile + with --with-mysqli and MySQL 6.0). (Jani) +- Fixed bug #49108 (2nd scan_dir produces segfault). (Felipe) +- Fixed bug #49098 (mysqli segfault on error). (Rasmus) +- Fixed bug #49095 (proc_get_status['exitcode'] fails on win32). (Felipe) +- Fixed bug #49092 (ReflectionFunction fails to work with functions in fully + qualified namespaces). (Kalle, Jani) +- Fixed bug #49074 (private class static fields can be modified by using + reflection). (Jani) +- Fixed bug #49072 (feof never returns true for damaged file in zip). (Pierre) +- Fixed bug #49065 ("disable_functions" php.ini option does not work on + Zend extensions). (Stas) +- Fixed bug #49064 (--enable-session=shared does not work: undefined symbol: + php_url_scanner_reset_vars). (Jani) +- Fixed bug #49056 (parse_ini_file() regression in 5.3.0 when using non-ASCII + strings as option keys). (Jani) +- Fixed bug #49052 (context option headers freed too early when using + --with-curlwrappers). (Jani) +- Fixed bug #49047 (The function touch() fails on directories on Windows). + (Pierre) +- Fixed bug #49032 (SplFileObject::fscanf() variables passed by reference). + (Jani) +- Fixed bug #49027 (mysqli_options() doesn't work when using mysqlnd). (Andrey) +- Fixed bug #49026 (proc_open() can bypass safe_mode_protected_env_vars + restrictions). (Ilia) +- Fixed bug #49020 (phar misinterprets ustar long filename standard). + (Greg) +- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed). + (Greg) +- Fixed bug #49014 (dechunked filter broken when serving more than 8192 bytes + in a chunk). (andreas dot streichardt at globalpark dot com, Ilia) +- Fixed bug #49012 (phar tar signature algorithm reports as Unknown (0) in + getSignature() call). (Greg) +- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes + when including files from function). (Stas) +- Fixed bug #48994 (zlib.output_compression does not output HTTP headers when + set to a string value). (Jani) +- Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe) +- Fixed bug #48962 (cURL does not upload files with specified filename). + (Ilia) +- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context + option is an array). (David Zülke) +- Fixed bug #48913 (Too long error code strings in pdo_odbc driver). + (naf at altlinux dot ru, Felipe) +- Fixed bug #48912 (Namespace causes unexpected strict behaviour with + extract()). (Dmitry) +- Fixed bug #48909 (Segmentation fault in mysqli_stmt_execute()). (Andrey) +- Fixed bug #48899 (is_callable returns true even if method does not exist in + parent class). (Felipe) +- Fixed bug #48893 (Problems compiling with Curl). (Felipe) +- Fixed bug #48880 (Random Appearing open_basedir problem). (Rasmus, Gwynne) +- Fixed bug #48872 (string.c: errors: duplicate case values). (Kalle) +- Fixed bug #48854 (array_merge_recursive modifies arrays after first one). + (Felipe) +- Fixed bug #48805 (IPv6 socket transport is not working). (Ilia) +- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani) +- Fixed bug #48791 (open office files always reported as corrupted). (Greg) +- Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked + directories). (Ilia) +- Fixed bug #48783 (make install will fail saying phar file exists). (Greg) +- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()). + (Sriram Natarajan) +- Fixed bug #48771 (rename() between volumes fails and reports no error on + Windows). (Pierre) +- Fixed bug #48768 (parse_ini_*() crash with INI_SCANNER_RAW). (Jani) +- Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at + gmail dot com, Pierre) +- Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe) +- Fixed bug #48757 (ReflectionFunction::invoke() parameter issues). (Kalle) +- Fixed bug #48754 (mysql_close() crash php when no handle specified). + (Johannes, Andrey) +- Fixed bug #48752 (Crash during date parsing with invalid date). (Pierre) +- Fixed bug #48746 (Unable to browse directories within Junction Points). + (Pierre, Kanwaljeet Singla) +- Fixed bug #48745 (mysqlnd: mysql_num_fields returns wrong column count for + mysql_list_fields). (Andrey) +- Fixed bug #48740 (PHAR install fails when INSTALL_ROOT is not the final + install location). (james dot cohen at digitalwindow dot com, Greg) +- Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns on + files that have been opened with r+). (Ilia) +- Fixed bug #48719 (parse_ini_*(): scanner_mode parameter is not checked for + sanity). (Jani) +- Fixed bug #48718 (FILTER_VALIDATE_EMAIL does not allow numbers in domain + components). (Ilia) +- Fixed bug #48681 (openssl signature verification for tar archives broken). + (Greg) +- Fixed bug #48660 (parse_ini_*(): dollar sign as last character of value + fails). (Jani) +- Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal + html-entities). (Moriyoshi) +- Fixed bug #48637 ("file" fopen wrapper is overwritten when using + --with-curlwrappers). (Jani) +- Fixed bug #48608 (Invalid libreadline version not detected during configure). + (Jani) +- Fixed bug #48400 (imap crashes when closing stream opened with + OP_PROTOTYPE flag). (Jani) +- Fixed bug #48377 (error message unclear on converting phar with existing + file). (Greg) +- Fixed bug #48247 (Infinite loop and possible crash during startup with + errors when errors are logged). (Jani) +- Fixed bug #48198 error: 'MYSQLND_LLU_SPEC' undeclared. Cause for #48780 and + #46952 - both fixed too. (Andrey) +- Fixed bug #48189 (ibase_execute error in return param). (Kalle) +- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection). + (Sriram Natarajan) +- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre, + Al dot Smith at aeschi dot ch dot eu dot org) +- Fixed bug #48057 (Only the date fields of the first row are fetched, others + are empty). (info at programmiernutte dot net) +- Fixed bug #47481 (natcasesort() does not sort extended ASCII characters + correctly). (Herman Radtke) +- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John) +- Fixed bug #47273 (Encoding bug in SoapServer->fault). (Dmitry) +- Fixed bug #46682 (touch() afield returns different values on windows). + (Pierre) +- Fixed bug #46614 (Extended MySQLi class gives incorrect empty() result). + (Andrey) +- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX). + (Uwe Schindler) +- Fixed bug #45905 (imagefilledrectangle() clipping error). + (markril at hotmail dot com, Pierre) +- Fixed bug #45554 (Inconsistent behavior of the u format char). (Derick) +- Fixed bug #45141 (setcookie will output expires years of >4 digits). (Ilia) +- Fixed bug #44683 (popen crashes when an invalid mode is passed). (Pierre) +- Fixed bug #43510 (stream_get_meta_data() does not return same mode as used + in fopen). (Jani) +- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot + com, Kalle) +- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter + Knauf) +- Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo). + (Kalle, Rick Yorgason) +- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett) +- Fixed bug #27051 (Impersonation with FastCGI does not exec process as + impersonated user). (Pierre) + + +30 Jun 2009, PHP 5.3.0 +- Upgraded bundled PCRE to version 7.9. (Nuno) +- Upgraded bundled sqlite to version 3.6.15. (Scott) + +- Moved extensions to PECL (Derick, Lukas, Pierre, Scott): + . ext/dbase + . ext/fbsql + . ext/fdf + . ext/ncurses + . ext/mhash (BC layer is now entirely within ext/hash) + . ext/ming + . ext/msql + . ext/sybase (not maintained anymore, sybase_ct has to be used instead) + +- Removed the experimental RPL (master/slave) functions from mysqli. (Andrey) +- Removed zend.ze1_compatibility_mode. (Dmitry) +- Removed all zend_extension_* php.ini directives. Zend extensions are now + always loaded using zend_extension directive. (Derick) +- Removed special treatment of "/tmp" in sessions for open_basedir. + Note: This undocumented behaviour was introduced in 5.2.2. (Alexey) +- Removed shebang line check from CGI sapi (checked by scanner). (Dmitry) + +- Changed PCRE, Reflection and SPL extensions to be always enabled. (Marcus) +- Changed md5() to use improved implementation. (Solar Designer, Dmitry) +- Changed HTTP stream wrapper to accept any code between and including + 200 to 399 as successful. (Mike, Noah Fontes) +- Changed __call() to be invoked on private/protected method access, similar to + properties and __get(). (Andrei) +- Changed dl() to be disabled by default. Enabled only when explicitly + registered by the SAPI. Currently enabled with cli, cgi and embed SAPIs. + (Dmitry) +- Changed opendir(), dir() and scandir() to use default context when no context + argument is passed. (Sara) +- Changed open_basedir to allow tightening in runtime contexts. (Sara) +- Changed PHP/Zend extensions to use flexible build IDs. (Stas) +- Changed error level E_ERROR into E_WARNING in Soap extension methods + parameter validation. (Felipe) +- Changed openssl info to show the shared library version number. (Scott) +- Changed floating point behaviour to consistently use double precision on all + platforms and with all compilers. (Christian Seiler) +- Changed round() to act more intuitively when rounding to a certain precision + and round very large and very small exponents correctly. (Christian Seiler) +- Changed session_start() to return false when session startup fails. (Jani) +- Changed property_exists() to check the existence of a property independent of + accessibility (like method_exists()). (Felipe) +- Changed array_reduce() to allow mixed $initial (Christian Seiler) + +- Improved PHP syntax and semantics: + . Added lambda functions and closures. (Christian Seiler, Dmitry) + . Added "jump label" operator (limited "goto"). (Dmitry, Sara) + . Added NOWDOC syntax. (Gwynne Raskind, Stas, Dmitry) + . Added HEREDOC syntax with double quotes. (Lars Strojny, Felipe) + . Added support for using static HEREDOCs to initialize static variables and + class members or constants. (Matt) + . Improved syntax highlighting and consistency for variables in double-quoted + strings and literal text in HEREDOCs and backticks. (Matt) + . Added "?:" operator. (Marcus) + . Added support for namespaces. (Dmitry, Stas, Gregory, Marcus) + . Added support for Late Static Binding. (Dmitry, Etienne Kneuss) + . Added support for __callStatic() magic method. (Sara) + . Added forward_static_call(_array) to complete LSB. (Mike Lively) + . Added support for dynamic access of static members using $foo::myFunc(). + (Etienne Kneuss) + . Improved checks for callbacks. (Marcus) + . Added __DIR__ constant. (Lars Strojny) + . Added new error modes E_USER_DEPRECATED and E_DEPRECATED. + E_DEPRECATED is used to inform about stuff being scheduled for removal + in future PHP versions. (Lars Strojny, Felipe, Marcus) + . Added "request_order" INI variable to control specifically $_REQUEST + behavior. (Stas) + . Added support for exception linking. (Marcus) + . Added ability to handle exceptions in destructors. (Marcus) + +- Improved PHP runtime speed and memory usage: + . Substitute global-scope, persistent constants with their values at compile + time. (Matt) + . Optimized ZEND_SIGNED_MULTIPLY_LONG(). (Matt) + . Removed direct executor recursion. (Dmitry) + . Use fastcall calling convention in executor on x86. (Dmitry) + . Use IS_CV for direct access to $this variable. (Dmitry) + . Use ZEND_FREE() opcode instead of ZEND_SWITCH_FREE(IS_TMP_VAR). (Dmitry) + . Lazy EG(active_symbol_table) initialization. (Dmitry) + . Optimized ZEND_RETURN opcode to not allocate and copy return value if it is + not used. (Dmitry) + . Replaced all flex based scanners with re2c based scanners. + (Marcus, Nuno, Scott) + . Added garbage collector. (David Wang, Dmitry). + . Improved PHP binary size and startup speed with GCC4 visibility control. + (Nuno) + . Improved engine stack implementation for better performance and stability. + (Dmitry) + . Improved memory usage by moving constants to read only memory. + (Dmitry, Pierre) + . Changed exception handling. Now each op_array doesn't contain + ZEND_HANDLE_EXCEPTION opcode in the end. (Dmitry) + . Optimized require_once() and include_once() by eliminating fopen(3) on + second usage. (Dmitry) + . Optimized ZEND_FETCH_CLASS + ZEND_ADD_INTERFACE into single + ZEND_ADD_INTERFACE opcode. (Dmitry) + . Optimized string searching for a single character. + (Michal Dziemianko, Scott) + . Optimized interpolated strings to use one less opcode. (Matt) + +- Improved php.ini handling: (Jani) + . Added ".htaccess" style user-defined php.ini files support for CGI/FastCGI. + . Added support for special [PATH=/opt/httpd/www.example.com/] and + [HOST=www.example.com] sections. Directives set in these sections can + not be overridden by user-defined ini-files or during runtime. + . Added better error reporting for php.ini syntax errors. + . Allowed using full path to load modules using "extension" directive. + . Allowed "ini-variables" to be used almost everywhere ini php.ini files. + . Allowed using alphanumeric/variable indexes in "array" ini options. + . Added 3rd optional parameter to parse_ini_file() to specify the scanning + mode of INI_SCANNER_NORMAL or INI_SCANNER_RAW. In raw mode option values + and section values are treated as-is. + . Fixed get_cfg_var() to be able to return "array" ini options. + . Added optional parameter to ini_get_all() to only retrieve the current + value. (Hannes) + +- Improved Windows support: + . Update all libraries to their latest stable version. (Pierre, Rob, Liz, + Garrett). + . Added Windows support for stat(), touch(), filemtime(), filesize() and + related functions. (Pierre) + . Re-added socket_create_pair() for Windows in sockets extension. (Kalle) + . Added inet_pton() and inet_ntop() also for Windows platforms. + (Kalle, Pierre) + . Added mcrypt_create_iv() for Windows platforms. (Pierre) + . Added ACL Cache support on Windows. + (Kanwaljeet Singla, Pierre, Venkat Raman Don) + . Added constants based on Windows' GetVersionEx information. + PHP_WINDOWS_VERSION_* and PHP_WINDOWS_NT_*. (Pierre) + . Added support for ACL (is_writable, is_readable, reports now correct + results) on Windows. (Pierre, Venkat Raman Don, Kanwaljeet Singla) + . Added support for fnmatch() on Windows. (Pierre) + . Added support for time_nanosleep() and time_sleep_until() on Windows. + (Pierre) + . Added support for symlink(), readlink(), linkinfo() and link() on Windows. + They are available only when the running platform supports them. (Pierre) + . the GMP extension now relies on MPIR instead of the GMP library. (Pierre) + . Added Windows support for stream_socket_pair(). (Kalle) + . Drop all external dependencies for the core features. (Pierre) + . Drastically improve the build procedure (Pierre, Kalle, Rob): + . VC9 (Visual C++ 2008) or later support + . Initial experimental x64 support + . MSI installer now supports all recent Windows versions, including + Windows 7. (John, Kanwaljeet Singla) + +- Improved and cleaned CGI code: + . FastCGI is now always enabled and cannot be disabled. + See sapi/cgi/CHANGES for more details. (Dmitry) + . Added CGI SAPI -T option which can be used to measure execution + time of script repeated several times. (Dmitry) + +- Improved streams: + . Fixed confusing error message on failure when no errors are logged. (Greg) + . Added stream_supports_lock() function. (Benjamin Schulz) + . Added context parameter for copy() function. (Sara) + . Added "glob://" stream wrapper. (Marcus) + . Added "params" as optional parameter for stream_context_create(). (Sara) + . Added ability to use stream wrappers in include_path. (Gregory, Dmitry) + +- Improved DNS API + . Added Windows support for dns_check_record(), dns_get_mx(), checkdnsrr() and + getmxrr(). (Pierre) + . Added support for old style DNS functions (supports OSX and FBSD). (Scott) + . Added a new "entries" array in dns_check_record() containing the TXT + elements. (Felipe, Pierre) + +- Improved hash extension: + . Changed mhash to be a wrapper layer around the hash extension. (Scott) + . Added hash_copy() function. (Tony) + . Added sha224 hash algorithm to the hash extension. (Scott) + +- Improved IMAP support (Pierre): + . Added imap_gc() to clear the imap cache + . Added imap_utf8_to_mutf7() and imap_mutf7_to_utf8() + +- Improved mbstring extension: + . Added "mbstring.http_output_conv_mimetypes" INI directive that allows + common non-text types such as "application/xhtml+xml" to be converted + by mb_output_handler(). (Moriyoshi) + +- Improved OCI8 extension (Chris Jones/Oracle Corp.): + . Added Database Resident Connection Pooling (DRCP) and Fast + Application Notification (FAN) support. + . Added support for Oracle External Authentication (not supported + on Windows). + . Improve persistent connection handling of restarted DBs. + . Added SQLT_AFC (aka CHAR datatype) support to oci_bind_by_name. + . Fixed bug #45458 (Numeric keys for associative arrays are not + handled properly) + . Fixed bug #41069 (Segmentation fault with query over DB link). + . Fixed define of SQLT_BDOUBLE and SQLT_BFLOAT constants with Oracle + 10g ORACLE_HOME builds. + . Changed default value of oci8.default_prefetch from 10 to 100. + . Fixed PECL Bug #16035 (OCI8: oci_connect without ORACLE_HOME defined causes + segfault) (Chris Jones/Oracle Corp.) + . Fixed PECL Bug #15988 (OCI8: sqlnet.ora isn't read with older Oracle + libraries) (Chris Jones/Oracle Corp.) + . Fixed PECL Bug #14268 (Allow "pecl install oci8" command to "autodetect" an + Instant Client RPM install) (Chris Jones/Oracle Corp.) + . Fixed PECL bug #12431 (OCI8 ping functionality is broken). + . Allow building (e.g from PECL) the PHP 5.3-based OCI8 code with + PHP 4.3.9 onwards. + . Provide separate extensions for Oracle 11g and 10g on Windows. + (Pierre, Chris) + +- Improved OpenSSL extension: + . Added support for OpenSSL digest and cipher functions. (Dmitry) + . Added access to internal values of DSA, RSA and DH keys. (Dmitry) + . Fixed a memory leak on openssl_decrypt(). (Henrique) + . Fixed segfault caused by openssl_pkey_new(). (Henrique) + . Fixed bug caused by uninitilized variables in openssl_pkcs7_encrypt() and + openssl_pkcs7_sign(). (Henrique) + . Fixed error message in openssl_seal(). (Henrique) + +- Improved pcntl extension: (Arnaud) + . Added pcntl_signal_dispatch(). + . Added pcntl_sigprocmask(). + . Added pcntl_sigwaitinfo(). + . Added pcntl_sigtimedwait(). + +- Improved SOAP extension: + . Added support for element names in context of XMLSchema's . (Dmitry) + . Added ability to use Traversable objects instead of plain arrays. + (Joshua Reese, Dmitry) + . Fixed possible crash bug caused by an uninitialized value. (Zdash Urf) + +- Improved SPL extension: + . Added SPL to list of standard extensions that cannot be disabled. (Marcus) + . Added ability to store associative information with objects in + SplObjectStorage. (Marcus) + . Added ArrayAccess support to SplObjectStorage. (Marcus) + . Added SplDoublyLinkedList, SplStack, SplQueue classes. (Etienne) + . Added FilesystemIterator. (Marcus) + . Added GlobIterator. (Marcus) + . Added SplHeap, SplMinHeap, SplMaxHeap, SplPriorityQueue classes. (Etienne) + . Added new parameter $prepend to spl_autoload_register(). (Etienne) + . Added SplFixedArray. (Etienne, Tony) + . Added delaying exceptions in SPL's autoload mechanism. (Marcus) + . Added RecursiveTreeIterator. (Arnaud, Marcus) + . Added MultipleIterator. (Arnaud, Marcus, Johannes) + +- Improved Zend Engine: + . Added "compact" handler for Zend MM storage. (Dmitry) + . Added "+" and "*" specifiers to zend_parse_parameters(). (Andrei) + . Added concept of "delayed early binding" that allows opcode caches to + perform class declaration (early and/or run-time binding) in exactly + the same order as vanilla PHP. (Dmitry) + +- Improved crypt() function: (Pierre) + . Added Blowfish and extended DES support. (Using Blowfish implementation + from Solar Designer). + . Made crypt features portable by providing our own implementations + for crypt_r and the algorithms which are used when OS does not provide + them. PHP implementations are always used for Windows builds. + +- Deprecated session_register(), session_unregister() and + session_is_registered(). (Hannes) +- Deprecated define_syslog_variables(). (Kalle) +- Deprecated ereg extension. (Felipe) + +- Added new extensions: + . Added Enchant extension as a way to access spell checkers. (Pierre) + . Added fileinfo extension as replacement for mime_magic extension. (Derick) + . Added intl extension for Internationalization. (Ed B., Vladimir I., + Dmitry L., Stanislav M., Vadim S., Kirti V.) + . Added mysqlnd extension as replacement for libmysql for ext/mysql, mysqli + and PDO_mysql. (Andrey, Johannes, Ulf) + . Added phar extension for handling PHP Archives. (Greg, Marcus, Steph) + . Added SQLite3 extension. (Scott) + +- Added new date/time functionality: (Derick) + . date_parse_from_format(): Parse date/time strings according to a format. + . date_create_from_format()/DateTime::createFromFormat(): Create a date/time + object by parsing a date/time string according to a given format. + . date_get_last_errors()/DateTime::getLastErrors(): Return a list of warnings + and errors that were found while parsing a date/time string through: + . strtotime() / new DateTime + . date_create_from_format() / DateTime::createFromFormat() + . date_parse_from_format(). + . support for abbreviation and offset based timezone specifiers for + the 'e' format specifier, DateTime::__construct(), DateTime::getTimeZone() + and DateTimeZone::getName(). + . support for selectively listing timezone identifiers by continent or + country code through timezone_identifiers_list() / + DateTimezone::listIdentifiers(). + . timezone_location_get() / DateTimezone::getLocation() for retrieving + location information from timezones. + . date_timestamp_set() / DateTime::setTimestamp() to set a Unix timestamp + without invoking the date parser. (Scott, Derick) + . date_timestamp_get() / DateTime::getTimestamp() to retrieve the Unix + timestamp belonging to a date object. + . two optional parameters to timezone_transitions_get() / + DateTimeZone::getTranstions() to limit the range of transitions being + returned. + . support for "first/last day of " style texts. + . support for date/time strings returned by MS SQL. + . support for serialization and unserialization of DateTime objects. + . support for diffing date/times through date_diff() / DateTime::diff(). + . support for adding/subtracting weekdays with strtotime() and + DateTime::modify(). + . DateInterval class to represent the difference between two date/times. + . support for parsing ISO intervals for use with DateInterval. + . date_add() / DateTime::add(), date_sub() / DateTime::sub() for applying an + interval to an existing date/time. + . proper support for "this week", "previous week"/"last week" and "next week" + phrases so that they actually mean the week and not a seven day period + around the current day. + . support for " of" and "last of" phrases to be used + with months - like in "last saturday of februari 2008". + . support for "back of " and "front of " phrases that are used in + Scotland. + . DatePeriod class which supports iterating over a DateTime object applying + DateInterval on each iteration, up to an end date or limited by maximum + number of occurences. + +- Added compatibility mode in GD, imagerotate, image(filled)ellipse + imagefilter, imageconvolution and imagecolormatch are now always enabled. + (Pierre) +- Added array_replace() and array_replace_recursive() functions. (Matt) +- Added ReflectionProperty::setAccessible() method that allows non-public + property's values to be read through ::getValue() and set through + ::setValue(). (Derick, Sebastian) +- Added msg_queue_exists() function to sysvmsg extension. (Benjamin Schulz) +- Added Firebird specific attributes that can be set via PDO::setAttribute() + to control formatting of date/timestamp columns: PDO::FB_ATTR_DATE_FORMAT, + PDO::FB_ATTR_TIME_FORMAT and PDO::FB_ATTR_TIMESTAMP_FORMAT. (Lars W) +- Added gmp_testbit() function. (Stas) +- Added icon format support to getimagesize(). (Scott) +- Added LDAP_OPT_NETWORK_TIMEOUT option for ldap_set_option() to allow + setting network timeout (FR #42837). (Jani) +- Added optional escape character parameter to fgetcsv(). (David Soria Parra) +- Added an optional parameter to strstr() and stristr() for retrieval of either + the part of haystack before or after first occurrence of needle. + (Johannes, Felipe) +- Added xsl->setProfiling() for profiling stylesheets. (Christian) +- Added long-option feature to getopt() and made getopt() available also on + win32 systems by adding a common getopt implementation into core. + (David Soria Parra, Jani) +- Added support for optional values, and = as separator, in getopt(). (Hannes) +- Added lcfirst() function. (David C) +- Added PREG_BAD_UTF8_OFFSET_ERROR constant. (Nuno) +- Added native support for asinh(), acosh(), atanh(), log1p() and expm1(). + (Kalle) +- Added LIBXML_LOADED_VERSION constant (libxml2 version currently used). (Rob) +- Added JSON_FORCE_OBJECT flag to json_encode(). (Scott, Richard Quadling) +- Added timezone_version_get() to retrieve the version of the used timezone + database. (Derick) +- Added 'n' flag to fopen to allow passing O_NONBLOCK to the underlying + open(2) system call. (Mikko) +- Added "dechunk" filter which can decode HTTP responses with chunked + transfer-encoding. HTTP streams use this filter automatically in case + "Transfer-Encoding: chunked" header is present in response. It's possible to + disable this behaviour using "http"=>array("auto_decode"=>0) in stream + context. (Dmitry) +- Added support for CP850 encoding in mbstring extension. + (Denis Giffeler, Moriyoshi) +- Added stream_cast() and stream_set_options() to user-space stream wrappers, + allowing stream_select(), stream_set_blocking(), stream_set_timeout() and + stream_set_write_buffer() to work with user-space stream wrappers. (Arnaud) +- Added header_remove() function. (chsc at peytz dot dk, Arnaud) +- Added stream_context_get_params() function. (Arnaud) +- Added optional parameter "new" to sybase_connect(). (Timm) +- Added parse_ini_string() function. (grange at lemonde dot fr, Arnaud) +- Added str_getcsv() function. (Sara) +- Added openssl_random_pseudo_bytes() function. (Scott) +- Added ability to send user defined HTTP headers with SOAP request. + (Brian J.France, Dmitry) +- Added concatenation option to bz2.decompress stream filter. + (Keisial at gmail dot com, Greg) +- Added support for using compressed connections with PDO_mysql. (Johannes) +- Added the ability for json_decode() to take a user specified depth. (Scott) +- Added support for the mysql_stmt_next_result() function from libmysql. + (Andrey) +- Added function preg_filter() that does grep and replace in one go. (Marcus) +- Added system independent realpath() implementation which caches intermediate + directories in realpath-cache. (Dmitry) +- Added optional clear_realpath_cache and filename parameters to + clearstatcache(). (Jani, Arnaud) +- Added litespeed SAPI module. (George Wang) +- Added ext/hash support to ext/session's ID generator. (Sara) +- Added quoted_printable_encode() function. (Tony) +- Added stream_context_set_default() function. (Davey Shafik) +- Added optional "is_xhtml" parameter to nl2br() which makes the function + output
when false and
when true (FR #34381). (Kalle) +- Added PHP_MAXPATHLEN constant (maximum length of a path). (Pierre) +- Added support for SSH via libssh2 in cURL. (Pierre) +- Added support for gray levels PNG image with alpha in GD extension. (Pierre) +- Added support for salsa hashing functions in HASH extension. (Scott) +- Added DOMNode::getLineNo to get line number of parsed node. (Rob) +- Added table info to PDO::getColumnMeta() with SQLite. (Martin Jansen, Scott) +- Added mail logging functionality that allows logging of mail sent via + mail() function. (Ilia) +- Added json_last_error() to return any error information from json_decode(). + (Scott) +- Added gethostname() to return the current system host name. (Ilia) +- Added shm_has_var() function. (Mike) +- Added depth parameter to json_decode() to lower the nesting depth from the + maximum if required. (Scott) +- Added pixelation support in imagefilter(). (Takeshi Abe, Kalle) +- Added SplObjectStorage::addAll/removeAll. (Etienne) + +- Implemented FR #41712 (curl progress callback: CURLOPT_PROGRESSFUNCTION). + (sdteffen[at]gmail[dot].com, Pierre) +- Implemented FR #47739 (Missing cURL option do disable IPv6). (Pierre) +- Implemented FR #39637 (Missing cURL option CURLOPT_FTP_FILEMETHOD). (Pierre) + +- Fixed an issue with ReflectionProperty::setAccessible(). + (Sebastian, Roman Borschel) +- Fixed html_entity_decode() incorrectly converting numeric html entities + to different characters with cp1251 and cp866. (Scott) +- Fixed an issue in date() where a : was printed for the O modifier after a P + modifier was used. (Derick) +- Fixed exec() on Windows to not eat the first and last double quotes. (Scott) +- Fixed readlink on Windows in thread safe SAPI (apache2.x etc.). (Pierre) +- Fixed a bug causing miscalculations with the "last of month" + relative time string. (Derick) +- Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott) +- Fixed invalid calls to free when internal fileinfo magic file is used. (Scott) +- Fixed memory leak inside wddx_add_vars() function. (Felipe) +- Fixed check in recode extension to allow builing of recode and mysql + extensions when using a recent libmysql. (Johannes) + +- Fixed PECL bug #12794 (PDOStatement->nextRowset() doesn't work). (Johannes) +- Fixed PECL bug #12401 (Add support for ATTR_FETCH_TABLE_NAMES). (Johannes) + +- Fixed bug #48696 (ldap_read() segfaults with invalid parameters). (Felipe) +- Fixed bug #48643 (String functions memory issue). (Dmitry) +- Fixed bug #48641 (tmpfile() uses old parameter parsing). + (crrodriguez at opensuse dot org) +- Fixed bug #48624 (.user.ini never gets parsed). (Pierre) +- Fixed bug #48620 (X-PHP-Originating-Script assumes no trailing CRLF in + existing headers). (Ilia) +- Fixed bug #48578 (Can't build 5.3 on FBSD 4.11). (Rasmus) +- Fixed bug #48535 (file_exists returns false when impersonate is used). + (Kanwaljeet Singla, Venkat Raman Don) +- Fixed bug #48493 (spl_autoload_register() doesn't work correctly when + prepending functions). (Scott) +- Fixed bug #48215 (Calling a method with the same name as the parent class + calls the constructor). (Scott) +- Fixed bug #48200 (compile failure with mbstring.c when + --enable-zend-multibyte is used). (Jani) +- Fixed bug #48188 (Cannot execute a scrollable cursors twice with PDO_PGSQL). + (Matteo) +- Fixed bug #48185 (warning: value computed is not used in + pdo_sqlite_stmt_get_col line 271). (Matteo) +- Fixed bug #48087 (call_user_method() invalid free of arguments). (Felipe) +- Fixed bug #48060 (pdo_pgsql - large objects are returned as empty). (Matteo) +- Fixed bug #48034 (PHP crashes when script is 8192 (8KB) bytes long). (Dmitry) +- Fixed bug #48004 (Error handler prevents creation of default object). (Dmitry) +- Fixed bug #47880 (crashes in call_user_func_array()). (Dmitry) +- Fixed bug #47856 (stristr() converts needle to lower-case). (Ilia) +- Fixed bug #47851 (is_callable throws fatal error). (Dmitry) +- Fixed bug #47816 (pcntl tests failing on NetBSD). (Matteo) +- Fixed bug #47779 (Wrong value for SIG_UNBLOCK and SIG_SETMASK constants). + (Matteo) +- Fixed bug #47771 (Exception during object construction from arg call calls + object's destructor). (Dmitry) +- Fixed bug #47767 (include_once does not resolve windows symlinks or junctions) + (Kanwaljeet Singla, Venkat Raman Don) +- Fixed bug #47757 (rename JPG to JPEG in phpinfo). (Pierre) +- Fixed bug #47745 (FILTER_VALIDATE_INT doesn't allow minimum integer). (Dmitry) +- Fixed bug #47714 (autoloading classes inside exception_handler leads to + crashes). (Dmitry) +- Fixed bug #47671 (Cloning SplObjectStorage instances). (Etienne) +- Fixed bug #47664 (get_class returns NULL instead of FALSE). (Dmitry) +- Fixed bug #47662 (Support more than 127 subpatterns in preg_match). (Nuno) +- Fixed bug #47596 (Bus error on parsing file). (Dmitry) +- Fixed bug #47572 (Undefined constant causes segmentation fault). (Felipe) +- Fixed bug #47560 (explode()'s limit parameter odd behaviour). (Matt) +- Fixed bug #47549 (get_defined_constants() return array with broken array + categories). (Ilia) +- Fixed bug #47535 (Compilation failure in ps_fetch_from_1_to_8_bytes()). + (Johannes) +- Fixed bug #47534 (RecursiveDiteratoryIterator::getChildren ignoring + CURRENT_AS_PATHNAME). (Etienne) +- Fixed bug #47443 (metaphone('scratch') returns wrong result). (Felipe) +- Fixed bug #47438 (mysql_fetch_field ignores zero offset). (Johannes) +- Fixed bug #47398 (PDO_Firebird doesn't implements quoter correctly). (Felipe) +- Fixed bug #47390 (odbc_fetch_into - BC in php 5.3.0). (Felipe) +- Fixed bug #47359 (Use the expected unofficial mimetype for bmp files). (Scott) +- Fixed bug #47343 (gc_collect_cycles causes a segfault when called within a + destructor in one case). (Dmitry) +- Fixed bug #47320 ($php_errormsg out of scope in functions). (Dmitry) +- Fixed bug #47318 (UMR when trying to activate user config). (Pierre) +- Fixed bug #47243 (OCI8: Crash at shutdown on Windows) (Chris Jones/Oracle + Corp.) +- Fixed bug #47231 (offsetGet error using incorrect offset). (Etienne) +- Fixed bug #47229 (preg_quote() should escape the '-' char). (Nuno) +- Fixed bug #47165 (Possible memory corruption when passing return value by + reference). (Dmitry) +- Fixed bug #47087 (Second parameter of mssql_fetch_array()). (Felipe) +- Fixed bug #47085 (rename() returns true even if the file in PHAR does not + exist). (Greg) +- Fixed bug #47050 (mysqli_poll() modifies improper variables). (Johannes) +- Fixed bug #47045 (SplObjectStorage instances compared with ==). (Etienne) +- Fixed bug #47038 (Memory leak in include). (Dmitry) +- Fixed bug #47031 (Fix constants in DualIterator example). (Etienne) +- Fixed bug #47021 (SoapClient stumbles over WSDL delivered with + "Transfer-Encoding: chunked"). (Dmitry) +- Fixed bug #46994 (OCI8: CLOB size does not update when using CLOB IN OUT param + in stored procedure) (Chris Jones/Oracle Corp.) +- Fixed bug #46979 (use with non-compound name *has* effect). (Dmitry) +- Fixed bug #46957 (The tokenizer returns deprecated values). (Felipe) +- Fixed bug #46944 (UTF-8 characters outside the BMP aren't encoded correctly). + (Scott) +- Fixed bug #46897 (ob_flush() should fail to flush unerasable buffers). + (David C.) +- Fixed bug #46849 (Cloning DOMDocument doesn't clone the properties). (Rob) +- Fixed bug #46847 (phpinfo() is missing some settings). (Hannes) +- Fixed bug #46844 (php scripts or included files with first line starting + with # have the 1st line missed from the output). (Ilia) +- Fixed bug #46817 (tokenizer misses last single-line comment (PHP 5.3+, with + re2c lexer)). (Matt, Shire) +- Fixed bug #46811 (ini_set() doesn't return false on failure). (Hannes) +- Fixed bug #46763 (mb_stristr() wrong output when needle does not exist). + (Henrique M. Decaria) +- Fixed bug #46755 (warning: use statement with non-compound name). (Dmitry) +- Fixed bug #46746 (xmlrpc_decode_request outputs non-suppressable error when + given bad data). (Ilia) +- Fixed bug #46738 (Segfault when mb_detect_encoding() fails). (Scott) +- Fixed bug #46731 (Missing validation for the options parameter of the + imap_fetch_overview() function). (Ilia) +- Fixed bug #46711 (cURL curl_setopt leaks memory in foreach loops). (magicaltux + [at] php [dot] net) +- Fixed bug #46701 (Creating associative array with long values in the key fails + on 32bit linux). (Shire) +- Fixed bug #46681 (mkdir() fails silently on PHP 5.3). (Hannes) +- Fixed bug #46653 (can't extend mysqli). (Johannes) +- Fixed bug #46646 (Restrict serialization on some internal classes like Closure + and SplFileInfo using exceptions). (Etienne) +- Fixed bug #46623 (OCI8: phpinfo doesn't show compile time ORACLE_HOME with + phpize) (Chris Jones/Oracle Corp.) +- Fixed bug #46578 (strip_tags() does not honor end-of-comment when it + encounters a single quote). (Felipe) +- Fixed bug #46546 (Segmentation fault when using declare statement with + non-string value). (Felipe) +- Fixed bug #46542 (Extending PDO class with a __call() function doesn't work as + expected). (Johannes) +- Fixed bug #46421 (SplFileInfo not correctly handling /). (Etienne) +- Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno) +- Fixed bug #46268 (DateTime::modify() does not reset relative time values). + (Derick) +- Fixed bug #46241 (stacked error handlers, internal error handling in general). + (Etienne) +- Fixed bug #46238 (Segmentation fault on static call with empty string method). + (Felipe) +- Fixed bug #46192 (ArrayObject with objects as storage serialization). + (Etienne) +- Fixed bug #46185 (importNode changes the namespace of an XML element). (Rob) +- Fixed bug #46178 (memory leak in ext/phar). (Greg) +- Fixed bug #46160 (SPL - Memory leak when exception is thrown in offsetSet). + (Felipe) +- Fixed Bug #46147 (after stream seek, appending stream filter reads incorrect + data). (Greg) +- Fixed bug #46127 (php_openssl_tcp_sockop_accept forgets to set context on + accepted stream) (Mark Karpeles, Pierre) +- Fixed bug #46115 (Memory leak when calling a method using Reflection). + (Dmitry) +- Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on + multiple calls). (Ilia) +- Fixed bug #46108 (DateTime - Memory leak when unserializing). (Felipe) +- Fixed bug #46106 (Memory leaks when using global statement). (Dmitry) +- Fixed bug #46099 (Xsltprocessor::setProfiling - memory leak). (Felipe, Rob). +- Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object). + (Ilia) +- Fixed bug #46048 (SimpleXML top-level @attributes not part of iterator). + (David C.) +- Fixed bug #46044 (Mysqli - wrong error message). (Johannes) +- Fixed bug #46042 (memory leaks with reflection of mb_convert_encoding()). + (Ilia) +- Fixed bug #46039 (ArrayObject iteration is slow). (Arnaud) +- Fixed bug #46033 (Direct instantiation of SQLite3stmt and SQLite3result cause + a segfault.) (Scott) +- Fixed bug #45991 (Ini files with the UTF-8 BOM are treated as invalid). + (Scott) +- Fixed bug #45989 (json_decode() doesn't return NULL on certain invalid + strings). (magicaltux, Scott) +- Fixed bug #45976 (Moved SXE from SPL to SimpleXML). (Etienne) +- Fixed bug #45928 (large scripts from stdin are stripped at 16K border). + (Christian Schneider, Arnaud) +- Fixed bug #45911 (Cannot disable ext/hash). (Arnaud) +- Fixed bug #45907 (undefined reference to 'PHP_SHA512Init'). (Greg) +- Fixed bug #45826 (custom ArrayObject serialization). (Etienne) +- Fixed bug #45820 (Allow empty keys in ArrayObject). (Etienne) +- Fixed bug #45791 (json_decode() doesn't convert 0e0 to a double). (Scott) +- Fixed bug #45786 (FastCGI process exited unexpectedly). (Dmitry) +- Fixed bug #45757 (FreeBSD4.11 build failure: failed include; stdint.h). + (Hannes) +- Fixed bug #45743 (property_exists fails to find static protected member in + child class). (Felipe) +- Fixed bug #45717 (Fileinfo/libmagic build fails, missing err.h and getopt.h). + (Derick) +- Fixed bug #45706 (Unserialization of classes derived from ArrayIterator + fails). (Etienne, Dmitry) +- Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick) +- Fixed bug #45682 (Unable to var_dump(DateInterval)). (Derick) +- Fixed bug #45447 (Filesystem time functions on Vista and server 2008). + (Pierre) +- Fixed bug #45432 (PDO: persistent connection leak). (Felipe) +- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Ilia) +- Fixed bug #45384 (parse_ini_file will result in parse error with no trailing + newline). (Arnaud) +- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto). (vnegrier at + optilian dot com, Ilia) +- Fixed bug #45044 (relative paths not resolved correctly). (Dmitry) +- Fixed bug #44861 (scrollable cursor don't work with pgsql). (Matteo) +- Fixed bug #44842 (parse_ini_file keys that start/end with underscore). + (Arnaud) +- Fixed bug #44575 (parse_ini_file comment # line problems). (Arnaud) +- Fixed bug #44409 (PDO::FETCH_SERIALIZE calls __construct()). (Matteo) +- Fixed bug #44173 (PDO->query() parameter parsing/checking needs an update). + (Matteo) +- Fixed bug #44154 (pdo->errorInfo() always have three elements in the returned + array). (David C.) +- Fixed bug #44153 (pdo->errorCode() returns NULL when there are no errors). + (David C.) +- Fixed bug #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS). (Johannes, + chx1975 at gmail dot com) +- Fixed bug #44100 (Inconsistent handling of static array declarations with + duplicate keys). (Dmitry) +- Fixed bug #43831 ($this gets mangled when extending PDO with persistent + connection). (Felipe) +- Fixed bug #43817 (opendir() fails on Windows directories with parent directory + unaccessible). (Dmitry) +- Fixed bug #43069 (SoapClient causes 505 HTTP Version not supported error + message). (Dmitry) +- Fixed bug #43008 (php://filter uris ignore url encoded filternames and can't + handle slashes). (Arnaud) +- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped). + (Scott, Edward Z. Yang) +- Fixed bug #41874 (separate STDOUT and STDERR in exec functions). (Kanwaljeet + Singla, Venkat Raman Don, Pierre) +- Fixed bug #41534 (SoapClient over HTTPS fails to reestablish connection). + (Dmitry) +- Fixed bug #38802 (max_redirects and ignore_errors). (patch by + datibbaw@php.net) +- Fixed bug #35980 (touch() works on files but not on directories). (Pierre) + +17 Jun 2009, PHP 5.2.10 +- Updated timezone database to version 2009.9 (2009i) (Derick) + +- Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara) +- Added new CURL options CURLOPT_REDIR_PROTOCOLS, CURLOPT_PROTOCOLS, + and CURLPROTO_* for redirect fixes in CURL 7.19.4. (Yoram Bar Haim, Stas) +- Added support for Sun CC (FR #46595 and FR #46513). (David Soria Parra) + +- Changed default value of array_unique()'s optional sorting type parameter + back to SORT_STRING to fix backwards compatibility breakage introduced in + PHP 5.2.9. (Moriyoshi) + +- Fixed memory corruptions while reading properties of zip files. (Ilia) +- Fixed memory leak in ob_get_clean/ob_get_flush. (Christian) +- Fixed segfault on invalid session.save_path. (Hannes) +- Fixed leaks in imap when a mail_criteria is used. (Pierre) +- Fixed missing erealloc() in fix for Bug #40091 in spl_autoload_register. (Greg) + +- Fixed bug #48562 (Reference recursion causes segfault when used in + wddx_serialize_vars()). (Felipe) +- Fixed bug #48557 (Numeric string keys in Apache Hashmaps are not cast to + integers). (David Zuelke) +- Fixed bug #48518 (curl crashes when writing into invalid file handle). (Tony) +- Fixed bug #48514 (cURL extension uses same resource name for simple and + multi APIs). (Felipe) +- Fixed bug #48469 (ldap_get_entries() leaks memory on empty search + results). (Patrick) +- Fixed bug #48456 (CPPFLAGS not restored properly in phpize.m4). (Jani, + spisek at kerio dot com) +- Fixed bug #48448 (Compile failure under IRIX 6.5.30 building cast.c). + (Kalle) +- Fixed bug #48441 (ldap_search() sizelimit, timelimit and deref options + persist). (Patrick) +- Fixed bug #48434 (Improve memory_get_usage() accuracy). (Arnaud) +- Fixed bug #48416 (Force a cache limit in ereg() to stop excessive memory + usage). (Scott) +- Fixed bug #48409 (Crash when exception is thrown while passing function + arguments). (Arnaud) +- Fixed bug #48378 (exif_read_data() segfaults on certain corrupted .jpeg + files). (Pierre) +- Fixed bug #48359 (Script hangs on snmprealwalk if OID is not increasing). + (Ilia, simonov at gmail dot com) +- Fixed bug #48336 (ReflectionProperty::getDeclaringClass() does not work + with redeclared property). + (patch by Markus dot Lidel at shadowconnect dot com) +- Fixed bug #48326 (constant MSG_DONTWAIT not defined). (Arnaud) +- Fixed bug #48313 (fgetcsv() does not return null for empty rows). (Ilia) +- Fixed bug #48309 (stream_copy_to_stream() and fpasstru() do not update + stream position of plain files). (Arnaud) +- Fixed bug #48307 (stream_copy_to_stream() copies 0 bytes when $source is a + socket). (Arnaud) +- Fixed bug #48273 (snmp*_real_walk() returns SNMP errors as values). + (Ilia, lytboris at gmail dot com) +- Fixed bug #48256 (Crash due to double-linking of history.o). + (tstarling at wikimedia dot org) +- Fixed bug #48248 (SIGSEGV when access to private property via &__get). + (Felipe) +- Fixed bug #48247 (Crash on errors during startup). (Stas) +- Fixed bug #48240 (DBA Segmentation fault dba_nextkey). (Felipe) +- Fixed bug #48224 (Incorrect shuffle in array_rand). (Etienne) +- Fixed bug #48221 (memory leak when passing invalid xslt parameter). + (Felipe) +- Fixed bug #48207 (CURLOPT_(FILE|WRITEHEADER options do not error out when + working with a non-writable stream). (Ilia) +- Fixed bug #48206 (Iterating over an invalid data structure with + RecursiveIteratorIterator leads to a segfault). (Scott) +- Fixed bug #48204 (xmlwriter_open_uri() does not emit warnings on invalid + paths). (Ilia) +- Fixed bug #48203 (Crash when CURLOPT_STDERR is set to regular file). (Jani) +- Fixed bug #48202 (Out of Memory error message when passing invalid file + path) (Pierre) +- Fixed bug #48156 (Added support for lcov v1.7). (Ilia) +- Fixed bug #48132 (configure check for curl ssl support fails with + --disable-rpath). (Jani) +- Fixed bug #48131 (Don't try to bind ipv4 addresses to ipv6 ips via bindto). + (Ilia) +- Fixed bug #48070 (PDO_OCI: Segfault when using persistent connection). + (Pierre, Matteo, jarismar dot php at gmail dot com) +- Fixed bug #48058 (Year formatter goes wrong with out-of-int range). (Derick) +- Fixed bug #48038 (odbc_execute changes variables used to form params array). + (Felipe) +- Fixed bug #47997 (stream_copy_to_stream returns 1 on empty streams). (Arnaud) +- Fixed bug #47991 (SSL streams fail if error stack contains items). (Mikko) +- Fixed bug #47981 (error handler not called regardless). (Hannes) +- Fixed bug #47969 (ezmlm_hash() returns different values depend on OS). (Ilia) +- Fixed bug #47946 (ImageConvolution overwrites background). (Ilia) +- Fixed bug #47940 (memory leaks in imap_body). (Pierre, Jake Levitt) +- Fixed bug #47937 (system() calls sapi_flush() regardless of output + buffering). (Ilia) +- Fixed bug #47903 ("@" operator does not work with string offsets). (Felipe) +- Fixed bug #47893 (CLI aborts on non blocking stdout). (Arnaud) +- Fixed bug #47849 (Non-deep import loses the namespace). (Rob) +- Fixed bug #47845 (PDO_Firebird omits first row from query). (Lars W) +- Fixed bug #47836 (array operator [] inconsistency when the array has + PHP_INT_MAX index value). (Matt) +- Fixed bug #47831 (Compile warning for strnlen() in main/spprintf.c). + (Ilia, rainer dot jung at kippdata dot de) +- Fixed bug #47828 (openssl_x509_parse() segfaults when a UTF-8 conversion + fails). (Scott, Kees Cook, Pierre) +- Fixed bug #47818 (Segfault due to bound callback param). (Felipe) +- Fixed bug #47801 (__call() accessed via parent:: operator is provided + incorrect method name). (Felipe) +- Fixed bug #47769 (Strange extends PDO). (Felipe) +- Fixed bug #47745 (FILTER_VALIDATE_INT doesn't allow minimum integer). + (Dmitry) +- Fixed bug #47721 (Alignment issues in mbstring and sysvshm extension). + (crrodriguez at opensuse dot org, Ilia) +- Fixed bug #47704 (PHP crashes on some "bad" operations with string + offsets). (Dmitry) +- Fixed bug #47695 (build error when xmlrpc and iconv are compiled against + different iconv versions). (Scott) +- Fixed bug #47667 (ZipArchive::OVERWRITE seems to have no effect). + (Mikko, Pierre) +- Fixed bug #47644 (Valid integers are truncated with json_decode()). (Scott) +- Fixed bug #47639 (pg_copy_from() WARNING: nonstandard use of \\ in a + string literal). (Ilia) +- Fixed bug #47616 (curl keeps crashing). (Felipe) +- Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware). (Ilia) +- Fixed bug #47566 (pcntl_wexitstatus() returns signed status). + (patch by james at jamesreno dot com) +- Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns wrong + result). (Ilia) +- Fixed bug #47487 (performance degraded when reading large chunks after + fix of bug #44607). (Arnaud) +- Fixed bug #47468 (enable cli|cgi-only extensions for embed sapi). (Jani) +- Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6 + addresses in the filter extension). (Ilia) +- Fixed bug #47430 (Errors after writing to nodeValue parameter of an absent + previousSibling). (Rob) +- Fixed bug #47365 (ip2long() may allow some invalid values on certain 64bit + systems). (Ilia) +- Fixed bug #47254 (Wrong Reflection for extends class). (Felipe) +- Fixed bug #47042 (cgi sapi is incorrectly removing SCRIPT_FILENAME). + (Sriram Natarajan, David Soria Parra) +- Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with + different bit numbers). (Matt) +- Fixed bug #46812 (get_class_vars() does not include visible private variable + looking at subclass). (Arnaud) +- Fixed bug #46386 (Digest authentication with SOAP module fails against MSSQL + SOAP services). (Ilia, lordelph at gmail dot com) +- Fixed bug #46109 (Memory leak when mysqli::init() is called multiple times). + (Andrey) +- Fixed bug #45997 (safe_mode bypass with exec/system/passthru (windows only)). + (Pierre) +- Fixed bug #45877 (Array key '2147483647' left as string). (Matt) +- Fixed bug #45822 (Near infinite-loops while parsing huge relative offsets). + (Derick, Mike Sullivan) +- Fixed bug #45799 (imagepng() crashes on empty image). + (Martin McNickle, Takeshi Abe) +- Fixed bug #45622 (isset($arrayObject->p) misbehaves with + ArrayObject::ARRAY_AS_PROPS set). (robin_fernandes at uk dot ibm dot com, Arnaud) +- Fixed bug #45614 (ArrayIterator::current(), ::key() can show 1st private prop + of wrapped object). (robin_fernandes at uk dot ibm dot com, Arnaud) +- Fixed bug #45540 (stream_context_create creates bad http request). (Arnaud) +- Fixed bug #45202 (zlib.output_compression can not be set with ini_set()). + (Jani) +- Fixed bug #45191 (error_log ignores date.timezone php.ini val when setting + logging timestamps). (Derick) +- Fixed bug #45092 (header HTTP context option not being used when compiled + using --with-curlwrappers). (Jani) +- Fixed bug #44996 (xmlrpc_decode() ignores time zone on iso8601.datetime). + (Ilia, kawai at apache dot org) +- Fixed bug #44827 (define() is missing error checks for class constants). + (Ilia) +- Fixed bug #44214 (Crash using preg_replace_callback() and global variables). + (Nuno, Scott) +- Fixed bug #43073 (TrueType bounding box is wrong for angle<>0). + (Martin McNickle) +- Fixed bug #42663 (gzinflate() try to allocate all memory with truncated + data). (Arnaud) +- Fixed bug #42414 (some odbc_*() functions incompatible with Oracle ODBC + driver). (jhml at gmx dot net) +- Fixed bug #42362 (HTTP status codes 204 and 304 should not be gzipped). + (Scott, Edward Z. Yang) +- Fixed bug #42143 (The constant NAN is reported as 0 on Windows) + (Kanwaljeet Singla, Venkat Raman Don) +- Fixed bug #38805 (PDO truncates text from SQL Server text data type field). + (Steph) + +26 Feb 2009, PHP 5.2.9 +- Changed __call() to be invoked on private/protected method access, similar to + properties and __get(). (Andrei) + +- Added optional sorting type flag parameter to array_unique(). Default is + SORT_REGULAR. (Andrei) + +- Fixed a crash on extract in zip when files or directories entry names contain + a relative path. (Pierre) +- Fixed error conditions handling in stream_filter_append(). (Arnaud) +- Fixed zip filename property read. (Pierre) +- Fixed explode() behavior with empty string to respect negative limit. (Shire) +- Fixed security issue in imagerotate(), background colour isn't validated + correctly with a non truecolour image. Reported by Hamid Ebadi, + APA Laboratory (Fixes CVE-2008-5498). (Scott) +- Fixed a segfault when malformed string is passed to json_decode(). (Scott) +- Fixed bug in xml_error_string() which resulted in messages being + off by one. (Scott) + +- Fixed bug #47422 (modulus operator returns incorrect results on 64 bit + linux). (Matt) +- Fixed bug #47399 (mb_check_encoding() returns true for some illegal SJIS + characters). (for-bugs at hnw dot jp, Moriyoshi) +- Fixed bug #47353 (crash when creating a lot of objects in object + destructor). (Tony) +- Fixed bug #47322 (sscanf %d doesn't work). (Felipe) +- Fixed bug #47282 (FILTER_VALIDATE_EMAIL is marking valid email addresses + as invalid). (Ilia) +- Fixed bug #47220 (segfault in dom_document_parser in recovery mode). (Rob) +- Fixed bug #47217 (content-type is not set properly for file uploads). (Ilia) +- Fixed bug #47174 (base64_decode() interprets pad char in mid string as + terminator). (Ilia) +- Fixed bug #47165 (Possible memory corruption when passing return value by + reference). (Dmitry) +- Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results). + (Felipe) +- Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting). (Ilia) +- Fixed bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object). + (Etienne, Dmitry) +- Fixed bug #47104 (Linking shared extensions fails with icc). (Jani) +- Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault). + (Dmitry) +- Fixed bug #47048 (Segfault with new pg_meta_data). (Felipe) +- Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non + apache). (Sriram Natarajan) +- Fixed bug #47037 (No error when using fopen with empty string). (Cristian + Rodriguez R., Felipe) +- Fixed bug #47035 (dns_get_record returns a garbage byte at the end of a + TXT record). (Felipe) +- Fixed bug #47027 (var_export doesn't show numeric indices on ArrayObject). + (Derick) +- Fixed bug #46985 (OVERWRITE and binary mode does not work, regression + introduced in 5.2.8). (Pierre) +- Fixed bug #46973 (IPv6 address filter rejects valid address). (Felipe) +- Fixed bug #46964 (Fixed pdo_mysql build with older version of MySQL). (Ilia) +- Fixed bug #46959 (Unable to disable PCRE). (Scott) +- Fixed bug #46918 (imap_rfc822_parse_adrlist host part not filled in + correctly). (Felipe) +- Fixed bug #46889 (Memory leak in strtotime()). (Derick) +- Fixed bug #46887 (Invalid calls to php_error_docref()). (oeriksson at + mandriva dot com, Ilia) +- Fixed bug #46873 (extract($foo) crashes if $foo['foo'] exists). (Arnaud) +- Fixed bug #46843 (CP936 euro symbol is not converted properly). (ty_c at + cybozuy dot co dot jp, Moriyoshi) +- Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value + inside a binary or image column type). (Ilia) +- Fixed bug #46782 (fastcgi.c parse error). (Matt) +- Fixed bug #46760 (SoapClient doRequest fails when proxy is used). (Felipe) +- Fixed bug #46748 (Segfault when an SSL error has more than one error). + (Scott) +- Fixed bug #46739 (array returned by curl_getinfo should contain + content_type key). (Mikko) +- Fixed bug #46699 (xml_parse crash when parser is namespace aware). (Rob) +- Fixed bug #46419 (Elements of associative arrays with NULL value are + lost). (Dmitry) +- Fixed bug #46282 (Corrupt DBF When Using DATE). (arne at bukkie dot nl) +- Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress + after end of stream). (Greg) +- Fixed bug #46005 (User not consistently logged under Apache2). (admorten + at umich dot edu, Stas) +- Fixed bug #45996 (libxml2 2.7 causes breakage with character data in + xml_parse()). (Rob) +- Fixed bug #45940 (MySQLI OO does not populate connect_error property on + failed connect). (Johannes) +- Fixed bug #45923 (mb_st[r]ripos() offset not handled correctly). (Moriyoshi) +- Fixed bug #45327 (memory leak if offsetGet throws exception). (Greg) +- Fixed bug #45239 (Encoding detector hangs with mbstring.strict_detection + enabled). (Moriyoshi) +- Fixed bug #45161 (Reusing a curl handle leaks memory). (Mark Karpeles, Jani) +- Fixed bug #44336 (Improve pcre UTF-8 string matching performance). (frode + at coretrek dot com, Nuno) +- Fixed bug #43841 (mb_strrpos() offset is byte count for negative values). + (Moriyoshi) +- Fixed bug #37209 (mssql_execute with non fatal errors). (Kalle) +- Fixed bug #35975 (Session cookie expires date format isn't the most + compatible. Now matches that of setcookie()). (Scott) + + +08 Dec 2008, PHP 5.2.8 +- Reverted bug fix #42718 that broke magic_quotes_gpc (Scott) + +04 Dec 2008, PHP 5.2.7 +- Upgraded PCRE to version 7.8 (Fixes CVE-2008-2371). (Ilia) +- Updated timezone database to version 2008.9. (Derick) +- Upgraded bundled libzip to 0.9.0. (Pierre) + +- Added logging option for error_log to send directly to SAPI. (Stas) +- Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, + PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants. (Pierre) +- Added "PHP_INI_SCAN_DIR" environment variable which can be used to + either disable or change the compile time ini scan directory (FR #45114). + (Jani) + +- Fixed missing initialization of BG(page_uid) and BG(page_gid), + reported by Maksymilian Arciemowicz. (Stas) +- Fixed memory leak inside sqlite_create_aggregate(). (Felipe) +- Fixed memory leak inside PDO sqlite's sqliteCreateAggregate() method. + (Felipe) +- Fixed a crash inside gd with invalid fonts (Fixes CVE-2008-3658). (Pierre) +- Fixed a possible overflow inside memnstr (Fixes CVE-2008-3659). + (LaurentGaffie) +- Fixed incorrect php_value order for Apache configuration, reported by + Maksymilian Arciemowicz. (Stas) +- Fixed memory leak inside readline_callback_handler_remove() function. + (Felipe) +- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) +- Fixed a bug inside dba_replace() that could cause file truncation + withinvalid keys. (Ilia) +- Fixed memory leak inside readline_callback_handler_install() function.(Ilia) +- Fixed memory leak inside readline_completion_function() function. (Felipe) +- Fixed stream_get_contents() when using $maxlength and socket is notclosed. + indeyets [at] php [dot] net on #46049. (Arnaud) +- Fixed stream_get_line() to behave as documented on non-blocking streams. + (Arnaud) +- Fixed endless loop in PDOStatement::debugDumpParams(). + (jonah.harris at gmail dot com) +- Fixed ability to use "internal" heaps in extensions. (Arnaud, Dmitry) +- Fixed weekdays adding/subtracting algorithm. (Derick) +- Fixed some ambiguities in the date parser. (Derick) +- Fixed a bug with the YYYY-MM format not resetting the day correctly. + (Derick) +- Fixed a bug in the DateTime->modify() methods, it would not use the advanced + relative time strings. (Derick) +- Fixed extraction of zip files or directories when the entry name is a + relative path. (Pierre) +- Fixed read or write errors for large zip archives. (Pierre) +- Fixed security issues detailed in CVE-2008-2665 and CVE-2008-2666. + (Christian Hoffmann) +- Fixed simplexml asXML() not to lose encoding when dumping entire + document to file. (Ilia) +- Fixed a crash inside PDO when trying instantiate PDORow manually. + (Felipe) +- Fixed build failure of ext/mysqli with libmysql 6.0 - missing + rplfunctions. (Andrey) +- Fixed a regression when using strip_tags() and < is within an + attribute.(Scott) +- Fixed a crash on invalid method in ReflectionParameter constructor. + (Christian Seiler) +- Reverted fix for bug #44197 due to behaviour change in minor version. + (Felipe) + +- Fixed bug #46732 (mktime.year description is wrong). (Derick) +- Fixed bug #46696 (cURL fails in upload files with specified content-type). + (Ilia) +- Fixed bug #46673 (stream_lock call with wrong parameter). (Arnaud) +- Fixed bug #46649 (Setting array element with that same array produces + inconsistent results). (Arnaud) +- Fixed bug #46626 (mb_convert_case does not handle apostrophe correctly). + (Ilia) +- Fixed bug #46543 (ibase_trans() memory leaks when using wrong parameters). + (Felipe) +- Fixed bug #46521 (Curl ZTS OpenSSL, error in config.m4 fragment). + (jd at cpanel dot net) +- Fixed bug #46496 (wddx_serialize treats input as ISO-8859-1). (Mark Karpeles) +- Fixed bug #46427 (SoapClient() stumbles over its "stream_context" parameter). + (Dmitry, Herman Radtke) +- Fixed bug #46426 (offset parameter of stream_get_contents() does not + workfor "0"). (Felipe) +- Fixed bug #46406 (Unregistering nodeclass throws E_FATAL). (Rob) +- Fixed bug #46389 (NetWare needs small patch for _timezone). + (patch by guenter@php.net) +- Fixed bug #46388 (stream_notification_callback inside of object destroys + object variables). (Felipe) +- Fixed bug #46381 (wrong $this passed to internal methods causes segfault). + (Tony) +- Fixed bug #46379 (Infinite loop when parsing '#' in one line file). (Arnaud) +- Fixed bug #46366 (bad cwd with / as pathinfo). (Dmitry) +- Fixed bug #46360 (TCP_NODELAY constant for socket_{get,set}_option). + (bugs at trick dot vanstaveren dot us) +- Fixed bug #46343 (IPv6 address filter accepts invalid address). (Ilia) +- Fixed bug #46335 (DOMText::splitText doesn't handle multibyte characters). + (Rob) +- Fixed bug #46323 (compilation of simplexml for NetWare breaks). + (Patch by guenter [at] php [dot] net) +- Fixed bug #46319 (PHP sets default Content-Type header for HTTP 304 + response code, in cgi sapi). (Ilia) +- Fixed bug #46313 (Magic quotes broke $_FILES). (Arnaud) +- Fixed bug #46308 (Invalid write when changing property from inside getter). + (Dmitry) +- Fixed bug #46292 (PDO::setFetchMode() shouldn't requires the 2nd arg when + using FETCH_CLASSTYPE). (Felipe) +- Fixed bug #46274, #46249 (pdo_pgsql always fill in NULL for empty BLOB and + segfaults when returned by SELECT). (Felipe) +- Fixed bug #46271 (local_cert option is not resolved to full path). (Ilia) +- Fixed bug #46247 (ibase_set_event_handler() is allowing to pass callback + without event). (Felipe) +- Fixed bug #46246 (difference between call_user_func(array($this, $method)) + and $this->$method()). (Dmitry) +- Fixed bug #46222 (ArrayObject EG(uninitialized_var_ptr) overwrite). + (Etienne) +- Fixed bug #46215 (json_encode mutates its parameter and has some + class-specific state). (Felipe) +- Fixed bug #46206 (pg_query_params/pg_execute convert passed values to + strings). (Ilia) +- Fixed bug #46191 (BC break: DOMDocument saveXML() doesn't accept null). + (Rob) +- Fixed bug #46164 (stream_filter_remove() closes the stream). (Arnaud) +- Fixed bug #46157 (PDOStatement::fetchObject prototype error). (Felipe) +- Fixed bug #46147 (after stream seek, appending stream filter reads + incorrect data). (Greg) +- Fixed bug #46139 (PDOStatement->setFetchMode() forgets FETCH_PROPS_LATE). + (chsc at peytz dot dk, Felipe) +- Fixed bug #46127 (php_openssl_tcp_sockop_accept forgets to set context + on accepted stream) (Mark Karpeles, Pierre) +- Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on + multiple calls). (Ilia) +- Fixed bug #46088 (RegexIterator::accept - segfault). (Felipe) +- Fixed bug #46082 (stream_set_blocking() can cause a crash in some + circumstances). (Felipe) +- Fixed bug #46064 (Exception when creating ReflectionProperty object + on dynamicly created property). (Felipe) +- Fixed bug #46059 (Compile failure under IRIX 6.5.30 building posix.c). + (Arnaud) +- Fixed bug #46053 (SplFileObject::seek - Endless loop). (Arnaud) +- Fixed bug #46051 (SplFileInfo::openFile - memory overlap). (Arnaud) +- Fixed bug #46047 (SimpleXML converts empty nodes into object with + nested array). (Rob) +- Fixed bug #46031 (Segfault in AppendIterator::next). (Arnaud) +- Fixed bug #46029 (Segfault in DOMText when using with Reflection). (Rob) +- Fixed bug #46026 (bzip2.decompress/zlib.inflate filter tries to decompress + after end of stream). (Keisial at gmail dot com, Greg) +- Fixed bug #46024 (stream_select() doesn't return the correct number). + (Arnaud) +- Fixed bug #46010 (warnings incorrectly generated for iv in ecb mode). + (Felipe) +- Fixed bug #46003 (isset on nonexisting node return unexpected results). (Rob) +- Fixed bug #45956 (parse_ini_file() does not return false with syntax errors + in parsed file). (Jani) +- Fixed bug #45901 (wddx_serialize_value crash with SimpleXMLElement object). + (Rob) +- Fixed bug #45862 (get_class_vars is inconsistent with 'protected' and + 'private' variables). (ilewis at uk dot ibm dot com, Felipe) +- Fixed bug #45860 (header() function fails to correctly replace all Status + lines). (Dmitry) +- Fixed bug #45805 (Crash on throwing exception from error handler). (Dmitry) +- Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause + an error). (Felipe) +- Fixed bug #45751 (Using auto_prepend_file crashes (out of scope stack address + use)). (basant dot kukreja at sun dot com) +- Fixed bug #45722 (mb_check_encoding() crashes). (Moriyoshi) +- Fixed bug #45705 (rfc822_parse_adrlist() modifies passed address parameter). + (Jani) +- Fixed bug #45691 (Some per-dir or runtime settings may leak into other + requests). (Moriyoshi) +- Fixed bug #45581 (htmlspecialchars() double encoding &#x hex items). (Arnaud) +- Fixed bug #45580 (levenshtein() crashes with invalid argument). (Ilia) +- Fixed bug #45575 (Segfault with invalid non-string as event handler callback). + (Christian Seiler) +- Fixed bug #45568 (ISAPI doesn't properly clear auth_digest in header). + (Patch by: navara at emclient dot com) +- Fixed bug #45556 (Return value from callback isn't freed). (Felipe) +- Fixed bug #45555 (Segfault with invalid non-string as + register_introspection_callback). (Christian Seiler) +- Fixed bug #45553 (Using XPath to return values for attributes with a + namespace does not work). (Rob) +- Fixed bug #45529 (new DateTimeZone() and date_create()->getTimezone() behave + different). (Derick) +- Fixed bug #45522 (FCGI_GET_VALUES request does not return supplied values). + (Arnaud) +- Fixed bug #45486 (mb_send_mail(); header 'Content-Type: text/plain; charset=' + parsing incorrect). (Felipe) +- Fixed bug #45485 (strip_tags and ). (Dmitry) +- Fixed bug #43668 (Added odbc.default_cursortype to control the ODBCcursor + model). (Patrick) +- Fixed bug #43666 (Fixed code to use ODBC 3.52 datatypes for 64bit + systems). (Patrick) +- Fixed bug #43540 (rfc1867 handler newlength problem). (Arnaud) +- Fixed bug #43452 (strings containing a weekday, or a number plus weekday + behaved incorrect of the current day-of-week was the same as the one in the + phrase). (Derick) +- Fixed bug #43353 (wrong detection of 'data' wrapper causes notice). + (gk at gknw dot de, Arnaud) +- Fixed bug #43053 (Regression: some numbers shown in scientific notation). + (int-e at gmx dot de) +- Fixed bug #43045 (SOAP encoding violation on "INF" for type double/float). + (Dmitry) +- Fixed bug #42862 (IMAP toolkit crash: rfc822.c legacy routine buffer + overflow). (Fixes CVE-2008-2829) (Dmitry) +- Fixed bug #42855 (dns_get_record() doesn't return all text from TXT record). + (a dot u dot savchuk at gmail dot com) +- Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines). + (Nuno) +- Fixed bug #42718 (FILTER_UNSAFE_RAW not applied when configured as default + filter). (Arnaud) +- Fixed bug #42604 ("make test" fails with --with-config-file-scan-dir=path). + (Jani) +- Fixed bug #42473 (ob_start php://output and headers). (Arnaud) +- Fixed bug #42318 (problem with nm on AIX, not finding object files). + (Dmitry) +- Fixed bug #42294 (Unified solution for round() based on C99 round). (Ilia) +- Fixed bug #42078 (pg_meta_data mix tables metadata from different schemas). + (Felipe) +- Fixed bug #41348 (OCI8: allow compilation with Oracle 8.1). (Chris Jones) +- Fixed bug #41033 (enable signing with DSA keys. + (gordyf at google dot com, Pierre) +- Fixed bug #37100 (data is returned truncated with BINARY CURSOR). (Tony) +- Fixed bug #30312 (crash in sybase_unbuffered_query() function). (Timm) +- Fixed bug #24679 (pg_* functions doesn't work using schema). (Felipe) +- Fixed bug #14962 (PECL) (::extractTo 2nd argument is not really optional) + (Mark van Der Velden) +- Fixed bug #14032 (Mail() always returns false but mail is sent). (Mikko) + + +01 May 2008, PHP 5.2.6 +- Fixed two possible crashes inside posix extension (Tony) +- Fixed incorrect heredoc handling when label is used within the block. + (Matt) +- Fixed possible stack buffer overflow in FastCGI SAPI. (Andrei Nigmatulin) +- Fixed sending of uninitialized paddings which may contain some information. (Andrei Nigmatulin) +- Fixed a bug in formatting timestamps when DST is active in the default timezone (Derick) +- Properly address incomplete multibyte chars inside escapeshellcmd() (Ilia, Stefan Esser) +- Fix integer overflow in printf(). (Stas, Maksymilian Aciemowicz) +- Fixed security issue detailed in CVE-2008-0599. (Rasmus) +- Fixed potential memleak in stream filter parameter for zlib filter. (Greg) +- Added Reflection API metadata for the methods of the DOM classes. (Sebastian) +- Fixed weird behavior in CGI parameter parsing. (Dmitry, Hannes Magnusson) +- Fixed a safe_mode bypass in cURL identified by Maksymilian Arciemowicz. + (Ilia) +- Fixed a bug with PDO::FETCH_COLUMN|PDO::FETCH_GROUP mode when a column # by + which to group by data is specified. (Ilia) +- Fixed segfault in filter extension when using callbacks. (Arnar Mar Sig, + Felipe) +- Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream filter). (Greg) +- Upgraded PCRE to version 7.6 (Nuno) + +- Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick) +- Fixed bug #44720 (Prevent crash within session_register()). (Scott) +- Fixed bug #44703 (htmlspecialchars() does not detect bad character set argument). (Andy Wharmby) +- Fixed bug #44673 (With CGI argv/argc starts from arguments, not from script) (Dmitry) +- Fixed bug #44667 (proc_open() does not handle pipes with the mode 'wb' correctly). (Jani) +- Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter invalid). (Ilia) +- Fixed bug #44650 (escaepshellscmd() does not check arg count). (Ilia) +- Fixed bug #44613 (Crash inside imap_headerinfo()). (Ilia, jmessa) +- Fixed bug #44603 (Order issues with Content-Type/Length headers on POST). (Ilia) +- Fixed bug #44594 (imap_open() does not validate # of retries parameter). (Ilia) +- Fixed bug #44591 (imagegif's filename parameter). (Felipe) +- Fixed bug #44557 (Crash in imap_setacl when supplied integer as username) (Thomas Jarosch) +- Fixed bug #44487 (call_user_method_array issues a warning when throwing an exception). (David Soria Parra) +- Fixed bug #44478 (Inconsistent behaviour when assigning new nodes). (Rob, Felipe) +- Fixed bug #44445 (email validator does not handle domains starting/ending with a -). (Ilia) +- Fixed bug #44440 (st_blocks undefined under BeOS). (Felipe) +- Fixed bug #44394 (Last two bytes missing from output). (Felipe) +- Fixed bug #44388 (Crash inside exif_read_data() on invalid images) (Ilia) +- Fixed bug #44373 (PDO_OCI extension compile failed). (Felipe) +- Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags). (Felipe) +- Fixed bug #44306 (Better detection of MIPS processors on Windows). (Ilia) +- Fixed bug #44242 (metaphone('CMXFXM') crashes PHP). (Felipe) +- Fixed bug #44233 (MSG_PEEK undefined under BeOS R5). (jonathonfreeman at gmail dot com, Ilia) +- Fixed bug #44216 (strftime segfaults on large negative value). (Derick) +- Fixed bug #44209 (strtotime() doesn't support 64 bit timestamps on 64 bit platforms). (Derick) +- Fixed bug #44206 (OCI8 selecting ref cursors leads to ORA-1000 maximum open cursors reached). (Oracle Corp.) +- Fixed bug #44200 (A crash in PDO when no bound targets exists and yet bound parameters are present). (Ilia) +- Fixed bug #44197 (socket array keys lost on socket_select). (Felipe) +- Fixed bug #44191 (preg_grep messes up array index). (Felipe) +- Fixed bug #44189 (PDO setAttribute() does not properly validate values for native numeric options). (Ilia) +- Fixed bug #44184 (Double free of loop-variable on exception). (Dmitry) +- Fixed bug #44171 (Invalid FETCH_COLUMN index does not raise an error). (Ilia) +- Fixed bug #44166 (Parameter handling flaw in PDO::getAvailableDrivers()). (Ilia) +- Fixed bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)). (Felipe) +- Fixed bug #44152 (Possible crash with syslog logging on ZTS builds). (Ilia) +- Fixed bug #44141 (private parent constructor callable through static function). (Dmitry) +- Fixed bug #44113 (OCI8 new collection creation can fail with OCI-22303). (Oracle Corp.) +- Fixed bug #44069 (Huge memory usage with concatenation using . instead of .=). (Dmitry) +- Fixed bug #44046 (crash inside array_slice() function with an invalid by-ref offset). (Ilia) +- Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling encryption without crypto type). (Ilia) +- Fixed bug #44018 (RecursiveDirectoryIterator options inconsistancy). (Marcus) +- Fixed bug #44008 (OCI8 incorrect usage of OCI-Lob->close crashes PHP). (Oracle Corp.) +- Fixed bug #43998 (Two error messages returned for incorrect encoding for mb_strto[upper|lower]). (Rui) +- Fixed bug #43994 (mb_ereg 'successfully' matching incorrect). (Rui) +- Fixed bug #43954 (Memory leak when sending the same HTTP status code multiple times). (Scott) +- Fixed bug #43927 (koi8r is missing from html_entity_decode()). (andy at demos dot su, Tony) +- Fixed bug #43912 (Interbase column names are truncated to 31 characters). (Ilia) +- Fixed bug #43875 (Two error messages returned for $new and $flag argument in mysql_connect()). (Hannes) +- Fixed bug #43863 (str_word_count() breaks on cyrillic "ya" in locale cp1251). (phprus at gmail dot com, Tony) +- Fixed bug #43841 (mb_strrpos offset is byte count for negative values). (Rui) +- Fixed bug #43840 (mb_strpos bounds check is byte count rather than a character count). (Rui) +- Fixed bug #43808 (date_create never fails (even when it should)). (Derick) +- Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file headers). (Greg) +- Fixed bug #43703 (Signature compatibility check broken). (Dmitry) +- Fixed bug #43677 (Inconsistent behaviour of include_path set with php_value). (manuel at mausz dot at) +- Fixed bug #43663 (Extending PDO class with a __call() function doesn't work). (David Soria Parra) +- Fixed bug #43647 (Make FindFile use PATH_SEPARATOR instead of ";"). (Ilia) +- Fixed bug #43635 (mysql extension ingores INI settings on NULL values passed to mysql_connect()). (Ilia) +- Fixed bug #43620 (Workaround for a bug inside libcurl 7.16.2 that can result in a crash). (Ilia) +- Fixed bug #43614 (incorrect processing of numerical string keys of array in arbitrary serialized data). (Dmitriy Buldakov, Felipe) +- Fixed bug #43606 (define missing depencies of the exif extension). (crrodriguez at suse dot de) +- Fixed bug #43589 (a possible infinite loop in bz2_filter.c). (Greg) +- Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url() function). (Ilia) +- Fixed bug #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values). (Felipe, Tony) +- Fixed bug #43533 (escapeshellarg('') returns null). (Ilia) +- Fixed bug #43527 (DateTime created from a timestamp reports environment timezone). (Derick) +- Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe, Ilia, Tony) +- Fixed bug #43507 (SOAPFault HTTP Status 500 - would like to be able to set the HTTP Status). (Dmitry) +- Fixed bug #43505 (Assign by reference bug). (Dmitry) +- Fixed bug #43498 (file_exists() on a proftpd server got SIZE not allowed in ASCII mode). (Ilia, crrodriguez at suse dot de) +- Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory). (Chris) +- Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays). (Ilia) +- Fixed bug #43493 (pdo_pgsql does not send username on connect when password is not available). (Ilia) +- Fixed bug #43491 (Under certain conditions, file_exists() never returns). (Dmitry) +- Fixed bug #43483 (get_class_methods() does not list all visible methods). (Dmitry) +- Fixed bug #43482 (array_pad() does not warn on very small pad numbers). (Ilia) +- Fixed bug #43457 (Prepared statement with incorrect parms doesn't throw exception with pdo_pgsql driver). (Ilia) +- Fixed bug #43450 (Memory leak on some functions with implicit object __toString() call). (David C.) +- Fixed bug #43386 (array_globals not reset to 0 properly on init). (Ilia) +- Fixed bug #43377 (PHP crashes with invalid argument for DateTimeZone). (Ilia) +- Fixed bug #43373 (pcntl_fork() should not raise E_ERROR on error). (Ilia) +- Fixed bug #43364 (recursive xincludes don't remove internal xml nodes properly). (Rob, patch from ddb@bitxtender.de) +- Fixed bug #43301 (mb_ereg*_replace() crashes when replacement string is invalid PHP expression and 'e' option is used). (Jani) +- Fixed bug #43295 (crash because of uninitialized SG(sapi_headers).mimetype). (Dmitry) +- Fixed bug #43293 (Multiple segfaults in getopt()). (Hannes) +- Fixed bug #43279 (pg_send_query_params() converts all elements in 'params' to strings). (Ilia) +- Fixed bug #43276 (Incomplete fix for bug #42739, mkdir() under safe_mode). (Ilia) +- Fixed bug #43248 (backward compatibility break in realpath()). (Dmitry) +- Fixed bug #43221 (SimpleXML adding default namespace in addAttribute). (Rob) +- Fixed bug #43216 (stream_is_local() returns false on "file://"). (Dmitry) +- Fixed bug #43201 (Crash on using uninitialized vals and __get/__set). (Dmitry) +- Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on file truncation). (Ilia) +- Fixed bug #43175 (__destruct() throwing an exception with __call() causes segfault). (Dmitry) +- Fixed bug #43128 (Very long class name causes segfault). (Dmitry) +- Fixed bug #43105 (PHP seems to fail to close open files). (Hannes) +- Fixed bug #43092 (curl_copy_handle() crashes with > 32 chars long URL). (Jani) +- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp). (Derick) +- Fixed bug #42978 (mismatch between number of bound params and values causes a crash in pdo_pgsql). (Ilia) +- Fixed bug #42945 (preg_split() swallows part of the string). (Nuno) +- Fixed bug #42937 (__call() method not invoked when methods are called on parent from child class). (Dmitry) +- Fixed bug #42841 (REF CURSOR and oci_new_cursor() crash PHP). (Chris) +- Fixed bug #42838 (Wrong results in array_diff_uassoc) (Felipe) +- Fixed bug #42779 (Incorrect forcing from HTTP/1.0 request to HTTP/1.1 response). (Ilia) +- Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony) +- Fixed bug #42692 (Procedure 'int1' not present with doc/lit SoapServer). (Dmitry) +- Fixed bug #42548 (mysqli PROCEDURE calls can't return result sets). (Hartmut) +- Fixed bug #42505 (new sendmail default breaks on Netware platform) (Guenter Knauf) +- Fixed bug #42369 (Implicit conversion to string leaks memory). (David C., Rob). +- Fixed bug #42272 (var_export() incorrectly escapes char(0)). (Derick) +- Fixed bug #42261 (Incorrect lengths for date and boolean data types). (Ilia) +- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates DateTimeZone). (Derick) +- Fixed bug #42177 (Warning "array_merge_recursive(): recursion detected" comes again...). (Felipe) +- Fixed bug #41941 (oci8 extension not lib64 savvy). (Chris) +- Fixed bug #41828 (Failing to call RecursiveIteratorIterator::__construct() causes a sefault). (Etienne) +- Fixed bug #41599 (setTime() fails after modify() is used). (Derick) +- Fixed bug #41562 (SimpleXML memory issue). (Rob) +- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter Knauf) +- Fixed bug #38468 (Unexpected creation of cycle). (Dmitry) +- Fixed bug #32979 (OpenSSL stream->fd casts broken in 64-bit build) (stotty at tvnet dot hu) + +08 Nov 2007, PHP 5.2.5 +- Upgraded PCRE to version 7.3 (Nuno) +- Added optional parameter $provide_object to debug_backtrace(). (Sebastian) +- Added alpha support for imagefilter() IMG_FILTER_COLORIZE. (Pierre) +- Added ability to control memory consumption between request using + ZEND_MM_COMPACT environment variable. (Dmitry) + +- Improved speed of array_intersect_key(), array_intersect_assoc(), + array_uintersect_assoc(), array_diff_key(), array_diff_assoc() and + array_udiff_assoc(). (Dmitry) + +- Fixed move_uploaded_file() to always set file permissions of resulting file + according to UMASK. (Andrew Sitnikov) +- Fixed possible crash in ext/soap because of uninitialized value. (Zdash Urf) +- Fixed regression in glob() when enforcing safe_mode/open_basedir checks on + paths containing '*'. (Ilia) +- Fixed "mail.force_extra_parameters" php.ini directive not to be modifiable + in .htaccess due to the security implications - reported by SecurityReason. + (Stas) +- Fixed PDO crash when driver returns empty LOB stream. (Stas) +- Fixed dl() to only accept filenames - reported by Laurent Gaffie. (Stas) +- Fixed dl() to limit argument size to MAXPATHLEN (CVE-2007-4887). + (Christian Hoffmann) +- Fixed iconv_*() functions to limit argument sizes as workaround to libc + bug (CVE-2007-4783, CVE-2007-4840 by Laurent Gaffie). + (Christian Hoffmann, Stas) +- Fixed missing brackets leading to build warning and error in the log. + Win32 code. (Andrey) +- Fixed leaks with multiple connects on one mysqli object. (Andrey) +- Fixed endianness detection on MacOS when building universal binary. + (Uwe Schindler, Christian Speich, Tony) +- Fixed possible triggering of buffer overflows inside glibc + implementations of the fnmatch(), setlocale() and glob() functions. + Reported by Laurent Gaffie. (Ilia) +- Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre) +- Fixed htmlentities/htmlspecialchars not to accept partial multibyte + sequences. (Stas) + +- Fixed bug #43196 (array_intersect_assoc() crashes with non-array input). + (Jani) +- Fixed bug #43139 (PDO ignores ATTR_DEFAULT_FETCH_MODE in some cases with + fetchAll()). (Ilia) +- Fixed bug #43137 (rmdir() and rename() do not clear statcache). (Jani) +- Fixed bug #43130 (Bound parameters cannot have - in their name). (Ilia) +- Fixed bug #43099 (XMLWriter::endElement() does not check # of params). + (Ilia) +- Fixed bug #43020 (Warning message is missing with shuffle() and more + than one argument). (Scott) +- Fixed bug #42976 (Crash when constructor for newInstance() or + newInstanceArgs() fails) (Ilia) +- Fixed bug #42943 (ext/mssql: Move *timeout initialization from RINIT + to connect time). (Ilia) +- Fixed bug #42917 (PDO::FETCH_KEY_PAIR doesn't work with setFetchMode). + (Ilia) +- Fixed bug #42890 (Constant "LIST" defined by mysqlclient and c-client). + (Andrey) +- Fixed bug #42869 (automatic session id insertion adds sessions id to + non-local forms). (Ilia) +- Fixed bug #42818 ($foo = clone(array()); leaks memory). (Dmitry) +- Fixed bug #42817 (clone() on a non-object does not result in a fatal + error). (Ilia) +- Fixed bug #42785 (json_encode() formats doubles according to locale rather + then following standard syntax). (Ilia) +- Fixed bug #42783 (pg_insert() does not accept an empty list for + insertion). (Ilia) +- Fixed bug #42773 (WSDL error causes HTTP 500 Response). (Dmitry) +- Fixed bug #42772 (Storing $this in a static var fails while handling a cast + to string). (Dmitry) +- Fixed bug #42767 (highlight_string() truncates trailing comment). (Ilia) +- Fixed bug #42739 (mkdir() doesn't like a trailing slash when safe_mode is + enabled). (Ilia) +- Fixed bug #42703 (Exception raised in an iterator::current() causes segfault + in FilterIterator) (Marcus) +- Fixed bug #42699 (PHP_SELF duplicates path). (Dmitry) +- Fixed bug #42654 (RecursiveIteratorIterator modifies only part of leaves) + (Marcus) +- Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). (Ilia) +- Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran) +- Fixed bug #42629 (Dynamically loaded PHP extensions need symbols exported + on MacOSX). (jdolecek at NetBSD dot org) +- Fixed bug #42627 (bz2 extension fails to build with -fno-common). + (dolecek at netbsd dot org) +- Fixed Bug #42596 (session.save_path MODE option does not work). (Ilia) +- Fixed bug #42590 (Make the engine recognize \v and \f escape sequences). + (Ilia) +- Fixed bug #42587 (behavior change regarding symlinked .php files). (Dmitry) +- Fixed bug #42579 (apache_reset_timeout() does not exist). (Jani) +- Fixed bug #42549 (ext/mysql failed to compile with libmysql 3.23). (Scott) +- Fixed bug #42523 (PHP_SELF duplicates path). (Dmitry) +- Fixed bug #42512 (ip2long('255.255.255.255') should return 4294967295 on + 64-bit PHP). (Derick) +- Fixed bug #42506 (php_pgsql_convert() timezone parse bug) (nonunnet at + gmail dot com, Ilia) +- Fixed bug #42496 (OCI8 cursor is not closed when using 2 clobs in a select + query). (Oracle Corp.) +- Fixed bug #42462 (Segmentation when trying to set an attribute in a + DOMElement). (Rob) +- Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline + options). (Dmitry) +- Fixed bug #42452 (PDO classes do not expose Reflection API information). + (Hannes) +- Fixed bug #42468 (Write lock on file_get_contents fails when using a + compression stream). (Ilia) +- Fixed bug #42488 (SoapServer reports an encoding error and the error itself + breaks). (Dmitry) +- Fixed bug #42378 (mysqli_stmt_bind_result memory exhaustion). (Andrey) +- Fixed bug #42359 (xsd:list type not parsed). (Dmitry) +- Fixed bug #42326 (SoapServer crash). (Dmitry) +- Fixed bug #42214 (SoapServer sends clients internal PHP errors). (Dmitry) +- Fixed bug #42189 (xmlrpc_set_type() crashes php on invalid datetime + values). (Ilia) +- Fixed bug #42139 (XMLReader option constants are broken using XML()). (Rob) +- Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic + compliant wsdl). (Dmitry) +- Fixed bug #41822 (Relative includes broken when getcwd() fails). (Ab5602, + Jani) +- Fixed bug #41561 (Values set with php_admin_* in httpd.conf can be overwritten + with ini_set()). (Stas, Jani) +- Fixed bug #39651 (proc_open() append mode doesn't work on windows). (Nuno) + +30 Aug 2007, PHP 5.2.4 +- Removed --enable-versioning configure option. (Jani) + +- Upgraded PCRE to version 7.2 (Nuno) +- Updated timezone database to version 2007.6. (Derick) + +- Improved openssl_x509_parse() to return extensions in readable form. (Dmitry) + +- Enabled changing the size of statement cache for non-persistent OCI8 + connections. (Chris Jones, Tony) + +- Changed "display_errors" php.ini option to accept "stderr" as value which + makes the error messages to be outputted to STDERR instead of STDOUT with + CGI and CLI SAPIs (FR #22839). (Jani) +- Changed error handler to send HTTP 500 instead of blank page on PHP errors. + (Dmitry, Andrei Nigmatulin) +- Changed mail() function to be always available. (Johannes) + +- Added check for unknown options passed to configure. (Jani) +- Added persistent connection status checker to pdo_pgsql. + (Elvis Pranskevichus, Ilia) +- Added support for ATTR_TIMEOUT inside pdo_pgsql driver. (Ilia) +- Added php_ini_loaded_file() function which returns the path to the actual + php.ini in use. (Jani) +- Added GD version constants GD_MAJOR_VERSION, GD_MINOR_VERSION, + GD_RELEASE_VERSION, GD_EXTRA_VERSION and GD_VERSION_STRING. (Pierre) +- Added missing open_basedir checks to CGI. + (anight at eyelinkmedia dot com, Tony) +- Added missing format validator to unpack() function. (Ilia) +- Added missing error check inside bcpowmod(). (Ilia) +- Added CURLOPT_PRIVATE & CURLINFO_PRIVATE constants. + (Andrey A. Belashkov, Tony) +- Added missing MSG_EOR and MSG_EOF constants to sockets extension. (Jani) +- Added PCRE_VERSION constant. (Tony) +- Added ReflectionExtension::info() function to print the phpinfo() + block for an extension. (Johannes) + +- Implemented FR #41884 (ReflectionClass::getDefaultProperties() does not + handle static attributes). (Tony) + +- Fixed "Floating point exception" inside wordwrap(). + (Mattias Bengtsson, Ilia) +- Fixed several integer overflows in ImageCreate(), ImageCreateTrueColor(), + ImageCopyResampled() and ImageFilledPolygon() reported by Mattias Bengtsson. + (Tony) +- Fixed size calculation in chunk_split(). (Stas) +- Fixed integer overflow in str[c]spn(). (Stas) +- Fixed money_format() not to accept multiple %i or %n tokens. + (Stas, Ilia) +- Fixed zend_alter_ini_entry() memory_limit interruption + vulnerability. (Ilia) +- Fixed INFILE LOCAL option handling with MySQL extensions not to be + allowed when open_basedir or safe_mode is active. (Stas) +- Fixed session.save_path and error_log values to be checked against + open_basedir and safe_mode (CVE-2007-3378) (Stas, Maksymilian Arciemowicz) +- Fixed possible invalid read in glob() win32 implementation (CVE-2007-3806). + (Tony) +- Improved fix for MOPB-03-2007. (Ilia) +- Corrected fix for CVE-2007-2872. (Ilia) + +- Fixed possible crash in imagepsloadfont(), work around a bug in the pslib on + Windows. (Pierre) +- Fixed oci8 and PDO_OCI extensions to allow configuring with Oracle 11g + client libraries. (Chris Jones) +- Fixed EOF handling in case of reading from file opened in write only mode. + (Dmitry) +- Fixed var_export() to use the new H modifier so that it can generate + parseable PHP code for floats, independent of the locale. (Derick) +- Fixed regression introduced by the fix for the libgd bug #74. (Pierre) +- Fixed SimpleXML's behavior when used with empty(). (Sara) +- Fixed crash in OpenSSL extension because of non-string passphrase. (Dmitry) + +- Fixed PECL Bug #11345 (PDO_OCI crash after National language Support "NLS" + environment initialization error). (Chris Jones) +- Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory + already exists). (Pierre) + +- Fixed bug #43926 (isInstance() isn't equivalent to instanceof operator). (Marcus) +- Fixed bug #42368 (Incorrect error message displayed by pg_escape_string). + (Ilia) +- Fixed bug #42365 (glob() crashes and/or accepts way too many flags). + (Jani) +- Fixed Bug #42364 (Crash when using getRealPath with DirectoryIterator). + (Johannes) +- Fixed bug #42292 ($PHP_CONFIG not set for phpized builds). (Jani) +- Fixed bug #42261 (header wrong for date field). + (roberto at spadim dot com dot br, Ilia) +- Fixed bug #42259 (SimpleXMLIterator loses ancestry). (Rob) +- Fixed bug #42247 (ldap_parse_result() not defined under win32). (Jani) +- Fixed bug #42243 (copy() does not output an error when the first arg is a + dir). (Ilia) +- Fixed bug #42242 (sybase_connect() crashes). (Ilia) +- Fixed bug #42237 (stream_copy_to_stream returns invalid values for mmaped + streams). (andrew dot minerd at sellingsource dot com, Ilia) +- Fixed bug #42233 (Problems with æøå in extract()). (Jani) +- Fixed bug #42222 (possible buffer overflow in php_openssl_make_REQ). (Pierre) +- Fixed bug #42211 (property_exists() fails to find protected properties + from a parent class). (Dmitry) +- Fixed bug #42208 (substr_replace() crashes when the same array is passed + more than once). (crrodriguez at suse dot de, Ilia) +- Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir + and using PATH_INFO). (Dmitry) +- Fixed bug #42195 (C++ compiler required always). (Jani) +- Fixed bug #42183 (classmap causes crash in non-wsdl mode). (Dmitry) +- Fixed bug #42173 (oci8 INTERVAL and TIMESTAMP type fixes). (Chris) +- Fixed bug #42151 (__destruct functions not called after catching a SoapFault + exception). (Dmitry) +- Fixed bug #42142 (substr_replace() returns FALSE when length > string length). + (Ilia) +- Fixed bug #42135 (Second call of session_start() causes creation of SID). + (Ilia) +- Fixed bug #42134 (oci_error() returns false after oci_new_collection() fails). + (Tony) +- Fixed bug #42119 (array_push($arr,&$obj) doesn't work with + zend.ze1_compatibility_mode On). (Dmitry) +- Fixed bug #42117 (bzip2.compress loses data in internal buffer). + (Philip, Ilia) +- Fixed bug #42112 (deleting a node produces memory corruption). (Rob) +- Fixed bug #42107 (sscanf broken when using %2$s format parameters). (Jani) +- Fixed bug #42090 (json_decode causes segmentation fault). (Hannes) +- Fixed bug #42082 (NodeList length zero should be empty). (Hannes) +- Fixed bug #42072 (No warning message for clearstatcache() with arguments). + (Ilia) +- Fixed bug #42071 (ini scanner allows using NULL as option name). (Jani) +- Fixed bug #42027 (is_file() / is_dir() matches file/dirnames with wildcard char + or trailing slash in Windows). (Dmitry) +- Fixed bug #42019 (configure option --with-adabas=DIR does not work). (Jani) +- Fixed bug #42015 (ldap_rename(): server error "DSA is unwilling to perform"). + (bob at mroczka dot com, Jani) +- Fixed bug #42009 (is_a() and is_subclass_of() should NOT call autoload, in the + same way as "instanceof" operator). (Dmitry) +- Fixed bug #41989 (move_uploaded_file() & relative path in ZTS mode). (Tony) +- Fixed bug #41984 (Hangs on large SoapClient requests). (Dmitry) +- Fixed bug #41983 (Error Fetching http headers terminated by '\n'). (Dmitry) +- Fixed bug #41973 (--with-ldap=shared fails with LDFLAGS="-Wl,--as-needed"). (Nuno) +- Fixed bug #41971 (PDOStatement::fetch and PDOStatement::setFetchMode causes + unexpected behavior). (Ilia) +- Fixed bug #41964 (strtotime returns a timestamp for non-time string of + pattern '(A|a) .+'). (Derick) +- Fixed bug #41961 (Ensure search for hidden private methods does not stray from + class hierarchy). (robin_fernandes at uk dot ibm dot com) +- Fixed bug #41947 (SimpleXML incorrectly registers empty strings asnamespaces). + (Rob) +- Fixed bug #41929 (Foreach on object does not iterate over all visible properties). + (Dmitry) +- Fixed bug #41919 (crash in string to array conversion). + (judas dot iscariote at gmail dot com, Ilia) +- Fixed bug #41909 (var_export() is locale sensitive when exporting float + values). (Derick) +- Fixed bug #41908 (CFLAGS="-Os" ./configure --enable-debug fails). + (christian at hoffie dot info, Tony) +- Fixed bug #41904 (proc_open(): empty env array should cause empty environment + to be passed to process). (Jani) +- Fixed bug #41867 (SimpleXML: getName is broken). (Rob) +- Fixed bug #41865 (fputcsv(): 2nd parameter is not optional). (Jani) +- Fixed bug #41861 (SimpleXML: getNamespaces() returns the namespaces of a node's + siblings). (Rob) +- Fixed bug #41845 (pgsql extension does not compile with PostgreSQL <7.4). (Ilia) +- Fixed bug #41844 (Format returns incorrect number of digits for negative years + -0001 to -0999). (Derick) +- Fixed bug #41842 (Cannot create years < 0100 & negative years with date_create + or new DateTime). (Derick) +- Fixed bug #41833 (addChild() on a non-existent node, no node created, + getName() segfaults). (Rob) +- Fixed bug #41831 (pdo_sqlite prepared statements convert resources to + strings). (Ilia) +- Fixed bug #41815 (Concurrent read/write fails when EOF is reached). (Sascha) +- Fixed bug #41813 (segmentation fault when using string offset as an object). + (judas dot iscariote at gmail dot com, Tony) +- Fixed bug #41795 (checkdnsrr does not support DNS_TXT type). + (lucas at facebook dot com, Tony) +- Fixed bug #41773 (php_strip_whitespace() sends headers with errors + suppressed). (Tony) +- Fixed bug #41770 (SSL: fatal protocol error due to buffer issues). (Ilia) +- Fixed bug #41765 (Recode crashes/does not work on amd64). + (nexus at smoula dot net, Stas) +- Fixed bug #41724 (libxml_get_last_error() - errors service request scope). + (thekid at php dot net, Ilia) +- Fixed bug #41717 (imagepolygon does not respect thickness). (Pierre) +- Fixed bug #41713 (Persistent memory consumption on win32 since 5.2). (Dmitry) +- Fixed bug #41711 (NULL temporary lobs not supported in OCI8). + (Chris Jones, Tony) +- Fixed bug #41709 (strtotime() does not handle 00.00.0000). (Derick) +- Fixed bug #41698 (float parameters truncated to integer in prepared + statements). (Ilia) +- Fixed bug #41692 (ArrayObject shows weird behavior in respect to + inheritance). (Tony) +- Fixed bug #41691 (ArrayObject::exchangeArray hangs Apache). (Tony) +- Fixed bug #41686 (Omitting length param in array_slice not possible). (Ilia) +- Fixed bug #41685 (array_push() fails to warn when next index is + already occupied). (Ilia) +- Fixed bug #41655 (open_basedir bypass via glob()). (Ilia) +- Fixed bug #41640 (get_class_vars produces error on class constants). + (Johannes) +- Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI + result in major slowdown). (Dmitry) +- Fixed bug #41633 (Crash instantiating classes with self-referencing + constants). (Dmitry) +- Fixed bug #41630 (segfault when an invalid color index is present in the + image data). (Reported by Elliot ) (Pierre) +- Fixed bug #41628 (PHP settings leak between Virtual Hosts in Apache 1.3). + (Scott, manuel at mausz dot at) +- Fixed bug #41608 (segfault on a weird code with objects and switch()). + (Tony) +- Fixed bug #41600 (url rewriter tags doesn't work with namespaced tags). + (Ilia) +- Fixed bug #41596 (Fixed a crash inside pdo_pgsql on some non-well-formed + SQL queries). (Ilia) +- Fixed bug #41594 (OCI8 statement cache is flushed too frequently). (Tony) +- Fixed bug #41582 (SimpleXML crashes when accessing newly created element). + (Tony) +- Fixed bug #41576 (configure failure when using --without-apxs or some other + SAPIs disabling options). (Jani) +- Fixed bug #41567 (json_encode() double conversion is inconsistent with PHP). + (Lucas, Ilia) +- Fixed bug #41566 (SOAP Server not properly generating href attributes). + (Dmitry) +- Fixed bug #41555 (configure failure: regression caused by fix for #41265). + (Jani) +- Fixed bug #41527 (WDDX deserialize numeric string array key). + (Matt, Ilia) +- Fixed bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30). + (Derick) +- Fixed bug #41518 (file_exists() warns of open_basedir restriction on + non-existent file). (Tony) +- Fixed bug #41445 (parse_ini_file() has a problem with certain types of + integer as sections). (Tony) +- Fixed bug #41433 (DBA: configure fails to include correct db.h for db4). + (Jani) +- Fixed bug #41372 (Internal pointer of source array resets during array + copying). (Dmitry) +- Fixed bug #41350 (my_thread_global_end() error during request shutdown on + Windows). (Scott, Andrey) +- Fixed bug #41278 (get_loaded_extensions() should list Zend extensions). + (Johannes) +- Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions). + (Jani) +- Fixed bug #40757 (get_object_vars get nothing in child class). (Dmitry) +- Fixed bug #40705 (Iterating within function moves original array pointer). + (Dmitry) +- Fixed bug #40509 (key() function changed behaviour if global array is used + within function). (Dmitry) +- Fixed bug #40419 (Trailing slash in CGI request does not work). (Dmitry) +- Fixed bug #39330 (apache2handler does not call shutdown actions before + apache child die). (isk at ecommerce dot com, Gopal, Tony) +- Fixed bug #39291 (ldap_sasl_bind() misses the sasl_authc_id parameter). + (diafour at gmail dot com, Jani) +- Fixed bug #37715 (array pointers resetting on copy). (Dmitry) +- Fixed bug #37273 (Symlinks and mod_files session handler allow open_basedir + bypass). (Ilia) +- Fixed bug #36492 (Userfilters can leak buckets). (Sara) +- Fixed bugs #36796, #36918, #41371 (stream_set_blocking() does not work). + (Jani) +- Fixed bug #35981 (pdo-pgsql should not use pkg-config when not present). + (Jani) +- Fixed bug #31892 (PHP_SELF incorrect without cgi.fix_pathinfo, but turning on + screws up PATH_INFO). (Dmitry) +- Fixed bug #21197 (socket_read() outputs error with PHP_NORMAL_READ). + (Nuno, Jani) + +31 May 2007, PHP 5.2.3 +- Changed CGI install target to php-cgi and 'make install' to install CLI + when CGI is selected. (Jani) +- Changed JSON maximum nesting depth from 20 to 128. (Rasmus) + +- Improved compilation of heredocs and interpolated strings. (Matt, Dmitry) +- Optimized out a couple of per-request syscalls. (Rasmus) +- Optimized digest generation in md5() and sha1() functions. (Ilia) +- Upgraded bundled SQLite 3 to version 3.3.17. (Ilia) + +- Added "max_input_nesting_level" php.ini option to limit nesting level of + input variables. Fix for MOPB-03-2007. (Stas) +- Added a 4th parameter flag to htmlspecialchars() and htmlentities() that + makes the function not encode existing html entities. (Ilia) +- Added PDO::FETCH_KEY_PAIR mode that will fetch a 2 column result set into + an associated array. (Ilia) +- Added CURLOPT_TIMEOUT_MS and CURLOPT_CONNECTTIMEOUT_MS cURL constants. (Sara) +- Added --ini switch to CLI that prints out configuration file names. (Marcus) +- Added mysql_set_charset() to allow runtime altering of connection encoding. + (Scott) + +- Implemented FR #41416 (getColumnMeta() should also return table name). (Tony) + +- Fixed an integer overflow inside chunk_split(). Identified by Gerhard Wagner. + (Ilia) +- Fixed SOAP extension's handler() to work even when + "always_populate_raw_post_data" is off. (Ilia) +- Fixed possible infinite loop in imagecreatefrompng. (libgd #86) + (by Xavier Roche, CVE-2007-2756). (Pierre) +- Fixed ext/filter Email Validation Vulnerability (MOPB-45 by Stefan Esser). + (Ilia) +- Fixed altering $this via argument named "this". (Dmitry) +- Fixed PHP CLI usage of php.ini from the binary location. (Hannes) +- Fixed segfault in strripos(). (Tony, Joxean Koret) +- Fixed bug #41693 (scandir() allows empty directory names). (Ilia) +- Fixed bug #41673 (json_encode breaks large numbers in arrays). (Ilia) +- Fixed bug #41525 (ReflectionParameter::getPosition() not available). (Marcus) +- Fixed bug #41511 (Compile failure under IRIX 6.5.30 building md5.c). (Jani) +- Fixed bug #41504 (json_decode() incorrectly decodes JSON arrays with empty + string keys). (Ilia) +- Fixed bug #41492 (open_basedir/safe_mode bypass inside realpath()). (Ilia) +- Fixed bug #41477 (no arginfo about SoapClient::__soapCall()). (Ilia) +- Fixed bug #41455 (ext/dba/config.m4 pollutes global $LIBS and $LDFLAGS). + (mmarek at suse dot cz, Tony) +- Fixed bug #41442 (imagegd2() under output control). (Tony) +- Fixed bug #41430 (Fatal error with negative values of maxlen parameter of + file_get_contents()). (Tony) +- Fixed bug #41423 (PHP assumes wrongly that certain ciphers are enabled in + OpenSSL). (Pierre) +- Fixed bug #41421 (Uncaught exception from a stream wrapper segfaults). + (Tony, Dmitry) +- Fixed bug #41403 (json_decode cannot decode floats if localeconv + decimal_point is not '.'). (Tony) +- Fixed bug #41401 (wrong unary operator precedence). (Stas) +- Fixed bug #41394 (dbase_create creates file with corrupted header). (Tony) +- Fixed bug #41390 (Clarify error message with invalid protocol scheme). + (Scott) +- Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in + "Status:" header). (anight at eyelinkmedia dot com, Dmitry) +- Fixed bug #41374 (whole text concats values of wrong nodes). (Rob) +- Fixed bug #41358 (configure cannot determine SSL lib with libcurl >= 7.16.2). + (Mike) +- Fixed bug #41353 (crash in openssl_pkcs12_read() on invalid input). (Ilia) +- Fixed bug #41351 (Invalid opcode with foreach ($a[] as $b)). (Dmitry, Tony) +- Fixed bug #41347 (checkdnsrr() segfaults on empty hostname). (Scott) +- Fixed bug #41337 (WSDL parsing doesn't ignore non soap bindings). (Dmitry) +- Fixed bug #41326 (Writing empty tags with Xmlwriter::WriteElement[ns]) + (Pierre) +- Fixed bug #41321 (downgrade read errors in getimagesize() to E_NOTICE). + (Ilia) +- Fixed bug #41304 (compress.zlib temp files left). (Dmitry) +- Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no + default post handler). (Ilia) +- Fixed bug #41291 (FastCGI does not set SO_REUSEADDR). + (fmajid at kefta dot com, Dmitry) +- Fixed gd build when used with freetype 1.x (Pierre, Tony) +- Fixed bug #41287 (Namespace functions don't allow xmlns definition to be + optional). (Rob) +- Fixed bug #41285 (Improved fix for CVE-2007-1887 to work with non-bundled + sqlite2 lib). (Ilia) +- Fixed bug #41283 (Bug with deserializing array key that are doubles or + floats in wddx). (Ilia) +- Fixed bug #41257 (lookupNamespaceURI does not work as expected). (Rob) +- Fixed bug #41236 (Regression in timeout handling of non-blocking SSL + connections during reads and writes). (Ilia) +- Fixed bug #41134 (zend_ts_hash_clean not thread-safe). + (marco dot cova at gmail dot com, Tony) +- Fixed bug #41097 (ext/soap returning associative array as indexed without + using WSDL). (Dmitry) +- Fixed bug #41004 (minOccurs="0" and null class member variable). (Dmitry) +- Fixed bug #39542 (Behavior of require/include different to < 5.2.0). + (Dmitry) + +03 May 2007, PHP 5.2.2 +- Improved bundled GD + . Sync to 2.0.35 + . Added imagegrabwindow and imagegrabscreen, capture a screen or a + window using its handle (Pierre) + . colors allocated henceforth from the resulting image overwrite the palette + colors (Rob Leslie) + . Improved thread safety of the gif support (Roman Nemecek, Nuno, Pierre) + . Use the dimension of the GIF frame to create the destination image (Pierre) + . Load only once the local color map from a GIF data (Pierre) + . Improved thread safety of the freetype cache (Scott MacVicar, Nuno, Pierre) + . imagearc huge CPU usage with large angles, libgd bug #74 (Pierre) +- Improved FastCGI SAPI to support external pipe and socket servers on win32. + (Dmitry) +- Improved Zend Memory Manager + . guarantee of reasonable time for worst cases of best-fit free block + searching algorithm. (Dmitry) + . better cache usage and less fragmentation on erealloc() (Tony, Dmitry) +- Improved SPL (Marcus) + . Added SplFileInfo::getBasename(), DirectoryIterator::getBasename(). + . Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath(). + . Made RecursiveFilterIterator::accept() abstract as stated in documentation. +- Improved SOAP + . Added ability to encode arrays with "SOAP-ENC:Array" type instead of WSDL + type. To activate the ability use "feature"=>SOAP_USE_XSI_ARRAY_TYPE + option in SoapClient/SoapServer constructors. (Rob, Dmitry) + +- Added GMP_VERSION constant. (Tony) +- Added --ri switch to CLI which allows to check extension information. (Marcus) +- Added tidyNode::getParent() method (John, Nuno) +- Added openbasedir and safemode checks in zip:// stream wrapper and + ZipArchive::open (Pierre) +- Added php_pdo_sqlite_external.dll, a version of the PDO SQLite driver that + links against an external sqlite3.dll. This provides Windows users to upgrade + their sqlite3 version outside of the PHP release cycle. (Wez, Edin) +- Added linenumbers to array returned by token_get_all(). (Johannes) + +- Upgraded SQLite 3 to version 3.3.16 (Ilia) +- Upgraded libraries bundled in the Windows distribution. (Edin) + . c-client (imap) to version 2006e + . libpq (PostgreSQL) to version 8.2.3 + . libmysql (MySQL) to version 5.0.37 + . openssl to version 0.9.8e +- Upgraded PCRE to version 7.0 (Nuno) + +- Updated timezone database to version 2007.5. (Derick) + +- Fixed commandline handling for CLI and CGI. (Marcus, Johannes) +- Fixed iterator_apply() with a callback using __call(). (Johannes) +- Fixed possible multi bytes issues in openssl csr parser (Pierre) +- Fixed shmop_open() with IPC_CREAT|IPC_EXCL flags on Windows. + (Vladimir Kamaev, Tony). +- Fixed possible leak in ZipArchive::extractTo when safemode checks fails (Ilia) +- Fixed possible relative path issues in zip_open and TS mode (old API) (Pierre) +- Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) +- Fixed a thread safety issue in gd gif read code (Nuno, Roman Nemecek) +- Fixed CVE-2007-1001, GD wbmp used with invalid image size (Pierre) +- Fixed unallocated memory access/double free in in array_user_key_compare() + (MOPB-24 by Stefan Esser) (Stas) +- Fixed wrong length calculation in unserialize S type + (MOPB-29 by Stefan Esser) (Stas) + +- Fixed bug #41215 (setAttribute return code reversed). (Ilia) +- Fixed bug #41192 (Per Directory Values only work for one key). (Dmitry) +- Fixed bug #41175 (addAttribute() fails to add an attribute with an empty + value). (Ilia) +- Fixed bug #41159 (mysql_pconnect() hash does not account for connect + flags). (Ilia) +- Fixed bug #41121 (range() overflow handling for large numbers on 32bit + machines). (Ilia) +- Fixed bug #41118 (PHP does not handle overflow of octal integers). (Tony) +- Fixed bug #41109 (recursiveiterator.inc says "implements" Iterator instead of + "extends"). (Marcus) +- Fixed bug #40130 (TTF usage doesn't work properly under Netware). (Scott, + gk at gknw dot de) +- Fixed bug #41093 (magic_quotes_gpc ignores first arrays keys). (Arpad, Ilia) +- Fixed bug #41075 (memleak when creating default object caused exception). + (Dmitry) +- Fixed bug #41067 (json_encode() problem with UTF-16 input). (jp at df5ea + dot net. Ilia) +- Fixed bug #41063 (chdir doesn't like root paths). (Dmitry) +- Fixed bug #41061 ("visibility error" in ReflectionFunction::export()). + (Johannes) +- Fixed bug #41043 (pdo_oci crash when freeing error text with persistent + connection). (Tony) +- Fixed bug #41037 (unregister_tick_function() inside the tick function crash PHP). + (Tony) +- Fixed bug #41034 (json_encode() ignores null byte started keys in arrays). + (Ilia) +- Fixed bug #41026 (segfault when calling "self::method()" in shutdown functions). + (Tony) +- Fixed bug #40999 (mcrypt_create_iv() not using random seed). (Ilia) +- Fixed bug #40998 (long session array keys are truncated). (Tony) +- Implement feature request #40947, allow a single filter as argument + for filter_var_array (Pierre) +- Fixed bug #40935 (pdo_mysql does not raise an exception on empty + fetchAll()). (Ilia) +- Fixed bug #40931 (open_basedir bypass via symlink and move_uploaded_file()). + (Tony) +- Fixed bug #40921 (php_default_post_reader crashes when post_max_size is + exceeded). (trickie at gmail dot com, Ilia) +- Fixed bug #40915 (addcslashes unexpected behavior with binary input). (Tony) +- Fixed bug #40899 (memory leak when nesting list()). (Dmitry) +- Fixed bug #40897 (error_log file not locked). (Ilia) +- Fixed bug #40883 (mysql_query() is allocating memory incorrectly). (Tony) +- Fixed bug #40872 (inconsistency in offsetSet, offsetExists treatment of + string enclosed integers). (Marcus) +- Fixed bug #40861 (strtotime() doesn't handle double negative relative time + units correctly). (Derick, Ilia) +- Fixed bug #40854 (imap_mail_compose() creates an invalid terminator for + multipart e-mails). (Ilia) +- Fixed bug #40848 (sorting issue on 64-bit Solaris). (Wez) +- Fixed bug #40836 (Segfault in ext/dom). (Rob) +- Fixed bug #40833 (Crash when using unset() on an ArrayAccess object retrieved + via __get()). (Dmitry) +- Fixed bug #40822 (pdo_mysql does not return rowCount() on select). (Ilia) +- Fixed bug #40815 (using strings like "class::func" and static methods in + set_exception_handler() might result in crash). (Tony) +- Fixed bug #40809 (Poor performance of ".="). (Dmitry) +- Fixed bug #40805 (Failure executing function ibase_execute()). (Tony) +- Fixed bug #40800 (cannot disable memory_limit with -1). (Dmitry, Tony) +- Fixed bug #40794 (ReflectionObject::getValues() may crash when used with + dynamic properties). (Tony) +- Fixed bug #40784 (Case sensitivity in constructor's fallback). (Tony) +- Fixed bug #40770 (Apache child exits when PHP memory limit reached). (Dmitry) +- Fixed bug #40764 (line thickness not respected for horizontal and vertical + lines). (Pierre) +- Fixed bug #40758 (Test fcgi_is_fastcgi() is wrong on windows). (Dmitry) +- Fixed bug #40754 (added substr() & substr_replace() overflow checks). (Ilia) +- Fixed bug #40752 (parse_ini_file() segfaults when a scalar setting is + redeclared as an array). (Tony) +- Fixed bug #40750 (openssl stream wrapper ignores default_stream_timeout). + (Tony) +- Fixed bug #40727 (segfault in PDO when failed to bind parameters). (Tony) +- Fixed bug #40709 (array_reduce() behaves strange with one item stored arrays). + (Ilia) +- Fixed bug #40703 (Resolved a possible namespace conflict between libxmlrpc + and MySQL's NDB table handler). (Ilia) +- Fixed bug #40961 (Incorrect results of DateTime equality check). (Mike) +- Fixed bug #40678 (Cross compilation fails). (Tony) +- Fixed bug #40621 (Crash when constructor called inappropriately). (Tony) +- Fixed bug #40609 (Segfaults when using more than one SoapVar in a request). + (Rob, Dmitry) +- Fixed bug #40606 (umask is not being restored when request is finished). + (Tony) +- Fixed bug #40598 (libxml segfault). (Rob) +- Fixed bug #40591 (list()="string"; gives invalid opcode). (Dmitry) +- Fixed bug #40578 (imagettftext() multithreading issue). (Tony, Pierre) +- Fixed bug #40576 (double values are truncated to 6 decimal digits when + encoding). (Tony) +- Fixed bug #40560 (DIR functions do not work on root UNC path). (Dmitry) +- Fixed bug #40548 (SplFileInfo::getOwner/getGroup give a warning on broken + symlink). (Marcus) +- Fixed bug #40546 (SplFileInfo::getPathInfo() throws an exception if directory + is in root dir). (Marcus) +- Fixed bug #40545 (multithreading issue in zend_strtod()). (Tony) +- Fixed bug #40503 (json_encode() value corruption on 32bit systems with + overflown values). (Ilia) +- Fixed bug #40467 (Partial SOAP request sent when XSD sequence or choice + include minOccurs=0). (Dmitry) +- Fixed bug #40465 (Ensure that all PHP elements are printed by var_dump). + (wharmby at uk dot ibm dot com, Ilia) +- Fixed bug #40464 (session.save_path wont use default-value when safe_mode + or open_basedir is enabled). (Ilia) +- Fixed bug #40455 (proc_open() uses wrong command line when safe_mode_exec_dir + is set). (Tony) +- Fixed bug #40432 (strip_tags() fails with greater than in attribute). (Ilia) +- Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty + methods). (Tony) +- Fixed bug #40451 (addAttribute() may crash when used with non-existent child + node). (Tony) +- Fixed bug #40442 (ArrayObject::offsetExists broke in 5.2.1, works in 5.2.0). + (olivier at elma dot fr, Marcus) +- Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre) +- Fixed bug #40417 (Allow multiple instances of the same named PDO token in + prepared statement emulation code). (Ilia) +- Fixed bug #40414 (possible endless fork() loop when running fastcgi). + (Dmitry) +- Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9). (Tony) +- Fixed bug #40392 (memory leaks in PHP milter SAPI). + (tuxracer69 at gmail dot com, Tony) +- Fixed bug #40371 (pg_client_encoding() not working on Windows). (Edin) +- Fixed bug #40352 (FCGI_WEB_SERVER_ADDRS function get lost). (Dmitry) +- Fixed bug #40290 (strtotime() returns unexpected result with particular + timezone offset). (Derick) +- Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when + parent is killed). (Dmitry) +- Fixed bug #40261 (Extremely slow data handling due to memory fragmentation). + (Dmitry) +- Fixed bug #40236 (php -a function allocation eats memory). (Dmitry) +- Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony) +- Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()). + (Derick) +- Implement #39867 (openssl PKCS#12 support) (Marc Delling, Pierre) +- Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus) +- Fixed bug #39416 (Milliseconds in date()). (Derick) +- Fixed bug #39396 (stream_set_blocking crashes on Win32). (Ilia, maurice at + iceblog dot de) +- Fixed bug #39351 (relative include fails on Solaris). (Dmitry, Tony) +- Fixed bug #39322 (proc_terminate() destroys process resource). (Nuno) +- Fixed bug #38406 (crash when assigning objects to SimpleXML attributes). (Tony) +- Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno) +- Fixed bug #36496 (SSL support in imap_open() not working on Windows). (Edin) +- Fixed bug #36226 (Inconsistent handling when passing nillable arrays). + (Dmitry) +- Fixed bug #35872 (Avoid crash caused by object store being referenced during + RSHUTDOWN). (Andy) +- Fixed bug #34794 (proc_close() hangs when used with two processes). + (jdolecek at netbsd dot org, Nuno) +- Fixed PECL bug #10194 (crash in Oracle client when memory limit reached in + the callback). (Tony) +- Fixed substr_compare and substr_count information leak (MOPB-14) (Stas, Ilia) +- Fixed crash on op-assign where argument is string offset (Brian, Stas) +- Fixed bug #38710 (data leakage because of nonexisting boundary checking in + statements in mysqli) (Stas) +- Fixed bug #37386 (autocreating element doesn't assign value to first node). + (Rob) +- Fixed bug #37013 (server hangs when returning circular object references). + (Dmitry) +- Fixed bug #33664 Console window appears when using exec() + (Richard Quadling, Stas) + + +08 Feb 2007, PHP 5.2.1 +- Added read-timeout context option "timeout" for HTTP streams. (Hannes, Ilia). +- Added CURLOPT_TCP_NODELAY constant to Curl extension. (Sara) +- Added support for hex numbers of any size. (Matt) +- Added function stream_socket_shutdown(). It is a wrapper for system + shutdown() function, that shut downs part of a full-duplex connection. + (Dmitry) +- Added internal heap protection (Dmitry) + . memory-limit is always enabled (--enable-memory-limit removed) + . default value if memory-limit is set to 128M + . safe unlinking + . cookies + . canary protection (debug build only) + . random generation of cookies and canaries +- Added forward support for 'b' prefix in front of string literals. (Andrei) +- Added three new functions to ext/xmlwriter (Rob, Ilia) + . xmlwriter_start_dtd_entity() + . xmlwriter_end_dtd_entity() + . xmlwriter_write_dtd_entity() +- Added a meta tag to phpinfo() output to prevent search engines from indexing + the page. (Ilia) +- Added new function, sys_get_temp_dir(). (Hartmut) +- Added missing object support to file_put_contents(). (Ilia) +- Added support for md2, ripemd256 and ripemd320 algos to hash(). (Sara) +- Added forward support for (binary) cast. (Derick) +- Added optimization for imageline with horizontal and vertical lines (Pierre) + +- Removed dependency from SHELL32.DLL. (Dmitry) +- Removed double "wrong parameter count" warnings in various functions. + (Hannes) +- Moved extensions to PECL: + . ext/informix (Derick, Tony) + +- Changed double-to-string utilities to use BSD implementation. (Dmitry, Tony) +- Updated bundled libcURL to version 7.16.0 in the Windows distro. (Edin) +- Updated timezone database to version 2006.16. (Derick) +- cgi.* and fastcgi.* directives are moved to INI subsystem. The new directive + cgi.check_shebang_line can be used to omitting check for "#! /usr/bin/php" + line. (Dmitry). +- Improved proc_open(). Now on Windows it can run external commands not + through CMD.EXE. (Dmitry) +- VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR. + (Dmitry) +- ext/bcmath initialization code is moved from request startup to module + startup. (Dmitry) +- Zend Memory Manager Improvements (Dmitry) + . use HeapAlloc() instead of VirtualAlloc() + . use "win32" storage manager (instead of "malloc") on Windows by default +- Zip Extension Improvements (Pierre) + . Fixed leak in statName and stateIndex + . Fixed return setComment (Hannes) + . Added addEmptyDir method +- Filter Extension Improvements (Ilia, Pierre) + . Fixed a bug when callback function returns a non-modified value. + . Added filter support for $_SERVER in cgi/apache2 sapis. + . Make sure PHP_SELF is filtered in Apache 1 sapi. + . Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to + php_filter.h). + . Added "default" option that allows a default value to be set for an + invalid or missing value. + . Invalid filters fails instead of returning unsafe value + . Fixed possible double encoding problem with sanitizing filters + . Make use of space-strict strip_tags() function + . Fixed whitespace trimming + . Added support for FastCGI environment variables. (Dmitry) +- PDO_MySQL Extension Improvements (Ilia) + . Enabled buffered queries by default. + . Enabled prepared statement emulation by default. + +- Small optimization of the date() function. (Matt,Ilia) +- Optimized the internal is_numeric_string() function. (Matt,Ilia) +- Optimized array functions utilizing php_splice(). (Ilia) +- Windows related optimizations (Dmitry, Stas) + . COM initialization/deinitialization are done only if necessary + . removed unnecessary checks for ISREG file and corresponding stat() calls + . opendir() is reimplementation using GetFistFile/GetNextFile those are + faster then _findfirst/_findnext + . implemented registry cache that prevent registry lookup on each request. + In case of modification of corresponding registry-tree PHP will reload it + automatic + . start timeout thread only if necessary + . stat() is reimplementation using GetFileAttributesEx(). The new + implementation is faster then implementation in MS VC CRT, but it doesn't + support Windows 95. +- Streams optimization (Dmitry) + . removed unnecessary ftell() calls (one call for each included PHP file) + . disabled calls to read() after EOF + +- Fixed incorrect function names on FreeBSD where inet_pton() was named + __inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes) +- Fixed FastCGI impersonation for persistent connections on Windows. (Dmitry) +- Fixed wrong signature initialization in imagepng (Takeshi Abe) +- Fixed ftruncate() with negative size on FreeBSD. (Hannes) +- Fixed segfault in RegexIterator when given invalid regex. (Hannes) +- Fixed segfault in SplFileObject->openFile()->getPathname(). (Hannes) +- Fixed segfault in ZTS mode when OCI8 statements containing sub-statements + are destroyed in wrong order. (Tony) +- Fixed the validate email filter so that the letter "v" can also be used in + the user part of the email address. (Derick) +- Fixed bug #40297 (compile failure in ZTS mode when collections support is + missing). (Tony) +- Fixed bug #40285 (The PDO prepare parser goes into an infinite loop in + some instances). (Ilia) +- Fixed bug #40274 (Sessions fail with numeric root keys). (Ilia) +- Fixed bug #40259 (ob_start call many times - memory error). (Dmitry) +- Fixed bug #40231 (file_exists incorrectly reports false). (Dmitry) +- Fixed bug #40228 (ZipArchive::extractTo does create empty directories + recursively). (Pierre) +- Fixed bug #40200 (The FastCgi version has different realpath results than + thread safe version). (Dmitry) +- Fixed bug #40191 (use of array_unique() with objects triggers segfault). + (Tony) +- Fixed bug #40189 (possible endless loop in zlib.inflate stream filter). + (Greg, Tony) +- Fixed bug #40169 (CURLOPT_TCP_NODELAY only available in curl >= 7.11.2). + (Tony) +- Fixed bug #40129 (iconv extension doesn't compile with CodeWarrior on + Netware). (gk at gknw dot de, Tony) +- Fixed bug #40127 (apache2handler doesn't compile on Netware). + (gk at gknw dot de) +- Fixed bug #40121 (PDO_DBLIB driver wont free statements). (Ilia) +- Fixed bug #40098 (php_fopen_primary_script() not thread safe). (Ilia) +- Fixed bug #40092 (chroot() doesn't clear realpath cache). (Dmitry) +- Fixed bug #40091 (spl_autoload_register with 2 instances of the same class). + (Ilia) +- Fixed bug #40083 (milter SAPI functions always return false/null). (Tony) +- Fixed bug #40079 (php_get_current_user() not thread safe). + (Ilia, wharmby at uk dot ibm dot com) +- Fixed bug #40078 (ORA-01405 when fetching NULL values using + oci_bind_array_by_name()). (Tony) +- Fixed bug #40076 (zend_alloc.c: Value of enumeration constant must be in + range of signed integer). (Dmitry) +- Fixed bug #40073 (exif_read_data dies on certain images). (Tony, Marcus) +- Fixed bug #40036 (empty() does not work correctly with ArrayObject when + using ARRAY_AS_PROPS). (Ilia) +- Fixed bug #40012 (php_date.c doesn't compile on Netware). + (gk at gknw dot de, Derick) +- Fixed bug #40009 (http_build_query(array()) returns NULL). (Ilia) +- Fixed bug #40002 (Try/Catch performs poorly). (Dmitry) +- Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). (Ilia) +- Fixed bug #39990 (Cannot "foreach" over overloaded properties). (Dmitry) +- Fixed bug #39988 (type argument of oci_define_by_name() is ignored). + (Chris Jones, Tony) +- Fixed bug #39984 (redirect response code in header() could be ignored + in CGI sapi). (Ilia) +- Fixed bug #39979 (PGSQL_CONNECT_FORCE_NEW will causes next connect to + establish a new connection). (Ilia) +- Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used + for timestamp fields). (Ilia) +- Fixed bug #39969 (ini setting short_open_tag has no effect when using + --enable-maintainer-zts). (Dmitry) +- Fixed bug #39952 (zip ignoring --with-libdir on zlib checks) + (judas dot iscariote at gmail dot com) +- Fixed bug #39944 (References broken). (Dmitry) +- Fixed bug #39935 (Extensions tidy,mcrypt,mhash,pdo_sqlite ignores + --with-libdir). (judas dot iscariote at gmail dot com, Derick) +- Fixed bug #39903 (Notice message when executing __halt_compiler() more than + once). (Tony) +- Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). (Ilia) +- Fixed bug #39890 (using autoconf 2.6x and --with-layout=GNU breaks PEAR + install path). (Tony) +- Fixed bug #39884 (ReflectionParameter::getClass() throws exception for + type hint self). (thekid at php dot net) +- Fixed bug #39878 (CURL doesn't compile on Sun Studio Pro). (Ilia) +- Fixed bug #39873 (number_format() breaks with locale & decimal points). + (Ilia) +- Fixed bug #39869 (safe_read does not initialize errno). + (michiel at boland dot org, Dmitry) +- Fixed bug #39850 (SplFileObject throws contradictory/wrong error messages + when trying to open "php://wrong"). (Tony) +- Fixed bug #39846 (Invalid IPv4 treated as valid). (Ilia) +- Fixed bug #39845 (Persistent connections generate a warning in pdo_pgsql). + (Ilia) +- Fixed bug #39832 (SOAP Server: parameter not matching the WSDL specified + type are set to 0). (Dmitry) +- Fixed bug #39825 (foreach produces memory error). (Dmitry) +- Fixed bug #39816 (apxs2filter ignores httpd.conf & .htaccess php config + settings). (Ilia) +- Fixed bug #39815 (SOAP double encoding is not locale-independent). (Dmitry) +- Fixed bug #39797 (virtual() does not reset changed INI settings). (Ilia) +- Fixed bug #39795 (build fails on AIX because crypt_r() uses different + data struct). (Tony) +- Fixed bug #39791 (Crash in strtotime() on overly long relative date + multipliers). (Ilia) +- Fixed bug #39787 (PHP doesn't work with Apache 2.3). + (mv at binarysec dot com). +- Fixed bug #39782 (setTime() on a DateTime constructed with a Weekday + yields incorrect results). (Ilia) +- Fixed bug #39780 (PNG image with CRC/data error raises fatal error) (Pierre) +- Fixed bug #39779 (Enable AUTH PLAIN mechanism in underlying libc-client). + (michael dot heimpold at s2000 dot tu-chemnitz dot de, Ilia) +- Fixed bug #39775 ("Indirect modification ..." message is not shown). + (Dmitry) +- Fixed bug #39763 (magic quotes are applied twice by ext/filter in + parse_str()). (Ilia) +- Fixed bug #39760 (cloning fails on nested SimpleXML-Object). (Rob) +- Fixed bug #39759 (Can't use stored procedures fetching multiple result + sets in pdo_mysql). (Ilia) +- Fixed bug #39754 (Some POSIX extension functions not thread safe). + (Ilia, wharmby at uk dot ibm dot com) +- Fixed bug #39751 (putenv crash on Windows). (KevinJohnHoffman at gmail.com) +- Fixed bug #39732 (oci_bind_array_by_name doesn't work on Solaris 64bit). + (Tony) +- Fixed bug #39724 (Broken build due to spl/filter usage of pcre extension). + (Tony, Ilia) +- Fixed bug #39718 (possible crash if assert.callback is set in ini). (Ilia) +- Fixed bug #39702 (php crashes in the allocator on linux-m68k). (Dmitry) +- Fixed bug #39685 (iconv() - undefined function). (Hannes) +- Fixed bug #39673 (file_get_contents causes bus error on certain offsets). + (Tony) +- Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory + corruption on Windows in pgsql and pdo_pgsql extensions). + (Ilia, matteo at beccati dot com) +- Fixed bug #39662 (Segfault when calling asXML() of a cloned + SimpleXMLElement). (Rob, Tony) +- Fixed bug #39656 (crash when calling fetch() on a PDO statment object after + closeCursor()). (Ilia, Tony) +- Fixed bug #39653 (ext/dba doesn't check for db-4.5 and db-4.4 when db4 + support is enabled). (Tony) +- Fixed bug #39652 (Wrong negative results from memory_get_usage()). (Dmitry) +- Fixed bug #39648 (Implementation of PHP functions chown() and chgrp() are + not thread safe). (Ilia, wharmby at uk dot ibm dot com) +- Fixed bug #39640 (Segfault with "Allowed memory size exhausted"). (Dmitry) +- Fixed bug #39625 (Apache crashes on importStylesheet call). (Rob) +- Fixed bug #39623 (thread safety fixes on *nix for putenv() & mime_magic). + (Ilia, wharmby at uk dot ibm dot com) +- Fixed bug #39621 (str_replace() is not binary safe on strings with equal + length). (Tony) +- Fixed bug #39613 (Possible segfault in imap initialization due to missing + module dependency). (wharmby at uk dot ibm dot com, Tony) +- Fixed bug #39606 (Use of com.typelib_file in PHP.ini STILL causes A/V). (Rob) +- Fixed bug #39602 (Invalid session.save_handler crashes PHP). (Dmitry) +- Fixed bug #39596 (Creating Variant of type VT_ARRAY). (Rob) +- Fixed bug #39583 (ftp_put() does not change transfer mode to ASCII). (Tony) +- Fixed bug #39576 (array_walk() doesn't separate user data zval). (Tony) +- Fixed bug #39575 (move_uploaded_file() no longer working (safe mode + related)). (Tony) +- Fixed bug #39571 (timeout ssl:// connections). (Ilia) +- Fixed bug #39564 (PDO::errorInfo() returns inconsistent information when + sqlite3_step() fails). (Tony) +- Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString() + on Windows). (Dmitry) +- Fixed bug #39538 (fgetcsv can't handle starting newlines and trailing odd + number of backslashes). (David Soria Parra, Pierre) +- Fixed bug #39534 (Error in maths to calculate of + ZEND_MM_ALIGNED_MIN_HEADER_SIZE). (wharmby at uk dot ibm dot com, Dmitry) +- Fixed bug #39527 (Failure to retrieve results when multiple unbuffered, + prepared statements are used in pdo_mysql). (Ilia) +- Fixed bug #39508 (imagefill crashes with small images 3 pixels or less). + (Pierre) +- Fixed bug #39506 (Archive corrupt with ZipArchive::addFile method). (Pierre) +- Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not + entity). (Hannes) +- Fixed bug #39483 (Problem with handling of \ char in prepared statements). + (Ilia, suhachov at gmail dot com) +- Fixed bug #39458 (ftp_nlist() returns false on empty dirs). (Nuno) +- Fixed bug #39454 (Returning a SOAP array segfaults PHP). (Dmitry) +- Fixed bug #39450 (getenv() fills other super-globals). (Ilia, Tony) +- Fixed bug #39449 (Overloaded array properties do not work correctly). + (Dmitry) +- Fixed bug #39445 (Calling debug_backtrace() in the __toString() + function produces a crash). (Dmitry) +- Fixed bug #39438 (Fatal error: Out of memory). (Dmitry) +- Fixed bug #39435 ('foo' instanceof bar gives invalid opcode error). (Sara) +- Fixed bug #39414 (Syntax error while compiling with Sun Workshop Complier). + (Johannes) +- Fixed bug #39398 (Booleans are not automatically translated to integers). + (Ilia) +- Fixed bug #39394 (Missing check for older variants of openssl). (Ilia) +- Fixed bug #39367 (clearstatcache() doesn't clear realpath cache). + (j at pureftpd dot org, Dmitry) +- Fixed bug #39366 (imagerotate does not use alpha with angle > 45 degrees) + (Pierre) +- Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()). + (Ilia) +- Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the + number of connection retries). (Ilia) +- Fixed bugs #39361 & #39400 (mbstring function overloading problem). (Seiji) +- Fixed bug #39354 (Allow building of curl extension against libcurl + 7.16.0). (Ilia) +- Fixed bug #39350 (crash with implode("\n", array(false))). (Ilia) +- Fixed bug #39344 (Unnecessary calls to OnModify callback routine for + an extension INI directive). (wharmby at uk dot ibm dot com, Dmitry) +- Fixed bug #39320 (ZEND_HASH_APPLY_STOP causes deletion). (Marcus) +- Fixed bug #39313 (spl_autoload triggers Fatal error). (Marcus) +- Fixed bug #39300 (make install fails if wget is not available). (Tony) +- Fixed bug #39297 (Memory corruption because of indirect modification of + overloaded array). (Dmitry) +- Fixed bug #39286 (misleading error message when invalid dimensions are + given) (Pierre) +- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre) +- Fixed bug #39265 (Fixed path handling inside mod_files.sh). + (michal dot taborsky at gmail dot com, Ilia) +- Fixed bug #39217 (serialNumber might be -1 when the value is too large). + (Pierre, Tony) +- Fixed bug #39215 (Inappropriate close of stdin/stdout/stderr). (Wez, Ilia) +- Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler). (Ilia) +- Fixed bug #39151 (Parse error in recursiveiteratoriterator.php). (Marcus) +- Fixed bug #39121 (Incorrect return array handling in non-wsdl soap client). + (Dmitry) +- Fixed bug #39090 (DirectoryFilterDots doxygen docs and example is wrong). + (Marcus) +- Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes) +- Fixed bug #38770 (unpack() broken with longs on 64 bit machines). + (Ilia, David Soria Parra). +- Fixed bug #38698 (for some keys cdbmake creates corrupted db and cdb can't + read valid db). (Marcus) +- Fixed bug #38680 (Added missing handling of basic types in json_decode). + (Ilia) +- Fixed bug #38604 (Fixed request time leak inside foreach() when iterating + through virtual properties). (Dmitry) +- Fixed bug #38602 (header( "HTTP/1.0 ..." ) does not change proto version). + (Ilia) +- Fixed bug #38542 (proc_get_status() returns wrong PID on windows). (Nuno) +- Fixed bug #38536 (SOAP returns an array of values instead of an object). + (Dmitry) +- Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php + ErrorDocument). (Ilia) +- Fixed bug #38325 (spl_autoload_register() gives wrong line for "class not + found"). (Ilia) +- Fixed bug #38319 (Remove bogus warnings from persistent PDO connections). + (Ilia) +- Fixed bug #38274 (Memlimit fatal error sent to "wrong" stderr when using + fastcgi). (Dmitry) +- Fixed bug #38252 (Incorrect PDO error message on invalid default fetch + mode). (Ilia) +- Fixed bug #37927 (Prevent trap when COM extension processes argument of + type VT_DISPATCH|VT_REF) (Andy) +- Fixed bug #37773 (iconv_substr() gives "Unknown error" when string + length = 1"). (Ilia) +- Fixed bug #37627 (session save_path check checks the parent directory). + (Ilia) +- Fixed bug #37619 (proc_open() closes stdin on fork() failure). + (jdolecek at NetBSD dot org, Nuno) +- Fixed bug #37588 (COM Property propputref converts to PHP function + and can't be accesed). (Rob) +- Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). + (Hannes) +- Fixed bug #36812 (pg_execute() modifies input array). (Ilia) +- Fixed bug #36798 (Error parsing named parameters with queries containing + high-ascii chars). (Ilia) +- Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia) +- Fixed bug #36427 (proc_open() / proc_close() leak handles on windows). + (jdolecek at NetBSD dot org, Nuno) +- Fixed bug #36392 (wrong number of decimal digits with %e specifier in + sprintf). (Matt,Ilia) +- Fixed bug #36214 (__get method works properly only when conditional + operator is used). (Dmitry) +- Fixed bug #35634 (Erroneous "Class declarations may not be nested" + error raised). (Carl P. Corliss, Dmitry) +- Fixed bug #35106 (nested foreach fails when array variable has a + reference). (Dmitry) +- Fixed bug #34564 (COM extension not returning modified "out" argument) (Andy) +- Fixed bug #33734 (Something strange with COM Object). (Rob) +- Fixed bug #33386 (ScriptControl only sees last function of class). (Rob) +- Fixed bug #33282 (Re-assignment by reference does not clear the is_ref + flag) (Ilia, Dmitry, Matt Wilmas) +- Fixed bug #30074 (apparent symbol table error with + extract($blah, EXTR_REFS)) (Brian) +- Fixed bug #29840 (is_executable() does not honor safe_mode_exec_dir + setting). (Ilia) +- Fixed PECL bug #7295 (ORA-01405: fetched column value is NULL on LOB + fields). (Tony) + +02 Nov 2006, PHP 5.2.0 +- Updated bundled OpenSSL to version 0.9.8d in the Windows distro. (Edin) +- Updated Postgresql client libraries to 8.1.4 in the Windows distro. (Edin) +- Updated PCRE to version 6.7. (Ilia) +- Updated libsqlite in ext/pdo_sqlite to 3.3.7. (Ilia) +- Updated bundled MySQL client library to version 5.0.22 in the Windows + distribution. (Edin) +- Updated timezonedb to version 2006.7. (Derick) + +- Added ability to make SOAP call userspace PHP<->XML converters. (Dmitry) +- Added support for character sets in pg_escape_string() for PostgreSQL 8.1.4 + and higher. (Ilia) +- Added support for character sets in PDO quote() method for PostgreSQL 8.1.4 + and higher. (Ilia) +- Added DSA key generation support to openssl_pkey_new(), FR #38731 (marci + at balabit dot hu, Tony) +- Added SoapServer::setObject() method (it is a simplified version of + SoapServer::setClass() method). (Dmitry) +- Added support for hexadecimal entity in imagettftext() for the bundled GD. + (Pierre) +- Added support for httpOnly flag for session extension and cookie setting + functions. (Scott MacVicar, Ilia) +- Added version specific registry keys to allow different configurations for + different php version. (Richard, Dmitry) +- Added "PHPINIDir" Apache directive to apache and apache_hooks SAPIs. + (Dmitry) +- Added an optional boolean parameter to memory_get_usage() and + memory_get_peak_usage() to get memory size allocated by emalloc() or real + size of memory allocated from system. (Dmitry) +- Added Zip Archive extension. (Pierre) +- Added RFC1867 fileupload processing hook. (Stefan E.) +- Added JSON and Filter extensions. (Derick, Rasmus) +- Added error messages to disk_free_space() and disk_total_space() functions. + FR #37971 (Tony) +- Added PATHINFO_FILENAME option to pathinfo() to get the filename. + (Toby S. and Christian S.) +- Added array_fill_keys() function. (Marcus, Matt Wilmas) +- Added posix_initgroups() function. (Ilia) +- Added an optional parameter to parse_url() to allow retrieval of distinct + URL components. (Ilia) +- Added optional parameter to http_build_query() to allow specification of + string separator. (Ilia) +- Added image_type_to_extension() function. (Hannes, Ilia) +- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus) +- Added automatic module globals management. (Dmitry) +- Added RFC2397 (data: stream) support. (Marcus) +- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony) +- Added support for getenv() input filtering. (Rasmus) +- Added support for constructors in interfaces to force constructor signature + checks in implementations. (Marcus) +- Added memory_get_peak_usage() function for retrieving peak memory usage of + a PHP script. (Ilia) +- Added pg_field_table() function. (Edin) +- Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML(). + (Hannes) +- Added DOMNode::getNodePath() for getting an XPath for a node. (Christian) +- Added gmp_nextprime() function. (ants dot aasma at gmail dot com, Tony) +- Added error_get_last() function. (Mike) + +- Removed current working directory from the php.ini search path for CLI and + re-added it for other SAPIs (restore to pre 5.1.x behavior). (Edin) +- Moved extensions to PECL: + . ext/filepro (Derick, Tony) + . ext/hwapi (Derick, Tony) +- Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or + safe_mode are enabled. (Stefan E., Ilia) + +- Increased default memory limit to 16 megabytes to accommodate for a more + accurate memory utilization measurement. +- In addition to path to php.ini, PHPRC now may specify full file name. + (Dmitry) + +- Optimized array/HashTable copying. (Matt Wilmas, Dmitry) +- Optimized zend_try/zend_catch macros by eliminating memcpy(3). (Dmitry) +- Optimized require_once() and include_once() by eliminating fopen(3) on + second usage. (Dmitry) +- Optimized request shutdown sequence. Restoring ini directives now iterates + only over modified directives instead of all. (Dmitry) + +- Changed priority of PHPRC environment variable on win32 to be higher then + value from registry. (Dmitry) +- Changed __toString() to be called wherever applicable. (Marcus) +- Changed E_ALL error reporting mode to include E_RECOVERABLE_ERROR. (Marcus) +- Changed realpath cache to be disabled when "open_basedir" or "safe_mode" + are enabled on per-request basis. (Ilia) + +- Improved SNMP extension: (Jani) + . Renamed snmp_set_oid_numeric_print() to snmp_set_oid_output_format(). + . Added 2 new constants: SNMP_OID_OUTPUT_FULL and SNMP_OID_OUTPUT_NUMERIC + . Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2 + compatibility issue). (Patch: scott dot moynes+php at gmail dot com) +- Improved OpenSSL extension: (Pierre) + . Added support for all supported algorithms in openssl_verify + . Added openssl_pkey_get_details, returns the details of a key + . Added x509 v3 extensions support + . Added openssl_csr_get_subject() and openssl_csr_get_public_key() + . Added 3 new constants OPENSSL_VERSION_TEXT and OPENSSL_VERSION_NUMBER and + OPENSSL_KEYTYPE_EC +- Improved the Zend memory manager: (Dmitry) + . Removed unnecessary "--disable-zend-memory-manager" configure option. + . Added "--enable-malloc-mm" configure option which is enabled by default in + debug builds to allow using internal and external memory debuggers. + . Allow tweaking the memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE + environment variables. + . For more information: Zend/README.ZEND_MM +- Improved safe_mode check for the error_log() function. (Ilia) +- Improved the error reporting in SOAP extension on request failure. (Ilia) +- Improved crypt() on win32 to be about 10 times faster and to have friendlier + license. (Frank, Dmitry) +- Improved performance of the implode() function on associated arrays. (Ilia) +- Improved performance of str_replace() when doing 1 char to 1 char or 1 char + to many chars replacement. (Ilia) +- Improved apache2filter SAPI: + . Allowed PHP to be an arbitrary filter in the chain and read the script from + the Apache stream. (John) + . Added support for apache2filter in the Windows build including binary + support for both Apache 2.0.x (php5apache2_filter.dll) and Apache 2.2.x + (php5apache2_2_filter.dll). (Edin) +- Improved apache2handler SAPI: + . Changed ap_set_content_type() to be called only once. (Mike) + . Added support for Apache 2.2 handler in the Windows distribution. (Edin) +- Improved FastCGI SAPI: (Dmitry) + . Removed source compatibility with libfcgi. + . Optimized access to FastCGI environment variables by using HashTable + instead of linear search. + . Allowed PHP_FCGI_MAX_REQUESTS=0 that assumes no limit. + . Allowed PHP_FCGI_CHILDREN=0 that assumes no worker children. (FastCGI + requests are handled by main process itself) +- Improved CURL: + . Added control character checks for "open_basedir" and "safe_mode" checks. + (Ilia) + . Added implementation of curl_multi_info_read(). (Brian) +- Improved PCRE: (Andrei) + . Added run-time configurable backtracking/recursion limits. + . Added preg_last_error(). (Andrei) +- Improved PDO: + . Added new attribute ATTR_DEFAULT_FETCH_MODE. (Pierre) + . Added FETCH_PROPS_LATE. (Marcus) +- Improved SPL: (Marcus) + . Made most iterator code exception safe. + . Added RegExIterator and RecursiveRegExIterator. + . Added full caching support and ArrayAccess to CachingIterator. + . Added array functions to ArrayObject/ArrayIterator and made them faster. + . Added support for reading csv and skipping empty lines in SplFileObject. + . Added CachingIterator::TOSTRING_USE_INNER, calls inner iterator __toString. + . Added ability to set the CSV separator per SplFileObject. +- Improved xmlReader: (Rob) + . Added readInnerXml(), xmlReader::setSchema(). + . Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+) + . Changed to passing libxml options when loading reader. + +- Fixed invalid read in imagecreatefrompng when an empty file is given + (Pierre, Tony) +- Fixed infinite loop when a wrong color index is given to imagefill (Pierre) +- Fixed mess with CGI/CLI -d option (now it works with cgi; constants are + working exactly like in php.ini; with FastCGI -d affects all requests). + (Dmitry) +- Fixed missing open_basedir check inside chdir() function. (Ilia) +- Fixed overflow on 64bit systems in str_repeat() and wordwrap(). (Stefan E.) +- Fixed XSLTProcessor::importStylesheet() to return TRUE on success + (Christian) +- Fixed leaks in openssl_csr_sign and openssl_csr_new (Pierre) +- Fixed phpinfo() cutoff of variables at \0. (Ilia) +- Fixed a bug in the filter extension that prevented magic_quotes_gpc from + being applied when RAW filter is used. (Ilia) +- Fixed memory leaks in openssl streams context options. (Pierre) +- Fixed handling of extremely long paths inside tempnam() function. (Ilia) +- Fixed bug #39721 (Runtime inheritance causes data corruption). (Dmitry) +- Fixed bug #39304 (Segmentation fault with list unpacking of string offset). + (Dmitry) +- Fixed bug #39192 (Not including nsapi.h properly with SJSWS 7). This will + make PHP 5.2 compatible to new Sun Webserver. (Uwe) +- Fixed bug #39140 (Uncaught exception may cause crash). (Dmitry) +- Fixed bug #39125 (Memleak when reflecting non-existing class/method). (Tony) +- Fixed bug #39067 (getDeclaringClass() and private properties). (Tony) +- Fixed bug #39039 (SSL: fatal protocol error when fetching HTTPS from servers + running Google web server). (Ilia) +- Fixed bug #39035 (Compatibility issue between DOM and + zend.ze1_compatibility_mode). (Rob) +- Fixed bug #39034 (curl_exec() with return transfer returns TRUE on empty + files). (Ilia) +- Fixed bug #39032 (strcspn() stops on null character). (Tony) +- Fixed bug #39020 (PHP in FastCGI server mode crashes). (Dmitry) +- Fixed bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; + segfaults). (Dmitry) +- Fixed bug #39004 (Fixed generation of config.nice with autoconf 2.60). (Ilia) +- Fixed bug #39003 (__autoload() is called for type hinting). (Dmitry, Tony) +- Fixed bug #39001 (ReflectionProperty returns incorrect declaring class for + protected properties). (Tony) +- Fixed bug #38996 (PDO_MYSQL doesn't check connections for liveness). (Tony) +- Fixed bug #38993 (Fixed safe_mode/open_basedir checks for session.save_path, + allowing them to account for extra parameters). (Ilia) +- Fixed bug #38989 (Absolute path with slash at beginning doesn't work on win). + (Dmitry) +- Fixed bug #38985 (Can't cast COM objects). (Wez) +- Fixed bug #38981 (using FTP URLs in get_headers() causes crash). (Tony) +- Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia) +- Fixed bug #38961 (metaphone() results in segmentation fault on NetBSD). + (Tony) +- Fixed bug #38949 (Cannot get xmlns value attribute). (Rob) +- Fixed bug #38942 (Double old-style-ctor inheritance). (Dmitry) +- Fixed bug #38941 (imap extension does not compile against new version of the + imap library). (Ilia) +- Fixed bug #38934 (move_uploaded_file() cannot read uploaded file outside of + open_basedir). (Ilia) +- Fixed bug #38904 (apache2filter changes cwd to /). (Ilia, Hannes) +- Fixed bug #38891 (get_headers() do not work with curl-wrappers). (Ilia) +- Fixed bug #38882 (ldap_connect causes segfault with newer versions of + OpenLDAP). (Tony) +- Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony) +- Fixed bug #38850 (lookupNamespaceURI doesn't return default namespace). (Rob) +- Fixed bug #38844 (curl_easy_strerror() is defined only since cURL 7.12.0). + (Tony) +- Fixed bug #38813 (DOMEntityReference->__construct crashes when called + explicitly). (Rob) +- Fixed bug #38808 ("maybe ref" issue for current() and others). (Dmitry) +- Fixed bug #38779 (engine crashes when require()'ing file with syntax error + through userspace stream wrapper). (Tony, Dmitry) +- Fixed bug #38772 (inconsistent overriding of methods in different visibility + contexts). (Dmitry) +- Fixed bug #38759 (PDO sqlite2 empty query causes segfault). (Tony) +- Fixed bug #38721 (Invalid memory read in date_parse()). (Tony, Derick) +- Fixed bug #38700 (SoapClient::__getTypes never returns). (Dmitry) +- Fixed bug #38693 (curl_multi_add_handle() set curl handle to null). (Ilia) +- Fixed bug #38687 (sockaddr local storage insufficient for all sock families). + (Sara) +- Fixed bug #38661 (mixed-case URL breaks url-wrappers). (Ilia) +- Fixed bug #38653 (memory leak in ReflectionClass::getConstant()). (Tony) +- Fixed bug #38649 (uninit'd optional arg in stream_socket_sendto()). (Sara) +- Fixed bug #38637 (curl_copy_handle() fails to fully copy the cURL handle). + (Tony, Ilia) +- Fixed bug #38624 (Strange warning when incrementing an object property and + exception is thrown from __get method). (Tony) +- Fixed bug #38623 (leaks in a tricky code with switch() and exceptions). + (Dmitry) +- Fixed bug #38579 (include_once() may include the same file twice). (Dmitry) +- Fixed bug #38574 (missing curl constants and improper constant detection). + (Ilia) +- Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too + low). (Dmitry) +- Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval + inside a failed query executed via query() method). (Ilia) +- Fixed bug #38534 (segfault when calling setlocale() in userspace session + handler). (Tony) +- Fixed bug #38524 (strptime() does not initialize the internal date storage + structure). (Ilia) +- Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown + order to ensure it is shutdown before the extensions it may depend on). + (Ilia) +- Fixed bug #38488 (Access to "php://stdin" and family crashes PHP on win32). + (Dmitry) +- Fixed bug #38474 (getAttribute select attribute by order, even when + prefixed). (Rob) +- Fixed bug #38467 (--enable-versioning causes make fail on OS X). (Tony) +- Fixed bug #38465 (ReflectionParameter fails if default value is an access + to self::). (Johannes) +- Fixed bug #38464 (array_count_values() mishandles numeric strings). + (Matt Wilmas, Ilia) +- Fixed bug #38461 (setting private attribute with __set() produces + segfault). (Tony) +- Fixed bug #38458, PECL bug #8944, PECL bug #7775 (error retrieving columns + after long/text columns with PDO_ODBC). (Wez) +- Fixed bug #38454 (warning upon disabling handler via + xml_set_element_handler). (dtorop933 at gmail dot com, Rob) +- Fixed bug #38451 (PDO_MYSQL doesn't compile on Solaris). (Tony) +- Fixed bug #38450 (constructor is not called for classes used in userspace + stream wrappers). (Tony) +- Fixed bug #38438 (DOMNodeList->item(0) segfault on empty NodeList). (Ilia) +- Fixed bug #38431 (xmlrpc_get_type() crashes PHP on objects). (Tony) +- Fixed bug #38427 (unicode causes xml_parser to misbehave). (Rob) +- Fixed bug #38424 (Different attribute assignment if new or existing). (Rob) +- Fixed bug #38400 (Use of com.typelib_file may cause a crash). (Ilia) +- Fixed bug #38394 (PDO fails to recover from failed prepared statement + execution). (Ilia) +- Fixed bug #38377 (session_destroy() gives warning after + session_regenerate_id()). (Ilia) +- Implemented #38357 (dbase_open can't open DBase 3 dbf file). + (rodrigo at fabricadeideias dot com, Mike) +- Fixed bug #38354 (Unwanted reformatting of XML when using AsXML). (Christian) +- Fixed bug #38347 (Segmentation fault when using foreach with an unknown/empty + SimpleXMLElement). (Tony) +- Fixed bug #38322 (reading past array in sscanf() leads to arbitrary code + execution). (Tony) +- Fixed bug #38315 (Constructing in the destructor causes weird behavior). + (Dmitry) +- Fixed bug #38303 (spl_autoload_register() suppress all errors silently). + (Ilia) +- Fixed bug #38290 (configure script ignores --without-cdb,inifile,flatfile). + (Marcus) +- Fixed bug #38289 (segfault in session_decode() when _SESSION is NULL). + (Tony) +- Fixed bug #38287 (static variables mess up global vars). (Dmitry) +- Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's + session.cache_expire). (Tony) +- Fixed bug #38276 (file_exists() works incorrectly with long filenames + on Windows). (Ilia, Tony) +- Fixed bug #38269 (fopen wrapper doesn't fail on invalid hostname with + curlwrappers enabled). (Tony) +- Fixed bug #38265 (heap corruption). (Dmitry) +- Fixed bug #38261 (openssl_x509_parse() leaks with invalid cert) (Pierre) +- Fixed bug #38255 (openssl possible leaks while passing keys) (Pierre) +- Fixed bug #38253 (PDO produces segfault with default fetch mode). (Tony) +- Fixed bug #38251 (socket_select() and invalid arguments). (Tony) +- Fixed bug #38236 (Binary data gets corrupted on multipart/formdata POST). + (Ilia) +- Fixed bug #38234 (Exception in __clone makes memory leak). (Dmitry, Nuno) +- Fixed bug #38229 (strtotime() does not parse YYYY-MM format). (Ilia) +- Fixed bug #38224 (session extension can't handle broken cookies). (Ilia) +- Fixed bug #38220 (Crash on some object operations). (Dmitry) +- Fixed bug #38217 (ReflectionClass::newInstanceArgs() tries to allocate too + much memory). (Tony) +- Fixed bug #38214 (gif interlace output cannot work). (Pierre) +- Fixed bug #38213, #37611, #37571 (wddx encoding fails to handle certain + characters). (Ilia) +- Fixed bug #38212 (Segfault on invalid imagecreatefromgd2part() parameters). + (Pierre) +- Fixed bug #38211 (variable name and cookie name match breaks script + execution). (Dmitry) +- Fixed bug #38199 (fclose() unable to close STDOUT and STDERR). (Tony) +- Fixed bug #38198 (possible crash when COM reports an exception). (Ilia) +- Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the + class itself). (Ilia) +- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be + called Foo). (Jani) +- Fixed bug #38179 (imagecopy from a palette to a truecolor image loose alpha + channel) (Pierre) +- Fixed bug #38173 (Freeing nested cursors causes OCI8 to segfault). (Tony) +- Fixed bug #38168 (Crash in pdo_pgsql on missing bound parameters). (Ilia) +- Fixed bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set + the variable). (Tony) +- Fixed bug #38146 (Cannot use array returned from foo::__get('bar') in write + context). (Dmitry) +- Fixed bug #38132 (ReflectionClass::getStaticProperties() retains \0 in key + names). (Ilia) +- Fixed bug #38125 (undefined reference to spl_dual_it_free_storage). (Marcus) +- Fixed bug #38112 (corrupted gif segfaults) (Pierre) +- Fixed bug #38096 (large timeout values ignored on 32bit machines in + stream_socket_accept() and stream_socket_client()). (Ilia) +- Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger + than the actual length). (Tony) +- Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on + Solaris). (Tony) +- Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding + option). (Dmitry) +- Fixed bug #38064 (ignored constructor visibility). (Marcus) +- Fixed bug #38055 (Wrong interpretation of boolean parameters). (Dmitry) +- Fixed bug #38047 ("file" and "line" sometimes not set in backtrace from + inside error handler). (Dmitry) +- Fixed bug #38019 (segfault extending mysqli class). (Dmitry) +- Fixed bug #38005 (SoapFault faultstring doesn't follow encoding rules). + (Dmitry) +- Fixed bug #38004 (Parameters in SoapServer are decoded twice). (Dmitry) +- Fixed bug #38003 (in classes inherited from MySQLi it's possible to call + private constructors from invalid context). (Tony) +- Fixed bug #37987 (invalid return of file_exists() in safe mode). (Ilia) +- Fixed bug #37947 (zend_ptr_stack reallocation problem). (Dmitry) +- Fixed bug #37945 (pathinfo() cannot handle argument with special characters + like German "Umlaut"). (Mike) +- Fixed bug #37931 (possible crash in OCI8 after database restart + when using persistent connections). (Tony) +- Fixed bug #37923 (Display constant value in reflection::export). (Johannes) +- Fixed bug #37920 (compilation problems on z/OS). (Tony) +- Fixed bug #37870 (pgo_pgsql tries to de-allocate unused statements). + (Ilia, ce at netage dot bg) +- Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes) +- Fixed bug #37862 (Integer pointer comparison to numeric value). + (bugs-php at thewrittenword dot com) +- Fixed bug #37846 (wordwrap() wraps incorrectly). (ddk at krasn dot ru, Tony) +- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing + protected attribute). (Marcus) +- Fixed bug #37811 (define not using toString on objects). (Marcus) +- Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony) +- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus) +- Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)). + (Mike) +- Fixed bug #37779 (empty include_path leads to search for files inside /). + (jr at terragate dot net, Ilia) +- Fixed bug #37747 (strtotime segfaults when given "nextyear"). (Derick) +- Fixed bug #37720 (merge_php_config scrambles values). + (Mike, pumuckel at metropolis dot de) +- Fixed bug #37709 (Possible crash in PDO::errorCode()). (Ilia) +- Fixed bug #37707 (clone without assigning leaks memory). (Ilia, Nuno, Dmitri) +- Fixed bug #37705 (Semaphore constants not available). (Ilia) +- Fixed bug #37671 (MySQLi extension fails to recognize BIT column). (Ilia) +- Fixed bug #37667 (Object is not added into array returned by __get). (Marcus) +- Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike) +- Fixed bug #37632 (Protected method access problem). (Marcus) +- Fixed bug #37630 (MySQL extensions should link against thread safe client + libs if built with ZTS). (Mike) +- Fixed bug #37620 (mysqli_ssl_set validation is inappropriate). (Georg) +- Fixed bug #37616 (DATE_RFC822 does not product RFC 822 dates). + (Hannes Magnusson, Derick) +- Fixed bug #37614 (Class name lowercased in error message). (Johannes) +- Fixed bug #37587 (var without attribute causes segfault). (Marcus) +- Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recursion + limit support). (Ilia) +- Fixed bug #37581 (oci_bind_array_by_name clobbers input array when using + SQLT_AFC, AVC). (Tony) +- Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters). (Ilia) +- Fixed bug #37565 (Using reflection::export with simplexml causing a crash). + (Marcus) +- Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2 + compatibility issue). (Jani, patch by scott dot moynes+php at gmail dot com) +- Fixed bug #37563 (array_key_exists performance is poor for &$array). (Ilia) +- Fixed bug #37558 (timeout functionality doesn't work after a second PHP + start-up on the same thread). (p dot desarnaud at wanadoo dot fr) +- Fixed bug #37531 (oci8 persistent connection corruption). (Tony) +- Fixed bug #37523 (namespaces added too late, leads to missing xsi:type + attributes. Incompatibility with libxml2-2.6.24). (Dmitry) +- Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick) +- Fixed bug #37510 (session_regenerate_id changes session_id() even on + failure). (Hannes) +- Fixed bug #37505 (touch() truncates large files). (Ilia) +- Fixed bug #37499 (CLI segmentation faults during cleanup with sybase-ct + extension enabled). (Tony) +- Fixed bug #37496 (FastCGI output buffer overrun). (Piotr, Dmitry) +- Fixed bug #37487 (oci_fetch_array() array-type should always default to + OCI_BOTH). (Tony) +- Fixed bug #37457 (Crash when an exception is thrown in accept() method of + FilterIterator). (Marcus) +- Fixed bug #37456 (DOMElement->setAttribute() loops forever). (Rob) +- Fixed bug #37445 (Fixed crash in pdo_mysql resulting from premature object + destruction). (Ilia) +- Fixed bug #37428 (PHP crashes on windows if there are start-up errors and + event log is used for logging them). (Edin) +- Fixed bug #37418 (tidy module crashes on shutdown). (Tony) +- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind() + method). (Tony) +- Fixed bug #37413 (Rejected versions of flex that don't work). (Ilia) +- Fixed bug #37395 (recursive mkdir() fails to create nonexistent directories + in root dir). (Tony) +- Fixed bug #37394 (substr_compare() returns an error when offset equals + string length). (Ilia) +- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of + request). (Tony) +- Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). (Ilia) +- Fixed bug #37368 (Incorrect timestamp returned for strtotime()). (Derick) +- Fixed bug #37363 (PDO_MYSQL does not build if no other mysql extension is + enabled). (Mike) +- Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia) +- Fixed bug #37341 ($_SERVER in included file is shortened to two entries, + if $_ENV gets used). (Dmitry) +- Fixed bug #37313 (sigemptyset() used without including ). + (jdolecek) +- Fixed bug #37306 (max_execution_time = max_input_time). (Dmitry) +- Fixed bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry) +- Fixed bug #37265 (Added missing safe_mode & open_basedir checks to + imap_body()). (Ilia) +- Fixed bug #37262 (var_export() does not escape \0 character). (Ilia) +- Fixed bug #37256 (php-fastcgi doesn't handle connection abort). (Dmitry) +- Fixed bug #37244 (Added strict flag to base64_decode() that enforces + RFC3548 compliance). (Ilia) +- Fixed bug #37144 (PHP crashes trying to assign into property of dead object). + (Dmitry) +- Fixed bug #36949 (invalid internal mysqli objects dtor). (Mike) +- Implement #36732 (req/x509 extensions support for openssl_csr_new and + openssl_csr_sign) (ben at psc dot edu, Pierre) +- Fixed bug #36759 (Objects destructors are invoked in wrong order when script + is finished). (Dmitry) +- Fixed bug #36681 (pdo_pgsql driver incorrectly ignored some errors). + (Wez, Ilia) +- Fixed bug #36630 (umask not reset at the end of the request). (Ilia) +- Fixed bug #36515 (Unlinking buckets from non-existent brigades). (Sara) +- Fixed bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB + field). (Tony) +- Fixed bug #35886 (file_get_contents() fails with some combinations of + offset & maxlen). (Nuno) +- Fixed bug #35512 (Lack of read permission on main script results in + E_WARNING rather then E_ERROR). (Ilia) +- Fixed bug #34180 (--with-curlwrappers causes PHP to disregard some HTTP + stream context options). (Mike) +- Fixed bug #34066 (recursive array_walk causes segfault). (Tony) +- Fixed bug #34065 (throw in foreach causes memory leaks). (Dmitry) +- Fixed bug #34005 (oci_password_change() fails). + (pholdaway at technocom-wireless dot com, Tony) +- Fixed bug #33895 (Missing math constants). (Hannes) +- Fixed bug #33770 (https:// or ftps:// do not work when --with-curlwrappers + is used and ssl certificate is not verifiable). (Ilia) +- Fixed bug #29538 (number_format and problem with 0). (Matt Wilmas) +- Implement #28382 (openssl_x509_parse() extensions support) (Pierre) +- Fixed PECL bug #9061 (oci8 might reuse wrong persistent connection). (Tony) +- Fixed PECL bug #8816 (issue in php_oci_statement_fetch with more than one + piecewise column) (jeff at badtz-maru dot com, Tony) +- Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache + process times out). (Tony) +- Fixed PECL bug #7755 (error selecting DOUBLE fields with PDO_ODBC). + ("slaws", Wez) + + +04 May 2006, PHP 5.1.4 +- Added "capture_peer_cert" and "capture_peer_cert_chain" context options + for SSL streams. (Wez). +- Added PDO::PARAM_EVT_* family of constants. (Sara) +- Fixed possible crash in highlight_string(). (Dmitry) +- Fixed bug #37291 (FastCGI no longer works with isapi_fcgi.dll). (Dmitry) +- Fixed bug #37277 (cloning Dom Documents or Nodes does not work). (Rob) +- Fixed bug #37276 (problems with $_POST array). (Dmitry) +- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez). +- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez). + +28 Apr 2006, PHP 5.1.3 +- Updated bundled PCRE library to version 6.6. (Andrei) +- Moved extensions to PECL: + . ext/msession (Derick) +- Reimplemented FastCGI interface. (Dmitry) +- Improved SPL: (Marcus) + - Fixed issues with not/double calling of constructors of SPL iterators. + - Fixed issues with info-class/file-class in SPL directory handling classes. + - Fixed ArrayIterator::seek(). + - Added SimpleXMLIterator::count(). + - Dropped erroneous RecursiveDirectoryIterator::getSubPathInfo(). +- Improved SimpleXML: (Marcus, Rob) + . Added SimpleXMLElement::getName() to retrieve name of element. + . Added ability to create elements on the fly. + . Added addChild() method for element creation supporting namespaces. + . Added addAttribute() method for attribute creation supporting namespaces. + . Added ability to delete specific elements and attributes by offset. +- Improved Reflection API: (Marcus) + . Added ReflectionClass::newInstanceArgs($args). + . Added ability to analyze extension dependency. + . Added ReflectionFunction::isDeprecated() and constant IS_DEPRECATED. + . Added ReflectionParameter::getDeclaringClass(). + . Changed reflection constants to be prefixed with IS_. (Johannes) +- Improved cURL extension: (Ilia) + . Added curl_setopt_array() function that allows setting of multiple + options via an associated array. + . Added the ability to retrieve the request message sent to the server. +- Improved GD extension: (Pierre) + . Added a weak/tolerant mode to the JPEG loader. + . Added filtering mode option to imagepng() to allow reducing file size. + . Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE + on error. +- Changed get_headers() to retrieve headers also from non-200 responses. + (Ilia) +- Changed get_headers() to use the default context. (Ilia) +- Added lchown() and lchgrp() to change user/group ownership of symlinks. + (Derick) +- Added support for exif date format in strtotime(). (Derick) +- Added a check for special characters in the session name. (Ilia) +- Added "consumed" stream filter. (Marcus) +- Added new mysqli constants for BIT and NEW_DECIMAL field types: + MYSQLI_TYPE_NEWDECIMAL and MYSQLI_TYPE_BIT. FR #36007. (Georg) +- Added imap_savebody() that allows message body to be written to a + file. (Mike) +- Added overflow checks to wordwrap() function. (Ilia) +- Added support for BINARY_DOUBLE and BINARY_FLOAT to PDO_OCI and OCI8 + (also fixes bug #36764). (Tony) +- Eliminated run-time constant fetching for TRUE, FALSE and NULL. (Dmitry) +- Removed the E_STRICT deprecation notice from "var". (Ilia) +- Fixed reading stream filters never notified about EOF. (Mike) +- Fixed tempnam() 2nd parameter to be checked against path components. (Ilia) +- Fixed a bug that would not fill in the fifth argument to preg_replace() + properly, if the variable was not declared previously. (Andrei) +- Fixed safe_mode check for source argument of the copy() function. (Ilia) +- Fixed mysqli bigint conversion under Windows (Georg) +- Fixed XSS inside phpinfo() with long inputs. (Ilia) +- Fixed Apache2 SAPIs header handler modifying header strings. (Mike) +- Fixed 'auto_globals_jit' to work together with 'register_argc_argv'. (Dmitry) +- Fixed offset/length parameter validation in substr_compare() function. (Ilia) +- Fixed debug_zval_dump() to support private and protected members. (Dmitry) +- Fixed SoapFault::getMessage(). (Dmitry) +- Fixed issue with iconv_mime_decode where the "encoding" would only allow + upper case specifiers. (Derick) +- Fixed tiger hash algorithm generating wrong results on big endian platforms. + (Mike) +- Fixed crash with DOMImplementation::createDocumentType("name:"). (Mike) +- Fixed bug #37205 (Serving binary content/images fails with "comm with server + aborted" FastCGI err). (Dmitry) +- Fixed bug #37192 (cc may complain about non-constant initializers in + hash_adler.c). (Mike) +- Fixed bug #37191 (chmod takes off sticky bit when safe_mode is On). (Tony) +- Fixed bug #37167 (PDO segfaults when throwing exception from the + fetch handler). (Tony) +- Fixed bug #37162 (wddx does not build as a shared extension). + (jdolecek at NetBSD dot org, Ilia) +- Fixed bug #37158 (fread behavior changes after calling + stream_wrapper_register). (Wez) +- Fixed bug #37138 (__autoload tries to load callback'ed self and parent). + (Dmitry) +- Fixed bug #37103 (libmbfl headers not installed). (Jani) +- Fixed bug #37062 (compile failure on ARM architecture). (Tony) +- Fixed bug #37061 (curl_exec() doesn't zero-terminate binary strings). (Tony) +- Fixed bug #37060 (Type of retval of Countable::count() is not checked). + (Johannes) +- Fixed bug #37059 (oci_bind_by_name() doesn't support RAW and LONG RAW + fields). (Tony) +- Fixed bug #37057 (xmlrpc_decode() may produce arrays with numeric strings, + which are unaccessible). (Tony) +- Fixed bug #37055 (incorrect reference counting for persistent OCI8 + connections). (Tony) +- Fixed bug #37054 (SoapClient Error Fetching http headers). (Dmitry) +- Fixed bug #37053 (html_errors with internal classes produces wrong links). + (Tony) +- Fixed bug #37046 (foreach breaks static scope). (Dmitry) +- Fixed bug #37045 (Fixed check for special chars for http redirects). (Ilia) +- Fixed bug #37017 (strtotime fails before 13:00:00 with some time zones + identifiers). (Derick) +- Fixed bug #37002 (Have to quote literals in INI when concatenating with + vars). (Dmitry)z +- Fixed bug #36988 (mktime freezes on long numbers). (Derick) +- Fixed bug #36981 (SplFileObject->fgets() ignores max_length). (Tony) +- Fixed bug #36957 (serialize() does not handle recursion). (Ilia) +- Fixed bug #36944 (strncmp & strncasecmp do not return false on negative + string length). (Tony) +- Fixed bug #36941 (ArrayIterator does not clone itself). (Marcus) +- Fixed bug #36934 (OCILob->read() doesn't move internal pointer when + reading 0's). (Tony) +- Fixed bug #36908 (wsdl default value overrides value in soap request). + (Dmitry) +- Fixed bug #36898 (__set() leaks in classes extending internal ones). + (Tony, Dmitry) +- Fixed bug #36886 (User filters can leak buckets in some situations). (Ilia) +- Fixed bug #36878 (error messages are printed even though an exception has + been thrown). (Tony) +- Fixed bug #36875 (is_*() functions do not account for open_basedir). (Ilia) +- Fixed bug #36872 (session_destroy() fails after call to + session_regenerate_id(true)). (Ilia) +- Fixed bug #36869 (memory leak in output buffering when using chunked + output). (Tony) +- Fixed bug #36859 (DOMElement crashes when calling __construct when + cloning). (Tony) +- Fixed bug #36857 (Added support for partial content fetching to the + HTTP streams wrapper). (Ilia) +- Fixed bug #36851 (Documentation and code discrepancies for NULL + data in oci_fetch_*() functions). (Tony) +- Fixed bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause + segfault). (Tony) +- Fixed bug #36820 (Privileged connection with an Oracle password file + fails). (Tony) +- Fixed bug #36809 (__FILE__ behavior changed). (Dmitry) +- Fixed bug #36808 (syslog ident becomes garbage between requests). (Tony) +- Fixed bug #36802 (mysqli_set_charset() crash with a non-open connection). + (Ilia) +- Fixed bug #36756 (DOMDocument::removeChild corrupts node). (Rob) +- Fixed bug #36749 (SOAP: 'Error Fetching http body' when using HTTP Proxy). + (Dmitry) +- Fixed bug #36745 (No error message when load data local file isn't found). + (Georg) +- Fixed bug #36743 (In a class extending XMLReader array properties are not + writable). (Tony) +- Fixed bug #36727 (segfault in pdo_pgsql bindValue() when no parameters are + defined). (Tony) +- Fixed bug #36721 (The SoapServer is not able to send a header that it didn't + receive). (Dmitry) +- Fixed bug #36697 (Transparency is lost when using imagecreatetruecolor). + (Pierre) +- Fixed bug #36689 (Removed arbitrary limit on the length of syslog messages). + (Ilia) +- Fixed bug #36656 (http_build_query generates invalid URIs due to use of + square brackets). (Mike) +- Fixed bug #36638 (strtotime() returns false when 2nd argument < 1). (Derick) +- Fixed bug #36629 (SoapServer::handle() exits on SOAP faults). (Dmitry) +- Fixed bug #36625 (pg_trace() does not work). (iakio at mono-space dot net) +- Fixed bug #36614 (Segfault when using Soap). (Dmitry) +- Fixed bug #36611 (assignment to SimpleXML object attribute changes argument + type to string). (Tony) +- Fixed bug #36606 (pg_query_params() changes arguments type to string). (Tony) +- Fixed bug #36599 (DATE_W3C format constant incorrect). (Derick) +- Fixed bug #36575 (SOAP: Incorrect complex type instantiation with + hierarchies). (Dmitry) +- Fixed bug #36572 (Added PDO::MYSQL_ATTR_DIRECT_QUERY constant that should + be set when executing internal queries like "show master status" via MySQL). + (Ilia) +- Fixed bug #36568 (memory_limit setting on win32 has no effect). (Dmitry) +- Fixed bug #36513 (comment will be outputted in last line). (Dmitry) +- Fixed bug #36510 (strtotime() fails to parse date strings with tabs). + (Ilia, Derick) +- Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n). + (Ilia) +- Fixed bug #36458 (sleep() accepts negative values). (Ilia) +- Fixed bug #36436 (DBA problem with Berkeley DB4). (Marcus) +- Fixed bug #36434 (Improper resolution of declaring class name of an + inherited property). (Ilia) +- Fixed bug #36420 (segfault when access result->num_rows after calling + result->close()). (Ilia,Tony) +- Fixed bug #36403 (oci_execute() no longer supports OCI_DESCRIBE_ONLY). (Tony) +- Fixed bug #36400 (Custom 5xx error does not return correct HTTP response error + code). (Tony) +- Fixed bug #36396 (strtotime() fails to parse dates in dd-mm-yyyy format). + (Derick) +- Fixed bug #36388 (ext/soap crashes when throwing exception and session + persistence). (David) +- Fixed bug #36382 (PDO/PgSQL's getColumnMeta() crashes). (Derick) +- Fixed bug #36359 (splFileObject::fwrite() doesn't write when no data + length specified). (Tony) +- Fixed bug #36351 (parse_url() does not parse numeric paths properly). (Ilia) +- Fixed bug #36345 (PDO/MySQL problem loading BLOB over 1MB). (Ilia) +- Fixed bug #36337 (ReflectionProperty fails to return correct visibility). + (Ilia) +- Fixed bug #36334 (Added missing documentation about realpath cache INI + settings). (Ilia) +- Fixed bug #36308 (ReflectionProperty::getDocComment() does not reflect + extended class commentary). (Ilia) +- Fixed bug #36306 (crc32() differ on 32-bit and 64-bit platforms) + (anight@eyelinkmedia dot com, Pierre) +- Fixed bug #36303 (foreach on error_zval produces segfault). (Dmitry) +- Fixed bug #36295 (typo in SplFileObject::flock() parameter name). (Tony) +- Fixed bug #36287 (Segfault with SplFileInfo conversion). (Marcus) +- Fixed bug #36283 (SOAPClient Compression Broken). (Dmitry) +- Fixed bug #36268 (Object destructors called even after fatal errors). (Dmitry) +- Fixed bug #36258 (SplFileObject::getPath() may lead to segfault). (Tony) +- Fixed bug #36250 (PHP causes ORA-07445 core dump in Oracle server 9.2.x). + (Tony) +- Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony) +- Fixed bug #36235 (ocicolumnname returns false before a successful fetch). + (Tony) +- Fixed bug #36226 (Inconsistent handling when passing potential arrays). + (Dmitry) +- Fixed bug #36224 (date(DATE_ATOM) gives wrong results). + (Derick, Hannes Magnusson) +- Fixed bug #36222 (errorInfo in PDOException is always NULL). (Ilia) +- Fixed bug #36208 (symbol namespace conflicts using bundled gd). (Jakub Moc) +- Fixed bug #36205 (Memory leaks on duplicate cookies). (Dmitry) +- Fixed bug #36185 (str_rot13() crash on non-string parameter). (Pierre) +- Fixed bug #36176 (PDO_PGSQL - PDO::exec() does not return number of rows + affected by the operation). (Ilia) +- Fixed bug #36158 (SIGTERM is not handled correctly when running as a + FastCGI server). (Dmitry) +- Fixed bug #36152 (problems with curl+ssl and pgsql+ssl in same PHP). (Mike) +- Fixed bug #36148 (unpack("H*hex", $data) is adding an extra character to + the end of the string). (Ilia) +- Fixed bug #36134 (DirectoryIterator constructor failed to detect empty + directory names). (Ilia) +- Fixed bug #36113 (Reading records of unsupported type causes segfault). + (Tony) +- Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed). + (Tony) +- Fixed bug #36083 (SoapClient waits for responses on one-way operations). + (Dmitry) +- Fixed bug #36071 (Engine Crash related with 'clone'). (Dmitry) +- Fixed bug #36055 (possible OCI8 crash in multi-threaded environment). (Tony) +- Fixed bug #36046 (parse_ini_file() miscounts lines in multi-line values). + (Ilia) +- Fixed bug #36038 (ext/hash compile failure on Mac OSX). (Tony) +- Fixed bug #36037 (heredoc adds extra line number). (Dmitry) +- Fixed bug #36016 (realpath cache memleaks). (Dmitry, Nuno) +- Fixed bug #36011 (Strict errormsg wrong for call_user_func() and the likes). + (Marcus) +- Fixed bug #36010 (Segfault when re-creating and re-executing statements with + bound parameters). (Tony) +- Fixed bug #36006 (Problem with $this in __destruct()). (Dmitry) +- Fixed bug #35999 (recursive mkdir() does not work with relative path + like "foo/bar"). (Tony) +- Fixed bug #35998 (SplFileInfo::getPathname() returns unix style filenames + in win32). (Marcus) +- Fixed bug #35988 (Unknown persistent list entry type in module shutdown). + (Dmitry) +- Fixed bug #35954 (Fatal com_exception casting object). (Rob) +- Fixed bug #35900 (stream_select() should warning when tv_sec is negative). + (Ilia) +- Fixed bug #35785 (SimpleXML causes memory read error zend engine). (Marcus) +- Fixed bug #34272 (empty array onto COM object blows up). (Rob) +- Fixed bug #33292 (apache_get_modules() crashes on Windows). (Edin) +- Fixed bug #29476 (sqlite_fetch_column_types() locks the database forever). + (Ilia) + +12 Jan 2006, PHP 5.1.2 +- Updated libsqlite in ext/sqlite to 2.8.17. (Ilia) +- Updated libsqlite in ext/pdo_sqlite to 3.2.8. (Ilia) +- Updated to libxml2-2.6.22 and libxslt-1.1.15 in the win32 bundle. (Rob) +- Added new extensions: (Ilia, Wez) + . XMLWriter + . Hash +- Added PNG compression support to GD extension. (Pierre) +- Added reflection constants as class constants. (Johannes) +- Added --enable-gcov configure option to enable C-level code coverage. + (John, Jani, Ilia, Marcus) +- Added missing support for 'B' format identifier to date() function. (Ilia) +- Changed reflection to be an extension. (Marcus) +- Improved SPL extension: (Marcus) + . Added class SplFileInfo as root class for DirectoryIterator and + SplFileObject + . Added SplTempFileObject +- Improved SimpleXML extension: (Marcus) + . Fixed memleaks + . Fixed var_dump() + . Fixed isset/empty/(bool) behavior + . Fixed iterator edge cases + . Added methods getNamespaces(), getDocNamespaces() +- Upgraded pear to version 1.4.6. (Greg) +- Added constants for libxslt and libexslt versions: LIBXSLT_VERSION, + LIBXSLT_DOTTED_VERSION, LIBEXSLT_VERSION and LIBEXSLT_DOTTED_VERSION. (Pierre) +- Fixed possible crash in apache_getenv()/apache_setenv() on invalid parameters. + (Ilia) +- Changed errors to warnings in imagecolormatch(). (Pierre) +- Fixed segfault/leak in imagecolormatch(). (Pierre) +- Fixed small leak in mysqli_stmt_fetch() when bound variable was empty string. + (Andrey) +- Fixed prepared statement name conflict handling in PDO_PGSQL. (Thies, Ilia) +- Fixed memory corruption when PDO::FETCH_LAZY mode is being used. (Ilia) +- Fixed possible leaks in imagecreatefromstring() with invalid data. (Pierre) +- Fixed possible memory corruption inside mb_strcut(). (Ilia) +- Fixed possible header injection by limiting each header to a single line. + (Ilia) +- Fixed possible XSS inside error reporting functionality. (Ilia) +- Fixed many bugs in OCI8. (Tony) +- Fixed crash and leak in mysqli when using 4.1.x client libraries and + connecting to 5.x server. (Andrey) +- Fixed bug #35916 (Duplicate calls to stream_bucket_append() lead to a crash). + (Ilia) +- Fixed bug #35908 (curl extension uses undefined GCRY_THREAD_OPTIONS_USER). + (Ilia) +- Fixed bug #35907 (PDO_OCI uses hardcoded lib path $ORACLE_HOME/lib). (Tony) +- Fixed bug #35887 (wddx_deserialize not parsing dateTime fields properly). + (Derick) +- Fixed bug #35885 (strtotime("NOW") no longer works). (Derick) +- Fixed bug #35821 (array_map() segfaults when exception is throwed from + the callback). (Tony) +- Fixed bug #35817 (unpack() does not decode odd number of hexadecimal values). + (Ilia) +- Fixed bug #35797 (segfault on PDOStatement::execute() with + zend.ze1_compatibility_mode = On). (Tony, Ilia) +- Fixed bug #35781 (stream_filter_append() can cause segfault). (Tony) +- Fixed bug #35760 (sybase_ct doesn't compile on Solaris using old gcc). (Tony) +- Fixed bug #35759 (mysqli_stmt_bind_result() makes huge allocation when + column empty). (Andrey) +- Fixed bug #35751 (using date with a timestamp makes httpd segfault). (Derick) +- Fixed bug #35740 (memory leak when including a directory). (Tony) +- Fixed bug #35730 (ext/mssql + freetds: Use correct character encoding + and allow setting it). (Frank) +- Fixed bug #35723 (xmlrpc_introspection.c fails compile per C99 std). (Jani) +- Fixed bug #35720 (A final constructor can be overwritten). (Marcus) +- Fixed bug #35713 (getopt() returns array with numeric strings when passed + options like '-1'). (Tony) +- Fixed bug #35705 (strtotime() fails to parse soap date format without TZ). + (Ilia) +- Fixed bug #35699 (date() can't handle leap years before 1970). (Derick) +- Fixed bug #35694 (Improved error message for invalid fetch mode). (Ilia) +- Fixed bug #35692 (iconv_mime_decode() segmentation fault; with libiconv + only). (Tony) +- Fixed bug #35690 (pack() tries to allocate huge memory block when packing + float values to strings). (Tony) +- Fixed bug #35669 (imap_mail_compose() crashes with + multipart-multiboundary-email). (Ilia) +- Fixed bug #35660 (AIX TZ variable format not understood, yields UTC + timezone). (Derick) +- Fixed bug #35655 (whitespace following end of heredoc is lost). (Ilia) +- Fixed bug #35630 (strtotime() crashes on certain relative identifiers). + (Ilia) +- Fixed bug #35629 (crash in http:// wrapper on multiple redirects). (Ilia) +- Fixed bug #35624 (strtotime() does not handle 3 character weekdays). (Ilia) +- Fixed bug #35612 (iis6 Access Violation crash). (Dmitry, alacn.uhahaa) +- Fixed bug #35594 (Multiple calls to getopt() may result in a crash). + (rabbitt at gmail dot com, Ilia) +- Fixed bug #35571 (Fixed crash in Apache 2 SAPI when more then one php + script is loaded via SSI include). (Ilia) +- Fixed bug #35570 (segfault when re-using soap client object). (Dmitry) +- Fixed bug #35558 (mktime() interpreting 3 digit years incorrectly). (Ilia) +- Fixed bug #35543 (php crash when calling non existing method of a class + that extends PDO). (Tony) +- Fixed bug #35539 (typo in error message for ErrorException). (Tony) +- FIxed bug #35536 (mysql_field_type() doesn't handle NEWDECIMAL). (Tony) +- Fixed bug #35517 (mysql_stmt_fetch returns NULL on data truncation). (Georg) +- Fixed bug #35509 (string constant as array key has different behavior inside + object). (Dmitry) +- Fixed bug #35508 (PDO fails when unknown fetch mode specified). (Tony) +- Fixed bug #35499 (strtotime() does not handle whitespace around the date + string). (Ilia) +- Fixed bug #35496 (Crash in mcrypt_generic()/mdecrypt_generic() without + proper init). (Ilia) +- Fixed bug #35490 (socket_sendto() unable to handle IPv6 addresses). (Tony) +- Fixed bug #35461 (Ming extension fails to compile with ming 0.3beta1). (Jani) +- Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4). (Dmitry) +- Fixed bug #35470 (Assigning global using variable name from array doesn't + function). (Dmitry) +- Fixed bug #35456 (+ 1 [time unit] format did not work). (Ilia) +- Fixed bug #35447 (xml_parse_into_struct() chokes on the UTF-8 BOM). (Rob) +- Fixed bug #35431 (PDO crashes when using LAZY fetch with fetchAll). (Wez) +- Fixed bug #35430 (PDO crashes on incorrect FETCH_FUNC use). (Tony) +- Fixed bug #35427 (str_word_count() handles '-' incorrectly). (Ilia) +- Fixed bug #35425 (idate() function ignores timezone settings). (Ilia) +- Fixed bug #35422 (strtotime() does not parse times with UTC as timezone). + (Ilia) +- Fixed bug #35414 (strtotime() no longer works with ordinal suffix). (Ilia) +- Fixed bug #35410 (wddx_deserialize() doesn't handle large ints as keys + properly). (Ilia) +- Fixed bug #35409 (undefined reference to 'rl_completion_matches'). (Jani) +- Fixed bug #35399 (Since fix of bug #35273 SOAP decoding of + soapenc:base64binary fails). (Dmitry) +- Fixed bug #35393 (changing static protected members from outside the class, + one more reference issue). (Dmitry) +- Fixed bug #35381 (ssl library is not initialized properly). (Alan) +- Fixed bug #35377 (PDO_SQLITE: undefined reference to "fdatasync"). + (Nuno, Jani) +- Fixed bug #35373 (HP-UX "alias not allowed in this configuration"). (Dmitry) +- Fixed bug #35288 (iconv() function defined as libiconv()). (Nuno) +- Fixed bug #35103 (mysqli handles bad unsigned (big)int incorrectly).(Andrey) +- Fixed bug #35062 (socket_read() produces warnings on non blocking sockets). + (Nuno, Ilia) +- Fixed bug #35028 (SimpleXML object fails FALSE test). (Marcus) +- Fixed bug #34729 (Crash in ZTS mode under Apache). (Dmitry, Zeev) +- Fixed bug #34429 (Output buffering cannot be turned off with FastCGI). + (Dmitry, Ilya) +- Fixed bug #34359 (Possible crash inside fopen http wrapper). (Ilia,Sara,Nuno) +- Fixed bug #33789 (Many Problems with SunFuncs). (Derick) +- Fixed bug #33671 (sun_rise and sun_set don't return a GMT timestamp if one + passes an offset). (Derick) +- Fixed bug #32820 (date_sunrise and date_sunset don't handle GMT offset + well). (Derick) +- Fixed bug #31347 (is_dir and is_file (incorrectly) return true for any string + greater then 255 characters). (Nuno,Ilia) +- Fixed bug #30937 (date_sunrise() & date_sunset() don't handle endless + day/night at high latitudes). (Derick) +- Fixed bug #30760 (Remove MessageBox on win32 for E_CORE errors if + display_startup_error is off). (Ilia) +- Fixed bug #29955 (mb_strtoupper() / lower() broken with Turkish encoding). + (Rui) +- Fixed bug #28899 (mb_substr() and substr() behave differently when + "mbstring.func_overload" is enabled). (Rui) +- Fixed bug #27678 (number_format() crashes with large numbers). (Marcus) + +28 Nov 2005, PHP 5.1.1 +- Disabled native date class to prevent pear::date conflict. (Ilia) +- Changed reflection constants be both PHP and class constants. (Johannes) +- Added an additional field $frame['object'] to the result array of + debug_backtrace() that contains a reference to the respective object when the + frame was called from an object. (Sebastian) +- Fixed bug #35423 (RecursiveDirectoryIterator doesnt appear to recurse with + RecursiveFilterIterator). (Marcus) +- Fixed bug #35413 (Removed -dev flag from Zend Engine version). (Ilia) +- Fixed bug #35411 (Regression with \{$ handling). (Ilia) +- Fixed bug #35406 (eval hangs when evall'ed code ends with comment w/o + newline). (Marcus) +- Fixed bug #35391 (pdo_mysql::exec does not return number of affected rows). + (Tony) +- Fixed bug #35382 (Comment in end of file produces fatal error). (Ilia) +- Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash). + (Dmitry) +- Fixed bug #35358 (Incorrect error messages for PDO class constants). (Ilia) +- Fixed bug #35338 (pdo_pgsql does not handle binary bound params). (Wez) +- Fixed bug #35316 (Application exception trying to create COM object). (Rob) +- Fixed bug #35170 (PHP_AUTH_DIGEST differs under Apache 1.x and 2.x). (Ilia) + +24 Nov 2005, PHP 5.1 +- Added support for class constants and static members for internal classes. + (Dmitry, Michael Wallner) +- Added "new_link" parameter to mssql_connect() (Bug #34369). (Frank) +- Added missing safe_mode checks for image* functions and cURL. (Ilia) +- Added missing safe_mode/open_basedir checks for file uploads. (Ilia) +- Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql. (Ilia) +- Added date_timezone_set() function to set the timezone that the date + function will use. (Derick) +- Added pg_fetch_all_columns() function to fetch all values of a column from a + result cursor. (Ilia) +- Added support for LOCK_EX flag for file_put_contents(). (Ilia) +- Added bindto socket context option. (Ilia) +- Added offset parameter to the stream_copy_to_stream() function. (Ilia) +- Added offset & length parameters to substr_count() function. (Ilia) +- Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana) +- Added support for .cc files in extensions. (Brian) +- Added PHP_INT_MAX and PHP_INT_SIZE as predefined constants. (Andrey) +- Added user opcode API that allow overloading of opcode handlers. (Dmitry) +- Added an optional remove old session parameter to session_regenerate_id(). + (Ilia) +- Added array type hinting. (Dmitry) +- Added the tidy_get_opt_doc() function to return documentation for + configuration options in tidy. (Patch by: nlopess@php.net) +- Added support for .cc files in extensions. (Brian) +- Added imageconvolution() function which can be used to apply a custom 3x3 + matrix convolution to an image. (Pierre) +- Added optional first parameter to XsltProcessor::registerPHPFunctions to + only allow certain functions to be called from XSLT. (Christian) +- Added the ability to override the autotools executables used by the + buildconf script via the PHP_AUTOCONF and PHP_AUTOHEADER environmental + variables. (Jon) +- Added several new functions to support the PostgreSQL v3 protocol introduced + in PostgreSQL 7.4. (Christopher) + . pg_transaction_status() - in-transaction status of a database connection. + . pg_query_params() - execution of parameterized queries. + . pg_prepare() - prepare named queries. + . pg_execute() - execution of named prepared queries. + . pg_send_query_params() - async equivalent of pg_query_params(). + . pg_send_prepare() - async equivalent of pg_prepare(). + . pg_send_execute() - async equivalent of pg_execute(). + . pg_result_error_field() - highly detailed error information, most + importantly + the SQLSTATE error code. + . pg_set_error_verbosity() - set verbosity of errors. +- Added optional fifth parameter "count" to preg_replace_callback() and + preg_replace() to count the number of replacements made. FR #32275. (Andrey) +- Added optional third parameter "charlist" to str_word_count() which contains + characters to be considered as word part. FR #31560. (Andrey, Ilia) +- Added interface Serializable. (Stanislav, Marcus) +- Added pg_field_type_oid() PostgreSQL function. (mauroi at digbang dot com) +- Added zend_declare_property_...() and zend_update_property_...() API + functions for bool, double and binary safe strings. (Hartmut) +- Added possibility to access INI variables from within .ini file. (Andrei) +- Added variable $_SERVER['REQUEST_TIME'] containing request start time. + (Ilia) +- Added optional float parameter to gettimeofday(). (Ilia) +- Added apache_reset_timeout() Apache1 function. (Rasmus) +- Added sqlite_fetch_column_types() 3rd argument for arrays. (Ilia) +- Added optional offset parameter to stream_get_contents() and + file_get_contents(). (Ilia) +- Added optional maxlen parameter to file_get_contents(). (Ilia) +- Added SAPI hook to get the current request time. (Rasmus) +- Added new functions: + . array_diff_key() (Andrey) + . array_diff_ukey() (Andrey) + . array_intersect_key() (Christiano Duarte) + . array_intersect_ukey() (Christiano Duarte) + . array_product() (Andrey) + . DomDocumentFragment::appendXML() (Christian) + . fputcsv() (David Sklar) + . htmlspecialchars_decode() (Ilia) + . inet_pton() (Sara) + . inet_ntop() (Sara) + . mysqli::client_info property (Georg) + . posix_access() (Magnus) + . posix_mknod() (Magnus) + . SimpleXMLElement::registerXPathNamespace() (Christian) + . stream_context_get_default() (Wez) + . stream_socket_enable_crypto() (Wez) + . stream_wrapper_unregister() (Sara) + . stream_wrapper_restore() (Sara) + . stream_filter_remove() (Sara) + . time_sleep_until() (Ilia) +- Added DomDocument::$recover property for parsing not well-formed XML + Documents. (Christian) +- Added Cursor support for MySQL 5.0.x in mysqli (Georg) +- Added proxy support to ftp wrapper via http. (Sara) +- Added MDTM support to ftp_url_stat. (Sara) +- Added zlib stream filter support. (Sara) +- Added bz2 stream filter support. (Sara) +- Added max_redirects context option that specifies how many HTTP + redirects to follow. (Ilia) +- Added support of parameter=>value arrays to + xsl_xsltprocessor_set_parameter(). (Tony) + +- PHP extension loading mechanism with support for module + dependencies and conflicts. (Jani, Dmitry) +- Improved interactive mode of PHP CLI (php -a). (Johannes, Marcus) +- Improved performance of: + . general execution/compilation. (Andi, Thies, Sterling, Dmitry, Marcus) + . switch() statement. (Dmitry) + . several array functions. (Marcus) + . virtual path handling by adding a realpath() cache. (Andi) + . variable fetches. (Andi) + . magic method invocations. (Marcus) +- Improved support for embedded server in mysqli. (Georg) +- Improved mysqli extension. (Georg) + . added constructor for mysqli_stmt and mysqli_result classes + . added new function mysqli_get_charset() + . added new function mysqli_set_charset() + . added new class mysqli_driver + . added new class mysqli_warning + . added new class mysqli_exception + . added new class mysqli_sql_exception +- Improved SPL extension. (Marcus) + . Moved RecursiveArrayIterator from examples into extension + . Moved RecursiveFilterIterator from examples into extension + . Added SplObjectStorage + . Made all SPL constants class constants + . Renamed CachingRecursiveIterator to RecursiveCachingIterator to follow + Recursive<*>Iterator naming scheme. + . added standard hierarchy of Exception classes + . added interface Countable + . added interfaces Subject and SplObserver + . added spl_autoload*() functions + . converted several 5.0 examples into c code + . added class SplFileObject + . added possibility to use a string with class_parents() and + class_implements(). (Andrey) + +- Changed type hints to allow "null" as default value for class and array. + (Marcus, Derick, Dmitry) +- Changed SQLite extension to be a shared module in Windows distribution. + (Edin) +- Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() + functions to not call __autoload(). (Dmitry) +- Changed sha1_file() and md5_file() functions to use streams instead of low + level IO. (Uwe) +- Changed abstract private methods to be not allowed anymore. (Stas) +- Changed stream_filter_(ap|pre)pend() to return resource. (Sara) +- Changed mysqli_exception and sqlite_exception to use RuntimeException as + base if SPL extension is present. (Georg, Marcus) + +- Upgraded bundled libraries: + . PCRE library to version 6.2. (Andrei) + . SQLite 3 library in ext/pdo_sqlite to 3.2.7. (Ilia) + . SQLite 2 library in ext/sqlite to 2.8.16. (Ilia) +- Upgraded bundled libraries in Windows distribution. (Edin) + . zlib 1.2.3 + . curl 7.14.0 + . openssl 0.9.8 + . ming 0.3b + . libpq (PostgreSQL) 8.0.1 + +- Implemented feature request #33452 (Year belonging to ISO week). (Derick) +- Allowed return by reference from internal functions. (Marcus, Andi, Dmitry) +- Rewrote strtotime() with support for timezones and many new formats. + Implements feature requests #21399, #26694, #28088, #29150, #29585 and + #29595. (Derick) + +- Moved extensions to PECL: + . ext/cpdf (Tony, Derick) + . ext/dio (Jani, Derick) + . ext/fam (Jani, Derick) + . ext/ingres_ii (Jani, Derick) + . ext/mnogosearch (Jani, Derick) + . ext/w32api (Jani, Derick) + . ext/yp (Jani, Derick) + . ext/mcve (Jani, Derick, Pierre) + . ext/oracle (Jani, Derick) + . ext/ovrimos (Jani, Derick, Pierre) + . ext/pfpro (Jani, Derick, Pierre) + . ext/dbx (Jani, Derick) + . ext/ircg (Jani, Derick) + +- Removed php_check_syntax() function which never worked properly. (Ilia) +- Removed garbage manager in Zend Engine which results in more aggressive + freeing of data. (Dmitry, Andi) + +- Fixed "make test" to work for phpized extensions. (Hartmut, Jani) +- Fixed Apache 2 regression with sub-request handling on non-linux systems. + (Ilia, Tony) +- Fixed PDO shutdown problem (possible infinite loop running rollback on + shutdown). (Wez) +- Fixed PECL bug #3714 (PDO: beginTransaction doesn't work if you're in + auto-commit mode). (Wez) +- Fixed ZTS destruction. (Marcus) +- Fixed __get/__set to allow recursive calls for different properties. (Dmitry) +- Fixed a bug where stream_get_meta_data() did not return the "uri" element + for files opened with tmpname(). (Derick) +- Fixed a problem with SPL iterators aggregating the inner iterator. (Marcus) +- Fixed an error in mysqli_fetch_fields (returned NULL instead of an array + when row number > field_count). (Georg) +- Fixed bug in mysql::client_version(). (Georg) +- Fixed bug in mysqli extension with unsigned int(11) being represented as + signed integer in PHP instead of string in 32bit systems. (Andrey) +- Fixed bug with $HTTP_RAW_POST_DATA not getting set. (Brian) +- Fixed crash inside stream_get_line() when length parameter equals 0. (Ilia) +- Fixed ext/mysqli to allocate less memory when fetching bound params of type + (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey) +- Fixed extension initialization to respect dependencies between extensions. + (Wez) +- Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems. + (Andrey) +- Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry) +- Fixed inheritance check to control return by reference and pass by + reference correctly (ArrayAccess can no longer support references correctly). + (Marcus, Andi, Dmitry) +- Fixed initializing and argument checking for posix_mknod(). (Derick) +- Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey) +- Fixed memory corruption in pg_copy_from() in case the as_null parameter was + passed. (Derick) +- Fixed memory corruption in stristr(). (Derick) +- Fixed possible GLOBALS variable override when register_globals are ON. + (Ilia, Stefan) +- Fixed possible INI setting leak via virtual() in Apache 2 sapi. (Ilia) +- Fixed possible register_globals toggle via parse_str(). (Ilia, Stefan) +- Fixed potential GLOBALS overwrite via import_request_variables() and + possible crash and/or memory corruption. (Ilia) +- Fixed segfaults when CURL callback functions throw exception. (Tony) +- Fixed support for shared extensions on AIX. (Dmitry) +- Fixed bug #35342 (isset(DOMNodeList->length) returns false). (Rob) +- Fixed bug #35341 (Fix for bug #33760 breaks build with older curl). (Tony) +- Fixed bug #35336 (crash on PDO::FETCH_CLASS + __set()). (Tony) +- Fixed bug #35303 (PDO prepare() crashes with invalid parameters). (Ilia) +- Fixed bug #35293 (PDO segfaults when using persistent connections). (Tony) +- Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module). (Ilia) +- Fixed bug #35273 (Error in mapping soap - java types). (Dmitry) +- Fixed bug #35249 (compile failure when ext/readline is compiled as shared). + (Jani) +- Fixed bug #35248 (sqlite_query() doesn't set error_msg when return value is + being used). (Ilia) +- Fixed bug #35243 (php_mblen() crashes when compiled with thread-safety on + Linux). (Patch: shulmanb at il dot ibm dot com, Jani) +- Fixed bug #35239 (Objects can lose references). (Dmitry) +- Fixed bug #35229 (call_user_func() crashes when argument_stack is nearly + full). (Dmitry) +- Fixed bug #35197 (Destructor is not called). (Tony) +- Fixed bug #35179 (tokenizer extension needs T_HALT_COMPILER). (Greg) +- Fixed bug #35176 (include()/require()/*_once() produce wrong error messages + about main()). (Dmitry) +- Fixed bug #35147 (__HALT_COMPILER() breaks with --enable-zend-multibyte). + (Dmitry, Moriyoshi) +- Fixed bug #35143 (gettimeofday() ignores current time zone). (Derick) +- Fixed bug #35142 (SOAP Client/Server Complex Object Support). (Dmitry) +- Fixed bug #35135 (PDOStatment without related PDO object may crash). (Ilia) +- Fixed bug #35091 (SoapClient leaks memory). (Dmitry) +- Fixed bug #35079 (stream_set_blocking(true) toggles, not enables blocking). + (askalski at gmail dot com, Tony) +- Fixed bug #35078 (configure does not find ldap_start_tls_s). (Jani) +- Fixed bug #35046 (phpinfo() uses improper css enclosure). (Ilia) +- Fixed bugs #35022, #35019 (Regression in the behavior of key() and + current() functions). (Ilia) +- Fixed bug #35017 (Exception thrown in error handler may cause unexpected + behavior). (Dmitry) +- Fixed bug #35014 (array_product() always returns 0). (Ilia) +- Fixed bug #35009 (ZTS: Persistent resource destruct crashes when extension + is compiled as shared). (Dmitry) +- Fixed bug #34996 (ImageTrueColorToPalette() crashes when ncolors is zero). + (Tony) +- Fixed bug #34982 (array_walk_recursive() modifies elements outside function + scope). (Dmitry) +- Fixed bug #34977 (Compile failure on MacOSX due to use of varargs.h). (Tony) +- Fixed bug #34968 (bz2 extension fails on to build on some win32 setups). + (Ilia) +- Fixed bug #34965 (tidy is not binary safe). (Mike) +- Fixed bug #34957 (PHP doesn't respect ACLs for access checks). (Wez) +- Fixed bug #34950 (Unable to get WSDL through proxy). (Dmitry) +- Fixed bug #34938 (dns_get_record() doesn't resolve long hostnames and + leaks). (Tony) +- Fixed bug #34905 (Digest authentication does not work with Apache 1). (Ilia) +- Fixed bug #34902 (mysqli::character_set_name() - undefined method). (Tony) +- Fixed bug #34899 (Fixed sqlite extension compile failure). (Ilia) +- Fixed bug #34893 (PHP5.1 overloading, Cannot access private property). + (Dmitry) +- Fixed bug #34884 (Possible crash in ext/sqlite when sqlite.assoc_case is + being used). (Tony, Ilia) +- Fixed bug #34879 (str_replace, array_map corrupt negative array indexes on + 64-bit platforms). (Dmitry) +- Fixed bug #34873 (Segmentation Fault on foreach in object). (Dmitry) +- Fixed bug #34856 (configure fails to detect libiconv's type). (Tony) +- Fixed bug #34855 (ibase_service_attach() segfault on AMD64). + (irie at gmx dot de, Tony) +- Fixed bug #34851 (SO_RECVTIMEO and SO_SNDTIMEO socket options expect + integer parameter on Windows). (Mike) +- Fixed bug #34850 (--program-suffix and --program-prefix not included in + man page names). (Jani) +- Fixed bug #34821 (zlib encoders fail on widely varying binary data on + windows). (Mike, Ilia) +- Fixed bug #34818 (several functions crash when invalid mysqli_link object + is passed). (Tony) +- Fixed bug #34810 (mysqli::init() and others use wrong $this pointer without + checks). (Tony) +- Fixed bug #34809 (FETCH_INTO in PDO crashes without a destination object). + (Ilia) +- Fixed bug #34802 (Fixed crash on object instantiation failure). (Ilia) +- Fixed bug #34796 (missing SSL linking in ext/ftp when configured as shared). + (Jani) +- Fixed bug #34790 (preg_match_all(), named capturing groups, variable + assignment/return => crash). (Dmitry) +- Fixed bug #34788 (SOAP Client not applying correct namespace to generated + values). (Dmitry) +- Fixed bug #34787 (SOAP Client not handling boolean types correctly). (Dmitry) +- Fixed bug #34786 (2 @ results in change to error_reporting() to random + value) (Dmitry, Tony) +- Fixed bug #34785 (subclassing of mysqli_stmt does not work). (Georg) +- Fixed bug #34782 (token_get_all() gives wrong result). (Dmitry) +- Fixed bug #34777 (Crash in dblib when fetching non-existent error info). + (Ilia) +- Fixed bug #34771 (strtotime() fails with 1-12am/pm). (Derick) +- Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects + correctly). (Dmitry) +- Fixed bug #34758 (PDO_DBLIB did not implement rowCount()). (Ilia) +- Fixed bug #34757 (iconv_substr() gives "Unknown error" when offset > string + length). (Tony) +- Fixed bug #34742 (ftp wrapper failures caused from segmented command + transfer). (Ilia) +- Fixed bug #34725 (CLI segmentation faults during cleanup). (Dmitry) +- Fixed bug #34723 (array_count_values() strips leading zeroes). (Tony) +- Fixed bug #34712 (zend.ze1_compatibility_mode = on segfault). (Dmitry) +- Fixed bug #34704 (Infinite recursion due to corrupt JPEG). (Marcus) +- Fixed bug #34678 (__call(), is_callable() and static methods). (Dmitry) +- Fixed bug #34676 (missing support for strtotime("midnight") and + strtotime("noon")). (Derick) +- Fixed bug #34645 (ctype corrupts memory when validating large numbers). + (Ilia) +- Fixed bug #34643 (wsdl default value has no effect). (Dmitry) +- Fixed bug #34623 (Crash in pdo_mysql on longtext fields). (Ilia) +- Fixed bug #34617 (zend_deactivate: objects_store used after + zend_objects_store_destroy is called). (Dmitry) +- Fixed bug #34590 (User defined PDOStatement class can't implement + methods). (Marcus) +- Fixed bug #34584 (Segfault with SPL autoload handler). (Marcus) +- Fixed bug #34581 (crash with mod_rewrite). (Tony, Ilia) +- Fixed bug #34565 (mb_send_mail does not fetch + mail.force_extra_parameters). (Marco, Ilia) +- Fixed bug #34557 (php -m exits with "error" 1). (Johannes) +- Fixed bug #34518 (Unset doesn't separate container in CV). (Dmitry) +- Fixed bug #34505 (Possible memory corruption when unmangling properties + with empty names). (Tony) +- Fixed bug #34478 (Incorrect parsing of url's fragment (#...)). (Dmitry) +- Fixed bug #34467 (foreach + __get + __set inconsistency). (Dmitry) +- Fixed bug #34456 (Possible crash inside pspell extension). (Ilia) +- Fixed bug #34453 (parsing http://www.w3.org/2001/xml.xsd exception). (Dmitry) +- Fixed bug #34450 (Segfault when calling mysqli_close() in destructor). (Tony) +- Fixed bug #34449 (ext/soap: XSD_ANYXML functionality not exposed). (Dmitry) +- Fixed bug #34420 (Possible crash inside curl_multi_remove_handle()). (Ilia) +- Fixed bug #34358 (Fatal error: Cannot re-assign $this). (Dmitry) +- Fixed bug #34331 (php crashes when variables_order is empty). (Ilia) +- Fixed bug #34321 (Possible crash in filter code). (Ilia) +- Fixed bug #34311 (unserialize() crashes with chars above 191 dec). (Nuno) +- Fixed bug #34310 (foreach($arr as $c->d => $x) crashes). (Dmitry) +- Fixed bug #34307 (on_modify handler not called to set the default value if + setting from php.ini was invalid). (Andrei) +- Fixed bug #34306 (wddx_serialize_value() crashes with long array keys). + (Jani) +- Fixed bug #34304 (date() doesn't have a modifier for ISO Week Day). (Derick) +- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). + (Derick) +- Fixed bug #34299 (ReflectionClass::isInstantiable() returns true for abstract + classes). (Marcus) +- Fixed bug #34284 (CLI phpinfo showing html on _SERVER["argv"]). (Jani) +- Fixed bug #34277 (array_filter() crashes with references and objects). + (Dmitry) +- Fixed bug #34276 (setAttributeNS doesn't work with default namespace). + (Rob) +- Fixed bug #34260 (Segfault with callbacks (array_map) + overloading). + (Dmitry) +- Fixed bug #34257 (lib64 not handled correctly in ming extension). (Marcus) +- Fixed bug #34221 (Compiling xmlrpc as shared fails other parts). (Jani) +- Fixed bug #34216 (Segfault with autoload). (Marcus) +- Fixed bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler). + (Dmitry, Alex) +- Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). (Ilia) +- Fixed bug #34156 (memory usage remains elevated after memory limit is + reached). (Ilia) +- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia) +- Fixed bug #34137 (assigning array element by reference causes binary mess). + (Dmitry) +- Fixed bug #34103 (line numbering not maintained in dom document). (Rob) +- Fixed bug #34078 (Reflection API problems in methods with boolean or + null default values). (Tony) +- Fixed bug #34068 (Numeric string as array key not cast to integer in + wddx_deserialize()). (Ilia) +- Fixed bug #34064 (arr[] as param to function in class gives invalid + opcode). (Dmitry) +- Fixed bug #34062 (Crash in catch block when many arguments are used). + (Dmitry) +- Fixed bug #34052 (date('U') returns %ld not unix timestamp). (Nuno) +- Fixed bug #34045 (Buffer overflow with serialized object). (Dmitry) +- Fixed bug #34001 (pdo_mysql truncates numeric fields at 4 chars). (Ilia) +- Fixed bug #33999 (object remains object when cast to int). (Dmitry) +- Fixed bug #33996 (No information given for fatal error on passing invalid + value to typed argument). (Dmitry) +- Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry) +- Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). + (Ilia) +- Fixed bug #33967 (misuse of Exception constructor doesn't display + errorfile). (Jani) +- Fixed bug #33966 (Wrong use of reflectionproperty causes a segfault). (Tony) +- Fixed bug #33963 (mssql_bind() fails on input parameters). (Frank) +- Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash). + (Ilia) +- Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number). + (Derick) +- Fixed bug #33940 (array_map() fails to pass by reference when called + recursively). (Dmitry) +- Fixed bug #33917 (number_format() output with > 1 char separators). (Jani) +- Fixed bug #33904 (input array keys being escaped when magic quotes is off). + (Ilia) +- Fixed bug #33903 (spl_autoload_register class method). (Marcus) +- Fixed bug #33899 (CLI: setting extension_dir=some/path extension=foobar.so + does not work). (Jani) +- Fixed bug #33882 (CLI was looking for php.ini in wrong path). (Hartmut) +- Fixed bug #33869 (strtotime() problem with "+1days" format). (Ilia) +- Fixed bug #33841 (pdo sqlite driver forgets to update affected column + count on execution of prepared statments). (Ilia) +- Fixed bug #33837 (Informix ESQL version numbering schema changed). (Jani) +- Fixed bug #33829 (mime_content_type() returns text/plain for gzip and bzip + files). (Derick) +- Fixed bug #33802 (throw Exception in error handler causes crash). (Dmitry) +- Fixed bug #33771 (error_reporting falls to 0 when @ was used inside + try/catch block). (Tony) +- Fixed bug #33760 (cURL needs to implement CRYPTO_callback functions to + prevent locking). (Mike, Ilia) +- Fixed bug #33732 (Wrong behavior of constants in class and interface + extending). (Dmitry) +- Fixed bug #33723 (php_value overrides php_admin_value). (Dmitry) +- Fixed bug #33720 (mb_encode_mimeheader does not work for multibyte + chars). (Rui) +- Fixed bug #33710 (ArrayAccess objects does not initialize $this). (Dmitry) +- Fixed bug #33690 (Crash setting some ini directives in httpd.conf). (Rasmus) +- Fixed bug #33673 (Added detection for partially uploaded files). (Ilia) +- Fixed bug #33605 (substr_compare() crashes with negative offset and length). + (Tony) +- Fixed bug #33597 (setcookie() "expires" date format doesn't comply with RFC). + (Tony) +- Fixed bug #33588 (LDAP: RootDSE query not possible). (Jani) +- Fixed bug #33578 (strtotime() problem with "Oct17" format). (Derick) +- Fixed bug #33578 (strtotime() doesn't understand "11 Oct" format). (Derick) +- Fixed bug #33562 (date("") crashes). (Derick) +- Fixed bug #33558 (warning with nested calls to functions returning by + reference). (Dmitry) +- Fixed bug #33536 (strtotime() defaults to now even on non time string). + (Derick) +- Fixed bug #33532 (Different output for strftime() and date()). (Derick) +- Fixed bug #33523 (Memory leak in xmlrpc_encode_request()). (Ilia) +- Fixed bug #33520 (crash if safe_mode is on and session.save_path is changed). + (Dmitry) +- Fixed bug #33512 (Add missing support for isset()/unset() overloading to + complement the property get/set methods). (Dmitry) +- Fixed bug #33491 (crash after extending MySQLi internal class). (Tony) +- Fixed bug #33475 (cURL handle is not closed on curl_close(). (Ilia) +- Fixed bug #33469 (Compile error undefined reference to ifx_checkAPI). (Jani) +- Fixed bug #33433 (strtoll not available on Tru64). (Jani, Derick) +- Fixed bug #33427 (ext/odbc: check if unixODBC header file exists). (Jani) +- Fixed bug #33415 (strtotime() related bugs). (Derick) +- Fixed bug #33414 (Comprehensive list of incorrect days returned after + strtotime() / date() tests). (Derick) +- Fixed bug #33389 (double free() when exporting a ReflectionClass). (Marcus) +- Fixed bug #33383 (crash when retrieving empty LOBs). (Tony) +- Fixed bug #33382 (array_reverse() fails after *sort()), introduced by + zend_hash_sort() optimizations in HEAD. (Tony) +- Fixed bug #33340 (CLI Crash when calling php:function from XSLT). (Rob) +- Fixed bug #33326 (Cannot build extensions with phpize on Macosx). (Jani) +- Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8). (Dmitry) +- Fixed bug #33312 (ReflectionParameter methods do not work correctly). + (Dmitry) +- Fixed bug #33299 (php:function no longer handles returned dom objects). + (Rob, Joe Orton) +- Fixed bug #33286 (nested array_walk() calls and user array compare functions + broken; FCI cache). (Andrei, patch from m.bretz@metropolis-ag.de) +- Fixed bug #33277 (private method accessed by child class). (Dmitry) +- Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3 in + length). (Ilia) +- Fixed bug #33257 (array_splice() inconsistent when passed function instead of + variable). (Dmitry) +- Fixed bug #33243 (ze1_compatibility_mode does not work as expected). (Dmitry) +- Fixed bug #33242 (Mangled error message when stream fails). (Derick) +- Fixed bug #33222 (segfault when CURL handle is closed in a callback). (Tony) +- Fixed bug #33214 (odbc_next_result does not signal SQL errors with + 2-statement SQL batches). (rich at kastle dot com, Tony) +- Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol + 'zend_error'). (Dmitry) +- Fixed bug #33210 (relax jpeg recursive loop protection). (Ilia) +- Fixed bug #33201 (Crash when fetching some data types). (Frank) +- Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier + misbehave). (Jani) +- Fixed bug #33185 (--enable-session=shared does not build). (Jani) +- Fixed bug #33171 (foreach enumerates private fields declared in base + classes). (Dmitry) +- Fixed bug #33167 (Possible crash inside pg_fetch_array()). (Ilia) +- Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). (Ilia) +- Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). + (Nuno) +- Fixed bug #33153 (crash in mssql_next result). (Frank) +- Fixed bug #33150 (shtool: insecure temporary file creation). (Jani) +- Fixed bug #33136 (method offsetSet in class extended from ArrayObject crash + PHP). (Marcus) +- Fixed bug #33125 (imagecopymergegray() produces mosaic rainbow effect). + (Pierre) +- Fixed bug #33116 (crash when assigning class name to global variable in + __autoload). (Dmitry) +- Fixed bug #33090 (mysqli_prepare() doesn't return an error). (Georg) +- Fixed bug #33076 (str_ireplace() incorrectly counts result string length + and may cause segfault). (Tony) +- Fixed bug #33072 (Add a safemode/open_basedir check for runtime + "session.save_path" change using session_save_path() function). (Rasmus) +- Fixed bug #33070 (Improved performance of bzdecompress() by several orders + of magnitude). (Ilia) +- Fixed bug #33059 (crash when moving xml attribute set in dtd). (Ilia) +- Fixed bug #33057 (Don't send extraneous entity-headers on a 304 as per + RFC 2616 section 10.3.5) (Rasmus, Choitel) +- Fixed bug #33019 (socket errors cause memory leaks in php_strerror()). + (jwozniak23 at poczta dot onet dot pl, Tony). +- Fixed bug #33017 ("make distclean" gives an error with VPATH build). (Jani) +- Fixed bug #33013 ("next month" was handled wrong while parsing dates). + (Derick) +- Fixed bug #32993 (implemented Iterator function current() don't throw + exception). (Dmitry) +- Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 + seg fault). (Dmitry) +- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL). + (Georg) +- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg) +- Fixed bug #32944 (Disabling session.use_cookies doesn't prevent reading + session cookies). (Jani, Tony) +- Fixed bug #32941 (Sending structured SOAP fault kills a php). (Dmitry) +- Fixed bug #32937 (open_basedir looses trailing / in the limiter). + (Adam Conrad) +- Fixed bug #32936 (http redirects URLs are not checked for control chars). + (Ilia) +- Fixed bug #32933 (Cannot extend class "SQLiteDatabase"). (Marcus) +- Fixed bug #32932 (Oracle LDAP: ldap_get_entries(), invalid pointer). (Jani) +- Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob) +- Fixed bug #32924 (file included with "auto_prepend_file" can be included + with require_once() or include_once()). (Stas) +- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Tony) +- Fixed bug #32852 (Crash with singleton and __destruct when + zend.ze1_compatibility_mode = On). (Dmitry) +- Fixed bug #32833 (Invalid opcode). (Dmitry) +- Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). + (Ilia) +- Fixed bug #32810 (temporary files not using plain file wrapper). (Ilia) +- Fixed bug #32809 (Missing T1LIB support on Windows). (Edin) +- Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia) +- Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani) +- Fixed bug #32799 (crash: calling the corresponding global var during the + destruct). (Dmitry) +- Fixed bug #32776 (SOAP doesn't support one-way operations). (Dmitry) +- Fixed bug #32773 (GMP functions break when second parameter is 0). (Stas) +- Fixed bug #32759 (incorrect determination of default value (COM)). (Wez) +- Fixed bug #32758 (Cannot access safearray properties in VB6 objects). (Wez) +- Fixed bug #32755 (Segfault in replaceChild() when DocumentFragment has no + children). (Rob) +- Fixed bug #32753 (Undefined constant SQLITE_NOTADB). (Ilia) +- Fixed bug #32742 (segmentation fault when the stream with a wrapper + is not closed). (Tony, Dmitry) +- Fixed bug #32699 (pg_affected_rows() was defined when it was not available). + (Derick) +- Fixed bug #32686 (Require/include file in destructor causes segfault). + (Marcus) +- Fixed bug #32682 (ext/mssql: Error on module shutdown when called from + activescript). (Frank) +- Fixed bug #32674 (exception in iterator causes crash). (Dmitry) +- Fixed bug #32660 (Assignment by reference causes crash when field access is + overloaded (__get)). (Dmitry) +- Fixed bug #32647 (Using register_shutdown_function() with invalid callback + can crash PHP). (Jani) +- Fixed bug #32615 (Segfault in replaceChild() using fragment when + previousSibling is NULL). (Rob) +- Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf + access errors). (Jani, ric at arizona dot edu) +- Fixed bug #32608 (html_entity_decode() converts single quotes even if + ENT_NOQUOTES is given). (Ilia) +- Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct). + (Dmitry) +- Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani) +- Fixed bug #32589 (possible crash inside imap_mail_compose() function). + (Ilia) +- Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). + (Ilia) +- Fixed bug #32587 (Apache2: errors sent to error_log do not include + timestamps). (Jani) +- Fixed bug #32560 (configure looks for incorrect db2 library). (Tony) +- Fixed bug #32553 (mmap loads only the 1st 2000000 bytes on Win32). (Ilia) +- Fixed bug #32533 (proc_get_status() returns the incorrect process status). + (Ilia) +- Fixed bug #32530 (chunk_split() does not append endstr if chunklen is + longer then the original string). (Ilia) +- Fixed bug #32491 (File upload error - unable to create a temporary file). + (Uwe Schindler) +- Fixed bug #32455 (wrong setting property to unset value). (Dmitry) +- Fixed bug #32429 (method_exists() always return TRUE if __call method + exists). (Dmitry) +- Fixed bug #32428 (The @ warning error suppression operator is broken). + (Dmitry) +- Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). + (Dmitry) +- Fixed bug #32405 (mysqli::fetch() returns bad data - 64bit problem). + (Andrey) +- Fixed bug #32296 (get_class_methods() output has changed between 5.0.2 and + 5.0.3). (Dmitry) +- Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit). (Georg) +- Fixed bug #32245 (xml_parser_free() in a function assigned to the xml + parser gives a segfault). (Rob) +- Fixed bug #32179 (xmlrpc_encode() segfaults with recursive references). + (Tony) +- Fixed bug #32171 (Userspace stream wrapper crashes PHP). (Tony, Dmitry) +- Fixed bug #32160 (copying a file into itself leads to data loss). (Ilia) +- Fixed bug #32139 (SOAP client does not auto-handle base64 encoding). (Ilia) +- Fixed bug #32109 ($_POST is not populated in multi-threaded environment). + (Moriyoshi) +- Fixed bug #32080 (segfault when assigning object to itself with + zend.ze1_compatibility_mode=On). (Dmitry) +- Fixed bug #32021 (Crash caused by range('', 'z')). (Derick) +- Fixed bug #32013 (ext/mysqli bind_result causes fatal error: memory limit). + (Andrey) +- Fixed bug #32010 (Memory leak in mssql_fetch_batch). (fmk) +- Fixed bug #32009 (crash when mssql_bind() is called more than once). (Frank) +- Fixed bug #31971 (ftp_login fails on some SSL servers). + (frantisek at augusztin dot com) +- Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP + response message). (Jani) +- Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On). (Dmitry) +- Fixed bug #31668 (multi_query works exactly every other time - multi query + d/e flag global and not per connection). (Andrey) +- Fixed bug #31636 (another crash when echoing a COM object). (Wez) +- Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance + mode). (mike at php dot net) +- Fixed bug #31525 (object reference being dropped. $this getting lost). + (Stas, Dmitry) +- Fixed bug #31502 (Wrong deserialization from session when using WDDX + serializer). (Dmitry) +- Fixed bug #31478 (segfault with empty() / isset()). (Moriyoshi) +- Fixed bug #31465 (False warning in unpack() when working with *). (Ilia) +- Fixed bug #31363 (broken non-blocking flock()). (ian at snork dot net) +- Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). + (Jani) +- Fixed bug #31341 (escape on curly inconsistent). (Dmitry) +- Fixed bug #31256 (PHP_EVAL_LIBLINE configure macro does not handle + -pthread). (Jani) +- Fixed bug #31213 (Side effects caused by fix of bug #29493). (Dmitry) +- Fixed bug #31177 (memory leaks and corruption because of incorrect + refcounting). (Dmitry) +- Fixed bug #31158 (array_splice on $GLOBALS crashes). (Dmitry) +- Fixed bug #31054 (safe_mode & open_basedir checks only check first + include_path value). (Ilia) +- Fixed bug #31033 (php:function(string, nodeset) with xsl:key crashes PHP). + (Rob) +- Fixed bug #30961 (Wrong line number in ReflectionClass getStartLine()). + (Dmitry) +- Fixed bug #30889 (Conflict between __get/__set and ++ operator). (Dmitry) +- Fixed bug #30833 (array_count_values() modifying input array). (Tony) +- Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden + methods). (Dmitry) +- Fixed bug #30820 (static member conflict with $this->member silently + ignored). (Dmitry) +- Fixed bug #30819 (Better support for LDAP SASL bind). (Jani) +- Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call + __call if object is overloaded). (Dmitry) +- Fixed bug #30707 (Segmentation fault on exception in method). + (Stas, Dmitry) +- Fixed bug #30702 (cannot initialize class variable from class constant). + (Dmitry) +- Fixed bug #30578 (Output buffers flushed before calling __destruct() + functions). (Jani) +- Fixed bug #30519 (Interface not existing says Class not found). (Dmitry) +- Fixed bug #30407 (Strange behavior of default arguments). (Dmitry) +- Fixed bug #30394 (Assignment operators yield wrong result with __get/__set). + (Dmitry) +- Fixed bug #30332 (zend.ze1_compatibility_mode isn't fully compatible with + array_push()). (Dmitry) +- Fixed bug #30162 (Catching exception in constructor causes lose of + $this). (Dmitry) +- Fixed bug #30140 (Problem with array in static properties). (Dmitry) +- Fixed bug #30126 (Enhancement for error message for abstract classes). + (Marcus) +- Fixed bug #30096 (gmmktime does not return the current time). (Derick) +- Fixed bug #30080 (Passing array or non array of objects). (Dmitry) +- Fixed bug #30052 (Crash on shutdown after odbc_pconnect()). (Edin) +- Fixed bug #29983 (PHP does not explicitly set mime type & charset). (Ilia) +- Fixed bug #29975 (memory leaks when set_error_handler() is used inside error + handler). (Tony) +- Fixed bug #29971 (variables_order behavior). (Dmitry) +- Fixed bug #29944 (Function defined in switch, crashes). (Dmitry) +- Fixed bug #29896 (Backtrace argument list out of sync). (Dmitry) +- Fixed bug #29728 (Reflection API Feature: Default parameter value). (Marcus) +- Fixed bug #29689 (default value of protected member overrides default value + of private and other private variable problems in inherited classes). (Stas) +- Fixed bug #29683 (headers_list() returns empty array). (Tony) +- Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez) +- Fixed bug #29522 (accessing properties without connection). (Georg) +- Fixed bug #29361 (var_export() producing invalid code). (Derick) +- Fixed bug #29338 (unencoded spaces get ignored after certain tags). (Ilia) +- Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default). (Georg) +- Fixed bug #29334 (win32 mail() provides incorrect Date: header). (Jani) +- Fixed bug #29311 (calling parent constructor in mysqli). (Georg) +- Fixed bug #29268 (__autoload() not called with Reflection->getClass()). + (Dmitry) +- Fixed bug #29256 (SOAP HTTP Error when envelop size is more than 24345 + bytes). (Dmitry, Wez) +- Fixed bug #29253 (array_diff with $GLOBALS argument fails). (Dmitry) +- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) +- Fixed bug #29210 (Function: is_callable - no support for private and + protected classes). (Dmitry) +- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry) +- Fixed bug #29104 (Function declaration in method doesn't work). (Dmitry) +- Fixed bug #29061 (soap extension segfaults). (Dmitry) +- Fixed bug #29015 (Incorrect behavior of member vars(non string ones)-numeric + mem vars and others). (Dmitry) +- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry) +- Fixed bug #28969 (Wrong data encoding of special characters). (Dmitry) +- Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). + (kameshj at fastmail dot fm) +- Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs). (Jani) +- Fixed bug #28568 (SAPI::known_post_content_types is not thread safe). + (Moriyoshi) +- Fixed bug #28377 (debug_backtrace is intermittently passing args). (Dmitry) +- Fixed bug #28355 (glob wont error if dir is not readable). (Hartmut) +- Fixed bug #28072 (static array with some constant keys will be incorrectly + ordered). (Dmitry) +- Fixed bug #27908 (xml default_handlers not being called). (Rob) +- Fixed bug #27598 (list() array key assignment causes HUGE memory leak). + (Dmitry) +- Fixed bug #27268 (Bad references accentuated by clone). (Dmitry) +- Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when + called via STDIN). (Dmitry) +- Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may + result in seg fault). (Dmitry) +- Fixed bug #25359 (array_multisort() doesn't work in a function if array is + global or reference). (Dmitry) +- Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry) +- Fixed bug #21306 (ext/sesssion: catch bailouts of write handler during + RSHUTDOWN). (Jani, Xuefer at 21cn dot com) +- Fixed bug #15854 (boolean ini options may be incorrectly displayed as Off + when they are On). (Tony) +- Fixed bugs #14561, #20382, #26090, #26320, #28024, #30532, #32086, #32270, + #32555, #32588, #33056 (strtotime() related bugs). (Derick) + +31 Mar 2005, PHP 5.0.4 +- Added SNMPv2 support. (harrie) +- Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony) +- Added length and charsetnr for field array and object in mysqli. (Georg) +- Added checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() + and gmp_fact() to prevent SIGFPE. (Tony) +- Changed foreach() to throw an exception if IteratorAggregate::getIterator() + does not return an Iterator. (Marcus) +- Changed phpize not to require libtool. (Jani) +- Updated bundled oniguruma library (used for multibyte regular expression) + to 3.7.0. (Moriyoshi) +- Updated bundled libmbfl library (used for multibyte functions). (Moriyoshi) + Fixed bugs: + . Bug #32311 (mb_encode_mimeheader() does not properly escape characters) + . Bug #32063 (mb_convert_encoding ignores named entity 'alpha') + . Bug #31911 (mb_decode_mimeheader() is case-sensitive to hex escapes) + . bug #30573 (compiler warnings in libmbfl due to invalid type cast) + . Bug #30549 (incorrect character translations for some ISO8859 charsets). +- Fixed bug preventing from building oci8 as shared. + (stanislav dot voroniy at portavita dot nl, Tony) +- Fixed a bug in mysql_affected_rows and mysql_stmt_affected_rows when the + api function returns -1 (Georg) +- Fixed several leaks in ext/browscap and sapi/embed. (Andrei) +- Fixed several leaks in ext/filepro. (Tony) +- Fixed build system to always use bundled libtool files. (Jani) +- Fixed a bug in mysqli_stmt_execute() (type conversion with NULL values). + (Georg) +- Fixed segfault in mysqli_fetch_field_direct() when invalid field offset + is passed. (Tony) +- Fixed posix_getsid() & posix_getpgid() to return sid & pgid instead + of true. (Tony) +- Fixed bug #32394 (offsetUnset() segfaults in a foreach). (Marcus) +- Fixed bug #32373 (segfault in bzopen() if supplied path to non-existent + file). (Tony) +- Fixed bug #32326 (Check values of Connection/Transfer-Encoding + case-incentively in SOAP extension). (Ilia) +- Fixed bug #32290 (call_user_func_array() calls wrong class method within + child class). (Marcus) +- Fixed bug #32238 (spl_array.c: void function cannot return value). (Johannes) +- Fixed bug #32210 (proc_get_status() sets "running" always to true). (Ilia) +- Fixed bug #32200 (Prevent using both --with-apxs2 and --with-apxs2filter). + (Jani) +- Fixed bug #32134 (Overloading offsetGet/offsetSet). (Marcus) +- Fixed bug #32130 (ArrayIterator::seek() does not throw an Exception on + invalid index). (Marcus) +- Fixed bug #32115 (dateTime SOAP encoding of timezone incorrect). (Dmitry) +- Fixed bug #32081 (in mysqli default socket value is not being used). (Ilia) +- Fixed bug #32021 (Crash caused by range('', 'z')). (Derick) +- Fixed bug #32011 (Fragments which replaced Nodes are not globaly useable). + (Rob) +- Fixed bug #32001 (xml_parse_into_struct() function exceeds maximum + execution time). (Rob, Moriyoshi) +- Fixed bug #31980 (Unicode exif data not available on Windows). (Edin) +- Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping columns + with NULL values). (Daniel Convissor) +- Fixed bug #31878 (Segmentation fault using clone keyword on nodes). (Rob) +- Fixed bug #31858 (--disable-cli does not force --without-pear). (Jani) +- Fixed bug #31842 (*date('r') does not return RFC2822 conforming date string). + (Jani) +- Fixed bug #31832 (SOAP encoding problem with complex types in WSDL mode with + multiple parts). (Dmitry) +- Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia) +- Fixed bug #31796 (readline completion handler does not handle empty return + values). (Ilia) +- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia) +- Fixed bug #31755 (Cannot create SOAP header in no namespace). (Dmitry) +- Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) +- Fixed bug #31751 (pg_parameter_status() missing on Windows). (Edin) +- Fixed bug #31747 (SOAP Digest Authentication doesn't work with + "HTTP/1.1 100 Continue" response). (Dmitry) +- Fixed bug #31732 (mb_get_info() causes segfault when no parameters + specified). (Tony) +- Fixed bug #31710 (Wrong return values for mysqli_autocommit/commit/rollback). + (Georg) +- Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar). (Ilia) +- Fixed bug #31695 (Cannot redefine endpoint when using WSDL). (Dmitry) +- Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings). + (elod at itfais dot com) +- Fixed bug #31683 (changes to $name in __get($name) override future + parameters) (Dmitry) +- Fixed bug #31699 (unserialize() float problem on non-English locales). (Ilia) +- Fixed bug #31562 (__autoload() problem with static variables). (Marcus) +- Fixed bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays). + (Marcus) +- Fixed bug #31623 (OCILogin does not support password grace period). + (daniel dot beet at accuratesoftware dot com, Tony) +- Fixed bug #31527 (crash in msg_send() when non-string is stored without + being serialized). (Ilia) +- Fixed bug #31515 (Improve performance of scandir() by factor of 10 or so). (Ilia) +- Fixed bug #31514 (open_basedir uses path_translated rather then cwd for . + translation). (Ilia) +- Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia) +- Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia) +- Fixed bug #31454 (session_set_save_handler crashes PHP when supplied + non-existent object ref). (Tony) +- Fixed bug #31444 (Memory leak in zend_language_scanner.c). + (hexer at studentcenter dot org) +- Fixed bug #31442 (unserialize broken on 64-bit systems). (Marcus) +- Fixed bug #31440 ($GLOBALS can be overwritten via GPC when register_globals + is enabled). (Ilia) +- Fixed bug #31422 (No Error-Logging on SoapServer-Side). (Dmitry) +- Fixed bug #31413 (curl POSTFIELDS crashes on 64-bit platforms). (Joe) +- Fixed bug #31396 (compile fails with gd 2.0.33 without freetype). (Jani) +- Fixed bug #31371 (highlight_file() trims new line after heredoc). (Ilia) +- Fixed bug #31361 (simplexml/domxml segfault when adding node twice). (Rob) +- Fixed bug #31348 (CachingIterator::rewind() leaks). (Marcus) +- Fixed bug #31346 (ArrayIterator::next segfaults). (Marcus) +- Fixed bug #31190 (Unexpected warning then exception is thrown from + call_user_func_array()). (phpbugs at domain51 dot net, Dmitry) +- Fixed bug #31142 (imap_mail_compose() fails to generate correct output). (Ilia) +- Fixed bug #31139 (XML Parser Functions seem to drop & when parsing). (Rob) +- Fixed bug #31398 (When magic_guotes_gpc are enabled filenames with ' get cutoff). + (Ilia) +- Fixed bug #31288 (Possible crash in mysql_fetch_field(), if mysql_list_fields() + was not called previously). (Ilia) +- Fixed bug #31107, #31110, #31111, #31249 (Compile failure of zend_strtod.c). + (Jani) +- Fixed bug #31110 (PHP 4.3.10 does not compile on Tru64 UNIX 5.1B). (Derick) +- Fixed bug #31107 (Compile failure on Solaris 9 (Intel) and gcc 3.4.3). (Derick) +- Fixed bug #31103 (Better error message when c-client cannot be found). (Ilia) +- Fixed bug #31101 (missing kerberos header file path with --with-openssl). (Jani) +- Fixed bug #31098 (isset() / empty() incorrectly return true in dereference of + a string type). (Moriyoshi) +- Fixed bug #31087 (broken php_url_encode_hash macro). (Ilia) +- Fixed bug #31072 (var_export() does not output an array element with an empty + string key). (Derick) +- Fixed bug #31060 (imageftbbox() does not use linespacing parameter). (Jani) +- Fixed bug #31056 (php_std_date() returns invalid formatted date if + y2k_compliance is On). (Ilia) +- Fixed bug #31055 (apache2filter: per request leak proportional to the full + path of the request URI). (kameshj at fastmail dot fm) +- Fixed bug #30901 (can't send cookies with soap envelop). (Dmitry) +- Fixed bug #30871 (Misleading warning message for array_combine()). (Andrey) +- Fixed bug #30868 (evaluated pointer comparison in mbregex causes compile + failure). (Moriyoshi) +- Fixed bug #30862 (Static array with boolean indexes). (Marcus) +- Fixed bug #30726 (-.1 like numbers are not being handled correctly). (Ilia) +- Fixed bug #30725 (PHP segfaults when an exception is thrown in getIterator() + within foreach). (Marcus) +- Fixed bug #30609 (cURL functions bypass open_basedir). (Jani) +- Fixed bug #30446 (apache2handler: virtual() includes files out of sequence) +- Fixed bug #30430 (odbc_next_result() doesn't bind values and that results + in segfault). (pdan-php at esync dot org, Tony) +- Fixed bug #30266 (Invalid opcode 137/1/8). (Marcus) +- Fixed bug #30120 imagettftext() and imagettfbbox() accept too many + parameters). (Jani) +- Fixed bug #30106 (SOAP cannot not parse 'ref' element. Causes Uncaught + SoapFault exception). (Dmitry) +- Fixed bug #29989 (type re_registers redefined in oniguruma.h). (Moriyoshi) +- Fixed bug #28803 (enabled debug causes bailout errors with CLI on AIX + because of fflush() called on already closed filedescriptor). (Tony) +- Fixed bug #29767 (Weird behaviour of __set($name, $value)). (Dmitry) +- Fixed bug #29733 (printf() handles repeated placeholders wrong). + (bugs dot php dot net at bluetwanger dot de, Ilia) +- Fixed bug #29424 (width and height inverted for JPEG2000 files). (Ilia) +- Fixed bug #29329 (configure for mysqli with shared doesn't work). (Georg) +- Fixed bug #29136 (make test - libtool failure on MacOSX). (Jani) +- Fixed bug #28976 (mail(): use "From:" from headers if sendmail_from is empty). + (Jani) +- Fixed bug #28930 (PHP sources pick wrong header files generated by bison). + (eggert at gnu dot org, Jani) +- Fixed bug #28840 (__destruct of a class that extends mysqli not called). + (Marcus) +- Fixed bug #28804 (ini-file section parsing pattern is buggy). + (wendland at scan-plus dot de) +- Fixed bug #28451 (corrupt EXIF headers have unlimited recursive IFD directory + entries). (Andrei) +- Fixed bug #28444 (Cannot access undefined property for object with overloaded + property access). (Dmitry) +- Fixed bug #28442 (Changing a static variables in a class changes it across + sub/super classes.) (Marcus) +- Fixed bug #28324 (HTTP_SESSION_VARS appear when register_long_arrays is + Off). (Tony) +- Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr stream). + (chris at ex-parrot dot com) +- Fixed bug #28067 (partially incorrect utf8 to htmlentities mapping). (Derick, + Benjamin Greiner) +- Fixed bug #28041 (SOAP HTTP Digest Access Authentication). (Dmitry) +- Fixed bug #27633 (Double \r problem on ftp_get in ASCII mode on Win32). (Ilia) +- Fixed bug #18613 (Multiple OUs in x509 certificate not handled properly). + (Jani) + +15 Dec 2004, PHP 5.0.3 +- Added the %F modifier to *printf to render a non-locale-aware representation + of a float with the . as decimal seperator. (Derick) +- Fixed error handling in mysqli_multi_query. (Georg) +- Extended the functionality of is_subclass_of() to accept either a class name + or an object as first parameter. (Andrey) +- Fixed potential problems with unserializing invalid serialize data. (Marcus) +- Fixed bug #32076 (ReflectionMethod::isDestructor() always return true). + (Derick, Tony) +- Fixed bug #31034 (Problem with non-existing iconv header file). (Derick) +- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia) +- Fixed bug #30994 (SOAP server unable to handle request with references). + (Dmitry) +- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia) +- Fixed bug #30967 (properties in extended mysqli classes don't work). (Georg) +- Fixed bug #30928 (When Using WSDL, SoapServer doesn't handle private or + protected properties). (Dmitry) +- Fixed bug #30922 (reflective functions crash PHP when interfaces extend + themselves). (Tony, Dmitry) +- Fixed bug #30904 (segfault when recording soapclient into session). (Tony, + Dmitry) +- Fixed bug #30890 (MySQLi testsuite) +- Fixed bug #30856 (ReflectionClass::getStaticProperties segfaults). (Marcus) +- Fixed bug #30832 ("!" stripped off comments in xml parser). (Rob) +- Fixed bug #30799 (SoapServer doesn't handle private or protected properties). + (Dmitry) +- Fixed bug #30783 (Apache crash when using ReflectionFunction:: + getStaticVariables()). (Marcus) +- Fixed bug #30750 (Meaningful error message when upload directory is not + accessible). (Ilia) +- Fixed bug #30685 (Malformed SOAPClient http header reequest). (Dmitry) +- Fixed bug #30672 (Problem handling exif data in jpeg images at unusual + places). (Marcus) +- Fixed bug #30658 (Ensure that temporary files created by GD are removed). + (Ilia) +- Fixed bug #30645 (def. multi result set support for mysql_connect). (Georg) +- Fixed bug #30637 (compile with pear error). (Antony) +- Fixed bug #30587 (array_multisort doesn't separate zvals before + changing them). (Tony) +- Fixed bug #30572 (crash when comparing SimpleXML attribute to a boolean). + (Andi) +- Fixed bug #30566 (attribute namespace URIs are inconsistent when parsing). + (Rob) +- Fixed bug #30490 (PEAR installation fails). (Antony) +- Fixed bug #30475 (curl_getinfo() may crash in some situations). (Ilia) +- Fixed bug #30442 (segfault when parsing ?getvariable[][ ). (Tony) +- Fixed bug #30388 (rename across filesystems loses ownership and + permission info). (Tony) +- Fixed bug #30387 (stream_socket_client async connect was broken). + (vnegrier at esds dot com, Wez). +- Fixed bug #30381 (Strange results with get_class_vars()). (Marcus) +- Fixed bug #30375 (cal_info() does not work without a parameter). (Ilia) +- Fixed bug #30362 (stream_get_line() not handling end string correctly). + (Ilia) +- Fixed bug #30359 (SOAP client requests have no port in "Host" field). + (Dmitry) +- Fixed bug #30356 (str_ireplace() does not work on all strings). (Ilia) +- Fixed bug #30344 (Reflection::getModifierNames() returns too long strings). + (Marcus) +- Fixed bug #30329 (Error Fetching http body, No Content-Length, connection + closed or chunked data). (Dmitry) +- Fixed bug #30282 (segfault when using unknown/unsupported + session.save_handler and/or session.serialize_handler). (Tony) +- Fixed bug #30281 (Prevent non-wbmp images from being detected as such). + (Ilia) +- Fixed bug #30276 (Possible crash in ctype_digit on large numbers). (Ilia) +- Fixed bug #30230 (exception handler not working with objects). (Marcus) +- Fixed bug #30224 (Sybase date strings are sometimes not null terminated). + (Ilia) +- Fixed bug #30175 (SOAP results aren't parsed correctly). (Dmitry) +- Fixed bug #30147 (OO sqlite_fetch_object did not reset error handler). (Wez) +- Fixed bug #30133 (get_current_user() crashes on Windows). (Edin) +- Fixed bug #30061 (xml_set_start_namespace_decl_handler not called). (Rob) +- Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez) +- Fixed bug #30042 (strtotime does not use second param). (Derick) +- Fixed bug #30027 (Possible crash inside ftp_get()). + (cfield at affinitysolutions dot com) +- Fixed bug #29954 (array_reduce segfaults when initial value is array). (Tony) +- Fixed bug #29883 (isset gives invalid values on strings). (Tony, Dmitry) +- Fixed bug #29801 (Set limit on the size of mmapable data). (Ilia) +- Fixed bug #29557 (strtotime error). (Derick) +- Fixed bug #29418 (double free when openssl_csr_new fails). + (Kamesh Jayachandran). +- Fixed bug #29385 (Soapserver always uses std class). (David, Dmitry) +- Fixed bug #29211 (SoapClient doesn't request wsdl through proxy). (Rob) +- Fixed bug #28817 (Var problem when extending domDocument). (Georg) +- Fixed bug #28599 (strtotime fails with zero base time). (Derick) +- Fixed bug #28598 (Lost support for MS Symbol fonts). (Pierre) +- Fixed bug #28220 (mb_strwidth() returns wrong width values for some hangul + characters). (Moriyoshi) +- Fixed bug #28228 (NULL decimal separator is not being handled correctly). + (Ilia) +- Fixed bug #28209 (strtotime("now")). (Derick) +- Fixed bug #27798 (private / protected variables not exposed by + get_object_vars() inside class). (Marcus) +- Fixed bug #27728 (Can't return within a zend_try {} block or the previous + bailout state isn't restored. (Andi) +- Fixed bug #27183 (Userland stream wrapper segfaults on stream_write). + (Christian) + +23 Sep 2004, PHP 5.0.2 +- Added new boolean (fourth) parameter to array_slice() that turns on the + preservation of keys in the returned array. (Derick) +- Added the sorting flag SORT_LOCALE_STRING to the sort() functions which makes + them sort based on the current locale. (Derick) +- Added interface_exists() and make class_exists() only return true for real + classes. (Andrey) +- Added PHP_EOL constant that contains the OS way of representing newlines. + (Paul Hudson, Derick) +- Implemented periodic PCRE compiled regexp cache cleanup, to avoid memory + exhaustion. (Andrei) +- Renamed SoapClient->__call() to SoapClinet->__soapCall(). (Dmitry) +- Fixed bug with raw_post_data not getting set (Brian) +- Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev) +- Fixed bug #30209 (ReflectionClass::getMethod() lowercases attribute). + (Marcus) +- Fixed bug #30182 (SOAP module processing WSDL file dumps core). (Dmitry) +- Fixed bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests). + (Dmitry) +- Fixed bug #29985 (unserialize()/ __PHP_Incomplete_class does not report + correctly class name). (Marcus, Tony) +- Fixed bug #29945 (simplexml_load_file URL limitation 255 char). (Rob) +- Fixed bug #29873 (No defines around pcntl_*priority definitions). (Derick) +- Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request). + (Dmitry) +- Fixed bug #29842 (soapclient return null value). (Dmitry) +- Fixed bug #29839 (incorrect convert (xml:lang to lang)). (Dmitry) +- Fixed bug #29830 (SoapServer::setClass() should not export non-public + methods). (Dmitry) +- Fixed bug #29828 (Interfaces no longer work). (Marcus) +- Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid + data). (Ilia) +- Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia) +- Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler) +- Fixed bug #29795 (SegFault with Soap and Amazon's Web Services). (Dmitry) +- Fixed bug #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE + on error). (Tony) +- Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob) +- Fixed bug #29678 (opendir() with ftp:// wrapper segfaults if path does not + have trailing slash). (Ilia) +- Fixed bug #29657 (xml_* functions throw non descriptive error). + (Christian, Rob) +- Fixed bug #29656 (segfault on result and statement properties). (Georg) +- Fixed bug #29566 (foreach/string handling strangeness (crash)). (Dmitry) +- Fixed bug #29447 (Reflection API issues). (Marcus) +- Fixed bug #29296 (Added sslv2 and sslv3 transports). (Wez) +- Fixed bug #29283 (Invalid statement handle in mysqli on execute). (Georg) +- Fixed bug #29913 (parse_url() is now binary safe). (Ilia) +- Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled). + (Dmitry) +- Fixed bug #27791 (Apache 2.0 SAPI build against Apache 2 HEAD). (Joe Orton, + Derick) +- Fixed bug #26737 (private/protected properties not serialized when user + declared method __sleep() exists). E_NOTICE thrown when __sleep() returns + name of non-existing member. (Andrey, Curt) -- GMP: - . Moved GMP to use object as the underlying structure and implemented various - improvements based on this. - (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) +12 Aug 2004, PHP 5.0.1 +- Changed destructor mechanism so that destructors are called prior to request + shutdown. (Marcus) +- Rewritten UNIX and Windows install help files. (Documentation Team) +- Updated several libraries bundled with the windows release which now + includes libxml2-2.6.11, libxslt-1.1.7 and iconv-1.9.1. (Rob, Edin) +- Improved and moved ActiveScript SAPI to PECL. (Wez) +- Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then + returning the value). (Ilia) +- Fixed bug #29577 (MYSQLI_CLIENT_FOUND_ROWS undefined) (Georg) +- Fixed bug #29573 (Segmentation fault, when exception thrown within + PHP function called from XSLT). (Christian) +- Fixed bug #29522 (accessing properties without connection) (Georg) +- Fixed bug #29505 (get_class_vars() severely broken when used with arrays). + (Marcus) +- Fixed bug #29490 (.Net object instantiation failed). (Michael Sisolak). +- Fixed bug #29474 (win32: usleep() doesn't work). (Wez) +- Fixed bug #29449 (win32: feof() hangs on empty tcp stream). (Wez) +- Fixed bug #29437 (Possible crash inside array_walk_recursive()). (Ilia) +- Fixed bug #29431 (crash when parsing invalid address; invalid address + returned by stream_socket_recvfrom(), stream_socket_getname()). (Wez) +- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob) +- Fixed unloading of dynamically loaded extensions. + (Marcus, kameshj at fastmail dot fm) +- Fixed bug #29395 (sqlite_escape_string() returns bogus data on empty + strings). (Ilia, Tony) +- Fixed bug #29392 (com_dotnet crashes when echo'ing an object). (Wez) +- Fixed bug #29368 (The destructor is called when an exception is thrown from + the constructor). (Marcus) +- Fixed bug #29354 (Exception constructor marked as both public and protected). + (Marcus) +- Fixed bug #29342 (strtotime() does not handle empty date string properly). + (Ilia) +- Fixed bug #29340 (win32 build produces invalid php_ifx.dll). (Edin) +- Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg) +- Fixed bug #29291 (get_class_vars() return names with NULLs). (Marcus) +- Fixed bug #29264 (gettext extension not working). (Edin) +- Fixed bug #29258 (variant_date_from_timestamp() does not honour + timezone). (Wez) +- Fixed bug #29256 (error when sending large packets on a socket). (Dmitry) +- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) +- Fixed bug #29147 (Compile Error in mnoGoSearch functions). (Sergey, Antony) +- Fixed bug #29132 ($_SERVER["PHP_AUTH_USER"] isn't defined). (Stefan) +- Fixed bug #29119 (html_entity_decode() misbehaves with UTF-8). (Moriyoshi) +- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry) +- Fixed bug #29061 (soap extension segfaults). (Dmitry) +- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry) +- Fixed bug #28969 (Wrong data encoding of special characters). (Dmitry) +- Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus) +- Fixed bug #28829 (Thread-unsafety in bcmath elementary values). (Sara) +- Fixed bug #28464 (catch() does not catch exceptions by interfaces). (Marcus) +- Fixed bug #27669 (PHP 5 didn't support all possibilities for calling static + methods dynamically). (Dmitry) +- Fixed ReflectionClass::getMethod() and ReflectionClass::getProperty() to + raise an ReflectionException instead of returning NULL on failure. + (Sebastian) +- Fixed convert.* filters to consume remaining buckets_in on flush. (Sara) +- Fixed bug in mysqli->client_version. (Georg) -<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> +13 Jul 2004, PHP 5.0.0 +- Updated PCRE to provide better error handling in certain cases. (Andrei) +- Changed doc comments to require a single white space after '/**'. (Marcus) +- Fixed bug #29019 (Database not closing). (Marcus) +- Fixed bug #29008 (array_combine() does not handle non-numeric/string keys). + (Ilia) +- Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X). (Ilia) +- Fixed bug #28868 (Internal filter registry not thread safe). (Sara) +- Fixed bug #28851 (call_user_func_array has typo in error message). (Marcus) +- Fixed bug #28831 (ArrayObject::offsetGet() does the work of offsetUnset()). + (Marcus) +- Fixed bug #28822 (ArrayObject::offsetExists() works inverted). (Marcus) +- Fixed bug #28789 (ReflectionProperty getValue() fails on public static + members). (Marcus) +- Fixed bug #28771 (Segfault when using xslt and clone). (Rob) +- Fixed bug #28751 (SoapServer does not call _autoload()). (Dmitry) +- Fixed bug #28739 (array_*diff() and array_*intersect() not clearing the fci + cache before work). (Andrey) +- Fixed bug #28721 (appendChild() and insertBefore() unset DOMText).(Rob) +- Fixed bug #28702 (SOAP does not parse WSDL service address correctly). (Dmitry) +- Fixed bug #28699 (Reflection api bugs). (Marcus) +- Fixed bug #28694 (ReflectionExtension::getFunctions() crashes PHP). (Marcus) +- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank) +- Fixed strip_tags() to correctly handle '\0' characters. (Stefan) diff --git a/README.EXTENSIONS b/README.EXTENSIONS new file mode 100644 index 000000000000..51e3b730e7de --- /dev/null +++ b/README.EXTENSIONS @@ -0,0 +1,39 @@ +Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way +that broke both source and binary compatibility. If you are +maintaining a third party extension, here's how to update it: + +If this was your old module entry: + +zend_module_entry foo_module_entry = { + "foo", /* extension name */ + foo_functions, /* extension function list */ + NULL, /* extension-wide startup function */ + NULL, /* extension-wide shutdown function */ + PHP_RINIT(foo), /* per-request startup function */ + PHP_RSHUTDOWN(foo), /* per-request shutdown function */ + PHP_MINFO(foo), /* information function */ + STANDARD_MODULE_PROPERTIES +}; + +Here's how it should look if you want your code to build with PHP +4.1.0 and up: + +zend_module_entry foo_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 + STANDARD_MODULE_HEADER, +#endif + "foo", /* extension name */ + foo_functions, /* extension function list */ + NULL, /* extension-wide startup function */ + NULL, /* extension-wide shutdown function */ + PHP_RINIT(foo), /* per-request startup function */ + PHP_RSHUTDOWN(foo), /* per-request shutdown function */ + PHP_MINFO(foo), /* information function */ +#if ZEND_MODULE_API_NO >= 20010901 + FOO_VERSION, /* extension version number (string) */ +#endif + STANDARD_MODULE_PROPERTIES +}; + +If you don't care about source compatibility with earlier PHP releases +than 4.1.0, you can drop the #if/#endif lines. diff --git a/README.GIT-RULES b/README.GIT-RULES index 6e90aa97b6ff..90e0d83cbed4 100644 --- a/README.GIT-RULES +++ b/README.GIT-RULES @@ -45,15 +45,14 @@ Currently we have the following branches in use:: master The active development branch. - PHP-5.5 Is used to release the PHP 5.5.x series. This is a current - stable version and is open for bugfixes only. + PHP-5.5 Is used to release the PHP 5.5.x series. It allows for larger + enhancements. - PHP-5.4 Is used to release the PHP 5.4.x series. This is a current + PHP-5.4 Is used to release the PHP 5.4.x series. This is current stable version and is open for bugfixes only. - PHP-5.3 Is used to release the PHP 5.3.x series. This is currently - in extended support and open forsecurity fixes only. Triaged - via security@php.net + PHP-5.3 Is used to release the PHP 5.3.x series. This is current + stable version and is open for bugfixes only. PHP-5.2 This branch is closed. diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API index 25a41096cf2e..edcee0f2eaa0 100644 --- a/README.PARAMETER_PARSING_API +++ b/README.PARAMETER_PARSING_API @@ -43,7 +43,7 @@ See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse Type specifiers --------------- The following list shows the type specifier, its meaning and the parameter - types that need to be passed by address. All passed parameters are set + types that need to be passed by address. All passed paramaters are set if the PHP parameter is non optional and untouched if optional and the parameter is not present. The only exception is O where the zend_class_entry* has to be provided on input and is used to verify the PHP parameter is an diff --git a/README.PHP4-TO-PHP5-THIN-CHANGES b/README.PHP4-TO-PHP5-THIN-CHANGES new file mode 100644 index 000000000000..0a2c6d665713 --- /dev/null +++ b/README.PHP4-TO-PHP5-THIN-CHANGES @@ -0,0 +1,155 @@ +1. strrpos() and strripos() now use the entire string as a needle. Be aware + that the existing scripts may no longer work as you expect. + + EX : + + + Will give you different results. The former returns 3 while the latter + returns false rather than the position of the last occurrence of 'D'. + The same applies to strripos(). + +2. Illegal use of string offsets causes E_ERROR instead of E_WARNING. + + EX : + + + Fatal error: Cannot use string offset as an array in ... on line 1 + +3. array_merge() was changed to accept only arrays. If a non-array variable is + passed, a E_WARNING will be thrown for every such parameter. Be careful + because your code may start emitting E_WARNING out of the blue. + +4. Be careful when porting from ext/mysql to ext/mysqli. The following + functions return NULL when no more data is available in the result set + (ext/mysql's functions return FALSE). + + - mysqli_fetch_row() + - mysqli_fetch_array() + - mysqli_fetch_assoc() + +5. PATH_TRANSLATED server variable is no longer set implicitly under + Apache2 SAPI in contrast to the situation in PHP 4, where it is set to the + same value as the SCRIPT_FILENAME server variable when it is not populated + by Apache. This change was made to comply with the CGI specification. + Please refer to bug #23610 for further information. + +6. Starting PHP 5.0.0 the T_ML_CONSTANT constant is no longer defined by the + ext/tokenizer extension. If error_reporting is set to E_ALL notices will + be produced. Instead of T_ML_CONSTANT for /* */ the T_COMMENT constant + is used, thus both // and /* */ are resolved as the T_COMMENT constant. + However the PHPDoc style comments /** */ ,which starting PHP 5 are parsed + by PHP, are recongnized as T_DOC_COMMENT. + +7. $_SERVER should be populated with argc and argv if variables_order + includes "S". If you have specifically configured your system to not + create $_SERVER, then of course it shouldn't be there. The change was to + always make argc and argv available in the CLI version regardless of the + variables_order setting. As in, the CLI version will now always populate + the global $argc and $argv variables. + +8. In some cases classes must be declared before used. It only happens only + if some of the new features of PHP 5 are used. Otherwise the behaviour is + the old. + Example 1 (works with no errors): + + + Example 2 (throws an error): + + + Output (example 2) : + Fatal error: Class 'a' not found in /tmp/cl.php on line 2 + +9. get_class() starting PHP 5 returns the name of the class as it was + declared which may lead to problems in older scripts that rely on + the previous behaviour - the class name is lowercased. Expect the + same behaviour from get_parent_class() when applicable. + Example : + + + Output (PHP 4): + string(6) "foobar" + string(9) "extfoobar" + + Output (PHP 5): + string(6) "FooBar" + string(9) "ExtFooBar" + ---------------------------------------------------------------------- + Example code that will break : + //.... + function someMethod($p) { + if (get_class($p) != 'helpingclass') { + return FALSE; + } + //... + } + //... + Possible solution is to search for get_class() and get_parent_class() in + all your scripts and use strtolower(). + +10. get_class_methods() returns the names of the methods of a class as they + declared. In PHP4 the names are all lowercased. + Example code : + + Output (PHP4): + array(2) { + [0]=> + string(5) "dofoo" + [1]=> + string(6) "hasfoo" + } + Output (PHP5): + array(2) { + [0]=> + string(5) "doFoo" + [1]=> + string(6) "hasFoo" + } + +11. Assignment $this is impossible. Starting PHP 5.0.0 $this has special + meaning in class methods and is recognized by the PHP parser. The latter + will generate a parse error when assignment to $this is found + Example code : + assignNew($b); + echo "I was executed\n"; + ?> + Output (PHP 4): + I was executed + Output (PHP 5): + PHP Fatal error: Cannot re-assign $this in /tmp/this_ex.php on line 4 + diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS index 06f4724f7a0a..58d3cd4e8e4f 100644 --- a/README.RELEASE_PROCESS +++ b/README.RELEASE_PROCESS @@ -78,9 +78,6 @@ f.e. http://downloads.php.net/derick/ (internals-win@lists.php.net) so that Windows binaries can be created. Once those are made, they should be placed into the same directory as the source snapshots. -12. Notify the documentation team if documentations for new features are -not yet available but a stable release is imminent. - Getting the non stable release (alpha/beta/RC) announced -------------------------------------------------------- @@ -177,9 +174,6 @@ those are made, they should be committed to SVN too. 15. When making a final release, also remind the PHP Windows development team (internals-win@lists.php.net) to prepare the installer packages for Win32. -16. Make sure proper documentation exists for all new features/changes. -Coordinate the release with the PHP Documentation team. - Getting the stable release announced ------------------------------------ diff --git a/README.STREAMS b/README.STREAMS index 0046e6a75438..f625406a3bae 100644 --- a/README.STREAMS +++ b/README.STREAMS @@ -46,7 +46,7 @@ Opening Streams =============== In most cases, you should use this API: -PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode, +PHPAPI php_stream *php_stream_open_wrapper(char *path, char *mode, int options, char **opened_path TSRMLS_DC); Where: diff --git a/README.SUBMITTING_PATCH b/README.SUBMITTING_PATCH index d1b74bd18d99..63b7156f100b 100644 --- a/README.SUBMITTING_PATCH +++ b/README.SUBMITTING_PATCH @@ -5,7 +5,7 @@ This document describes how to submit an enhancement or patch for PHP. It's easy! You don't need any login accounts or special access to download, -build, debug and begin submitting PHP or PECL code, tests or +build, debug and begin submitting PHP, PECL or PEAR code, tests or documentation. Once you've followed this README and had several patches accepted, commit privileges are often quickly granted. @@ -16,8 +16,8 @@ http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith Online Forums ------------- There are several IRC channels where PHP developers are often -available to discuss questions. They include #php.pecl and #php.doc -on the EFNet network and #php-dev-win on FreeNode. +available to discuss questions. They include #php.pecl, #php.doc and +#pear on the EFNet network and #php-dev-win on FreeNode. PHP Patches @@ -78,7 +78,7 @@ of type 'text/*' are accepted. PECL Extension Patches: http://pecl.php.net/ -------------------------------------------- If you are fixing broken functionality in a PECL extension then create -a bug or identify an existing bug at http://bugs.php.net/. A bug +a bug or identify an existing bug at http://pecl.php.net/bugs/. A bug can be used to track the patch progress and prevent your changes getting lost in the PHP mail archives. @@ -114,15 +114,15 @@ http://pear.php.net/manual/en/guide-developers.php How to create your PHP, PHP Documentation or PECL patch ------------------------------------------------------- -PHP and most PECL packages use Git for revision control. Some PECL -packages use Subversion (SVN) Read http://www.php.net/git.php for help -on using Git to get and build PHP source code. We recommend to look -at our workflow on https://wiki.php.net/vcs/gitworkflow and our FAQ -https://wiki.php.net/vcs/gitfaq. +PHP and PECL use Subversion (SVN) for revision control. Read +http://www.php.net/svn.php for help on using SVN to get and build PHP +source code. We recommend using a Sparse Directory checkout described +in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read +http://svnbook.red-bean.com. Generally we ask that bug fix patches work on the current stable PHP -development branches and on "master". New PHP features only need to -work on "master". +development branches and on "trunk". New PHP features only need to +work on "trunk". Read CODING_STANDARDS before you start working. @@ -134,7 +134,7 @@ comprehensive. After testing is finished, create a patch file using the command: - git diff > your_patch.txt + svn diff > your_patch.txt For ease of review and later troubleshooting, submit individual patches for each bug or feature. @@ -142,7 +142,7 @@ patches for each bug or feature. Checklist for submitting your PHP or PECL code patch ---------------------------------------------------- - - Update git source just before running your final 'diff' and + - Update SVN source just before running your final 'diff' and before testing. - Add in-line comments and/or have external documentation ready. Use only "/* */" style comments, not "//". @@ -175,7 +175,7 @@ about these questions: What happens when your PHP or PECL patch is applied --------------------------------------------------- -Your name will likely be included in the Git commit log. If your +Your name will likely be included in the SVN commit log. If your patch affects end users, a brief description and your name might be added to the NEWS file. diff --git a/README.TESTING b/README.TESTING index 5e0ee11be05a..75141d50e570 100644 --- a/README.TESTING +++ b/README.TESTING @@ -1,6 +1,6 @@ [IMPORTANT NOTICE] ------------------ - Failed tests usually indicate a problem with your local system setup + Failed tests usualy indicate a problem with your local system setup and not within PHP itself (at least for official PHP release versions). You may decide to automaticaly submit a test summary to our QA workflow at the end of a test run. diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index a7d09630a26c..3e211fa54f9a 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -1673,7 +1673,7 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */ } /* }}} */ -CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /* {{{ */ +CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */ { cwd_state old_state; cwd_state new_state; diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index 72c442467056..8aac4aa2671e 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -161,7 +161,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC); CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC); CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); -CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC); +CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); CWD_API int virtual_unlink(const char *path TSRMLS_DC); diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 2ec97be0116b..0ced6db451bf 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -625,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags) shm->info = info_handle; shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - if (NULL != shm->descriptor && created) { + if (created) { shm->descriptor->shm_perm.key = key; shm->descriptor->shm_segsz = size; shm->descriptor->shm_ctime = time(NULL); @@ -639,10 +639,8 @@ TSRM_API int shmget(int key, int size, int flags) shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; } - if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) { - if (NULL != shm->segment) { - CloseHandle(shm->segment); - } + if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { + CloseHandle(shm->segment); UnmapViewOfFile(shm->descriptor); CloseHandle(shm->info); return -1; diff --git a/UPGRADING b/UPGRADING index f392edd54d65..09218cca5fce 100755 --- a/UPGRADING +++ b/UPGRADING @@ -35,9 +35,6 @@ PHP X.Y UPGRADE NOTES 3. Deprecated Functionality ======================================== -- Incompatible context calls: - Instance calls from an incompatible context are now deprecated and issue - E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx ======================================== 4. Changed Functions @@ -66,21 +63,6 @@ PHP X.Y UPGRADE NOTES 8. Other Changes to Extensions ======================================== -- GMP: - The GMP extension now uses objects as the underlying data structure, rather - than resources. GMP instances now support dumping, serialization, cloning, - casts to primitive types and have overloaded operators. - (RFC: https://wiki.php.net/rfc/operator_overloading_gmp) - -- OCI8: - - Added Implicit Result Set support for Oracle Database 12c with a - new oci_get_implicit_resultset() function. - - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer - unnecessarily initiates an internal ROLLBACK during connection - close. - - Added DTrace probes enabled with PHP's generic --enable-dtrace - - The oci_internal_debug() function is now a no-op. - - The phpinfo() output format for OCI8 has changed. ======================================== 9. New Global Constants @@ -96,5 +78,3 @@ PHP X.Y UPGRADE NOTES 11. Other Changes ======================================== -- File upload: - Uploads equal or greater than 2GB in size are now accepted. diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 7cb5539fc1c2..e9252b73bd41 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -3,8 +3,7 @@ $Id$ UPGRADE NOTES - PHP X.Y 1. Internal API changes - a. Addition of do_operation and compare object handlers - b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros + a. 2. Build system changes a. Unix build system changes @@ -15,57 +14,12 @@ UPGRADE NOTES - PHP X.Y 1. Internal API changes ======================== - a. Addition of do_operation and compare object handlers - - Two new object handlers have been added: - - do_operation: - typedef int (*zend_object_do_operation_t)( - zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC - ); - - compare: - typedef int (*zend_object_compare_zvals_t)( - zval *result, zval *op1, zval *op2 TSRMLS_DC - ); - - The first handler is used to overload arithmetic operations. The first - argument specifies the opcode of the operator, result is the target zval, - op1 the first operand and op2 the second operand. For unary operations - op2 is NULL. If the handler returns FAILURE PHP falls back to the default - behavior for the operation. - - The second handler is used to perform comparison operations with - non-objects. The value written into result must be an IS_LONG with value - -1 (smaller), 0 (equal) or 1 (greater). The return value is a SUCCESS/FAILURE - return code. The difference between this handler and compare_objects is - that it will be triggered for comparisons with non-objects and objects of - different types. It takes precedence over compare_objects. - - Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp - - b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros - - The return_value_ptr argument to internal functions is now always set. - Previously it was only available for functions returning by-reference. - return_value_ptr can now be used to return zvals without copying them. - For this purpose two new macros are provided: - - RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */ - RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */ - - The macros behave similarly to the non-FAST variants with copy=1 and - dtor=0, but will try to return the zval without making a copy by utilizing - return_value_ptr. - ======================== 2. Build system changes ======================== a. Unix build system changes - - The bison version check is now a blacklist instead of a whitelist. - - The bison binary can be specified through the YACC environment/configure - variable. Previously `bison` was assumed to be in $PATH. + - b. Windows build system changes - diff --git a/Zend/README.ZEND_VM b/Zend/README.ZEND_VM index de66110d6483..15ff6fd86f4b 100644 --- a/Zend/README.ZEND_VM +++ b/Zend/README.ZEND_VM @@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading and direct threading). As a result ZE2 got more than 20% speedup on raw PHP code execution (with specialized executor and direct threading execution method). As in most PHP applications raw execution speed isn't the limiting -factor but system calls and database calls are, your mileage with this patch +factor but system calls and database callls are, your mileage with this patch will vary. Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES index afb3595595f4..5208ce162392 100644 --- a/Zend/ZEND_CHANGES +++ b/Zend/ZEND_CHANGES @@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0 that of other object-oriented languages, such as Java: When the last reference to an object is destroyed the object's destructor, which is a class method name __destruct() that - receives no parameters, is called before the object is freed + recieves no parameters, is called before the object is freed from memory. Example: @@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0 (supports breakpoints, expression evaluation, step-in/over, function call backtrace, and more). - The Zend Engine claims 100% compatibility with the engine of PHP + The Zend Engine claims 100% compatability with the engine of PHP 3.0, and is shamelessly lying about it. Here's why: * Static variable initializers only accept scalar values @@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0 printed the letter { and the contents of the variable $somevar in PHP 3.0), it will result in a parse error with the Zend Engine. In this case, you would have to change the code to print - "\{$somevar"; This incompatibility is due to the full variable + "\{$somevar"; This incompatability is due to the full variable reference within quoted strings feature added in the Zend Engine. diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index fe3ab63beb4c..136d2d8befeb 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -3,13 +3,8 @@ dnl dnl This file contains local autoconf functions. AC_DEFUN([LIBZEND_BISON_CHECK],[ - # we only support certain bison versions; - # min: 2.4 (i.e. 204, major * 100 + minor for easier comparison) - bison_version_min="204" - # non-working versions, e.g. "3.0 3.2"; - # remove "none" when introducing the first incompatible bison version an - # separate any following additions by spaces - bison_version_exclude="none" + # we only support certain bison versions + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2" # for standalone build of Zend Engine test -z "$SED" && SED=sed @@ -17,27 +12,23 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ bison_version=none if test "$YACC"; then AC_CACHE_CHECK([for bison version], php_cv_bison_version, [ - bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z` + bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z` php_cv_bison_version=invalid if test -n "$bison_version_vars"; then set $bison_version_vars bison_version="${1}.${2}" - bison_version_num="`expr ${1} \* 100 + ${2}`" - if test $bison_version_num -ge $bison_version_min; then - php_cv_bison_version="$bison_version (ok)" - for bison_check_version in $bison_version_exclude; do - if test "$bison_version" = "$bison_check_version"; then - php_cv_bison_version=invalid - break - fi - done - fi + for bison_check_version in $bison_version_list; do + if test "$bison_version" = "$bison_check_version"; then + php_cv_bison_version="$bison_check_version (ok)" + break + fi + done fi ]) fi case $php_cv_bison_version in ""|invalid[)] - bison_msg="This bison version is not supported for regeneration of the Zend/PHP parsers (found: $bison_version, min: $bison_version_min, excluded: $bison_version_exclude)." + bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found: $bison_version)." AC_MSG_WARN([$bison_msg]) YACC="exit 0;" ;; diff --git a/Zend/tests/019.phpt b/Zend/tests/019.phpt index 654f86bb1163..70093cd28b92 100644 --- a/Zend/tests/019.phpt +++ b/Zend/tests/019.phpt @@ -357,7 +357,7 @@ var_dump($global_var); test_unset3(); var_dump($global_var); -//Note: No error conditions relating to passing arguments can be tested +//Note: No error conditions relating to passing arugments can be tested // because these are not functions but statements, it will result in syntax error. ?> ===DONE=== diff --git a/Zend/tests/bug32428.phpt b/Zend/tests/bug32428.phpt index e75148fec15f..0b5ca6aebcf1 100644 --- a/Zend/tests/bug32428.phpt +++ b/Zend/tests/bug32428.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #32428 (The @ warning error suppression operator is broken) +Bug #32428 (The @ warning error supression operator is broken) --FILE-- guid = 1; - $containers[spl_object_hash($this)] = $this; - } - public function __destruct() { - global $containers; - $containers[spl_object_hash($this)] = NULL; - } -} - -for ($i = 0; $i < OBJECT_COUNT; ++$i) { - new Object(); -} - -// You probably won't see this because of the "zend_mm_heap corrupted" -?> -If you see this, try to increase OBJECT_COUNT to 100,000 ---EXPECT-- -If you see this, try to increase OBJECT_COUNT to 100,000 diff --git a/Zend/tests/bug60771.phpt b/Zend/tests/bug60771.phpt index 119ae50ad4f8..c20bbc462a96 100644 --- a/Zend/tests/bug60771.phpt +++ b/Zend/tests/bug60771.phpt @@ -1,10 +1,10 @@ ---TEST-- -test of larger than 8kb text file being parsed by require statement ---FILE-- - ---EXPECT-- -passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, +--TEST-- +test of larger than 8kb text file being parsed by require statement +--FILE-- + +--EXPECT-- +passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, diff --git a/Zend/tests/bug64660.phpt b/Zend/tests/bug64660.phpt deleted file mode 100644 index e2b89da1cdd2..000000000000 --- a/Zend/tests/bug64660.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #64660 (Segfault on memory exhaustion within function definition) ---FILE-- -trace = debug_backtrace(1); - } -} - -class Bar { - public function __destruct() { - Stat::getInstance(); - new Error(); - } - - public function test() { - new Error(); - } -} - -$foo = new Foo(); -$bar = new Bar(); -$bar->test(); -?> ---EXPECTF-- -Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12 diff --git a/Zend/tests/bug64821.1.phpt b/Zend/tests/bug64821.1.phpt deleted file mode 100644 index 5e2093c472a6..000000000000 --- a/Zend/tests/bug64821.1.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1) ---FILE-- -message = NULL; - $this->string = NULL; - $this->code = array(); - $this->line = "hello"; - } -} - -throw new a; - -?> ---EXPECTF-- -Fatal error: Uncaught exception 'a' in %s:0 -Stack trace: -#0 {main} - thrown in %s on line %d diff --git a/Zend/tests/bug64821.2.phpt b/Zend/tests/bug64821.2.phpt deleted file mode 100644 index 91a43f500b09..000000000000 --- a/Zend/tests/bug64821.2.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2) ---FILE-- -line = array(); - } -} - -throw new a; - -?> ---EXPECTF-- -Fatal error: Uncaught exception 'a' in %s:0 -Stack trace: -#0 {main} - thrown in %s on line %d diff --git a/Zend/tests/bug64821.3.phpt b/Zend/tests/bug64821.3.phpt deleted file mode 100644 index 9e96075d4913..000000000000 --- a/Zend/tests/bug64821.3.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3) ---FILE-- -line = array(); - $this->file = NULL; - } -} - -throw new a; - -?> ---EXPECTF-- -Fatal error: Uncaught exception 'a' in :0 -Stack trace: -#0 {main} - thrown in Unknown on line %d diff --git a/Zend/tests/bug64896.phpt b/Zend/tests/bug64896.phpt deleted file mode 100644 index 3e955bbece7d..000000000000 --- a/Zend/tests/bug64896.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects) ---XFAIL-- -We can not fix this bug without a significant (performace slow down) change to gc ---FILE-- -_private[] = 'php'; - } - - public function __destruct() - { - global $bar; - $bar = $this; - } -} - -$foo = new stdclass; -$foo->foo = $foo; -$foo->bad = new bad; - -gc_disable(); - -unserialize(serialize($foo)); -gc_collect_cycles(); -var_dump($bar); -/* will output: -object(bad)#4 (1) { - ["_private":"bad":private]=> - &UNKNOWN:0 -} -*/ -?> ---EXPECTF-- -bject(bad)#%d (1) { - ["_private":"bad":private]=> - array(1) { - [0]=> - string(3) "php" - } -} diff --git a/Zend/tests/bug64960.phpt b/Zend/tests/bug64960.phpt deleted file mode 100644 index b31cca3dc6dd..000000000000 --- a/Zend/tests/bug64960.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #64960 (Segfault in gc_zval_possible_root) ---FILE-- -_trace = debug_backtrace(); - - throw $e; -}); - -// trigger error handler -$a['waa']; -?> ---EXPECTF-- -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3 - -Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19 -Stack trace: -#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array) -#1 %sbug64960.php(9): ob_end_clean() -#2 [internal function]: ExceptionHandler->__invoke(Object(Exception)) -#3 {main} - thrown in %sbug64960.php on line 19 diff --git a/Zend/tests/bug64966.phpt b/Zend/tests/bug64966.phpt deleted file mode 100644 index c1cdbbf812d4..000000000000 --- a/Zend/tests/bug64966.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) ---FILE-- -b(); -?> ---EXPECTF-- -Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3 -Stack trace: -#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array) -#1 %sbug64966.php(6): iterator_apply('') -#2 %sbug64966.php(12): test('iterator_apply') -#3 %sbug64966.php(17): A->b() -#4 {main} - thrown in %sbug64966.php on line 3 diff --git a/Zend/tests/bug64979.phpt b/Zend/tests/bug64979.phpt deleted file mode 100644 index 09de55554642..000000000000 --- a/Zend/tests/bug64979.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #64578 (Closures with static variables can be generators) ---XFAIL-- -Bug #64979 not fixed yet. ---FILE-- - ---EXPECT-- -int(1) -int(2) -int(1) diff --git a/Zend/tests/bug64988.phpt b/Zend/tests/bug64988.phpt deleted file mode 100644 index 34fd482f384e..000000000000 --- a/Zend/tests/bug64988.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #64988 (Class loading order affects E_STRICT warning) ---FILE-- - ---EXPECTF-- -Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20 -okey diff --git a/Zend/tests/bug65051.phpt b/Zend/tests/bug65051.phpt deleted file mode 100644 index 42febf5b92e8..000000000000 --- a/Zend/tests/bug65051.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #65051: count() off by one inside unset() ---FILE-- -array[0])); - var_dump($this->array[0]); - } -} - -$array = [[new Foo]]; -$array[0][0]->array =& $array; -unset($array[0][0]); - -?> ---EXPECT-- -int(0) -array(0) { -} diff --git a/Zend/tests/bug65108.phpt b/Zend/tests/bug65108.phpt deleted file mode 100644 index d3e5a65b26eb..000000000000 --- a/Zend/tests/bug65108.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #65108 (is_callable() triggers Fatal Error) ---FILE-- - ---EXPECT-- -Tester diff --git a/Zend/tests/bug65372.phpt b/Zend/tests/bug65372.phpt deleted file mode 100644 index 50fc2dbb1b26..000000000000 --- a/Zend/tests/bug65372.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #65372 (Segfault in gc_zval_possible_root when return reference fails) ---FILE-- -Manager = $this; - } - - public static function &GetCurrent() - { - return ChildClass::Get(); - } - - public static function &Get() - { - return parent::Get(); - } -} - -$staff = ChildClass::GetCurrent(); -?> ---EXPECTF-- -Notice: Only variable references should be returned by reference in %sbug65372.php on line 30 diff --git a/Zend/tests/bug65579.phpt b/Zend/tests/bug65579.phpt deleted file mode 100644 index 25d74ed4f5ee..000000000000 --- a/Zend/tests/bug65579.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #65579 (Using traits with get_class_methods causes segfault) ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(10) "testMethod" - [1]=> - string(25) "testmethodfromparenttrait" -} diff --git a/Zend/tests/closure_044.phpt b/Zend/tests/closure_044.phpt index 8fdef135dc08..d2644c0401f5 100644 --- a/Zend/tests/closure_044.phpt +++ b/Zend/tests/closure_044.phpt @@ -3,7 +3,7 @@ Closure 044: Scope/bounding combination invariants; non static closures --FILE-- ---EXPECT-- -a=0 -a=0, b=1 -a=0, b=1, c=2 -Done diff --git a/Zend/tests/closure_048.phpt b/Zend/tests/closure_048.phpt deleted file mode 100644 index 40f2e2fbac8f..000000000000 --- a/Zend/tests/closure_048.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Closure 048: Use in preg_replace_callback() using variables by reference ---FILE-- - ---EXPECT-- -a=0 -a=0, b=1 -a=0, b=1, c=2 -Done diff --git a/Zend/tests/gc_007.phpt b/Zend/tests/gc_007.phpt index a018e4846df6..8601ea43b151 100644 --- a/Zend/tests/gc_007.phpt +++ b/Zend/tests/gc_007.phpt @@ -1,5 +1,5 @@ --TEST-- -GC 007: Unreferenced array cycle +GC 007: Unreferensed array cycle --INI-- zend.enable_gc=1 --FILE-- diff --git a/Zend/tests/gc_008.phpt b/Zend/tests/gc_008.phpt index 4e27e5b70ad3..289d581d6068 100644 --- a/Zend/tests/gc_008.phpt +++ b/Zend/tests/gc_008.phpt @@ -1,5 +1,5 @@ --TEST-- -GC 008: Unreferenced object cycle +GC 008: Unreferensed object cycle --INI-- zend.enable_gc=1 --FILE-- diff --git a/Zend/tests/gc_009.phpt b/Zend/tests/gc_009.phpt index 3f4657d2e31b..263d31f45b9f 100644 --- a/Zend/tests/gc_009.phpt +++ b/Zend/tests/gc_009.phpt @@ -1,5 +1,5 @@ --TEST-- -GC 009: Unreferenced array-object cycle +GC 009: Unreferensed array-object cycle --INI-- zend.enable_gc=1 --FILE-- diff --git a/Zend/tests/generators/bug65035.phpt b/Zend/tests/generators/bug65035.phpt deleted file mode 100644 index 18276cc23ad4..000000000000 --- a/Zend/tests/generators/bug65035.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #65035: yield / exit segfault ---FILE-- -current(); - -?> ---EXPECT-- -Done diff --git a/Zend/tests/generators/bug65161.phpt b/Zend/tests/generators/bug65161.phpt deleted file mode 100644 index 215c1880e3a6..000000000000 --- a/Zend/tests/generators/bug65161.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #65161: Generator + autoload + syntax error = segfault ---FILE-- - ---EXPECTF-- -Fatal error: Call to undefined function foo() in %s on line %d diff --git a/Zend/tests/generators/yield_without_value.phpt b/Zend/tests/generators/yield_without_value.phpt index 52292b737c75..510c755bd3fe 100644 --- a/Zend/tests/generators/yield_without_value.phpt +++ b/Zend/tests/generators/yield_without_value.phpt @@ -9,13 +9,13 @@ function recv() { } } -$receiver = recv(); -var_dump($receiver->current()); -$receiver->send(1); -var_dump($receiver->current()); -$receiver->send(2); -var_dump($receiver->current()); -$receiver->send(3); +$reciever = recv(); +var_dump($reciever->current()); +$reciever->send(1); +var_dump($reciever->current()); +$reciever->send(2); +var_dump($reciever->current()); +$reciever->send(3); ?> --EXPECT-- diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt deleted file mode 100644 index 2d9b59c1e803..000000000000 --- a/Zend/tests/incompat_ctx_user.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Incompatible context call (non-internal function) ---INI-- -error_reporting=E_ALL ---FILE-- -bar(); - -?> ---EXPECTF-- -Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d -string(1) "B" diff --git a/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt b/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt index 0bbea110055d..fc09a367bde9 100644 --- a/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt +++ b/Zend/tests/traits/bugs/overridding-conflicting-methods.phpt @@ -1,5 +1,5 @@ --TEST-- -Overriding Conflicting Methods should not result in a notice/warning about collisions +Overridding Conflicting Methods should not result in a notice/warning about collisions --FILE-- refcount++; @@ -2847,8 +2842,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca } if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0 && (fcc->calling_scope && - ((fcc->object_ptr && fcc->calling_scope->__call) || - (!fcc->object_ptr && fcc->calling_scope->__callstatic)))) { + (fcc->calling_scope->__call || + fcc->calling_scope->__callstatic))) { if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) { if (!zend_check_private(fcc->function_handler, fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) { retval = 0; @@ -3985,16 +3980,15 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name { zend_trait_alias *alias, **alias_ptr; - if ((alias_ptr = ce->trait_aliases)) { - alias = *alias_ptr; - while (alias) { - if (alias->alias_len == len && - !strncasecmp(name, alias->alias, alias->alias_len)) { - return alias->alias; - } - alias_ptr++; - alias = *alias_ptr; + alias_ptr = ce->trait_aliases; + alias = *alias_ptr; + while (alias) { + if (alias->alias_len == len && + !strncasecmp(name, alias->alias, alias->alias_len)) { + return alias->alias; } + alias_ptr++; + alias = *alias_ptr; } return name; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 16e766d8a51e..26aa1e6b1773 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache { #define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags) #define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0) -#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0) +#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0) #define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0) #define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED) #define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0) @@ -465,7 +465,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; */ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC); -/** Clear arguments connected with zend_fcall_info *fci +/** Clear argumens connected with zend_fcall_info *fci * If free_mem is not zero then the params array gets free'd as well */ ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem); @@ -503,7 +503,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...); /** Call a function using information created by zend_fcall_info_init()/args(). - * If args is given then those replace the argument info in fci is temporarily. + * If args is given then those replace the arguement info in fci is temporarily. */ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC); @@ -594,20 +594,22 @@ END_EXTERN_C() Z_TYPE_P(__z) = IS_STRING; \ } while (0) -#define ZVAL_ZVAL(z, zv, copy, dtor) do { \ - zval *__z = (z); \ - zval *__zv = (zv); \ - ZVAL_COPY_VALUE(__z, __zv); \ +#define ZVAL_ZVAL(z, zv, copy, dtor) { \ + zend_uchar is_ref = Z_ISREF_P(z); \ + zend_uint refcount = Z_REFCOUNT_P(z); \ + ZVAL_COPY_VALUE(z, zv); \ if (copy) { \ - zval_copy_ctor(__z); \ + zval_copy_ctor(z); \ } \ if (dtor) { \ if (!copy) { \ - ZVAL_NULL(__zv); \ + ZVAL_NULL(zv); \ } \ - zval_ptr_dtor(&__zv); \ + zval_ptr_dtor(&zv); \ } \ - } while (0) + Z_SET_ISREF_TO_P(z, is_ref); \ + Z_SET_REFCOUNT_P(z, refcount); \ + } #define ZVAL_FALSE(z) ZVAL_BOOL(z, 0) #define ZVAL_TRUE(z) ZVAL_BOOL(z, 1) @@ -636,18 +638,6 @@ END_EXTERN_C() #define RETURN_FALSE { RETVAL_FALSE; return; } #define RETURN_TRUE { RETVAL_TRUE; return; } -#define RETVAL_ZVAL_FAST(z) do { \ - zval *_z = (z); \ - if (Z_ISREF_P(_z)) { \ - RETVAL_ZVAL(_z, 1, 0); \ - } else { \ - zval_ptr_dtor(&return_value); \ - Z_ADDREF_P(_z); \ - *return_value_ptr = _z; \ - } \ -} while (0) -#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; } - #define SET_VAR_STRING(n, v) { \ { \ zval *var; \ diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index bf9d00043773..c6aee57a73d9 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2465,7 +2465,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) size_t res = nmemb; unsigned long overflow = 0; - __asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1" + __asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1" : "=&a"(res), "=&d" (overflow) : "%0"(res), "rm"(size), @@ -2493,7 +2493,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) __asm__ ("mul" LP_SUFF " %3\n\t" "add %4,%0\n\t" - "adc $0,%1" + "adc %1,%1" : "=&a"(res), "=&d" (overflow) : "%0"(res), "rm"(size), @@ -2535,7 +2535,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset) size_t res; unsigned long overflow; - __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr" + __asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,%1" : "=&r"(res), "=&r"(overflow) : "r"(nmemb), "r"(size), diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1ad64e74eaf4..47fb4d2d9b54 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1399,8 +1399,15 @@ ZEND_FUNCTION(class_alias) return; } - found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC); + if (!autoload) { + lc_name = do_alloca(class_name_len + 1, use_heap); + zend_str_tolower_copy(lc_name, class_name, class_name_len); + found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce); + free_alloca(lc_name, use_heap); + } else { + found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC); + } if (found == SUCCESS) { if ((*ce)->type == ZEND_USER_CLASS) { if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) { @@ -1904,11 +1911,6 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC) zval *name_array = (zval *)arg; zval *const_val; - if (!constant->name) { - /* skip special constants */ - return 0; - } - MAKE_STD_ZVAL(const_val); *const_val = constant->value; zval_copy_ctor(const_val); @@ -1976,16 +1978,11 @@ ZEND_FUNCTION(get_defined_constants) while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) { zval *const_val; - if (!val->name) { - /* skip special constants */ - goto next_constant; - } - if (val->module_number == PHP_USER_CONSTANT) { module_number = i; } else if (val->module_number > i || val->module_number < 0) { /* should not happen */ - goto next_constant; + goto bad_module_id; } else { module_number = val->module_number; } @@ -2002,7 +1999,7 @@ ZEND_FUNCTION(get_defined_constants) INIT_PZVAL(const_val); add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val); -next_constant: +bad_module_id: zend_hash_move_forward_ex(EG(zend_constants), &pos); } efree(module_names); @@ -2374,7 +2371,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int MAKE_STD_ZVAL(arg_array); array_init(arg_array); - /* include_filename always points to the last filename of the last last called-function. + /* include_filename always points to the last filename of the last last called-fuction. if we have called include in the frame above - this is the file we have included. */ diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index fcad86f17105..5faefbd2241a 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -59,8 +59,14 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ } else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) { RETVAL_FALSE; } else if (closure_result_ptr) { - zval_ptr_dtor(&return_value); - *return_value_ptr = closure_result_ptr; + if (Z_ISREF_P(closure_result_ptr) && return_value_ptr) { + if (return_value) { + zval_ptr_dtor(&return_value); + } + *return_value_ptr = closure_result_ptr; + } else { + RETVAL_ZVAL(closure_result_ptr, 1, 1); + } } efree(arguments); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f250b2be2087..862f82da01d1 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1734,7 +1734,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n } { - /* Push a separator to the switch stack */ + /* Push a seperator to the switch stack */ zend_switch_entry switch_entry; switch_entry.cond.op_type = IS_UNUSED; @@ -1828,7 +1828,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /* CG(active_op_array) = function_token->u.op_array; - /* Pop the switch and foreach separators */ + /* Pop the switch and foreach seperators */ zend_stack_del_top(&CG(switch_cond_stack)); zend_stack_del_top(&CG(foreach_copy_stack)); } @@ -2671,7 +2671,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /* { zend_op *opline; - /* If we reach the separator then stop applying the stack */ + /* If we reach the seperator then stop applying the stack */ if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) { return 1; } @@ -3464,11 +3464,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); + zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC)); } } else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { - char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC); + char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC); zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype); efree(method_prototype); } @@ -3941,7 +3941,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const #endif } else { /* inherited members are overridden by members inserted by traits */ - /* check whether the trait method fulfills the inheritance requirements */ + /* check whether the trait method fullfills the inheritance requirements */ do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); } } @@ -4108,7 +4108,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* /** With the other traits, we are more permissive. We do not give errors for those. This allows to be more defensive in such definitions. - However, we want to make sure that the insteadof declaration + However, we want to make sure that the insteadof declartion is consistent in itself. */ j = 0; @@ -5687,7 +5687,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */ break; } SET_NODE(opline->op1, cmd); - opline->op2.opline_num = 1; + opline->op2.opline_num = 0; opline->extended_value = ZEND_DO_FCALL; SET_UNUSED(opline->op2); @@ -7176,7 +7176,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len) } #elif defined(NETWARE) /* - * Find the first occurrence of : from the left + * Find the first occurence of : from the left * move the path pointer to the position just after : * increment the len_adjust to the length of path till colon character(inclusive) * If there is no character beyond : simple return len diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 594559d58bf0..21580d3d5f60 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -25,7 +25,7 @@ #include "zend_variables.h" #include "zend_operators.h" #include "zend_globals.h" -#include "zend_API.h" + void free_zend_constant(zend_constant *c) { @@ -119,12 +119,42 @@ void zend_register_standard_constants(TSRMLS_D) REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS); /* true/false constants */ { - REGISTER_MAIN_BOOL_CONSTANT("TRUE", 1, CONST_PERSISTENT | CONST_CT_SUBST); - REGISTER_MAIN_BOOL_CONSTANT("FALSE", 0, CONST_PERSISTENT | CONST_CT_SUBST); - REGISTER_MAIN_BOOL_CONSTANT("ZEND_THREAD_SAFE", ZTS_V, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_BOOL_CONSTANT("ZEND_DEBUG_BUILD", ZEND_DEBUG, CONST_PERSISTENT | CONST_CS); + zend_constant c; + + c.flags = CONST_PERSISTENT | CONST_CT_SUBST; + c.module_number = 0; + + c.name = zend_strndup(ZEND_STRL("TRUE")); + c.name_len = sizeof("TRUE"); + c.value.value.lval = 1; + c.value.type = IS_BOOL; + zend_register_constant(&c TSRMLS_CC); + + c.name = zend_strndup(ZEND_STRL("FALSE")); + c.name_len = sizeof("FALSE"); + c.value.value.lval = 0; + c.value.type = IS_BOOL; + zend_register_constant(&c TSRMLS_CC); + + c.name = zend_strndup(ZEND_STRL("NULL")); + c.name_len = sizeof("NULL"); + c.value.type = IS_NULL; + zend_register_constant(&c TSRMLS_CC); + + c.flags = CONST_PERSISTENT | CONST_CS; + + c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE")); + c.name_len = sizeof("ZEND_THREAD_SAFE"); + c.value.value.lval = ZTS_V; + c.value.type = IS_BOOL; + zend_register_constant(&c TSRMLS_CC); + + c.name = zend_strndup(ZEND_STRL("ZEND_DEBUG_BUILD")); + c.name_len = sizeof("ZEND_DEBUG_BUILD"); + c.value.value.lval = ZEND_DEBUG; + c.value.type = IS_BOOL; + zend_register_constant(&c TSRMLS_CC); } - REGISTER_MAIN_NULL_CONSTANT("NULL", CONST_PERSISTENT | CONST_CT_SUBST); } @@ -145,35 +175,13 @@ void clean_non_persistent_constants(TSRMLS_D) } } -ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC) -{ - zend_constant c; - - ZVAL_NULL(&c.value); - c.flags = flags; - c.name = zend_strndup(name, name_len-1); - c.name_len = name_len; - c.module_number = module_number; - zend_register_constant(&c TSRMLS_CC); -} - -ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC) -{ - zend_constant c; - - ZVAL_BOOL(&c.value, bval); - c.flags = flags; - c.name = zend_strndup(name, name_len-1); - c.name_len = name_len; - c.module_number = module_number; - zend_register_constant(&c TSRMLS_CC); -} ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC) { zend_constant c; - ZVAL_LONG(&c.value, lval); + c.value.type = IS_LONG; + c.value.value.lval = lval; c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; @@ -186,7 +194,8 @@ ZEND_API void zend_register_double_constant(const char *name, uint name_len, dou { zend_constant c; - ZVAL_DOUBLE(&c.value, dval); + c.value.type = IS_DOUBLE; + c.value.value.dval = dval; c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; @@ -199,7 +208,9 @@ ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, ch { zend_constant c; - ZVAL_STRINGL(&c.value, strval, strlen, 0); + c.value.type = IS_STRING; + c.value.value.str.val = strval; + c.value.value.str.len = strlen; c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index 718c173cc7b9..c7261946c826 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -38,22 +38,16 @@ typedef struct _zend_constant { int module_number; } zend_constant; -#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), module_number TSRMLS_CC) -#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), module_number TSRMLS_CC) #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC) #define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC) #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC) #define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC) -#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC) -#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC) #define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC) -#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), 0 TSRMLS_CC) -#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC) @@ -68,8 +62,6 @@ void zend_register_standard_constants(TSRMLS_D); void clean_non_persistent_constants(TSRMLS_D); ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC); ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC); -ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC); -ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC); diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c index 51bd1f421c5e..165172ad1eb4 100644 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@ -24,7 +24,7 @@ #ifdef HAVE_DTRACE /* PHP DTrace probes {{{ */ -static inline const char *dtrace_get_executed_filename(TSRMLS_D) +static inline char *dtrace_get_executed_filename(TSRMLS_D) { if (EG(current_execute_data) && EG(current_execute_data)->op_array) { return EG(current_execute_data)->op_array->filename; @@ -36,9 +36,9 @@ static inline const char *dtrace_get_executed_filename(TSRMLS_D) ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) { zend_op_array *res; - DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename); + DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename); res = compile_file(file_handle, type TSRMLS_CC); - DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename); + DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename); return res; } @@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC) { int lineno; - const char *scope, *filename, *funcname, *classname; + char *scope, *filename, *funcname, *classname; scope = filename = funcname = classname = NULL; /* we need filename and lineno for both execute and function probes */ @@ -58,46 +58,48 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC) } if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) { + filename = dtrace_get_executed_filename(TSRMLS_C); classname = get_active_class_name(&scope TSRMLS_CC); funcname = get_active_function_name(TSRMLS_C); + lineno = zend_get_executed_lineno(TSRMLS_C); } if (DTRACE_EXECUTE_ENTRY_ENABLED()) { - DTRACE_EXECUTE_ENTRY((char *)filename, lineno); + DTRACE_EXECUTE_ENTRY(filename, lineno); } if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) { - DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); + DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope); } execute_ex(execute_data TSRMLS_CC); if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) { - DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); + DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope); } if (DTRACE_EXECUTE_RETURN_ENABLED()) { - DTRACE_EXECUTE_RETURN((char *)filename, lineno); + DTRACE_EXECUTE_RETURN(filename, lineno); } } ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { int lineno; - const char *filename; + char *filename; if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) { filename = dtrace_get_executed_filename(TSRMLS_C); lineno = zend_get_executed_lineno(TSRMLS_C); } if (DTRACE_EXECUTE_ENTRY_ENABLED()) { - DTRACE_EXECUTE_ENTRY((char *)filename, lineno); + DTRACE_EXECUTE_ENTRY(filename, lineno); } execute_internal(execute_data_ptr, fci, return_value_used TSRMLS_CC); if (DTRACE_EXECUTE_RETURN_ENABLED()) { - DTRACE_EXECUTE_RETURN((char *)filename, lineno); + DTRACE_EXECUTE_RETURN(filename, lineno); } } diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 14ae75e38d09..f457b2846f9e 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ { #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_THROWN_ENABLED()) { - const char *classname; - zend_uint name_len; + char *classname; + int name_len; if (exception != NULL) { zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC); - DTRACE_EXCEPTION_THROWN((char *)classname); + DTRACE_EXCEPTION_THROWN(classname); } else { DTRACE_EXCEPTION_THROWN(NULL); } @@ -817,10 +817,6 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* { if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) { file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC); line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC); - - convert_to_string(file); - file = (Z_STRLEN_P(file) > 0) ? file : NULL; - line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL; } else { file = NULL; line = NULL; @@ -832,11 +828,7 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* { file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC); line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC); - convert_to_string(str); - convert_to_string(file); - convert_to_long(line); - - zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str)); + zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str)); } else { zend_error(severity, "Uncaught exception '%s'", ce_exception->name); } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 048c1fc18495..a65f5331de43 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -183,7 +183,8 @@ static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_exec { zval *ptr = EX_T(var).var.ptr; - return should_free->var = ptr; + PZVAL_UNLOCK(ptr, should_free); + return ptr; } static zend_never_inline zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, int type TSRMLS_DC) @@ -385,19 +386,6 @@ static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const zend return ptr_ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_var_fast(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) -{ - zval** ptr_ptr = EX_T(var).var.ptr_ptr; - - if (EXPECTED(ptr_ptr != NULL)) { - should_free->var = *ptr_ptr; - } else { - /* string offset */ - should_free->var = EX_T(var).str_offset.str; - } - return ptr_ptr; -} - static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC) { zval ***ptr = EX_CV_NUM(EG(current_execute_data), var); @@ -921,7 +909,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value } else { /* we need to split */ Z_DELREF_P(variable_ptr); GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr); - if (PZVAL_IS_REF(value)) { + if (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) { ALLOC_ZVAL(variable_ptr); *variable_ptr_ptr = variable_ptr; INIT_PZVAL_COPY(variable_ptr, value); @@ -930,6 +918,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value } else { *variable_ptr_ptr = value; Z_ADDREF_P(value); + Z_UNSET_ISREF_P(value); return value; } } @@ -1487,17 +1476,15 @@ ZEND_API opcode_handler_t *zend_opcode_handlers; ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { - if (fci != NULL) { - execute_data_ptr->function_state.function->internal_function.handler( - fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, - fci->object_ptr, 1 TSRMLS_CC - ); + if(fci != NULL) { + ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count, + *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); + } else { zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr; - execute_data_ptr->function_state.function->internal_function.handler( - execute_data_ptr->opline->extended_value, *return_value_ptr, return_value_ptr, - execute_data_ptr->object, return_value_used TSRMLS_CC - ); + ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr, + (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL, + execute_data_ptr->object, return_value_used TSRMLS_CC); } } diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ff0758772e48..a17f10b312e5 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -293,7 +293,7 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC void **end = p - (int)(zend_uintptr_t)*p; while (p != end) { - zval *q = (zval *) *(--p); + zval *q = *(zval **)(--p); *p = NULL; i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0b29086a0d5d..8739e21c2b9f 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -254,13 +254,15 @@ void shutdown_executor(TSRMLS_D) /* {{{ */ if (EG(user_error_handler)) { zeh = EG(user_error_handler); EG(user_error_handler) = NULL; - zval_ptr_dtor(&zeh); + zval_dtor(zeh); + FREE_ZVAL(zeh); } if (EG(user_exception_handler)) { zeh = EG(user_exception_handler); EG(user_exception_handler) = NULL; - zval_ptr_dtor(&zeh); + zval_dtor(zeh); + FREE_ZVAL(zeh); } zend_stack_destroy(&EG(user_error_handlers_error_reporting)); @@ -952,9 +954,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (EX(function_state).function->common.scope) { EG(scope) = EX(function_state).function->common.scope; } - if (EXPECTED(zend_execute_internal == NULL)) { + if(EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ - EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); + ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC); } @@ -1054,7 +1056,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_ } /* The compiler is not-reentrant. Make sure we __autoload() only during run-time - * (doesn't impact functionality of __autoload() + * (doesn't impact fuctionality of __autoload() */ if (!use_autoload || zend_is_compiling(TSRMLS_C)) { if (!key) { diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index 3483e9dbf011..a443032686f6 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -106,7 +106,7 @@ typedef struct _zend_gc_globals { gc_root_buffer *first_unused; /* pointer to first unused buffer */ gc_root_buffer *last_unused; /* pointer to last unused buffer */ - zval_gc_info *zval_to_free; /* temporary list of zvals to free */ + zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */ zval_gc_info *free_list; zval_gc_info *next_to_free; @@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS GC_ZVAL_INIT(z); \ } while (0) -/* The following macros override macros from zend_alloc.h */ +/* The following macroses override macroses from zend_alloc.h */ #undef ALLOC_ZVAL #define ALLOC_ZVAL(z) \ do { \ diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index c6b211ae4d7a..d189148f47fc 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -55,12 +55,6 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished zval_ptr_dtor(&execute_data->current_this); } - /* A fatal error / die occurred during the generator execution. Trying to clean - * up the stack may not be safe in this case. */ - if (CG(unclean_shutdown)) { - return; - } - /* If the generator is closed before it can finish execution (reach * a return statement) we have to free loop variables manually, as * we don't know whether the SWITCH_FREE / FREE opcodes have run */ @@ -430,7 +424,7 @@ ZEND_METHOD(Generator, current) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL_FAST(generator->value); + RETURN_ZVAL(generator->value, 1, 0); } } /* }}} */ @@ -450,7 +444,7 @@ ZEND_METHOD(Generator, key) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->key) { - RETURN_ZVAL_FAST(generator->key); + RETURN_ZVAL(generator->key, 1, 0); } } /* }}} */ @@ -499,7 +493,7 @@ ZEND_METHOD(Generator, send) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL_FAST(generator->value); + RETURN_ZVAL(generator->value, 1, 0); } } /* }}} */ @@ -532,7 +526,7 @@ ZEND_METHOD(Generator, throw) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL_FAST(generator->value); + RETURN_ZVAL(generator->value, 1, 0); } } else { /* If the generator is already closed throw the exception in the diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index b9a5b39914a6..800bdc7f66bc 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -302,7 +302,7 @@ struct _zend_php_scanner_globals { unsigned char *script_filtered; size_t script_filtered_size; - /* input/output filters */ + /* input/ouput filters */ zend_encoding_filter input_filter; zend_encoding_filter output_filter; const zend_encoding *script_encoding; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index ae7d8402f4bd..27b603eed2d3 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -96,7 +96,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin zend_hash_do_resize(ht); \ } -static void zend_hash_do_resize(HashTable *ht); +static int zend_hash_do_resize(HashTable *ht); ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) { @@ -128,6 +128,10 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) (p)->pData = &(p)->pDataPtr; \ } else { \ (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\ + if (!(p)->pData) { \ + pefree_rel(p, (ht)->persistent); \ + return FAILURE; \ + } \ memcpy((p)->pData, pData, nDataSize); \ (p)->pDataPtr=NULL; \ } @@ -241,9 +245,15 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe if (IS_INTERNED(arKey)) { p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent); + if (!p) { + return FAILURE; + } p->arKey = arKey; } else { p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent); + if (!p) { + return FAILURE; + } p->arKey = (const char*)(p + 1); memcpy((char*)p->arKey, arKey, nKeyLength); } @@ -312,9 +322,15 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui if (IS_INTERNED(arKey)) { p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent); + if (!p) { + return FAILURE; + } p->arKey = arKey; } else { p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent); + if (!p) { + return FAILURE; + } p->arKey = (const char*)(p + 1); memcpy((char*)p->arKey, arKey, nKeyLength); } @@ -394,6 +410,9 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void p = p->pNext; } p = (Bucket *) pemalloc_rel(sizeof(Bucket), ht->persistent); + if (!p) { + return FAILURE; + } p->arKey = NULL; p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */ p->h = h; @@ -418,7 +437,7 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void } -static void zend_hash_do_resize(HashTable *ht) +static int zend_hash_do_resize(HashTable *ht) { Bucket **t; #ifdef ZEND_SIGNALS @@ -428,14 +447,19 @@ static void zend_hash_do_resize(HashTable *ht) IS_CONSISTENT(ht); if ((ht->nTableSize << 1) > 0) { /* Let's double the table size */ - t = (Bucket **) perealloc(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent); - HANDLE_BLOCK_INTERRUPTIONS(); - ht->arBuckets = t; - ht->nTableSize = (ht->nTableSize << 1); - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - HANDLE_UNBLOCK_INTERRUPTIONS(); + t = (Bucket **) perealloc_recoverable(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent); + if (t) { + HANDLE_BLOCK_INTERRUPTIONS(); + ht->arBuckets = t; + ht->nTableSize = (ht->nTableSize << 1); + ht->nTableMask = ht->nTableSize - 1; + zend_hash_rehash(ht); + HANDLE_UNBLOCK_INTERRUPTIONS(); + return SUCCESS; + } + return FAILURE; } + return SUCCESS; } ZEND_API int zend_hash_rehash(HashTable *ht) @@ -503,7 +527,6 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n if (ht->pInternalPointer == p) { ht->pInternalPointer = p->pListNext; } - ht->nNumOfElements--; if (ht->pDestructor) { ht->pDestructor(p->pData); } @@ -512,6 +535,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n } pefree(p, ht->persistent); HANDLE_UNBLOCK_INTERRUPTIONS(); + ht->nNumOfElements--; return SUCCESS; } p = p->pNext; @@ -1144,7 +1168,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, return HASH_KEY_IS_LONG; } } - return HASH_KEY_NON_EXISTENT; + return HASH_KEY_NON_EXISTANT; } ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { @@ -1181,7 +1205,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos) return HASH_KEY_IS_LONG; } } - return HASH_KEY_NON_EXISTENT; + return HASH_KEY_NON_EXISTANT; } @@ -1296,7 +1320,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const if (ht->pInternalPointer == p) { ht->pInternalPointer = p->pListNext; } - ht->nNumOfElements--; if (ht->pDestructor) { ht->pDestructor(p->pData); } @@ -1304,6 +1327,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const pefree(p->pData, ht->persistent); } pefree(p, ht->persistent); + ht->nNumOfElements--; HANDLE_UNBLOCK_INTERRUPTIONS(); return FAILURE; } @@ -1331,7 +1355,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const if (ht->pInternalPointer == q) { ht->pInternalPointer = q->pListNext; } - ht->nNumOfElements--; if (ht->pDestructor) { ht->pDestructor(q->pData); } @@ -1339,6 +1362,7 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const pefree(q->pData, ht->persistent); } pefree(q, ht->persistent); + ht->nNumOfElements--; } if (p->pNext) { @@ -1425,6 +1449,9 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, return SUCCESS; } arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent); + if (!arTmp) { + return FAILURE; + } p = ht->pListHead; i = 0; while (p) { diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 69732cd59753..a0c147f39782 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -27,8 +27,7 @@ #define HASH_KEY_IS_STRING 1 #define HASH_KEY_IS_LONG 2 -#define HASH_KEY_NON_EXISTENT 3 -#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */ +#define HASH_KEY_NON_EXISTANT 3 #define HASH_UPDATE (1<<0) #define HASH_ADD (1<<1) @@ -173,7 +172,7 @@ ZEND_API ulong zend_hash_next_free_element(const HashTable *ht); /* traversing */ #define zend_hash_has_more_elements_ex(ht, pos) \ - (zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS) + (zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTANT ? FAILURE : SUCCESS) ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos); ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos); ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos); diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index deb799ab763b..9a62a9c04598 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -260,8 +260,6 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) SCNG(input_filter) = lex_state->input_filter; SCNG(output_filter) = lex_state->output_filter; SCNG(script_encoding) = lex_state->script_encoding; - - RESET_DOC_COMMENT(); } ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) @@ -545,7 +543,6 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) CG(zend_lineno) = 1; } - RESET_DOC_COMMENT(); CG(increment_lineno) = 0; return SUCCESS; } @@ -590,7 +587,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR compiler_result = zendparse(TSRMLS_C); zend_do_return(&retval_znode, 0 TSRMLS_CC); CG(in_compilation) = original_in_compilation; - if (compiler_result != 0) { /* parser error */ + if (compiler_result==1) { /* parser error */ zend_bailout(); } compilation_successful=1; @@ -696,7 +693,6 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D zend_set_compiled_filename(filename TSRMLS_CC); CG(zend_lineno) = 1; CG(increment_lineno) = 0; - RESET_DOC_COMMENT(); return SUCCESS; } @@ -766,7 +762,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) SCNG(script_filtered) = NULL; } - if (compiler_result != 0) { + if (compiler_result==1) { CG(active_op_array) = original_active_op_array; CG(unclean_shutdown)=1; destroy_op_array(op_array TSRMLS_CC); @@ -1006,7 +1002,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yymore_restart: -#line 1010 "Zend/zend_language_scanner.c" +#line 1006 "Zend/zend_language_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1105,7 +1101,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1807 "Zend/zend_language_scanner.l" +#line 1803 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1165,7 +1161,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; } -#line 1169 "Zend/zend_language_scanner.c" +#line 1165 "Zend/zend_language_scanner.c" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1183,7 +1179,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy6: YYDEBUG(6, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1795 "Zend/zend_language_scanner.l" +#line 1791 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1195,14 +1191,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) goto inline_char_handler; } } -#line 1199 "Zend/zend_language_scanner.c" +#line 1195 "Zend/zend_language_scanner.c" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy43; YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1772 "Zend/zend_language_scanner.l" +#line 1768 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1214,7 +1210,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) goto inline_char_handler; } } -#line 1218 "Zend/zend_language_scanner.c" +#line 1214 "Zend/zend_language_scanner.c" yy9: YYDEBUG(9, *YYCURSOR); yych = *++YYCURSOR; @@ -1400,7 +1396,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(38, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1732 "Zend/zend_language_scanner.l" +#line 1728 "Zend/zend_language_scanner.l" { YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1)); @@ -1417,7 +1413,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1421 "Zend/zend_language_scanner.c" +#line 1417 "Zend/zend_language_scanner.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; @@ -1444,7 +1440,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(44, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1750 "Zend/zend_language_scanner.l" +#line 1746 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1456,13 +1452,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) goto inline_char_handler; } } -#line 1460 "Zend/zend_language_scanner.c" +#line 1456 "Zend/zend_language_scanner.c" yy45: YYDEBUG(45, *YYCURSOR); ++YYCURSOR; YYDEBUG(46, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1763 "Zend/zend_language_scanner.l" +#line 1759 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1470,7 +1466,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } -#line 1474 "Zend/zend_language_scanner.c" +#line 1470 "Zend/zend_language_scanner.c" yy47: YYDEBUG(47, *YYCURSOR); yych = *++YYCURSOR; @@ -1497,7 +1493,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy51: YYDEBUG(51, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1785 "Zend/zend_language_scanner.l" +#line 1781 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1506,7 +1502,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1510 "Zend/zend_language_scanner.c" +#line 1506 "Zend/zend_language_scanner.c" yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; @@ -1577,7 +1573,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2258 "Zend/zend_language_scanner.l" +#line 2254 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1618,7 +1614,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1622 "Zend/zend_language_scanner.c" +#line 1618 "Zend/zend_language_scanner.c" yy57: YYDEBUG(57, *YYCURSOR); yych = *++YYCURSOR; @@ -1629,12 +1625,12 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2202 "Zend/zend_language_scanner.l" +#line 2198 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; } -#line 1638 "Zend/zend_language_scanner.c" +#line 1634 "Zend/zend_language_scanner.c" yy60: YYDEBUG(60, *YYCURSOR); yych = *++YYCURSOR; @@ -1644,14 +1640,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(62, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1655 "Zend/zend_language_scanner.c" +#line 1651 "Zend/zend_language_scanner.c" yy63: YYDEBUG(63, *YYCURSOR); yyaccept = 0; @@ -1667,24 +1663,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1677 "Zend/zend_language_scanner.c" +#line 1673 "Zend/zend_language_scanner.c" yy66: YYDEBUG(66, *YYCURSOR); ++YYCURSOR; YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1688 "Zend/zend_language_scanner.c" +#line 1684 "Zend/zend_language_scanner.c" yy68: YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; @@ -1698,7 +1694,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(71, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1706,7 +1702,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1710 "Zend/zend_language_scanner.c" +#line 1706 "Zend/zend_language_scanner.c" yy72: YYDEBUG(72, *YYCURSOR); yych = *++YYCURSOR; @@ -1724,7 +1720,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(74, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1732,7 +1728,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1736 "Zend/zend_language_scanner.c" +#line 1732 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1800,7 +1796,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2208 "Zend/zend_language_scanner.l" +#line 2204 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1849,7 +1845,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1853 "Zend/zend_language_scanner.c" +#line 1849 "Zend/zend_language_scanner.c" yy79: YYDEBUG(79, *YYCURSOR); yych = *++YYCURSOR; @@ -1860,12 +1856,12 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2197 "Zend/zend_language_scanner.l" +#line 2193 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; } -#line 1869 "Zend/zend_language_scanner.c" +#line 1865 "Zend/zend_language_scanner.c" yy82: YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; @@ -1875,14 +1871,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(84, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1886 "Zend/zend_language_scanner.c" +#line 1882 "Zend/zend_language_scanner.c" yy85: YYDEBUG(85, *YYCURSOR); yyaccept = 0; @@ -1898,24 +1894,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1908 "Zend/zend_language_scanner.c" +#line 1904 "Zend/zend_language_scanner.c" yy88: YYDEBUG(88, *YYCURSOR); ++YYCURSOR; YYDEBUG(89, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1919 "Zend/zend_language_scanner.c" +#line 1915 "Zend/zend_language_scanner.c" yy90: YYDEBUG(90, *YYCURSOR); yych = *++YYCURSOR; @@ -1929,7 +1925,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(93, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1937,7 +1933,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1941 "Zend/zend_language_scanner.c" +#line 1937 "Zend/zend_language_scanner.c" yy94: YYDEBUG(94, *YYCURSOR); yych = *++YYCURSOR; @@ -1955,7 +1951,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(96, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1963,7 +1959,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1967 "Zend/zend_language_scanner.c" +#line 1963 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_END_HEREDOC: @@ -1974,7 +1970,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2175 "Zend/zend_language_scanner.l" +#line 2171 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1987,7 +1983,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_IN_SCRIPTING); return T_END_HEREDOC; } -#line 1991 "Zend/zend_language_scanner.c" +#line 1987 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_HEREDOC: { @@ -2049,7 +2045,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy104: YYDEBUG(104, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2300 "Zend/zend_language_scanner.l" +#line 2296 "Zend/zend_language_scanner.l" { int newline = 0; @@ -2122,7 +2118,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 2126 "Zend/zend_language_scanner.c" +#line 2122 "Zend/zend_language_scanner.c" yy105: YYDEBUG(105, *YYCURSOR); yych = *++YYCURSOR; @@ -2137,14 +2133,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(108, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 2148 "Zend/zend_language_scanner.c" +#line 2144 "Zend/zend_language_scanner.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; @@ -2160,24 +2156,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy111: YYDEBUG(111, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2170 "Zend/zend_language_scanner.c" +#line 2166 "Zend/zend_language_scanner.c" yy112: YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYDEBUG(113, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 2181 "Zend/zend_language_scanner.c" +#line 2177 "Zend/zend_language_scanner.c" yy114: YYDEBUG(114, *YYCURSOR); yych = *++YYCURSOR; @@ -2191,7 +2187,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(117, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -2199,7 +2195,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2203 "Zend/zend_language_scanner.c" +#line 2199 "Zend/zend_language_scanner.c" yy118: YYDEBUG(118, *YYCURSOR); yych = *++YYCURSOR; @@ -2217,7 +2213,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(120, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -2225,7 +2221,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2229 "Zend/zend_language_scanner.c" +#line 2225 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_IN_SCRIPTING: @@ -2408,13 +2404,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy124: YYDEBUG(124, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1908 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 2418 "Zend/zend_language_scanner.c" +#line 2414 "Zend/zend_language_scanner.c" yy125: YYDEBUG(125, *YYCURSOR); yych = *++YYCURSOR; @@ -2646,11 +2642,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy139: YYDEBUG(139, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1454 "Zend/zend_language_scanner.l" +#line 1450 "Zend/zend_language_scanner.l" { return yytext[0]; } -#line 2654 "Zend/zend_language_scanner.c" +#line 2650 "Zend/zend_language_scanner.c" yy140: YYDEBUG(140, *YYCURSOR); ++YYCURSOR; @@ -2659,7 +2655,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy141: YYDEBUG(141, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -2667,7 +2663,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 2671 "Zend/zend_language_scanner.c" +#line 2667 "Zend/zend_language_scanner.c" yy142: YYDEBUG(142, *YYCURSOR); yych = *++YYCURSOR; @@ -2678,11 +2674,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(144, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1214 "Zend/zend_language_scanner.l" +#line 1210 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } -#line 2686 "Zend/zend_language_scanner.c" +#line 2682 "Zend/zend_language_scanner.c" yy145: YYDEBUG(145, *YYCURSOR); yych = *++YYCURSOR; @@ -2910,18 +2906,18 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(169, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1455 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return '{'; } -#line 2919 "Zend/zend_language_scanner.c" +#line 2915 "Zend/zend_language_scanner.c" yy170: YYDEBUG(170, *YYCURSOR); ++YYCURSOR; YYDEBUG(171, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1471 "Zend/zend_language_scanner.l" +#line 1467 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2929,7 +2925,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return '}'; } -#line 2933 "Zend/zend_language_scanner.c" +#line 2929 "Zend/zend_language_scanner.c" yy172: YYDEBUG(172, *YYCURSOR); yyaccept = 2; @@ -2957,7 +2953,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy173: YYDEBUG(173, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1522 "Zend/zend_language_scanner.l" +#line 1518 "Zend/zend_language_scanner.l" { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ zendlval->value.lval = strtol(yytext, NULL, 0); @@ -2978,7 +2974,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_LONG; return T_LNUMBER; } -#line 2982 "Zend/zend_language_scanner.c" +#line 2978 "Zend/zend_language_scanner.c" yy174: YYDEBUG(174, *YYCURSOR); yyaccept = 2; @@ -3006,7 +3002,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy177: YYDEBUG(177, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1919 "Zend/zend_language_scanner.l" +#line 1915 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -3040,14 +3036,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_COMMENT; } -#line 3044 "Zend/zend_language_scanner.c" +#line 3040 "Zend/zend_language_scanner.c" yy178: YYDEBUG(178, *YYCURSOR); ++YYCURSOR; yy179: YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2010 "Zend/zend_language_scanner.l" +#line 2006 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -3115,14 +3111,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return T_CONSTANT_ENCAPSED_STRING; } -#line 3119 "Zend/zend_language_scanner.c" +#line 3115 "Zend/zend_language_scanner.c" yy180: YYDEBUG(180, *YYCURSOR); ++YYCURSOR; yy181: YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2079 "Zend/zend_language_scanner.l" +#line 2075 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -3163,24 +3159,24 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(ST_DOUBLE_QUOTES); return '"'; } -#line 3167 "Zend/zend_language_scanner.c" +#line 3163 "Zend/zend_language_scanner.c" yy182: YYDEBUG(182, *YYCURSOR); ++YYCURSOR; YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2169 "Zend/zend_language_scanner.l" +#line 2165 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; } -#line 3178 "Zend/zend_language_scanner.c" +#line 3174 "Zend/zend_language_scanner.c" yy184: YYDEBUG(184, *YYCURSOR); ++YYCURSOR; YYDEBUG(185, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2428 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -3189,7 +3185,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 3193 "Zend/zend_language_scanner.c" +#line 3189 "Zend/zend_language_scanner.c" yy186: YYDEBUG(186, *YYCURSOR); ++YYCURSOR; @@ -3216,13 +3212,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy190: YYDEBUG(190, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1587 "Zend/zend_language_scanner.l" +#line 1583 "Zend/zend_language_scanner.l" { zendlval->value.dval = zend_strtod(yytext, NULL); zendlval->type = IS_DOUBLE; return T_DNUMBER; } -#line 3226 "Zend/zend_language_scanner.c" +#line 3222 "Zend/zend_language_scanner.c" yy191: YYDEBUG(191, *YYCURSOR); yyaccept = 2; @@ -3314,7 +3310,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(202, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1497 "Zend/zend_language_scanner.l" +#line 1493 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3339,7 +3335,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_DNUMBER; } } -#line 3343 "Zend/zend_language_scanner.c" +#line 3339 "Zend/zend_language_scanner.c" yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -3351,7 +3347,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(205, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1543 "Zend/zend_language_scanner.l" +#line 1539 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3376,7 +3372,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_DNUMBER; } } -#line 3380 "Zend/zend_language_scanner.c" +#line 3376 "Zend/zend_language_scanner.c" yy206: YYDEBUG(206, *YYCURSOR); ++YYCURSOR; @@ -3385,7 +3381,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy207: YYDEBUG(207, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1987 "Zend/zend_language_scanner.l" +#line 1983 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -3393,7 +3389,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } -#line 3397 "Zend/zend_language_scanner.c" +#line 3393 "Zend/zend_language_scanner.c" yy208: YYDEBUG(208, *YYCURSOR); yych = *++YYCURSOR; @@ -3427,13 +3423,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy212: YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 3437 "Zend/zend_language_scanner.c" +#line 3433 "Zend/zend_language_scanner.c" yy213: YYDEBUG(213, *YYCURSOR); yych = *++YYCURSOR; @@ -3447,11 +3443,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(215, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1442 "Zend/zend_language_scanner.l" +#line 1438 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3455 "Zend/zend_language_scanner.c" +#line 3451 "Zend/zend_language_scanner.c" yy216: YYDEBUG(216, *YYCURSOR); ++YYCURSOR; @@ -3460,61 +3456,61 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(217, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1434 "Zend/zend_language_scanner.l" +#line 1430 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3468 "Zend/zend_language_scanner.c" +#line 3464 "Zend/zend_language_scanner.c" yy218: YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYDEBUG(219, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1422 "Zend/zend_language_scanner.l" +#line 1418 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3478 "Zend/zend_language_scanner.c" +#line 3474 "Zend/zend_language_scanner.c" yy220: YYDEBUG(220, *YYCURSOR); ++YYCURSOR; YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1426 "Zend/zend_language_scanner.l" +#line 1422 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3488 "Zend/zend_language_scanner.c" +#line 3484 "Zend/zend_language_scanner.c" yy222: YYDEBUG(222, *YYCURSOR); ++YYCURSOR; YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1418 "Zend/zend_language_scanner.l" +#line 1414 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3498 "Zend/zend_language_scanner.c" +#line 3494 "Zend/zend_language_scanner.c" yy224: YYDEBUG(224, *YYCURSOR); ++YYCURSOR; YYDEBUG(225, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1430 "Zend/zend_language_scanner.l" +#line 1426 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3508 "Zend/zend_language_scanner.c" +#line 3504 "Zend/zend_language_scanner.c" yy226: YYDEBUG(226, *YYCURSOR); ++YYCURSOR; YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1414 "Zend/zend_language_scanner.l" +#line 1410 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3518 "Zend/zend_language_scanner.c" +#line 3514 "Zend/zend_language_scanner.c" yy228: YYDEBUG(228, *YYCURSOR); ++YYCURSOR; @@ -3523,7 +3519,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy229: YYDEBUG(229, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1996 "Zend/zend_language_scanner.l" +#line 1992 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(INITIAL); @@ -3536,17 +3532,17 @@ int lex_scan(zval *zendlval TSRMLS_DC) return yytext[0]; } } -#line 3540 "Zend/zend_language_scanner.c" +#line 3536 "Zend/zend_language_scanner.c" yy230: YYDEBUG(230, *YYCURSOR); ++YYCURSOR; YYDEBUG(231, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1402 "Zend/zend_language_scanner.l" +#line 1398 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3550 "Zend/zend_language_scanner.c" +#line 3546 "Zend/zend_language_scanner.c" yy232: YYDEBUG(232, *YYCURSOR); yych = *++YYCURSOR; @@ -3577,11 +3573,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(237, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1398 "Zend/zend_language_scanner.l" +#line 1394 "Zend/zend_language_scanner.l" { return T_CONCAT_EQUAL; } -#line 3585 "Zend/zend_language_scanner.c" +#line 3581 "Zend/zend_language_scanner.c" yy238: YYDEBUG(238, *YYCURSOR); yyaccept = 4; @@ -3590,7 +3586,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy239: YYDEBUG(239, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1953 "Zend/zend_language_scanner.l" +#line 1949 "Zend/zend_language_scanner.l" { int doc_com; @@ -3624,7 +3620,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_COMMENT; } -#line 3628 "Zend/zend_language_scanner.c" +#line 3624 "Zend/zend_language_scanner.c" yy240: YYDEBUG(240, *YYCURSOR); yych = *++YYCURSOR; @@ -3634,11 +3630,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(242, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1394 "Zend/zend_language_scanner.l" +#line 1390 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3642 "Zend/zend_language_scanner.c" +#line 3638 "Zend/zend_language_scanner.c" yy243: YYDEBUG(243, *YYCURSOR); yych = *++YYCURSOR; @@ -3661,42 +3657,42 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1390 "Zend/zend_language_scanner.l" +#line 1386 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3669 "Zend/zend_language_scanner.c" +#line 3665 "Zend/zend_language_scanner.c" yy248: YYDEBUG(248, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy252; YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1450 "Zend/zend_language_scanner.l" +#line 1446 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3680 "Zend/zend_language_scanner.c" +#line 3676 "Zend/zend_language_scanner.c" yy250: YYDEBUG(250, *YYCURSOR); ++YYCURSOR; YYDEBUG(251, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1378 "Zend/zend_language_scanner.l" +#line 1374 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3690 "Zend/zend_language_scanner.c" +#line 3686 "Zend/zend_language_scanner.c" yy252: YYDEBUG(252, *YYCURSOR); ++YYCURSOR; YYDEBUG(253, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1410 "Zend/zend_language_scanner.l" +#line 1406 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3700 "Zend/zend_language_scanner.c" +#line 3696 "Zend/zend_language_scanner.c" yy254: YYDEBUG(254, *YYCURSOR); yyaccept = 5; @@ -3707,11 +3703,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy255: YYDEBUG(255, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1446 "Zend/zend_language_scanner.l" +#line 1442 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3715 "Zend/zend_language_scanner.c" +#line 3711 "Zend/zend_language_scanner.c" yy256: YYDEBUG(256, *YYCURSOR); yych = *++YYCURSOR; @@ -3723,22 +3719,22 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(258, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1374 "Zend/zend_language_scanner.l" +#line 1370 "Zend/zend_language_scanner.l" { return T_IS_SMALLER_OR_EQUAL; } -#line 3731 "Zend/zend_language_scanner.c" +#line 3727 "Zend/zend_language_scanner.c" yy259: YYDEBUG(259, *YYCURSOR); ++YYCURSOR; yy260: YYDEBUG(260, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1370 "Zend/zend_language_scanner.l" +#line 1366 "Zend/zend_language_scanner.l" { return T_IS_NOT_EQUAL; } -#line 3742 "Zend/zend_language_scanner.c" +#line 3738 "Zend/zend_language_scanner.c" yy261: YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; @@ -3789,11 +3785,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(269, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1406 "Zend/zend_language_scanner.l" +#line 1402 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } -#line 3797 "Zend/zend_language_scanner.c" +#line 3793 "Zend/zend_language_scanner.c" yy270: YYDEBUG(270, *YYCURSOR); ++YYCURSOR; @@ -3898,7 +3894,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy280: YYDEBUG(280, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2121 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3945,7 +3941,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_START_HEREDOC; } -#line 3949 "Zend/zend_language_scanner.c" +#line 3945 "Zend/zend_language_scanner.c" yy281: YYDEBUG(281, *YYCURSOR); yych = *++YYCURSOR; @@ -3985,31 +3981,31 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1362 "Zend/zend_language_scanner.l" +#line 1358 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } -#line 3993 "Zend/zend_language_scanner.c" +#line 3989 "Zend/zend_language_scanner.c" yy287: YYDEBUG(287, *YYCURSOR); ++YYCURSOR; YYDEBUG(288, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1382 "Zend/zend_language_scanner.l" +#line 1378 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } -#line 4003 "Zend/zend_language_scanner.c" +#line 3999 "Zend/zend_language_scanner.c" yy289: YYDEBUG(289, *YYCURSOR); ++YYCURSOR; YYDEBUG(290, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1350 "Zend/zend_language_scanner.l" +#line 1346 "Zend/zend_language_scanner.l" { return T_INC; } -#line 4013 "Zend/zend_language_scanner.c" +#line 4009 "Zend/zend_language_scanner.c" yy291: YYDEBUG(291, *YYCURSOR); yych = *++YYCURSOR; @@ -4028,42 +4024,42 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(294, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1338 "Zend/zend_language_scanner.l" +#line 1334 "Zend/zend_language_scanner.l" { return T_LIST; } -#line 4036 "Zend/zend_language_scanner.c" +#line 4032 "Zend/zend_language_scanner.c" yy295: YYDEBUG(295, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy299; YYDEBUG(296, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1366 "Zend/zend_language_scanner.l" +#line 1362 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } -#line 4047 "Zend/zend_language_scanner.c" +#line 4043 "Zend/zend_language_scanner.c" yy297: YYDEBUG(297, *YYCURSOR); ++YYCURSOR; YYDEBUG(298, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1334 "Zend/zend_language_scanner.l" +#line 1330 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } -#line 4057 "Zend/zend_language_scanner.c" +#line 4053 "Zend/zend_language_scanner.c" yy299: YYDEBUG(299, *YYCURSOR); ++YYCURSOR; YYDEBUG(300, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1358 "Zend/zend_language_scanner.l" +#line 1354 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } -#line 4067 "Zend/zend_language_scanner.c" +#line 4063 "Zend/zend_language_scanner.c" yy301: YYDEBUG(301, *YYCURSOR); yych = *++YYCURSOR; @@ -4193,7 +4189,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(320, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1722 "Zend/zend_language_scanner.l" +#line 1718 "Zend/zend_language_scanner.l" { if (CG(current_namespace)) { *zendlval = *CG(current_namespace); @@ -4203,7 +4199,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return T_NS_C; } -#line 4207 "Zend/zend_language_scanner.c" +#line 4203 "Zend/zend_language_scanner.c" yy321: YYDEBUG(321, *YYCURSOR); yych = *++YYCURSOR; @@ -4223,7 +4219,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(325, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1695 "Zend/zend_language_scanner.l" +#line 1691 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); const size_t filename_len = strlen(filename); @@ -4250,7 +4246,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_DIR; } -#line 4254 "Zend/zend_language_scanner.c" +#line 4250 "Zend/zend_language_scanner.c" yy326: YYDEBUG(326, *YYCURSOR); yych = *++YYCURSOR; @@ -4275,13 +4271,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(331, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1677 "Zend/zend_language_scanner.l" +#line 1673 "Zend/zend_language_scanner.l" { zendlval->value.lval = CG(zend_lineno); zendlval->type = IS_LONG; return T_LINE; } -#line 4285 "Zend/zend_language_scanner.c" +#line 4281 "Zend/zend_language_scanner.c" yy332: YYDEBUG(332, *YYCURSOR); yych = *++YYCURSOR; @@ -4316,7 +4312,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(339, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1656 "Zend/zend_language_scanner.l" +#line 1652 "Zend/zend_language_scanner.l" { const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; @@ -4337,7 +4333,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_METHOD_C; } -#line 4341 "Zend/zend_language_scanner.c" +#line 4337 "Zend/zend_language_scanner.c" yy340: YYDEBUG(340, *YYCURSOR); yych = *++YYCURSOR; @@ -4388,7 +4384,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(350, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1640 "Zend/zend_language_scanner.l" +#line 1636 "Zend/zend_language_scanner.l" { const char *func_name = NULL; @@ -4404,7 +4400,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_FUNC_C; } -#line 4408 "Zend/zend_language_scanner.c" +#line 4404 "Zend/zend_language_scanner.c" yy351: YYDEBUG(351, *YYCURSOR); yych = *++YYCURSOR; @@ -4424,7 +4420,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(355, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1683 "Zend/zend_language_scanner.l" +#line 1679 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); @@ -4436,7 +4432,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zendlval->type = IS_STRING; return T_FILE; } -#line 4440 "Zend/zend_language_scanner.c" +#line 4436 "Zend/zend_language_scanner.c" yy356: YYDEBUG(356, *YYCURSOR); yych = *++YYCURSOR; @@ -4466,7 +4462,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(362, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1620 "Zend/zend_language_scanner.l" +#line 1616 "Zend/zend_language_scanner.l" { const char *trait_name = NULL; @@ -4486,7 +4482,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) return T_TRAIT_C; } -#line 4490 "Zend/zend_language_scanner.c" +#line 4486 "Zend/zend_language_scanner.c" yy363: YYDEBUG(363, *YYCURSOR); yych = *++YYCURSOR; @@ -4516,7 +4512,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(369, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1593 "Zend/zend_language_scanner.l" +#line 1589 "Zend/zend_language_scanner.l" { const char *class_name = NULL; @@ -4543,7 +4539,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return T_CLASS_C; } -#line 4547 "Zend/zend_language_scanner.c" +#line 4543 "Zend/zend_language_scanner.c" yy370: YYDEBUG(370, *YYCURSOR); yych = *++YYCURSOR; @@ -4605,11 +4601,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(382, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1302 "Zend/zend_language_scanner.l" +#line 1298 "Zend/zend_language_scanner.l" { return T_HALT_COMPILER; } -#line 4613 "Zend/zend_language_scanner.c" +#line 4609 "Zend/zend_language_scanner.c" yy383: YYDEBUG(383, *YYCURSOR); yych = *++YYCURSOR; @@ -4629,11 +4625,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(386, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1282 "Zend/zend_language_scanner.l" +#line 1278 "Zend/zend_language_scanner.l" { return T_USE; } -#line 4637 "Zend/zend_language_scanner.c" +#line 4633 "Zend/zend_language_scanner.c" yy387: YYDEBUG(387, *YYCURSOR); yych = *++YYCURSOR; @@ -4652,11 +4648,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(390, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1330 "Zend/zend_language_scanner.l" +#line 1326 "Zend/zend_language_scanner.l" { return T_UNSET; } -#line 4660 "Zend/zend_language_scanner.c" +#line 4656 "Zend/zend_language_scanner.c" yy391: YYDEBUG(391, *YYCURSOR); ++YYCURSOR; @@ -4828,11 +4824,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(408, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1230 "Zend/zend_language_scanner.l" +#line 1226 "Zend/zend_language_scanner.l" { return T_INT_CAST; } -#line 4836 "Zend/zend_language_scanner.c" +#line 4832 "Zend/zend_language_scanner.c" yy409: YYDEBUG(409, *YYCURSOR); yych = *++YYCURSOR; @@ -4876,11 +4872,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(417, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1234 "Zend/zend_language_scanner.l" +#line 1230 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } -#line 4884 "Zend/zend_language_scanner.c" +#line 4880 "Zend/zend_language_scanner.c" yy418: YYDEBUG(418, *YYCURSOR); yych = *++YYCURSOR; @@ -4950,11 +4946,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(431, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1238 "Zend/zend_language_scanner.l" +#line 1234 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } -#line 4958 "Zend/zend_language_scanner.c" +#line 4954 "Zend/zend_language_scanner.c" yy432: YYDEBUG(432, *YYCURSOR); yych = *++YYCURSOR; @@ -4987,11 +4983,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(438, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1242 "Zend/zend_language_scanner.l" +#line 1238 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } -#line 4995 "Zend/zend_language_scanner.c" +#line 4991 "Zend/zend_language_scanner.c" yy439: YYDEBUG(439, *YYCURSOR); yych = *++YYCURSOR; @@ -5029,11 +5025,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(446, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1246 "Zend/zend_language_scanner.l" +#line 1242 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } -#line 5037 "Zend/zend_language_scanner.c" +#line 5033 "Zend/zend_language_scanner.c" yy447: YYDEBUG(447, *YYCURSOR); yych = *++YYCURSOR; @@ -5074,11 +5070,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(454, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1250 "Zend/zend_language_scanner.l" +#line 1246 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } -#line 5082 "Zend/zend_language_scanner.c" +#line 5078 "Zend/zend_language_scanner.c" yy455: YYDEBUG(455, *YYCURSOR); yych = *++YYCURSOR; @@ -5138,11 +5134,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(466, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1254 "Zend/zend_language_scanner.l" +#line 1250 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } -#line 5146 "Zend/zend_language_scanner.c" +#line 5142 "Zend/zend_language_scanner.c" yy467: YYDEBUG(467, *YYCURSOR); yych = *++YYCURSOR; @@ -5156,11 +5152,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(469, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1226 "Zend/zend_language_scanner.l" +#line 1222 "Zend/zend_language_scanner.l" { return T_VAR; } -#line 5164 "Zend/zend_language_scanner.c" +#line 5160 "Zend/zend_language_scanner.c" yy470: YYDEBUG(470, *YYCURSOR); yych = *++YYCURSOR; @@ -5180,11 +5176,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(473, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1218 "Zend/zend_language_scanner.l" +#line 1214 "Zend/zend_language_scanner.l" { return T_NEW; } -#line 5188 "Zend/zend_language_scanner.c" +#line 5184 "Zend/zend_language_scanner.c" yy474: YYDEBUG(474, *YYCURSOR); yych = *++YYCURSOR; @@ -5223,21 +5219,21 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(481, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1278 "Zend/zend_language_scanner.l" +#line 1274 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } -#line 5231 "Zend/zend_language_scanner.c" +#line 5227 "Zend/zend_language_scanner.c" yy482: YYDEBUG(482, *YYCURSOR); ++YYCURSOR; YYDEBUG(483, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1210 "Zend/zend_language_scanner.l" +#line 1206 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 5241 "Zend/zend_language_scanner.c" +#line 5237 "Zend/zend_language_scanner.c" yy484: YYDEBUG(484, *YYCURSOR); ++YYCURSOR; @@ -5259,32 +5255,32 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(487, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1386 "Zend/zend_language_scanner.l" +#line 1382 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 5267 "Zend/zend_language_scanner.c" +#line 5263 "Zend/zend_language_scanner.c" yy488: YYDEBUG(488, *YYCURSOR); ++YYCURSOR; YYDEBUG(489, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1354 "Zend/zend_language_scanner.l" +#line 1350 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 5277 "Zend/zend_language_scanner.c" +#line 5273 "Zend/zend_language_scanner.c" yy490: YYDEBUG(490, *YYCURSOR); ++YYCURSOR; YYDEBUG(491, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1180 "Zend/zend_language_scanner.l" +#line 1176 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); return T_OBJECT_OPERATOR; } -#line 5288 "Zend/zend_language_scanner.c" +#line 5284 "Zend/zend_language_scanner.c" yy492: YYDEBUG(492, *YYCURSOR); yych = *++YYCURSOR; @@ -5329,11 +5325,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(498, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1326 "Zend/zend_language_scanner.l" +#line 1322 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 5337 "Zend/zend_language_scanner.c" +#line 5333 "Zend/zend_language_scanner.c" yy499: YYDEBUG(499, *YYCURSOR); yych = *++YYCURSOR; @@ -5388,11 +5384,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(507, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1322 "Zend/zend_language_scanner.l" +#line 1318 "Zend/zend_language_scanner.l" { return T_PROTECTED; } -#line 5396 "Zend/zend_language_scanner.c" +#line 5392 "Zend/zend_language_scanner.c" yy508: YYDEBUG(508, *YYCURSOR); yych = *++YYCURSOR; @@ -5422,11 +5418,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(513, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1318 "Zend/zend_language_scanner.l" +#line 1314 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5430 "Zend/zend_language_scanner.c" +#line 5426 "Zend/zend_language_scanner.c" yy514: YYDEBUG(514, *YYCURSOR); ++YYCURSOR; @@ -5435,11 +5431,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(515, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1156 "Zend/zend_language_scanner.l" +#line 1152 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5443 "Zend/zend_language_scanner.c" +#line 5439 "Zend/zend_language_scanner.c" yy516: YYDEBUG(516, *YYCURSOR); yych = *++YYCURSOR; @@ -5464,11 +5460,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(520, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1148 "Zend/zend_language_scanner.l" +#line 1144 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5472 "Zend/zend_language_scanner.c" +#line 5468 "Zend/zend_language_scanner.c" yy521: YYDEBUG(521, *YYCURSOR); yych = *++YYCURSOR; @@ -5492,11 +5488,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(525, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1290 "Zend/zend_language_scanner.l" +#line 1286 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5500 "Zend/zend_language_scanner.c" +#line 5496 "Zend/zend_language_scanner.c" yy526: YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; @@ -5533,11 +5529,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(533, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1140 "Zend/zend_language_scanner.l" +#line 1136 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5541 "Zend/zend_language_scanner.c" +#line 5537 "Zend/zend_language_scanner.c" yy534: YYDEBUG(534, *YYCURSOR); yych = *++YYCURSOR; @@ -5577,11 +5573,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(541, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1124 "Zend/zend_language_scanner.l" +#line 1120 "Zend/zend_language_scanner.l" { return T_SWITCH; } -#line 5585 "Zend/zend_language_scanner.c" +#line 5581 "Zend/zend_language_scanner.c" yy542: YYDEBUG(542, *YYCURSOR); yych = *++YYCURSOR; @@ -5605,11 +5601,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(546, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1306 "Zend/zend_language_scanner.l" +#line 1302 "Zend/zend_language_scanner.l" { return T_STATIC; } -#line 5613 "Zend/zend_language_scanner.c" +#line 5609 "Zend/zend_language_scanner.c" yy547: YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; @@ -5636,11 +5632,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(551, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1120 "Zend/zend_language_scanner.l" +#line 1116 "Zend/zend_language_scanner.l" { return T_AS; } -#line 5644 "Zend/zend_language_scanner.c" +#line 5640 "Zend/zend_language_scanner.c" yy552: YYDEBUG(552, *YYCURSOR); yych = *++YYCURSOR; @@ -5659,11 +5655,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(555, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1342 "Zend/zend_language_scanner.l" +#line 1338 "Zend/zend_language_scanner.l" { return T_ARRAY; } -#line 5667 "Zend/zend_language_scanner.c" +#line 5663 "Zend/zend_language_scanner.c" yy556: YYDEBUG(556, *YYCURSOR); ++YYCURSOR; @@ -5672,11 +5668,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(557, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1438 "Zend/zend_language_scanner.l" +#line 1434 "Zend/zend_language_scanner.l" { return T_LOGICAL_AND; } -#line 5680 "Zend/zend_language_scanner.c" +#line 5676 "Zend/zend_language_scanner.c" yy558: YYDEBUG(558, *YYCURSOR); yych = *++YYCURSOR; @@ -5710,11 +5706,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(564, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1310 "Zend/zend_language_scanner.l" +#line 1306 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5718 "Zend/zend_language_scanner.c" +#line 5714 "Zend/zend_language_scanner.c" yy565: YYDEBUG(565, *YYCURSOR); yych = *++YYCURSOR; @@ -5738,11 +5734,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(569, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1080 "Zend/zend_language_scanner.l" +#line 1076 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5746 "Zend/zend_language_scanner.c" +#line 5742 "Zend/zend_language_scanner.c" yy570: YYDEBUG(570, *YYCURSOR); ++YYCURSOR; @@ -5751,11 +5747,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(571, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1064 "Zend/zend_language_scanner.l" +#line 1060 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5759 "Zend/zend_language_scanner.c" +#line 5755 "Zend/zend_language_scanner.c" yy572: YYDEBUG(572, *YYCURSOR); yych = *++YYCURSOR; @@ -5807,11 +5803,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(578, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1294 "Zend/zend_language_scanner.l" +#line 1290 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5815 "Zend/zend_language_scanner.c" +#line 5811 "Zend/zend_language_scanner.c" yy579: YYDEBUG(579, *YYCURSOR); yych = *++YYCURSOR; @@ -5865,11 +5861,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy586: YYDEBUG(586, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1262 "Zend/zend_language_scanner.l" +#line 1258 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5873 "Zend/zend_language_scanner.c" +#line 5869 "Zend/zend_language_scanner.c" yy587: YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; @@ -5898,11 +5894,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(592, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1266 "Zend/zend_language_scanner.l" +#line 1262 "Zend/zend_language_scanner.l" { return T_INCLUDE_ONCE; } -#line 5906 "Zend/zend_language_scanner.c" +#line 5902 "Zend/zend_language_scanner.c" yy593: YYDEBUG(593, *YYCURSOR); yych = *++YYCURSOR; @@ -5936,11 +5932,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(599, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1164 "Zend/zend_language_scanner.l" +#line 1160 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5944 "Zend/zend_language_scanner.c" +#line 5940 "Zend/zend_language_scanner.c" yy600: YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; @@ -5990,11 +5986,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(607, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1286 "Zend/zend_language_scanner.l" +#line 1282 "Zend/zend_language_scanner.l" { return T_INSTEADOF; } -#line 5998 "Zend/zend_language_scanner.c" +#line 5994 "Zend/zend_language_scanner.c" yy608: YYDEBUG(608, *YYCURSOR); yych = *++YYCURSOR; @@ -6023,11 +6019,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(613, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1116 "Zend/zend_language_scanner.l" +#line 1112 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 6031 "Zend/zend_language_scanner.c" +#line 6027 "Zend/zend_language_scanner.c" yy614: YYDEBUG(614, *YYCURSOR); yych = *++YYCURSOR; @@ -6071,11 +6067,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(622, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1176 "Zend/zend_language_scanner.l" +#line 1172 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 6079 "Zend/zend_language_scanner.c" +#line 6075 "Zend/zend_language_scanner.c" yy623: YYDEBUG(623, *YYCURSOR); yych = *++YYCURSOR; @@ -6103,11 +6099,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(626, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1048 "Zend/zend_language_scanner.l" +#line 1044 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 6111 "Zend/zend_language_scanner.c" +#line 6107 "Zend/zend_language_scanner.c" yy627: YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; @@ -6126,11 +6122,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(630, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1168 "Zend/zend_language_scanner.l" +#line 1164 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 6134 "Zend/zend_language_scanner.c" +#line 6130 "Zend/zend_language_scanner.c" yy631: YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; @@ -6149,11 +6145,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(634, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1060 "Zend/zend_language_scanner.l" +#line 1056 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 6157 "Zend/zend_language_scanner.c" +#line 6153 "Zend/zend_language_scanner.c" yy635: YYDEBUG(635, *YYCURSOR); yych = *++YYCURSOR; @@ -6177,11 +6173,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(639, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1044 "Zend/zend_language_scanner.l" +#line 1040 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 6185 "Zend/zend_language_scanner.c" +#line 6181 "Zend/zend_language_scanner.c" yy640: YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; @@ -6242,11 +6238,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy647: YYDEBUG(647, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1270 "Zend/zend_language_scanner.l" +#line 1266 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 6250 "Zend/zend_language_scanner.c" +#line 6246 "Zend/zend_language_scanner.c" yy648: YYDEBUG(648, *YYCURSOR); yych = *++YYCURSOR; @@ -6275,11 +6271,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(653, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1274 "Zend/zend_language_scanner.l" +#line 1270 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 6283 "Zend/zend_language_scanner.c" +#line 6279 "Zend/zend_language_scanner.c" yy654: YYDEBUG(654, *YYCURSOR); yych = *++YYCURSOR; @@ -6298,11 +6294,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(657, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1040 "Zend/zend_language_scanner.l" +#line 1036 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 6306 "Zend/zend_language_scanner.c" +#line 6302 "Zend/zend_language_scanner.c" yy658: YYDEBUG(658, *YYCURSOR); yych = *++YYCURSOR; @@ -6392,11 +6388,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(668, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1144 "Zend/zend_language_scanner.l" +#line 1140 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6400 "Zend/zend_language_scanner.c" +#line 6396 "Zend/zend_language_scanner.c" yy669: YYDEBUG(669, *YYCURSOR); ++YYCURSOR; @@ -6405,11 +6401,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(670, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1036 "Zend/zend_language_scanner.l" +#line 1032 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6413 "Zend/zend_language_scanner.c" +#line 6409 "Zend/zend_language_scanner.c" yy671: YYDEBUG(671, *YYCURSOR); yych = *++YYCURSOR; @@ -6434,11 +6430,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(675, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1222 "Zend/zend_language_scanner.l" +#line 1218 "Zend/zend_language_scanner.l" { return T_CLONE; } -#line 6442 "Zend/zend_language_scanner.c" +#line 6438 "Zend/zend_language_scanner.c" yy676: YYDEBUG(676, *YYCURSOR); yych = *++YYCURSOR; @@ -6452,11 +6448,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(678, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1160 "Zend/zend_language_scanner.l" +#line 1156 "Zend/zend_language_scanner.l" { return T_CLASS; } -#line 6460 "Zend/zend_language_scanner.c" +#line 6456 "Zend/zend_language_scanner.c" yy679: YYDEBUG(679, *YYCURSOR); yych = *++YYCURSOR; @@ -6502,11 +6498,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(687, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1346 "Zend/zend_language_scanner.l" +#line 1342 "Zend/zend_language_scanner.l" { return T_CALLABLE; } -#line 6510 "Zend/zend_language_scanner.c" +#line 6506 "Zend/zend_language_scanner.c" yy688: YYDEBUG(688, *YYCURSOR); ++YYCURSOR; @@ -6515,11 +6511,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(689, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1132 "Zend/zend_language_scanner.l" +#line 1128 "Zend/zend_language_scanner.l" { return T_CASE; } -#line 6523 "Zend/zend_language_scanner.c" +#line 6519 "Zend/zend_language_scanner.c" yy690: YYDEBUG(690, *YYCURSOR); yych = *++YYCURSOR; @@ -6533,11 +6529,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(692, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1052 "Zend/zend_language_scanner.l" +#line 1048 "Zend/zend_language_scanner.l" { return T_CATCH; } -#line 6541 "Zend/zend_language_scanner.c" +#line 6537 "Zend/zend_language_scanner.c" yy693: YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; @@ -6588,11 +6584,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(702, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1032 "Zend/zend_language_scanner.l" +#line 1028 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6596 "Zend/zend_language_scanner.c" +#line 6592 "Zend/zend_language_scanner.c" yy703: YYDEBUG(703, *YYCURSOR); ++YYCURSOR; @@ -6616,11 +6612,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy704: YYDEBUG(704, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1092 "Zend/zend_language_scanner.l" +#line 1088 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6624 "Zend/zend_language_scanner.c" +#line 6620 "Zend/zend_language_scanner.c" yy705: YYDEBUG(705, *YYCURSOR); yych = *++YYCURSOR; @@ -6644,11 +6640,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(709, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1100 "Zend/zend_language_scanner.l" +#line 1096 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6652 "Zend/zend_language_scanner.c" +#line 6648 "Zend/zend_language_scanner.c" yy710: YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; @@ -6682,11 +6678,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy713: YYDEBUG(713, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1314 "Zend/zend_language_scanner.l" +#line 1310 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6690 "Zend/zend_language_scanner.c" +#line 6686 "Zend/zend_language_scanner.c" yy714: YYDEBUG(714, *YYCURSOR); yych = *++YYCURSOR; @@ -6700,11 +6696,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(716, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1056 "Zend/zend_language_scanner.l" +#line 1052 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6708 "Zend/zend_language_scanner.c" +#line 6704 "Zend/zend_language_scanner.c" yy717: YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; @@ -6735,11 +6731,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(720, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1088 "Zend/zend_language_scanner.l" +#line 1084 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6743 "Zend/zend_language_scanner.c" +#line 6739 "Zend/zend_language_scanner.c" yy721: YYDEBUG(721, *YYCURSOR); ++YYCURSOR; @@ -6748,11 +6744,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(722, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1028 "Zend/zend_language_scanner.l" +#line 1024 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6756 "Zend/zend_language_scanner.c" +#line 6752 "Zend/zend_language_scanner.c" yy723: YYDEBUG(723, *YYCURSOR); yych = *++YYCURSOR; @@ -6787,11 +6783,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(729, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1136 "Zend/zend_language_scanner.l" +#line 1132 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6795 "Zend/zend_language_scanner.c" +#line 6791 "Zend/zend_language_scanner.c" yy730: YYDEBUG(730, *YYCURSOR); yych = *++YYCURSOR; @@ -6815,11 +6811,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(734, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1108 "Zend/zend_language_scanner.l" +#line 1104 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6823 "Zend/zend_language_scanner.c" +#line 6819 "Zend/zend_language_scanner.c" yy735: YYDEBUG(735, *YYCURSOR); yych = *++YYCURSOR; @@ -6899,11 +6895,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(747, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1172 "Zend/zend_language_scanner.l" +#line 1168 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6907 "Zend/zend_language_scanner.c" +#line 6903 "Zend/zend_language_scanner.c" yy748: YYDEBUG(748, *YYCURSOR); ++YYCURSOR; @@ -6912,11 +6908,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(749, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1024 "Zend/zend_language_scanner.l" +#line 1020 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6920 "Zend/zend_language_scanner.c" +#line 6916 "Zend/zend_language_scanner.c" yy750: YYDEBUG(750, *YYCURSOR); yych = *++YYCURSOR; @@ -6930,11 +6926,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(752, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1258 "Zend/zend_language_scanner.l" +#line 1254 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6938 "Zend/zend_language_scanner.c" +#line 6934 "Zend/zend_language_scanner.c" yy753: YYDEBUG(753, *YYCURSOR); yych = *++YYCURSOR; @@ -7004,11 +7000,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(763, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1084 "Zend/zend_language_scanner.l" +#line 1080 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 7012 "Zend/zend_language_scanner.c" +#line 7008 "Zend/zend_language_scanner.c" yy764: YYDEBUG(764, *YYCURSOR); yych = *++YYCURSOR; @@ -7037,11 +7033,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(769, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1128 "Zend/zend_language_scanner.l" +#line 1124 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 7045 "Zend/zend_language_scanner.c" +#line 7041 "Zend/zend_language_scanner.c" yy770: YYDEBUG(770, *YYCURSOR); ++YYCURSOR; @@ -7050,11 +7046,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(771, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1072 "Zend/zend_language_scanner.l" +#line 1068 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 7058 "Zend/zend_language_scanner.c" +#line 7054 "Zend/zend_language_scanner.c" yy772: YYDEBUG(772, *YYCURSOR); yych = *++YYCURSOR; @@ -7083,11 +7079,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy774: YYDEBUG(774, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1096 "Zend/zend_language_scanner.l" +#line 1092 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 7091 "Zend/zend_language_scanner.c" +#line 7087 "Zend/zend_language_scanner.c" yy775: YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; @@ -7111,11 +7107,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(779, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1104 "Zend/zend_language_scanner.l" +#line 1100 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 7119 "Zend/zend_language_scanner.c" +#line 7115 "Zend/zend_language_scanner.c" yy780: YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; @@ -7149,11 +7145,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(786, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1112 "Zend/zend_language_scanner.l" +#line 1108 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 7157 "Zend/zend_language_scanner.c" +#line 7153 "Zend/zend_language_scanner.c" yy787: YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; @@ -7172,11 +7168,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(790, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1298 "Zend/zend_language_scanner.l" +#line 1294 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 7180 "Zend/zend_language_scanner.c" +#line 7176 "Zend/zend_language_scanner.c" yy791: YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; @@ -7205,11 +7201,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy793: YYDEBUG(793, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1076 "Zend/zend_language_scanner.l" +#line 1072 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 7213 "Zend/zend_language_scanner.c" +#line 7209 "Zend/zend_language_scanner.c" yy794: YYDEBUG(794, *YYCURSOR); yych = *++YYCURSOR; @@ -7223,11 +7219,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(796, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1068 "Zend/zend_language_scanner.l" +#line 1064 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 7231 "Zend/zend_language_scanner.c" +#line 7227 "Zend/zend_language_scanner.c" yy797: YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; @@ -7241,11 +7237,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) } YYDEBUG(799, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1152 "Zend/zend_language_scanner.l" +#line 1148 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 7249 "Zend/zend_language_scanner.c" +#line 7245 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -7318,7 +7314,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy803: YYDEBUG(803, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -7326,7 +7322,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 7330 "Zend/zend_language_scanner.c" +#line 7326 "Zend/zend_language_scanner.c" yy804: YYDEBUG(804, *YYCURSOR); ++YYCURSOR; @@ -7334,13 +7330,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy805: YYDEBUG(805, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1204 "Zend/zend_language_scanner.l" +#line 1200 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); goto restart; } -#line 7344 "Zend/zend_language_scanner.c" +#line 7340 "Zend/zend_language_scanner.c" yy806: YYDEBUG(806, *YYCURSOR); ++YYCURSOR; @@ -7349,14 +7345,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy807: YYDEBUG(807, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1197 "Zend/zend_language_scanner.l" +#line 1193 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7360 "Zend/zend_language_scanner.c" +#line 7356 "Zend/zend_language_scanner.c" yy808: YYDEBUG(808, *YYCURSOR); yych = *++YYCURSOR; @@ -7377,11 +7373,11 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(812, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1193 "Zend/zend_language_scanner.l" +#line 1189 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 7385 "Zend/zend_language_scanner.c" +#line 7381 "Zend/zend_language_scanner.c" yy813: YYDEBUG(813, *YYCURSOR); ++YYCURSOR; @@ -7466,14 +7462,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy818: YYDEBUG(818, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1490 "Zend/zend_language_scanner.l" +#line 1486 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); goto restart; } -#line 7477 "Zend/zend_language_scanner.c" +#line 7473 "Zend/zend_language_scanner.c" yy819: YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; @@ -7498,7 +7494,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(824, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1480 "Zend/zend_language_scanner.l" +#line 1476 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7507,7 +7503,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return T_STRING_VARNAME; } -#line 7511 "Zend/zend_language_scanner.c" +#line 7507 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: @@ -7518,7 +7514,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(828, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2374 "Zend/zend_language_scanner.l" +#line 2370 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7575,7 +7571,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7579 "Zend/zend_language_scanner.c" +#line 7575 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7682,7 +7678,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy832: YYDEBUG(832, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1568 "Zend/zend_language_scanner.l" +#line 1564 "Zend/zend_language_scanner.l" { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { zendlval->value.lval = strtol(yytext, NULL, 10); @@ -7694,7 +7690,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) } return T_NUM_STRING; } -#line 7698 "Zend/zend_language_scanner.c" +#line 7694 "Zend/zend_language_scanner.c" yy833: YYDEBUG(833, *YYCURSOR); yych = *++YYCURSOR; @@ -7714,23 +7710,23 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy835: YYDEBUG(835, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1900 "Zend/zend_language_scanner.l" +#line 1896 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7723 "Zend/zend_language_scanner.c" +#line 7719 "Zend/zend_language_scanner.c" yy836: YYDEBUG(836, *YYCURSOR); ++YYCURSOR; YYDEBUG(837, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1895 "Zend/zend_language_scanner.l" +#line 1891 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); return ']'; } -#line 7734 "Zend/zend_language_scanner.c" +#line 7730 "Zend/zend_language_scanner.c" yy838: YYDEBUG(838, *YYCURSOR); yych = *++YYCURSOR; @@ -7740,14 +7736,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) ++YYCURSOR; YYDEBUG(840, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1905 "Zend/zend_language_scanner.l" +#line 1901 "Zend/zend_language_scanner.l" { /* Invalid rule to return a more explicit parse error with proper line number */ yyless(0); yy_pop_state(TSRMLS_C); return T_ENCAPSED_AND_WHITESPACE; } -#line 7751 "Zend/zend_language_scanner.c" +#line 7747 "Zend/zend_language_scanner.c" yy841: YYDEBUG(841, *YYCURSOR); ++YYCURSOR; @@ -7756,19 +7752,19 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy842: YYDEBUG(842, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1908 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7766 "Zend/zend_language_scanner.c" +#line 7762 "Zend/zend_language_scanner.c" yy843: YYDEBUG(843, *YYCURSOR); ++YYCURSOR; YYDEBUG(844, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2428 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7777,7 +7773,7 @@ int lex_scan(zval *zendlval TSRMLS_DC) zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7781 "Zend/zend_language_scanner.c" +#line 7777 "Zend/zend_language_scanner.c" yy845: YYDEBUG(845, *YYCURSOR); ++YYCURSOR; @@ -7813,13 +7809,13 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy849: YYDEBUG(849, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 7823 "Zend/zend_language_scanner.c" +#line 7819 "Zend/zend_language_scanner.c" yy850: YYDEBUG(850, *YYCURSOR); ++YYCURSOR; @@ -7859,14 +7855,14 @@ int lex_scan(zval *zendlval TSRMLS_DC) yy857: YYDEBUG(857, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1580 "Zend/zend_language_scanner.l" +#line 1576 "Zend/zend_language_scanner.l" { /* Offset must be treated as a string */ zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; return T_NUM_STRING; } -#line 7870 "Zend/zend_language_scanner.c" +#line 7866 "Zend/zend_language_scanner.c" yy858: YYDEBUG(858, *YYCURSOR); ++YYCURSOR; @@ -7889,6 +7885,6 @@ int lex_scan(zval *zendlval TSRMLS_DC) goto yy857; } } -#line 2441 "Zend/zend_language_scanner.l" +#line 2437 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index 2e5914f1b20a..03ca911262c9 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -45,7 +45,7 @@ typedef struct _zend_lex_state { unsigned char *script_filtered; size_t script_filtered_size; - /* input/output filters */ + /* input/ouput filters */ zend_encoding_filter input_filter; zend_encoding_filter output_filter; const zend_encoding *script_encoding; diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index d2e7243bb2da..23a2f472c061 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -258,8 +258,6 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) SCNG(input_filter) = lex_state->input_filter; SCNG(output_filter) = lex_state->output_filter; SCNG(script_encoding) = lex_state->script_encoding; - - RESET_DOC_COMMENT(); } ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) @@ -543,7 +541,6 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) CG(zend_lineno) = 1; } - RESET_DOC_COMMENT(); CG(increment_lineno) = 0; return SUCCESS; } @@ -588,7 +585,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR compiler_result = zendparse(TSRMLS_C); zend_do_return(&retval_znode, 0 TSRMLS_CC); CG(in_compilation) = original_in_compilation; - if (compiler_result != 0) { /* parser error */ + if (compiler_result==1) { /* parser error */ zend_bailout(); } compilation_successful=1; @@ -694,7 +691,6 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D zend_set_compiled_filename(filename TSRMLS_CC); CG(zend_lineno) = 1; CG(increment_lineno) = 0; - RESET_DOC_COMMENT(); return SUCCESS; } @@ -764,7 +760,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) SCNG(script_filtered) = NULL; } - if (compiler_result != 0) { + if (compiler_result==1) { CG(active_op_array) = original_active_op_array; CG(unclean_shutdown)=1; destroy_op_array(op_array TSRMLS_CC); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 8beacdfd352b..92c67c3436d4 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -896,8 +896,11 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - RETVAL_ZVAL_FAST(method_result_ptr); - zval_ptr_dtor(&method_result_ptr); + if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { + RETVAL_ZVAL(method_result_ptr, 1, 1); + } else { + RETVAL_ZVAL(method_result_ptr, 0, 1); + } } /* now destruct all auxiliaries */ @@ -1110,8 +1113,11 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - RETVAL_ZVAL_FAST(method_result_ptr); - zval_ptr_dtor(&method_result_ptr); + if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { + RETVAL_ZVAL(method_result_ptr, 1, 1); + } else { + RETVAL_ZVAL(method_result_ptr, 0, 1); + } } /* now destruct all auxiliaries */ @@ -1275,14 +1281,6 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p } } - if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) || - UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) { - if (!silent) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - return NULL; - } - return &CE_STATIC_MEMBERS(ce)[property_info->offset]; } /* }}} */ @@ -1645,8 +1643,6 @@ ZEND_API zend_object_handlers std_object_handlers = { NULL, /* get_debug_info */ zend_std_get_closure, /* get_closure */ zend_std_get_gc, /* get_gc */ - NULL, /* do_operation */ - NULL, /* compare */ }; /* diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 07428737ff19..3ea6008350d2 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -100,7 +100,6 @@ typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC); typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); -typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC); /* Cast an object to some other type */ @@ -114,8 +113,6 @@ typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, u typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval ***table, int *n TSRMLS_DC); -typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC); - struct _zend_object_handlers { /* general object functions */ zend_object_add_ref_t add_ref; @@ -145,8 +142,6 @@ struct _zend_object_handlers { zend_object_get_debug_info_t get_debug_info; zend_object_get_closure_t get_closure; zend_object_get_gc_t get_gc; - zend_object_do_operation_t do_operation; - zend_object_compare_zvals_t compare; }; extern ZEND_API zend_object_handlers std_object_handlers; diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index b5dd48f79845..1fe5d0c1994c 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -57,11 +57,6 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS obj->dtor(obj->object, i TSRMLS_CC); obj = &objects->object_buckets[i].bucket.obj; obj->refcount--; - - if (obj->refcount == 0) { - /* in case gc_collect_cycle is triggered before free_storage */ - GC_REMOVE_ZOBJ_FROM_BUFFER(obj); - } } } } diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 41b4bd25710f..db0a40035b6d 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -166,9 +166,8 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC) for (i = 0; i < ce->default_static_members_count; i++) { if (ce->static_members_table[i]) { - zval *p = ce->static_members_table[i]; + zval_ptr_dtor(&ce->static_members_table[i]); ce->static_members_table[i] = NULL; - zval_ptr_dtor(&p); } } ce->static_members_table = NULL; diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 34237387b6b3..c8b868d16a80 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -857,8 +857,6 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD); - zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -906,8 +904,6 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB); - zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -949,8 +945,6 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL); - zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -1016,8 +1010,6 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV); - zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -1035,15 +1027,9 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * zval op1_copy, op2_copy; long op1_lval; - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MOD); - - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); if (Z_LVAL_P(op2) == 0) { zend_error(E_WARNING, "Division by zero"); @@ -1067,16 +1053,9 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) zval op1_copy, op2_copy; long op1_lval; - if (Z_TYPE_P(op1) != IS_BOOL || Z_TYPE_P(op2) != IS_BOOL) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BOOL_XOR); - - zendi_convert_to_boolean(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_boolean(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } - + zendi_convert_to_boolean(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_boolean(op2, op2_copy, result); ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); return SUCCESS; } @@ -1086,12 +1065,7 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ { zval op1_copy; - if (Z_TYPE_P(op1) != IS_BOOL) { - ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BOOL_NOT); - - zendi_convert_to_boolean(op1, op1_copy, result); - } - + zendi_convert_to_boolean(op1, op1_copy, result); ZVAL_BOOL(result, !Z_LVAL_P(op1)); return SUCCESS; } @@ -1099,32 +1073,29 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ { + zval op1_copy = *op1; - switch (Z_TYPE_P(op1)) { - case IS_LONG: - ZVAL_LONG(result, ~Z_LVAL_P(op1)); - return SUCCESS; - case IS_DOUBLE: - ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); - return SUCCESS; - case IS_STRING: { - int i; - zval op1_copy = *op1; - - Z_TYPE_P(result) = IS_STRING; - Z_STRVAL_P(result) = estrndup(Z_STRVAL(op1_copy), Z_STRLEN(op1_copy)); - Z_STRLEN_P(result) = Z_STRLEN(op1_copy); - for (i = 0; i < Z_STRLEN(op1_copy); i++) { - Z_STRVAL_P(result)[i] = ~Z_STRVAL(op1_copy)[i]; - } - return SUCCESS; - } - default: - ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BW_NOT); + op1 = &op1_copy; - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; + if (Z_TYPE_P(op1) == IS_LONG) { + ZVAL_LONG(result, ~Z_LVAL_P(op1)); + return SUCCESS; + } else if (Z_TYPE_P(op1) == IS_DOUBLE) { + ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); + return SUCCESS; + } else if (Z_TYPE_P(op1) == IS_STRING) { + int i; + + Z_TYPE_P(result) = IS_STRING; + Z_STRVAL_P(result) = estrndup(Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + Z_STRLEN_P(result) = Z_STRLEN_P(op1); + for (i = 0; i < Z_STRLEN_P(op1); i++) { + Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i]; + } + return SUCCESS; } + zend_error(E_ERROR, "Unsupported operand types"); + return FAILURE; /* unknown datatype */ } /* }}} */ @@ -1159,16 +1130,9 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / Z_STRLEN_P(result) = result_len; return SUCCESS; } - - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_OR); - - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); return SUCCESS; @@ -1207,15 +1171,10 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) return SUCCESS; } - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_AND); - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); return SUCCESS; @@ -1254,15 +1213,9 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) return SUCCESS; } - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_XOR); - - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); return SUCCESS; @@ -1274,16 +1227,9 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / zval op1_copy, op2_copy; long op1_lval; - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SL); - - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } - + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); return SUCCESS; } @@ -1294,16 +1240,9 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) zval op1_copy, op2_copy; long op1_lval; - if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SR); - - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); - } else { - op1_lval = Z_LVAL_P(op1); - } - + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); return SUCCESS; } @@ -1352,15 +1291,11 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{ zval op1_copy, op2_copy; int use_copy1 = 0, use_copy2 = 0; - if (Z_TYPE_P(op1) != IS_STRING || Z_TYPE_P(op2) != IS_STRING) { - ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT); - - if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - } - if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - } + if (Z_TYPE_P(op1) != IS_STRING) { + zend_make_printable_zval(op1, &op1_copy, &use_copy1); + } + if (Z_TYPE_P(op2) != IS_STRING) { + zend_make_printable_zval(op2, &op2_copy, &use_copy2); } if (use_copy1) { @@ -1591,24 +1526,20 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* { ZVAL_LONG(result, -1); return SUCCESS; - default: - if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, compare)) { - return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC); - } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { - return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2 TSRMLS_CC); - } - - if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) { + case TYPE_PAIR(IS_OBJECT, IS_OBJECT): + /* If both are objects sharing the same comparision handler then use is */ + if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) { if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { - /* object handles are identical, apparently this is the same object */ + /* object handles are identical, apprently this is the same object */ ZVAL_LONG(result, 0); return SUCCESS; } - if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) { - ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2 TSRMLS_CC)); - return SUCCESS; - } + ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); + return SUCCESS; } + /* break missing intentionally */ + + default: if (Z_TYPE_P(op1) == IS_OBJECT) { if (Z_OBJ_HT_P(op1)->get) { op_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC); @@ -1959,20 +1890,6 @@ ZEND_API int increment_function(zval *op1) /* {{{ */ } } break; - case IS_OBJECT: - if (Z_OBJ_HANDLER_P(op1, do_operation)) { - zval *op2; - int res; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(op2); - ZVAL_LONG(op2, 1); - res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, op2 TSRMLS_CC); - zval_ptr_dtor(&op2); - - return res; - } - return FAILURE; default: return FAILURE; } @@ -2019,20 +1936,6 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */ break; } break; - case IS_OBJECT: - if (Z_OBJ_HANDLER_P(op1, do_operation)) { - zval *op2; - int res; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(op2); - ZVAL_LONG(op2, 1); - res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, op2 TSRMLS_CC); - zval_ptr_dtor(&op2); - - return res; - } - return FAILURE; default: return FAILURE; } @@ -2235,8 +2138,8 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */ { int ret1, ret2; int oflow1, oflow2; - long lval1 = 0, lval2 = 0; - double dval1 = 0.0, dval2 = 0.0; + long lval1, lval2; + double dval1, dval2; if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) && (ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) { diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 15ad79e4dbfc..a82c14b8c260 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -26,10 +26,6 @@ #include #include -#ifdef __GNUC__ -#include -#endif - #ifdef HAVE_IEEEFP_H #include #endif @@ -132,7 +128,7 @@ static inline zend_uchar is_numeric_string_ex(const char *str, int length, long { const char *ptr; int base = 10, digits = 0, dp_or_e = 0; - double local_dval = 0.0; + double local_dval; zend_uchar type; if (!length) { @@ -269,11 +265,11 @@ static inline zend_uchar is_numeric_string(const char *str, int length, long *lv return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL); } -static inline const char * -zend_memnstr(const char *haystack, const char *needle, int needle_len, char *end) +static inline char * +zend_memnstr(char *haystack, char *needle, int needle_len, char *end) { - const char *p = haystack; - const char ne = needle[needle_len-1]; + char *p = haystack; + char ne = needle[needle_len-1]; if (needle_len == 1) { return (char *)memchr(p, *needle, (end-p)); @@ -501,7 +497,7 @@ ZEND_API void zend_update_current_locale(void); /* The offset in bytes between the value and type fields of a zval */ #define ZVAL_OFFSETOF_TYPE \ - (offsetof(zval,type) - offsetof(zval,value)) + (__builtin_offsetof(zval,type) - __builtin_offsetof(zval,value)) static zend_always_inline int fast_increment_function(zval *op1) { @@ -945,24 +941,6 @@ static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zv return Z_LVAL_P(result) <= 0; } -#define ZEND_TRY_BINARY_OBJECT_OPERATION(opcode) \ - if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation)) { \ - if (SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \ - return SUCCESS; \ - } \ - } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, do_operation)) { \ - if (SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \ - return SUCCESS; \ - } \ - } - -#define ZEND_TRY_UNARY_OBJECT_OPERATION(opcode) \ - if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation) \ - && SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL TSRMLS_CC) \ - ) { \ - return SUCCESS; \ - } - #endif /* diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2bc80faa4e84..f66d9775e0cf 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1170,18 +1170,22 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + OP1_TYPE != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (OP1_TYPE == IS_TMP_VAR || OP1_TYPE == IS_CONST) { zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); FREE_OP2(); FREE_OP1(); } else { - container = GET_OP1_ZVAL_PTR_PTR_FAST(BP_VAR_R); + container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); FREE_OP2(); - if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - FREE_OP1_VAR_PTR_FAST(); - } + FREE_OP1_VAR_PTR(); } CHECK_EXCEPTION(); @@ -1251,10 +1255,10 @@ ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV) zval **container; SAVE_OPLINE(); - container = GET_OP1_ZVAL_PTR_PTR_FAST(BP_VAR_IS); + container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_IS TSRMLS_CC); FREE_OP2(); - FREE_OP1_VAR_PTR_FAST(); + FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1276,17 +1280,15 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) if (OP1_TYPE == IS_VAR && OP1_FREE && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - FREE_OP2(); - FREE_OP1_VAR_PTR(); } else { if (OP2_TYPE == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = GET_OP1_ZVAL_PTR_PTR_FAST(BP_VAR_R); + container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR_FAST(); } + FREE_OP2(); + FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1990,7 +1992,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -1998,8 +2000,6 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(&ret->var.ptr); } - } else if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; } } else if (fbc->type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); @@ -2519,11 +2519,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -2609,7 +2607,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -2684,7 +2682,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) if (call->object) { Z_ADDREF_P(call->object); } - if (OP2_TYPE == IS_VAR && OP2_FREE && Z_REFCOUNT_P(function_name) == 1 && + if (OP2_TYPE == IS_VAR && OP2_FREE && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -2844,7 +2842,9 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if (!EG(return_value_ptr_ptr)) { - FREE_OP1(); + if (OP1_TYPE == IS_TMP_VAR) { + FREE_OP1(); + } } else { if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR || @@ -2857,23 +2857,18 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; - FREE_OP1_IF_VAR(); } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; - if (OP1_TYPE == IS_VAR) { - Z_DELREF_P(retval_ptr); - } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(retval_ptr); - } + Z_ADDREF_P(retval_ptr); } } + FREE_OP1_IF_VAR(); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -2925,12 +2920,9 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EG(return_value_ptr_ptr)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, *retval_ptr_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } break; } @@ -2944,7 +2936,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } } while (0); - FREE_OP1_VAR_PTR(); + FREE_OP1_IF_VAR(); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -3015,7 +3007,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV) #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { - DTRACE_EXCEPTION_CAUGHT((char *)ce->name); + DTRACE_EXCEPTION_CAUGHT(ce->name); } #endif /* HAVE_DTRACE */ @@ -3087,26 +3079,21 @@ ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if (varptr == &EG(uninitialized_zval)) { - if (OP1_TYPE == IS_VAR) { - Z_DELREF_P(varptr); - } - ALLOC_INIT_ZVAL(varptr); + ALLOC_ZVAL(varptr); + INIT_ZVAL(*varptr); + Z_SET_REFCOUNT_P(varptr, 0); } else if (PZVAL_IS_REF(varptr)) { - if (OP1_TYPE == IS_CV || - (OP1_TYPE == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { - zval *original_var = varptr; + zval *original_var = varptr; - ALLOC_ZVAL(varptr); - INIT_PZVAL_COPY(varptr, original_var); - zval_copy_ctor(varptr); - FREE_OP1(); - } else { - Z_UNSET_ISREF_P(varptr); - } - } else if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(varptr); + ALLOC_ZVAL(varptr); + ZVAL_COPY_VALUE(varptr, original_var); + Z_UNSET_ISREF_P(varptr); + Z_SET_REFCOUNT_P(varptr, 0); + zval_copy_ctor(varptr); } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); + FREE_OP1(); /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3127,15 +3114,22 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); } - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && + (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && + EX_T(opline->op1.var).var.fcall_returned_reference && + EX_T(opline->op1.var).var.ptr) { + varptr = EX_T(opline->op1.var).var.ptr; + PZVAL_UNLOCK_EX(varptr, &free_op1, 0); + } else { + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + } if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { + (PZVAL_IS_REF(varptr) || + (Z_REFCOUNT_P(varptr) == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) { Z_SET_ISREF_P(varptr); - if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(varptr); - } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -3150,9 +3144,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) if (!IS_OP1_TMP_FREE()) { zval_copy_ctor(valptr); } - FREE_OP1_IF_VAR(); zend_vm_stack_push(valptr TSRMLS_CC); } + FREE_OP1_IF_VAR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -3304,6 +3298,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, EX(op_array), execute_data TSRMLS_CC); + FREE_OP2(); ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); } @@ -3315,6 +3310,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, EX(op_array), execute_data TSRMLS_CC); + FREE_OP2(); ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } @@ -3351,6 +3347,9 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) zend_free_op free_op1, free_op2; SAVE_OPLINE(); + if (OP1_TYPE==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, GET_OP1_ZVAL_PTR(BP_VAR_R), GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); @@ -3537,11 +3536,9 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST) ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -3614,8 +3611,7 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - FREE_OP1_IF_VAR(); - } else if (OP1_TYPE == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -3663,6 +3659,8 @@ ZEND_VM_C_LABEL(num_index): } if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && opline->extended_value) { FREE_OP1_VAR_PTR(); + } else { + FREE_OP1_IF_VAR(); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3918,17 +3916,15 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (OP1_TYPE != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { zval_ptr_dtor(&varname); } FREE_OP1(); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -4151,27 +4147,19 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } else if (OP1_TYPE == IS_CONST || - (OP1_TYPE == IS_CV && + ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1) || - (OP1_TYPE == IS_VAR && - !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 2)) { + Z_REFCOUNT_P(array_ptr) > 1)) { zval *tmp; - if (OP1_TYPE == IS_VAR) { - Z_DELREF_P(array_ptr); - } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else if (OP1_TYPE == IS_CV) { + } else { Z_ADDREF_P(array_ptr); } } @@ -4179,15 +4167,10 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - FREE_OP1_IF_VAR(); - } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } + FREE_OP1_IF_VAR(); if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -4204,18 +4187,14 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } + FREE_OP1_IF_VAR(); HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } + FREE_OP1_IF_VAR(); HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -4230,7 +4209,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) zend_uchar key_type; key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTENT && + if (key_type != HASH_KEY_NON_EXISTANT && (key_type == HASH_KEY_IS_LONG || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { break; @@ -4245,9 +4224,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) is_empty = 1; } - if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } + FREE_OP1_IF_VAR(); if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -4483,7 +4460,7 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST| zval *offset; SAVE_OPLINE(); - container = GET_OP1_OBJ_ZVAL_PTR_PTR_FAST(BP_VAR_IS); + container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS); offset = GET_OP2_ZVAL_PTR(BP_VAR_R); @@ -4610,7 +4587,7 @@ ZEND_VM_C_LABEL(num_index_prop): Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - FREE_OP1_VAR_PTR_FAST(); + FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5312,14 +5289,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE generator->value = *value_ptr; } - FREE_OP1_VAR_PTR(); + FREE_OP1_IF_VAR(); } } else { zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); /* Consts, temporary variables and references need copying */ if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -5332,13 +5309,12 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE } generator->value = copy; - FREE_OP1_IF_VAR(); } else { - if (OP1_TYPE == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + FREE_OP1_IF_VAR(); } } else { /* If no value was specified yield null */ diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 08fb84738298..c3635c114869 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -20,13 +20,6 @@ #ifdef ZEND_WIN32 # pragma warning(once : 4101) -# pragma warning(once : 6235) -# pragma warning(once : 6237) -# pragma warning(once : 6239) -# pragma warning(once : 6240) -# pragma warning(once : 6285) -# pragma warning(once : 6286) -# pragma warning(once : 6326) #endif static user_opcode_handler_t zend_user_opcode_handlers[256] = { (user_opcode_handler_t)NULL, @@ -551,7 +544,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -559,8 +552,6 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(&ret->var.ptr); } - } else if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; } } else if (fbc->type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); @@ -1274,7 +1265,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE if (call->object) { Z_ADDREF_P(call->object); } - if (IS_CONST == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 && + if (IS_CONST == IS_VAR && 0 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -1434,6 +1425,7 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, EX(op_array), execute_data TSRMLS_CC); + ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); } @@ -1445,6 +1437,7 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, EX(op_array), execute_data TSRMLS_CC); + ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } @@ -1599,7 +1592,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H if (call->object) { Z_ADDREF_P(call->object); } - if (IS_TMP_VAR == IS_VAR && 1 && Z_REFCOUNT_P(function_name) == 1 && + if (IS_TMP_VAR == IS_VAR && 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -1723,7 +1716,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1772,7 +1765,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; call->object = NULL; call->called_scope = NULL; call->is_ctor_call = 0; @@ -1786,12 +1779,12 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H if (call->object) { Z_ADDREF_P(call->object); } - if (IS_VAR == IS_VAR && (free_op2.var != NULL) && Z_REFCOUNT_P(function_name) == 1 && + if (IS_VAR == IS_VAR && (free_op2.var != NULL) && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } call->is_ctor_call = 0; EX(call) = call; @@ -1862,7 +1855,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H } call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -2011,7 +2004,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA if (call->object) { Z_ADDREF_P(call->object); } - if (IS_CV == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 && + if (IS_CV == IS_VAR && 0 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -2343,7 +2336,9 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG retval_ptr = opline->op1.zv; if (!EG(return_value_ptr_ptr)) { + if (IS_CONST == IS_TMP_VAR) { + } } else { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR || @@ -2356,23 +2351,18 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; - } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; - if (IS_CONST == IS_VAR) { - Z_DELREF_P(retval_ptr); - } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - if (IS_CONST == IS_CV) { - Z_ADDREF_P(retval_ptr); - } + Z_ADDREF_P(retval_ptr); } } + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -2424,12 +2414,9 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EG(return_value_ptr_ptr)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, *retval_ptr_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } break; } @@ -2835,27 +2822,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } else if (IS_CONST == IS_CONST || - (IS_CONST == IS_CV && - !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1) || - (IS_CONST == IS_VAR && + ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 2)) { + Z_REFCOUNT_P(array_ptr) > 1)) { zval *tmp; - if (IS_CONST == IS_VAR) { - Z_DELREF_P(array_ptr); - } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(array_ptr); } } @@ -2863,15 +2842,10 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - - } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -2888,18 +2862,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -2914,7 +2884,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_uchar key_type; key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTENT && + if (key_type != HASH_KEY_NON_EXISTANT && (key_type == HASH_KEY_IS_LONG || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { break; @@ -2929,9 +2899,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A is_empty = 1; } - if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -3514,6 +3481,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CONST != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); @@ -3523,9 +3496,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_ container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -3571,11 +3542,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -3661,7 +3630,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -3685,6 +3654,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); + if (IS_CONST==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, opline->op2.zv TSRMLS_CC); @@ -3744,11 +3716,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -3821,8 +3791,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -3870,6 +3839,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3932,17 +3903,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CONST != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -4164,7 +4133,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -4177,13 +4146,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE } generator->value = copy; - } else { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -4531,6 +4498,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CONST != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); @@ -4540,9 +4513,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -4564,11 +4535,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -4654,7 +4623,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -4678,6 +4647,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op2; SAVE_OPLINE(); + if (IS_CONST==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -4718,8 +4690,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -4767,6 +4738,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4858,7 +4831,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -4871,13 +4844,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - } else { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -4951,7 +4922,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4966,7 +4937,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4981,7 +4952,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4996,7 +4967,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5011,7 +4982,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5026,7 +4997,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5041,7 +5012,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5056,7 +5027,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5071,7 +5042,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5088,7 +5059,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5104,7 +5075,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5120,7 +5091,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5136,7 +5107,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5152,7 +5123,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5167,7 +5138,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5182,7 +5153,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5197,7 +5168,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5212,7 +5183,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5389,18 +5360,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CONST != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } } CHECK_EXCEPTION(); @@ -5422,11 +5397,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -5491,7 +5464,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE } } if (IS_VAR != IS_CONST) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { if (UNEXPECTED(ce->constructor == NULL)) { @@ -5512,7 +5485,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -5536,11 +5509,14 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op2; SAVE_OPLINE(); + if (IS_CONST==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5576,8 +5552,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -5619,12 +5594,14 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC /* do nothing */ break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5687,17 +5664,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CONST != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -5879,7 +5854,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -5892,13 +5867,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - } else { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -5937,7 +5910,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -6142,11 +6115,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -6232,7 +6203,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -6281,8 +6252,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -6330,6 +6300,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -6392,17 +6364,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CONST != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -6602,7 +6572,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -6615,13 +6585,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL } generator->value = copy; - } else { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -6969,6 +6937,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CONST != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); @@ -6978,9 +6952,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -7002,11 +6974,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -7092,7 +7062,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -7134,7 +7104,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { - DTRACE_EXCEPTION_CAUGHT((char *)ce->name); + DTRACE_EXCEPTION_CAUGHT(ce->name); } #endif /* HAVE_DTRACE */ @@ -7176,6 +7146,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); + if (IS_CONST==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -7215,8 +7188,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CONST == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -7264,6 +7236,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7355,7 +7329,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -7368,13 +7342,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A } generator->value = copy; - } else { - if (IS_CONST == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -7671,7 +7643,9 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { - zval_dtor(free_op1.var); + if (IS_TMP_VAR == IS_TMP_VAR) { + zval_dtor(free_op1.var); + } } else { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR || @@ -7684,23 +7658,18 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; - } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; - if (IS_TMP_VAR == IS_VAR) { - Z_DELREF_P(retval_ptr); - } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(retval_ptr); - } + Z_ADDREF_P(retval_ptr); } } + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -7752,12 +7721,9 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EG(return_value_ptr_ptr)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, *retval_ptr_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } break; } @@ -8164,27 +8130,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } else if (IS_TMP_VAR == IS_CONST || - (IS_TMP_VAR == IS_CV && + ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1) || - (IS_TMP_VAR == IS_VAR && - !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 2)) { + Z_REFCOUNT_P(array_ptr) > 1)) { zval *tmp; - if (IS_TMP_VAR == IS_VAR) { - Z_DELREF_P(array_ptr); - } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(array_ptr); } } @@ -8192,15 +8150,10 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - - } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -8217,18 +8170,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -8243,7 +8192,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_uchar key_type; key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTENT && + if (key_type != HASH_KEY_NON_EXISTANT && (key_type == HASH_KEY_IS_LONG || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { break; @@ -8258,9 +8207,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = 1; } - if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -8895,6 +8841,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_TMP_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { zval *container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); @@ -8904,9 +8856,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -9068,6 +9018,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op1; SAVE_OPLINE(); + if (IS_TMP_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -9107,8 +9060,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -9156,6 +9108,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -9218,17 +9172,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { zval_ptr_dtor(&varname); } zval_dtor(free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -9410,7 +9362,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -9423,13 +9375,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - } else { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -9777,6 +9727,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_TMP_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { zval *container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); @@ -9786,9 +9742,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -9926,6 +9880,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); + if (IS_TMP_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -9966,8 +9923,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -10015,6 +9971,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10106,7 +10064,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -10119,13 +10077,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; - } else { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -10199,7 +10155,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10214,7 +10170,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10229,7 +10185,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10244,7 +10200,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10259,7 +10215,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10274,7 +10230,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10289,7 +10245,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10304,7 +10260,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10319,7 +10275,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10336,7 +10292,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10352,7 +10308,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10368,7 +10324,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10384,7 +10340,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10400,7 +10356,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10415,7 +10371,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10430,7 +10386,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10445,7 +10401,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10460,7 +10416,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10637,18 +10593,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_TMP_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { zval *container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; zval_dtor(free_op1.var); } else { container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } } CHECK_EXCEPTION(); @@ -10694,7 +10654,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're * string offsets or overloaded objects */ - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10752,7 +10712,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE } } else { if (UNEXPECTED(EG(exception) != NULL)) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -10774,7 +10734,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10786,11 +10746,14 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); + if (IS_TMP_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10826,8 +10789,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -10869,12 +10831,14 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD /* do nothing */ break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10937,17 +10901,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { zval_ptr_dtor(&varname); } zval_dtor(free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -11129,7 +11091,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -11142,13 +11104,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; - } else { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -11187,7 +11147,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -11408,8 +11368,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -11457,6 +11416,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -11519,17 +11480,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_TMP_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { zval_ptr_dtor(&varname); } zval_dtor(free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -11711,7 +11670,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -11724,13 +11683,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; - } else { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -12078,6 +12035,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_TMP_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { zval *container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); @@ -12087,9 +12050,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL container = NULL; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -12225,6 +12186,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op1; SAVE_OPLINE(); + if (IS_TMP_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -12264,8 +12228,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_TMP_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -12313,6 +12276,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12404,7 +12369,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -12417,13 +12382,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; - } else { - if (IS_TMP_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -12495,7 +12458,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); bitwise_not_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12508,7 +12471,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); boolean_not_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12707,7 +12670,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } zend_print_variable(z); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12734,7 +12697,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ret = Z_LVAL_P(val); } else { ret = i_zend_is_true(val); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12764,7 +12727,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ret = Z_LVAL_P(val); } else { ret = i_zend_is_true(val); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12794,7 +12757,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12828,7 +12791,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12859,7 +12822,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12900,7 +12863,9 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { - zval_ptr_dtor(&free_op1.var); + if (IS_VAR == IS_TMP_VAR) { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } } else { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR || @@ -12913,23 +12878,18 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; - zval_ptr_dtor(&free_op1.var); } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; - if (IS_VAR == IS_VAR) { - Z_DELREF_P(retval_ptr); - } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - if (IS_VAR == IS_CV) { - Z_ADDREF_P(retval_ptr); - } + Z_ADDREF_P(retval_ptr); } } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -12950,7 +12910,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { if (IS_VAR == IS_TMP_VAR) { - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else if (!0) { /* Not a temp var */ zval *ret; @@ -12981,12 +12941,9 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EG(return_value_ptr_ptr)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, *retval_ptr_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } break; } @@ -13031,7 +12988,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_throw_exception_object(exception TSRMLS_CC); zend_exception_restore(TSRMLS_C); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; HANDLE_EXCEPTION(); } @@ -13043,26 +13000,21 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_AR varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { - if (IS_VAR == IS_VAR) { - Z_DELREF_P(varptr); - } - ALLOC_INIT_ZVAL(varptr); + ALLOC_ZVAL(varptr); + INIT_ZVAL(*varptr); + Z_SET_REFCOUNT_P(varptr, 0); } else if (PZVAL_IS_REF(varptr)) { - if (IS_VAR == IS_CV || - (IS_VAR == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { - zval *original_var = varptr; + zval *original_var = varptr; - ALLOC_ZVAL(varptr); - INIT_PZVAL_COPY(varptr, original_var); - zval_copy_ctor(varptr); - zval_ptr_dtor(&free_op1.var); - } else { - Z_UNSET_ISREF_P(varptr); - } - } else if (IS_VAR == IS_CV) { - Z_ADDREF_P(varptr); + ALLOC_ZVAL(varptr); + ZVAL_COPY_VALUE(varptr, original_var); + Z_UNSET_ISREF_P(varptr); + Z_SET_REFCOUNT_P(varptr, 0); + zval_copy_ctor(varptr); } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13083,15 +13035,22 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && + (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && + EX_T(opline->op1.var).var.fcall_returned_reference && + EX_T(opline->op1.var).var.ptr) { + varptr = EX_T(opline->op1.var).var.ptr; + PZVAL_UNLOCK_EX(varptr, &free_op1, 0); + } else { + varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + } if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { + (PZVAL_IS_REF(varptr) || + (Z_REFCOUNT_P(varptr) == 1 && (IS_VAR == IS_CV || free_op1.var)))) { Z_SET_ISREF_P(varptr); - if (IS_VAR == IS_CV) { - Z_ADDREF_P(varptr); - } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -13106,9 +13065,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (!0) { zval_copy_ctor(valptr); } - zval_ptr_dtor(&free_op1.var); zend_vm_stack_push(valptr TSRMLS_CC); } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13171,7 +13130,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC))); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13248,7 +13207,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) AI_SET_PTR(&EX_T(opline->result.var), retval); } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13290,7 +13249,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (use_copy) { ZVAL_COPY_VALUE(result, &var_copy); if (0) { - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { ZVAL_COPY_VALUE(result, expr); @@ -13307,7 +13266,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) convert_to_object(result); break; } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13396,7 +13355,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (tmp_inc_filename) { zval_ptr_dtor(&tmp_inc_filename); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } else if (EXPECTED(new_op_array != NULL)) { @@ -13503,27 +13462,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } else if (IS_VAR == IS_CONST || - (IS_VAR == IS_CV && + ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1) || - (IS_VAR == IS_VAR && - !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 2)) { + Z_REFCOUNT_P(array_ptr) > 1)) { zval *tmp; - if (IS_VAR == IS_VAR) { - Z_DELREF_P(array_ptr); - } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(array_ptr); } } @@ -13531,15 +13482,10 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - zval_ptr_dtor(&free_op1.var); - } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -13556,18 +13502,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -13582,7 +13524,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_uchar key_type; key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTENT && + if (key_type != HASH_KEY_NON_EXISTANT && (key_type == HASH_KEY_IS_LONG || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { break; @@ -13597,9 +13539,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = 1; } - if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -13754,7 +13694,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { zend_print_variable(ptr); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } #endif zend_bailout(); @@ -13775,14 +13715,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (!0) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; #if DEBUG_ZEND>=2 printf("Conditional jmp to %d\n", opline->op2.opline_num); #endif ZEND_VM_JMP(opline->op2.jmp_addr); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13810,14 +13750,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ zval_copy_ctor(EX_T(opline->result.var).var.ptr); } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; #if DEBUG_ZEND>=2 printf("Conditional jmp to %d\n", opline->op2.opline_num); #endif ZEND_VM_JMP(opline->op2.jmp_addr); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13835,7 +13775,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (!0) { zval_copy_ctor(&EX_T(opline->result.var).tmp_var); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13863,7 +13803,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13884,7 +13824,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A result = 0; } ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13898,7 +13838,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13913,7 +13853,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13928,7 +13868,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13943,7 +13883,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13958,7 +13898,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13973,7 +13913,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13988,7 +13928,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14003,7 +13943,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14018,7 +13958,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14035,7 +13975,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14051,7 +13991,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14067,7 +14007,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14083,7 +14023,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14099,7 +14039,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14114,7 +14054,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14129,7 +14069,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14144,7 +14084,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14159,7 +14099,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14661,7 +14601,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14671,7 +14611,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -14710,11 +14650,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } break; case ZEND_FETCH_LOCAL: - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -14799,18 +14739,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { zval *container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_ptr_dtor(&free_op1.var); - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); @@ -14880,10 +14824,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14905,17 +14849,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - - zval_ptr_dtor(&free_op1.var); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14999,7 +14941,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15126,7 +15068,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15450,7 +15392,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15471,11 +15413,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -15561,7 +15501,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -15585,6 +15525,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op1; SAVE_OPLINE(); + if (IS_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -15644,11 +15587,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -15721,8 +15662,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - zval_ptr_dtor(&free_op1.var); - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -15770,6 +15710,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } else { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15832,17 +15774,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -15862,7 +15802,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -16072,7 +16012,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } if (opline->extended_value & ZEND_ISSET) { @@ -16104,7 +16044,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST( zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = opline->op2.zv; @@ -16231,7 +16171,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST( Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16320,7 +16260,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -16333,13 +16273,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - zval_ptr_dtor(&free_op1.var); } else { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -16412,7 +16351,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16427,7 +16366,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16442,7 +16381,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16457,7 +16396,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16472,7 +16411,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16487,7 +16426,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16502,7 +16441,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16517,7 +16456,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16532,7 +16471,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16549,7 +16488,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16565,7 +16504,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16581,7 +16520,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16597,7 +16536,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16613,7 +16552,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16628,7 +16567,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16643,7 +16582,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16658,7 +16597,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16673,7 +16612,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -17150,18 +17089,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { zval *container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_ptr_dtor(&free_op1.var); - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); @@ -17231,10 +17174,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); zval_dtor(free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17256,17 +17199,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - zval_ptr_dtor(&free_op1.var); } + zval_dtor(free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17350,7 +17291,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17477,7 +17418,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17803,7 +17744,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE EX(call) = call; zval_dtor(free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -17824,11 +17765,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -17914,7 +17853,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -17938,6 +17877,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); + if (IS_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -17978,8 +17920,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - zval_ptr_dtor(&free_op1.var); - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -18027,6 +17968,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } else { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18198,7 +18141,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); @@ -18325,7 +18268,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18414,7 +18357,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -18427,13 +18370,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; - zval_ptr_dtor(&free_op1.var); } else { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -18506,8 +18448,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18521,8 +18463,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18536,8 +18478,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18551,8 +18493,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18566,8 +18508,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18581,8 +18523,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18596,8 +18538,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18611,8 +18553,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18626,8 +18568,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18643,8 +18585,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18659,8 +18601,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18675,8 +18617,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18691,8 +18633,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18707,8 +18649,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPC ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18722,8 +18664,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18737,8 +18679,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18752,8 +18694,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18767,8 +18709,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); - zval_ptr_dtor(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18792,7 +18734,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -18873,7 +18815,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } FREE_OP(free_op_data1); } @@ -18932,7 +18874,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -18960,7 +18902,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ PZVAL_LOCK(*var_ptr); AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); @@ -19054,7 +18996,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); @@ -19117,7 +19059,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); @@ -19158,7 +19100,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; ZVAL_NULL(retval); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); @@ -19219,7 +19161,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); @@ -19270,7 +19212,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19280,7 +19222,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -19319,11 +19261,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } break; case ZEND_FETCH_LOCAL: - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -19408,18 +19350,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { zval *container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_ptr_dtor(&free_op1.var); - } + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); @@ -19439,7 +19385,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -19473,7 +19419,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -19489,10 +19435,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19514,17 +19460,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - zval_ptr_dtor(&free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - zval_ptr_dtor(&free_op1.var); } + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19547,7 +19491,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -19587,7 +19531,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -19604,11 +19548,11 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19645,7 +19589,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19688,7 +19632,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19714,7 +19658,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -19731,11 +19675,11 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19764,7 +19708,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19803,7 +19747,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19841,7 +19785,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property_name); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* assign_obj has two opcodes! */ @@ -19873,7 +19817,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property_name); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { zend_free_op free_op2, free_op_data1, free_op_data2; @@ -19882,7 +19826,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); @@ -19981,7 +19925,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* zend_assign_to_variable() always takes care of op2, never free it! */ - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20093,7 +20037,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE } } else { if (UNEXPECTED(EG(exception) != NULL)) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -20115,8 +20059,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op2.var); - zval_ptr_dtor(&free_op1.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20137,11 +20081,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -20206,7 +20148,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND } } if (IS_VAR != IS_CONST) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { if (UNEXPECTED(ce->constructor == NULL)) { @@ -20227,7 +20169,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -20251,11 +20193,14 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); + if (IS_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20291,8 +20236,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - zval_ptr_dtor(&free_op1.var); - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -20334,12 +20278,14 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD /* do nothing */ break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } else { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20402,17 +20348,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -20432,7 +20376,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20504,7 +20448,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } case IS_OBJECT: @@ -20518,18 +20462,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -20564,13 +20508,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -20642,7 +20586,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } if (opline->extended_value & ZEND_ISSET) { @@ -20674,7 +20618,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); @@ -20737,7 +20681,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in result = 1; } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else if (Z_TYPE_PP(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -20760,7 +20704,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -20789,9 +20733,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in } } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -20801,7 +20745,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20890,7 +20834,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -20903,13 +20847,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; - zval_ptr_dtor(&free_op1.var); } else { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -20948,7 +20891,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -21264,7 +21207,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21274,7 +21217,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -21313,11 +21256,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } break; case ZEND_FETCH_LOCAL: - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -21467,17 +21410,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); - - zval_ptr_dtor(&free_op1.var); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21577,11 +21518,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -21667,7 +21606,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -21716,8 +21655,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - zval_ptr_dtor(&free_op1.var); - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -21765,6 +21703,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } else { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -21827,17 +21767,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -21857,7 +21795,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21926,7 +21864,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } if (opline->extended_value & ZEND_ISSET) { @@ -22041,7 +21979,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -22054,13 +21992,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; - zval_ptr_dtor(&free_op1.var); } else { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -22133,7 +22070,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22148,7 +22085,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22163,7 +22100,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22178,7 +22115,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22193,7 +22130,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22208,7 +22145,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22223,7 +22160,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22238,7 +22175,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22253,7 +22190,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22270,7 +22207,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22286,7 +22223,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22302,7 +22239,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22318,7 +22255,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22334,7 +22271,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCO ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22349,7 +22286,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22364,7 +22301,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22379,7 +22316,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22394,7 +22331,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22870,18 +22807,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_VAR != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { zval *container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - zval_ptr_dtor(&free_op1.var); - } + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); @@ -22951,10 +22892,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22976,17 +22917,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - - zval_ptr_dtor(&free_op1.var); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23070,7 +23009,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23197,7 +23136,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND } } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23574,7 +23513,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23595,11 +23534,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -23685,7 +23622,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -23709,6 +23646,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op1; SAVE_OPLINE(); + if (IS_VAR==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -23748,8 +23688,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - zval_ptr_dtor(&free_op1.var); - } else if (IS_VAR == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -23797,6 +23736,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } else { + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23968,7 +23909,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); @@ -24095,7 +24036,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - zval_ptr_dtor(&free_op1.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -24184,7 +24125,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -24197,13 +24138,12 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; - zval_ptr_dtor(&free_op1.var); } else { - if (IS_VAR == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -25268,11 +25208,9 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC ce = CACHED_PTR(opline->op1.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, opline->extended_value TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { - HANDLE_EXCEPTION(); - } if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op1.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op1.literal->cache_slot, ce); } @@ -25691,7 +25629,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -25704,13 +25642,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL } generator->value = copy; - } else { - if (IS_UNUSED == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -27014,7 +26950,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -27027,13 +26963,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; - } else { - if (IS_UNUSED == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -27116,7 +27050,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -27197,7 +27131,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } FREE_OP(free_op_data1); } @@ -27255,7 +27189,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -27283,7 +27217,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina PZVAL_LOCK(*var_ptr); AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); @@ -27377,7 +27311,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); @@ -27440,7 +27374,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -27481,7 +27415,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -27542,7 +27476,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -27576,7 +27510,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -27593,7 +27527,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } @@ -27633,7 +27567,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27675,7 +27609,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27701,7 +27635,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -27718,7 +27652,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } @@ -27750,7 +27684,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27789,7 +27723,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27826,7 +27760,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA if (0) { zval_ptr_dtor(&property_name); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } /* assign_obj has two opcodes! */ @@ -27874,7 +27808,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're * string offsets or overloaded objects */ - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -27932,7 +27866,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC } } else { if (UNEXPECTED(EG(exception) != NULL)) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -27954,7 +27888,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -28041,7 +27975,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } case IS_OBJECT: @@ -28055,18 +27989,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -28100,13 +28034,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -28187,7 +28121,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR result = 1; } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else if (Z_TYPE_PP(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -28210,7 +28144,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -28239,9 +28173,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR } } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -28337,7 +28271,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -28350,13 +28284,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; - } else { - if (IS_UNUSED == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -28395,7 +28327,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -28762,7 +28694,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -28775,13 +28707,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND } generator->value = copy; - } else { - if (IS_UNUSED == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -30082,7 +30012,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -30095,13 +30025,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - } else { - if (IS_UNUSED == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -30559,7 +30487,9 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { + if (IS_CV == IS_TMP_VAR) { + } } else { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR || @@ -30572,23 +30502,18 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; - } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; - if (IS_CV == IS_VAR) { - Z_DELREF_P(retval_ptr); - } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - if (IS_CV == IS_CV) { - Z_ADDREF_P(retval_ptr); - } + Z_ADDREF_P(retval_ptr); } } + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -30640,12 +30565,9 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER } else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EG(return_value_ptr_ptr)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, *retval_ptr_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } break; } @@ -30701,26 +30623,21 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { - if (IS_CV == IS_VAR) { - Z_DELREF_P(varptr); - } - ALLOC_INIT_ZVAL(varptr); + ALLOC_ZVAL(varptr); + INIT_ZVAL(*varptr); + Z_SET_REFCOUNT_P(varptr, 0); } else if (PZVAL_IS_REF(varptr)) { - if (IS_CV == IS_CV || - (IS_CV == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - INIT_PZVAL_COPY(varptr, original_var); - zval_copy_ctor(varptr); + zval *original_var = varptr; - } else { - Z_UNSET_ISREF_P(varptr); - } - } else if (IS_CV == IS_CV) { - Z_ADDREF_P(varptr); + ALLOC_ZVAL(varptr); + ZVAL_COPY_VALUE(varptr, original_var); + Z_UNSET_ISREF_P(varptr); + Z_SET_REFCOUNT_P(varptr, 0); + zval_copy_ctor(varptr); } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); + ; /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -30729,7 +30646,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE - + zend_free_op free_op1; zval *varptr; SAVE_OPLINE(); @@ -30741,15 +30658,22 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && + (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && + EX_T(opline->op1.var).var.fcall_returned_reference && + EX_T(opline->op1.var).var.ptr) { + varptr = EX_T(opline->op1.var).var.ptr; + PZVAL_UNLOCK_EX(varptr, &free_op1, 0); + } else { + varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + } if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { + (PZVAL_IS_REF(varptr) || + (Z_REFCOUNT_P(varptr) == 1 && (IS_CV == IS_CV || free_op1.var)))) { Z_SET_ISREF_P(varptr); - if (IS_CV == IS_CV) { - Z_ADDREF_P(varptr); - } + Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -30764,9 +30688,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL if (!0) { zval_copy_ctor(valptr); } - zend_vm_stack_push(valptr TSRMLS_CC); } + CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -31149,27 +31073,19 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - if (IS_CV == IS_CV) { - Z_ADDREF_P(array_ptr); - } + Z_ADDREF_P(array_ptr); } } else if (IS_CV == IS_CONST || - (IS_CV == IS_CV && - !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1) || - (IS_CV == IS_VAR && + ((IS_CV == IS_CV || IS_CV == IS_VAR) && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 2)) { + Z_REFCOUNT_P(array_ptr) > 1)) { zval *tmp; - if (IS_CV == IS_VAR) { - Z_DELREF_P(array_ptr); - } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(array_ptr); } } @@ -31177,15 +31093,10 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - - } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -31202,18 +31113,14 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -31228,7 +31135,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_uchar key_type; key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTENT && + if (key_type != HASH_KEY_NON_EXISTANT && (key_type == HASH_KEY_IS_LONG || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { break; @@ -31243,9 +31150,6 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS is_empty = 1; } - if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -32310,6 +32214,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CV != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { zval *container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); @@ -32319,9 +32229,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -32415,17 +32323,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - } else { if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); + } - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -32965,6 +32871,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); + if (IS_CV==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -33004,8 +32913,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -33053,6 +32961,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -33115,17 +33025,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CV != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -33598,7 +33506,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -33611,13 +33519,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } generator->value = copy; - } else { - if (IS_CV == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -34427,6 +34333,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CV != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { zval *container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); @@ -34436,9 +34348,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -34532,17 +34442,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - zval_dtor(free_op2.var); - } else { if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - } + zval_dtor(free_op2.var); + CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35084,6 +34992,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op2; SAVE_OPLINE(); + if (IS_CV==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -35124,8 +35035,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -35173,6 +35083,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -35555,7 +35467,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -35568,13 +35480,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; - } else { - if (IS_CV == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -35648,7 +35558,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35663,7 +35573,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35678,7 +35588,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35693,7 +35603,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35708,7 +35618,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35723,7 +35633,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35738,7 +35648,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35753,7 +35663,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35768,7 +35678,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35785,7 +35695,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35801,7 +35711,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35817,7 +35727,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35833,7 +35743,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35849,7 +35759,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCO _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35864,7 +35774,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35879,7 +35789,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35894,7 +35804,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35909,7 +35819,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35933,7 +35843,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { @@ -36014,7 +35924,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } FREE_OP(free_op_data1); } @@ -36072,7 +35982,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -36100,7 +36010,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o PZVAL_LOCK(*var_ptr); AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); @@ -36194,7 +36104,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); @@ -36257,7 +36167,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -36298,7 +36208,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -36359,7 +36269,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -36548,18 +36458,22 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CV != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { zval *container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } } CHECK_EXCEPTION(); @@ -36579,7 +36493,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36612,7 +36526,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36630,7 +36544,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_zval_ptr_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -36653,17 +36567,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - zval_ptr_dtor(&free_op2.var); - } else { if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); - } + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36686,7 +36598,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36726,7 +36638,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -36743,7 +36655,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } @@ -36783,7 +36695,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36825,7 +36737,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36851,7 +36763,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zval *retval; @@ -36868,7 +36780,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } @@ -36900,7 +36812,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36939,7 +36851,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H if (0) { zval_ptr_dtor(&property); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36976,7 +36888,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&property_name); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } /* assign_obj has two opcodes! */ @@ -37008,7 +36920,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&property_name); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { zend_free_op free_op2, free_op_data1, free_op_data2; @@ -37017,7 +36929,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); @@ -37114,7 +37026,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } /* zend_assign_to_variable() always takes care of op2, never free it! */ - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37225,7 +37137,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ } } else { if (UNEXPECTED(EG(exception) != NULL)) { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -37247,7 +37159,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ call->is_ctor_call = 0; EX(call) = call; - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37259,11 +37171,14 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op2; SAVE_OPLINE(); + if (IS_CV==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -37299,8 +37214,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -37342,12 +37256,14 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE /* do nothing */ break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37410,17 +37326,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CV != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -37512,7 +37426,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER zend_error(E_WARNING, "Illegal offset type in unset"); break; } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } case IS_OBJECT: @@ -37526,18 +37440,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } break; case IS_STRING: zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_CONTINUE(); /* bailed out before */ default: - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; break; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -37571,13 +37485,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } CHECK_EXCEPTION(); @@ -37743,7 +37657,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int result = 1; } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else if (Z_TYPE_PP(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -37766,7 +37680,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int if (0) { zval_ptr_dtor(&offset); } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -37795,9 +37709,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int } } } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -37893,7 +37807,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -37906,13 +37820,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; - } else { - if (IS_CV == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -37951,7 +37863,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - zval_ptr_dtor(&free_op2.var); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -38468,17 +38380,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - } else { if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); + } - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -38594,8 +38504,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -38643,6 +38552,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -38705,17 +38616,15 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND ce = CACHED_PTR(opline->op2.literal->cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv), opline->op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(EG(exception) != NULL)) { + if (UNEXPECTED(ce == NULL)) { if (IS_CV != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } else if (IS_CV == IS_VAR || IS_CV == IS_CV) { zval_ptr_dtor(&varname); } - HANDLE_EXCEPTION(); - } - if (UNEXPECTED(ce == NULL)) { - zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_P(opline->op2.zv)); + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); } CACHE_PTR(opline->op2.literal->cache_slot, ce); } @@ -38897,7 +38806,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -38910,13 +38819,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; - } else { - if (IS_CV == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ @@ -39725,6 +39632,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); + if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && + IS_CV != IS_CV && + EX_T(opline->op1.var).var.ptr_ptr) { + PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + } + if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { zval *container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); @@ -39734,9 +39647,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - } } CHECK_EXCEPTION(); @@ -39830,17 +39741,15 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - - } else { if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + } - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -40432,6 +40341,9 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); + if (IS_CV==IS_VAR) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); + } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -40471,8 +40383,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - - } else if (IS_CV == IS_CV) { + } else { Z_ADDREF_P(expr_ptr); } } @@ -40520,6 +40431,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { + } else { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -40902,7 +40815,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || PZVAL_IS_REF(value) + || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) ) { zval *copy; @@ -40915,13 +40828,11 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } generator->value = copy; - } else { - if (IS_CV == IS_CV) { - Z_ADDREF_P(value); - } + Z_ADDREF_P(value); generator->value = value; } + } } else { /* If no value was specified yield null */ diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index a65349c4ed63..63d0cf73f0d5 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -143,8 +143,6 @@ "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); -$op1_get_zval_ptr_ptr_fast = $op1_get_zval_ptr_ptr; -$op1_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -154,8 +152,6 @@ "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); -$op2_get_zval_ptr_ptr_fast = $op2_get_zval_ptr_ptr; -$op2_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_get_obj_zval_ptr = array( "ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", @@ -183,8 +179,6 @@ "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); -$op1_get_obj_zval_ptr_ptr_fast = $op1_get_obj_zval_ptr_ptr; -$op1_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_obj_zval_ptr_ptr = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -194,8 +188,6 @@ "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); -$op2_get_obj_zval_ptr_ptr_fast = $op2_get_obj_zval_ptr_ptr; -$op2_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_is_tmp_free = array( "ANY" => "IS_TMP_FREE(free_op1)", @@ -218,7 +210,7 @@ $op1_free_op = array( "ANY" => "FREE_OP(free_op1)", "TMP" => "zval_dtor(free_op1.var)", - "VAR" => "zval_ptr_dtor(&free_op1.var)", + "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -227,7 +219,7 @@ $op2_free_op = array( "ANY" => "FREE_OP(free_op2)", "TMP" => "zval_dtor(free_op2.var)", - "VAR" => "zval_ptr_dtor(&free_op2.var)", + "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -236,7 +228,7 @@ $op1_free_op_if_var = array( "ANY" => "FREE_OP_IF_VAR(free_op1)", "TMP" => "", - "VAR" => "zval_ptr_dtor(&free_op1.var)", + "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -245,7 +237,7 @@ $op2_free_op_if_var = array( "ANY" => "FREE_OP_IF_VAR(free_op2)", "TMP" => "", - "VAR" => "zval_ptr_dtor(&free_op2.var)", + "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -259,8 +251,6 @@ "UNUSED" => "", "CV" => "", ); -$op1_free_op_var_ptr_fast = $op1_free_op_var_ptr; -$op1_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor(&free_op1.var)"; $op2_free_op_var_ptr = array( "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", @@ -270,8 +260,6 @@ "UNUSED" => "", "CV" => "", ); -$op2_free_op_var_ptr_fast = $op2_free_op_var_ptr; -$op2_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor(&free_op2.var)"; $list = array(); // list of opcode handlers and helpers in original order $opcodes = array(); // opcode handlers by code @@ -323,10 +311,7 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, - $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix, - $op1_get_zval_ptr_ptr_fast, $op2_get_zval_ptr_ptr_fast, - $op1_get_obj_zval_ptr_ptr_fast, $op2_get_obj_zval_ptr_ptr_fast, - $op1_free_op_var_ptr_fast, $op2_free_op_var_ptr_fast; + $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; // Specializing $code = preg_replace( @@ -351,12 +336,6 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { "/FREE_OP2_IF_VAR\(\)/", "/FREE_OP1_VAR_PTR\(\)/", "/FREE_OP2_VAR_PTR\(\)/", - "/GET_OP1_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", - "/FREE_OP1_VAR_PTR_FAST\(\)/", - "/FREE_OP2_VAR_PTR_FAST\(\)/", "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", "/\!defined\(ZEND_VM_SPEC\)/m", @@ -389,12 +368,6 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op2_free_op_if_var[$op2], $op1_free_op_var_ptr[$op1], $op2_free_op_var_ptr[$op2], - $op1_get_zval_ptr_ptr_fast[$op1], - $op2_get_zval_ptr_ptr_fast[$op2], - $op1_get_obj_zval_ptr_ptr_fast[$op1], - $op2_get_obj_zval_ptr_ptr_fast[$op2], - $op1_free_op_var_ptr_fast[$op1], - $op2_free_op_var_ptr_fast[$op2], ($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n", ($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n", ($op1!="ANY"||$op2!="ANY")?"0":"1", @@ -1216,26 +1189,8 @@ function gen_vm($def, $skel) { // Insert header out($f, $GLOBALS['header_text']); - out($f, "#ifdef ZEND_WIN32\n"); // Suppress free_op1 warnings on Windows - out($f, "# pragma warning(once : 4101)\n"); - if (ZEND_VM_SPEC) { - // Suppress ( || ) warnings on windows - out($f, "# pragma warning(once : 6235)\n"); - // Suppress ( && ) warnings on windows - out($f, "# pragma warning(once : 6237)\n"); - // Suppress ( && ) warnings on windows - out($f, "# pragma warning(once : 6239)\n"); - // Suppress ( && ) warnings on windows - out($f, "# pragma warning(once : 6240)\n"); - // Suppress ( || ) warnings on windows - out($f, "# pragma warning(once : 6285)\n"); - // Suppress ( || ) warnings on windows - out($f, "# pragma warning(once : 6286)\n"); - // Suppress constant with constant comparsion warnings on windows - out($f, "# pragma warning(once : 6326)\n"); - } - out($f, "#endif\n"); + out($f, "#ifdef ZEND_WIN32\n# pragma warning(once : 4101)\n#endif\n"); // Support for ZEND_USER_OPCODE out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n"); @@ -1426,7 +1381,7 @@ function usage() { // Disabling code for old-style executor define("ZEND_VM_OLD_EXECUTOR", 1); } else if ($argv[$i] == "--with-lines") { - // Enabling debugging using original zend_vm_def.h + // Enabling debuging using original zend_vm_def.h define("ZEND_VM_LINES", 1); } else if ($argv[$i] == "--help") { usage(); diff --git a/acinclude.m4 b/acinclude.m4 index c25e59eef08d..11ff779ff19a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -66,10 +66,10 @@ AC_DEFUN([PHP_EXPAND_PATH],[ $2=$1 else changequote({,}) - ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'` + ep_dir="`echo $1|$SED 's%/*[^/][^/]*/*$%%'`" changequote([,]) - ep_realdir=`(cd "$ep_dir" && pwd)` - $2="$ep_realdir"/`basename "$1"` + ep_realdir="`(cd \"$ep_dir\" && pwd)`" + $2="$ep_realdir/`basename \"$1\"`" fi ]) @@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([ ]) dnl ------------------------------------------------------------------------- -dnl Library/function existence and build sanity checks +dnl Library/function existance and build sanity checks dnl ------------------------------------------------------------------------- dnl @@ -2686,14 +2686,14 @@ EOF fi for arg in $ac_configure_args; do if test `expr -- $arg : "'.*"` = 0; then - if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then - continue; + if test `expr -- $arg : "--.*"` = 0; then + break; fi echo "'[$]arg' \\" >> $1 CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" else - if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then - continue; + if test `expr -- $arg : "'--.*"` = 0; then + break; fi echo "[$]arg \\" >> $1 CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" @@ -2925,17 +2925,17 @@ dnl providerdesc dnl header-file ac_hdrobj=$2 -dnl Add providerdesc.o or .lo into global objects when needed +dnl Add providerdesc.o into global objects when needed case $host_alias in *freebsd*) PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" PHP_LDFLAGS="$PHP_LDFLAGS -lelf" ;; *solaris*) - PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo" + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" ;; *linux*) - PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo" + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" ;; esac @@ -2962,72 +2962,15 @@ dnl DTrace objects esac dnl Generate Makefile.objects entries -dnl The empty $ac_provsrc command stops an implicit circular dependency -dnl in GNU Make which causes the .d file to be overwritten (Bug 61268) cat>>Makefile.objects< \$[]@ + CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 's,PHP_,DTRACE_,g' \$[]@ \$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj -EOF - - case $host_alias in - *solaris*|*linux*) - dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o" - dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs" - dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o" - dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)' - for ac_lo in $PHP_DTRACE_OBJS; do - dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" - done; -dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692) - cat>>Makefile.objects< \$[]@ - @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir - if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] - echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "pic_object='none'" >> \$[]@ [;\\] - fi - if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] - echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "non_pic_object='none'" >> \$[]@ [;\\] - fi - -EOF - - ;; - *) -cat>>Makefile.objects< -#endif -#if HAVE_SYS_TYPES_H -# include -#endif - ]) - AC_DEFINE([PHP_HAVE_STDINT_TYPES], [1], [Checked for stdint types]) ]) diff --git a/build/libtool.m4 b/build/libtool.m4 index 56658ccbb4d4..268cad9d3e5c 100644 --- a/build/libtool.m4 +++ b/build/libtool.m4 @@ -193,11 +193,11 @@ AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], -[ --disable-libtool-lock Avoid locking (might break parallel builds)]) +[ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], -[ --with-pic Try to use only PIC/non-PIC objects [default=use both]], +[ --with-pic try to use only PIC/non-PIC objects [default=use both]], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default @@ -1230,7 +1230,7 @@ if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - # We can hardcode non-existent directories. + # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -1919,7 +1919,7 @@ fi AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], -[ --with-tags[=TAGS] Include additional configurations [automatic] +[ --with-tags[=TAGS] include additional configurations [automatic] ], [tagnames="$withval"]) @@ -2023,7 +2023,7 @@ AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], changequote(<<, >>)dnl -<< --enable-shared[=PKGS] Build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in @@ -2063,7 +2063,7 @@ AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], changequote(<<, >>)dnl -<< --enable-static[=PKGS] Build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in @@ -2103,8 +2103,7 @@ AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] - Optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in @@ -2242,7 +2241,7 @@ fi # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld Assume the C compiler uses GNU ld [default=no]], +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl diff --git a/build/shtool b/build/shtool index 684a01f5df96..d50aa1dbb85d 100755 --- a/build/shtool +++ b/build/shtool @@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do eval "opt_${opt_OPT}=yes" ;; ':' ) - # option with argument (multiple occurrences override) + # option with argument (multiple occurances override) eval "opt_${opt_OPT}=\"\$opt_ARG\"" ;; '+' ) - # option with argument (multiple occurrences append) + # option with argument (multiple occurances append) eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\"" ;; * ) diff --git a/config.guess b/config.guess index 1578aa1736a3..b94cde8ef2e0 100644 --- a/config.guess +++ b/config.guess @@ -1080,7 +1080,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that + # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; diff --git a/configure.in b/configure.in index 16738fe30ab6..260b982ce8a4 100644 --- a/configure.in +++ b/configure.in @@ -572,9 +572,6 @@ PHP_CHECK_SIZEOF(intmax_t, 0) PHP_CHECK_SIZEOF(ssize_t, 8) PHP_CHECK_SIZEOF(ptrdiff_t, 8) -dnl Check stdint types (must be after header check) -PHP_CHECK_STDINT_TYPES - dnl Check for members of the stat structure AC_STRUCT_ST_BLKSIZE dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists @@ -1009,7 +1006,7 @@ dnl Check if all enabled by default extensions should be disabled dnl AC_ARG_ENABLE(all, -[ --disable-all Disable all extensions which are enabled by default +[ --disable-all Disable all extensions which are enabled by default ], [ PHP_ENABLE_ALL=$enableval ]) @@ -1585,7 +1582,7 @@ cat <abstract) { /* Should never happen */ @@ -222,6 +223,7 @@ static php_stream_filter_status_t php_bz2_compress_filter( } data = (php_bz2_filter_data *)(thisfilter->abstract); + streamp = &(data->strm); while (buckets_in->head) { size_t bin = 0, desired; diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 index 55917c07f421..3e6aa78d053a 100644 --- a/ext/bz2/config.m4 +++ b/ext/bz2/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(bz2, for BZip2 support, -[ --with-bz2[=DIR] Include BZip2 support]) +[ --with-bz2[=DIR] Include BZip2 support]) if test "$PHP_BZ2" != "no"; then if test -r $PHP_BZ2/include/bzlib.h; then diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index 7bcffc1831e5..8b12eca357d9 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -47,8 +47,8 @@ extern zend_module_entry bz2_module_entry; # define PHP_BZ2_API #endif -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC); +PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC); #define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC) #define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC) diff --git a/ext/bz2/tests/bug51997.phpt b/ext/bz2/tests/bug51997.phpt index c53deacc5f3d..fea539894773 100644 --- a/ext/bz2/tests/bug51997.phpt +++ b/ext/bz2/tests/bug51997.phpt @@ -7,7 +7,7 @@ Bug #51997 (SEEK_CUR with 0 value, returns a warning) error_reporting(E_ALL); -$filename = "bug51997.bz2"; +$filename = "testfile.bz2"; $str = "This is a test string.\n"; $bz = bzopen($filename, "w"); bzwrite($bz, $str); diff --git a/ext/bz2/tests/with_files.phpt b/ext/bz2/tests/with_files.phpt index 3763398a14d6..569144593928 100644 --- a/ext/bz2/tests/with_files.phpt +++ b/ext/bz2/tests/with_files.phpt @@ -7,7 +7,7 @@ BZ2 with files error_reporting(E_ALL); -$filename = "with_files.bz2"; +$filename = "testfile.bz2"; $str = "This is a test string.\n"; $bz = bzopen($filename, "w"); bzwrite($bz, $str); diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c index ddc8aaaf86c6..9e5b0beced7a 100644 --- a/ext/calendar/jewish.c +++ b/ext/calendar/jewish.c @@ -272,7 +272,6 @@ #define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) #define JEWISH_SDN_OFFSET 347997 -#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */ #define NEW_MOON_OF_CREATION 31524 #define SUNDAY 0 @@ -560,7 +559,7 @@ void SdnToJewish( int tishri1After; int yearLength; - if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) { + if (sdn <= JEWISH_SDN_OFFSET) { *pYear = 0; *pMonth = 0; *pDay = 0; diff --git a/ext/calendar/tests/jdtojewish64.phpt b/ext/calendar/tests/jdtojewish64.phpt deleted file mode 100644 index 9f01109a71c2..000000000000 --- a/ext/calendar/tests/jdtojewish64.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #64895: Integer overflow in SndToJewish ---SKIPIF-- - ---FILE-- - max_index) { @@ -102,9 +102,8 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep { OLECHAR *olestring; php_com_dotnet_object *obj; - zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z)); - switch (ztype) { + switch (Z_TYPE_P(z)) { case IS_NULL: V_VT(v) = VT_NULL; break; @@ -430,7 +429,7 @@ PHP_FUNCTION(com_variant_create_instance) /* If already an array and VT_ARRAY is passed then: - if only VT_ARRAY passed then do not perform a conversion - if VT_ARRAY plus other type passed then perform conversion - but will probably fail (original behavior) + but will probably fail (origional behavior) */ if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) { long orig_vt = vt; diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 355779e4ad97..597b0599510f 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -467,7 +467,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) /* properties */ if (Z_OBJPROP_P(disp->object)) { zend_hash_internal_pointer_reset_ex(Z_OBJPROP_P(disp->object), &pos); - while (HASH_KEY_NON_EXISTENT != (keytype = + while (HASH_KEY_NON_EXISTANT != (keytype = zend_hash_get_current_key_ex(Z_OBJPROP_P(disp->object), &name, &namelen, &pid, 0, &pos))) { char namebuf[32]; @@ -498,7 +498,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) /* functions */ if (Z_OBJCE_P(disp->object)) { zend_hash_internal_pointer_reset_ex(&Z_OBJCE_P(disp->object)->function_table, &pos); - while (HASH_KEY_NON_EXISTENT != (keytype = + while (HASH_KEY_NON_EXISTANT != (keytype = zend_hash_get_current_key_ex(&Z_OBJCE_P(disp->object)->function_table, &name, &namelen, &pid, 0, &pos))) { @@ -598,7 +598,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); zend_hash_internal_pointer_reset_ex(id_to_name, &pos); - while (HASH_KEY_NON_EXISTENT != (keytype = + while (HASH_KEY_NON_EXISTANT != (keytype = zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) { if (keytype == HASH_KEY_IS_LONG) { diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 2f82c3485d86..e3d1d51cccdf 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(curl, for cURL support, -[ --with-curl[=DIR] Include cURL support]) +[ --with-curl[=DIR] Include cURL support]) if test "$PHP_CURL" != "no"; then if test -r $PHP_CURL/include/curl/easy.h; then diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 591315973ce2..ccbc08db61cd 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -958,7 +958,7 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLFTPMETHOD_SINGLECWD); #endif -#if LIBCURL_VERSION_NUM >= 0x070f04 /* Available since 7.15.4 */ +#if LIBCURL_VERSION_NUM >- 0x070f04 /* Available since 7.15.4 */ REGISTER_CURL_CONSTANT(CURLINFO_FTP_ENTRY_PATH); #endif @@ -1717,9 +1717,9 @@ static void curl_free_post(void **post) /* {{{ curl_free_slist */ -static void curl_free_slist(void *slist) +static void curl_free_slist(void **slist) { - curl_slist_free_all(*((struct curl_slist **) slist)); + curl_slist_free_all((struct curl_slist *) *slist); } /* }}} */ @@ -1790,11 +1790,9 @@ static void alloc_curl_handle(php_curl **ch) (*ch)->handlers->read->stream = NULL; zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); + zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); (*ch)->safe_upload = 1; /* for now, for BC reason we allow unsafe API */ - - (*ch)->to_free->slist = emalloc(sizeof(HashTable)); - zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); } /* }}} */ @@ -2045,7 +2043,6 @@ PHP_FUNCTION(curl_copy_handle) } #endif - efree(dupch->to_free->slist); efree(dupch->to_free); dupch->to_free = ch->to_free; @@ -2441,7 +2438,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu ph = HASH_OF(*zvalue); if (!ph) { - char *name = NULL; + char *name; switch (option) { case CURLOPT_HTTPHEADER: name = "CURLOPT_HTTPHEADER"; @@ -2491,7 +2488,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu return 1; } } - zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); + zend_llist_add_element(&ch->to_free->slist, &slist); error = curl_easy_setopt(ch->cp, option, slist); @@ -2504,7 +2501,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu case CURLOPT_FOLLOWLOCATION: convert_to_long_ex(zvalue); -#if LIBCURL_VERSION_NUM < 0x071304 if (PG(open_basedir) && *PG(open_basedir)) { if (Z_LVAL_PP(zvalue) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); @@ -2512,7 +2508,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu return 1; } } -#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; @@ -3271,9 +3266,8 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC) /* cURL destructors should be invoked only by last curl handle */ if (Z_REFCOUNT_P(ch->clone) <= 1) { zend_llist_clean(&ch->to_free->str); + zend_llist_clean(&ch->to_free->slist); zend_llist_clean(&ch->to_free->post); - zend_hash_destroy(ch->to_free->slist); - efree(ch->to_free->slist); efree(ch->to_free); FREE_ZVAL(ch->clone); } else { diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index c45ed80fc252..9e98fe57cdc5 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -168,7 +168,7 @@ struct _php_curl_send_headers { struct _php_curl_free { zend_llist str; zend_llist post; - HashTable *slist; + zend_llist slist; }; typedef struct { diff --git a/ext/curl/tests/bug65458.phpt b/ext/curl/tests/bug65458.phpt deleted file mode 100644 index 99288f24be4d..000000000000 --- a/ext/curl/tests/bug65458.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #65458 (curl memory leak) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) diff --git a/ext/curl/tests/bug65646.phpt b/ext/curl/tests/bug65646.phpt deleted file mode 100644 index f244f7238fc7..000000000000 --- a/ext/curl/tests/bug65646.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir disabled ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) diff --git a/ext/curl/tests/bug65646_open_basedir_new.phpt b/ext/curl/tests/bug65646_open_basedir_new.phpt deleted file mode 100644 index 991c4a2b8a56..000000000000 --- a/ext/curl/tests/bug65646_open_basedir_new.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl >= 7.19.4 ---INI-- -open_basedir=. ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) - -Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d -bool(false) - -Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d -bool(false) diff --git a/ext/curl/tests/bug65646_open_basedir_old.phpt b/ext/curl/tests/bug65646_open_basedir_old.phpt deleted file mode 100644 index cf11d21a200a..000000000000 --- a/ext/curl/tests/bug65646_open_basedir_old.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl < 7.19.4 ---INI-- -open_basedir=. ---SKIPIF-- -=')) exit("skip curl version is too new"); -?> ---FILE-- - ---EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s on line %d -bool(false) diff --git a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt new file mode 100644 index 000000000000..7a778f36924d --- /dev/null +++ b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt @@ -0,0 +1,22 @@ +--TEST-- +CURLOPT_FOLLOWLOCATION case check open_basedir +--CREDITS-- +WHITE new media architects - Dennis +--INI-- +open_basedir = DIRECTORY_SEPARATOR."tmp"; +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s.php on line %d +bool(false) + diff --git a/ext/date/config0.m4 b/ext/date/config0.m4 index 0b46c6803a7f..f403104a8afb 100644 --- a/ext/date/config0.m4 +++ b/ext/date/config0.m4 @@ -22,5 +22,4 @@ cat > $ext_builddir/lib/timelib_config.h < #endif -#include EOF diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 9428ce380415..8f707482678a 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sun Aug 25 15:12:48 2013 */ +/* Generated by re2c 0.13.5 on Fri Apr 26 11:10:28 2013 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -616,8 +616,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr) char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' && - **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { ++*ptr; } end = *ptr; @@ -837,11 +836,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) std: s->tok = cursor; s->len = 0; -#line 963 "ext/date/lib/parse_date.re" +#line 962 "ext/date/lib/parse_date.re" -#line 845 "ext/date/lib/parse_date.c" +#line 844 "ext/date/lib/parse_date.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -961,7 +960,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy2: YYDEBUG(2, *YYCURSOR); -#line 1049 "ext/date/lib/parse_date.re" +#line 1048 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("firstdayof | lastdayof"); TIMELIB_INIT; @@ -977,7 +976,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 981 "ext/date/lib/parse_date.c" +#line 980 "ext/date/lib/parse_date.c" yy3: YYDEBUG(3, *YYCURSOR); ++YYCURSOR; @@ -1000,7 +999,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy4: YYDEBUG(4, *YYCURSOR); -#line 1643 "ext/date/lib/parse_date.re" +#line 1642 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -1013,7 +1012,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 1017 "ext/date/lib/parse_date.c" +#line 1016 "ext/date/lib/parse_date.c" yy5: YYDEBUG(5, *YYCURSOR); yych = *++YYCURSOR; @@ -1324,12 +1323,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1385; yy13: YYDEBUG(13, *YYCURSOR); -#line 1738 "ext/date/lib/parse_date.re" +#line 1737 "ext/date/lib/parse_date.re" { add_error(s, "Unexpected character"); goto std; } -#line 1333 "ext/date/lib/parse_date.c" +#line 1332 "ext/date/lib/parse_date.c" yy14: YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; @@ -2386,11 +2385,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy55; yy50: YYDEBUG(50, *YYCURSOR); -#line 1727 "ext/date/lib/parse_date.re" +#line 1726 "ext/date/lib/parse_date.re" { goto std; } -#line 2394 "ext/date/lib/parse_date.c" +#line 2393 "ext/date/lib/parse_date.c" yy51: YYDEBUG(51, *YYCURSOR); yych = *++YYCURSOR; @@ -2399,12 +2398,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(52, *YYCURSOR); ++YYCURSOR; YYDEBUG(53, *YYCURSOR); -#line 1732 "ext/date/lib/parse_date.re" +#line 1731 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 2408 "ext/date/lib/parse_date.c" +#line 2407 "ext/date/lib/parse_date.c" yy54: YYDEBUG(54, *YYCURSOR); yych = *++YYCURSOR; @@ -2791,7 +2790,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 's') goto yy74; yy73: YYDEBUG(73, *YYCURSOR); -#line 1711 "ext/date/lib/parse_date.re" +#line 1710 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -2806,7 +2805,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 2810 "ext/date/lib/parse_date.c" +#line 2809 "ext/date/lib/parse_date.c" yy74: YYDEBUG(74, *YYCURSOR); yych = *++YYCURSOR; @@ -3568,7 +3567,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy167: YYDEBUG(167, *YYCURSOR); -#line 1574 "ext/date/lib/parse_date.re" +#line 1573 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -3585,7 +3584,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3589 "ext/date/lib/parse_date.c" +#line 3588 "ext/date/lib/parse_date.c" yy168: YYDEBUG(168, *YYCURSOR); yych = *++YYCURSOR; @@ -4105,7 +4104,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy194: YYDEBUG(194, *YYCURSOR); -#line 1633 "ext/date/lib/parse_date.re" +#line 1632 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -4114,7 +4113,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4118 "ext/date/lib/parse_date.c" +#line 4117 "ext/date/lib/parse_date.c" yy195: YYDEBUG(195, *YYCURSOR); ++YYCURSOR; @@ -4165,7 +4164,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy199: YYDEBUG(199, *YYCURSOR); -#line 1379 "ext/date/lib/parse_date.re" +#line 1378 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datetextual | datenoyear"); @@ -4178,7 +4177,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4182 "ext/date/lib/parse_date.c" +#line 4181 "ext/date/lib/parse_date.c" yy200: YYDEBUG(200, *YYCURSOR); yyaccept = 6; @@ -4447,7 +4446,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy223: YYDEBUG(223, *YYCURSOR); -#line 1681 "ext/date/lib/parse_date.re" +#line 1680 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -4476,7 +4475,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4480 "ext/date/lib/parse_date.c" +#line 4479 "ext/date/lib/parse_date.c" yy224: YYDEBUG(224, *YYCURSOR); yyaccept = 7; @@ -5174,7 +5173,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(278, *YYCURSOR); ++YYCURSOR; YYDEBUG(279, *YYCURSOR); -#line 1657 "ext/date/lib/parse_date.re" +#line 1656 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); TIMELIB_INIT; @@ -5197,7 +5196,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 5201 "ext/date/lib/parse_date.c" +#line 5200 "ext/date/lib/parse_date.c" yy280: YYDEBUG(280, *YYCURSOR); yych = *++YYCURSOR; @@ -5375,7 +5374,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy295: YYDEBUG(295, *YYCURSOR); -#line 1351 "ext/date/lib/parse_date.re" +#line 1350 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenoday"); @@ -5388,7 +5387,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 5392 "ext/date/lib/parse_date.c" +#line 5391 "ext/date/lib/parse_date.c" yy296: YYDEBUG(296, *YYCURSOR); yych = *++YYCURSOR; @@ -6608,7 +6607,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy365; yy364: YYDEBUG(364, *YYCURSOR); -#line 1495 "ext/date/lib/parse_date.re" +#line 1494 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextshort"); @@ -6621,7 +6620,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 6625 "ext/date/lib/parse_date.c" +#line 6624 "ext/date/lib/parse_date.c" yy365: YYDEBUG(365, *YYCURSOR); yych = *++YYCURSOR; @@ -7259,7 +7258,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy393: YYDEBUG(393, *YYCURSOR); -#line 1553 "ext/date/lib/parse_date.re" +#line 1552 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("ago"); TIMELIB_INIT; @@ -7279,7 +7278,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 7283 "ext/date/lib/parse_date.c" +#line 7282 "ext/date/lib/parse_date.c" yy394: YYDEBUG(394, *YYCURSOR); yyaccept = 5; @@ -9029,7 +9028,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy455: YYDEBUG(455, *YYCURSOR); -#line 1256 "ext/date/lib/parse_date.re" +#line 1255 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); TIMELIB_INIT; @@ -9040,7 +9039,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 9044 "ext/date/lib/parse_date.c" +#line 9043 "ext/date/lib/parse_date.c" yy456: YYDEBUG(456, *YYCURSOR); yyaccept = 0; @@ -9600,7 +9599,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy476: YYDEBUG(476, *YYCURSOR); -#line 1393 "ext/date/lib/parse_date.re" +#line 1392 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenoyearrev"); TIMELIB_INIT; @@ -9611,7 +9610,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 9615 "ext/date/lib/parse_date.c" +#line 9614 "ext/date/lib/parse_date.c" yy477: YYDEBUG(477, *YYCURSOR); yyaccept = 10; @@ -9752,7 +9751,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(488, *YYCURSOR); ++YYCURSOR; YYDEBUG(489, *YYCURSOR); -#line 1111 "ext/date/lib/parse_date.re" +#line 1110 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); TIMELIB_INIT; @@ -9768,7 +9767,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 9772 "ext/date/lib/parse_date.c" +#line 9771 "ext/date/lib/parse_date.c" yy490: YYDEBUG(490, *YYCURSOR); yyaccept = 11; @@ -9781,7 +9780,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy491: YYDEBUG(491, *YYCURSOR); -#line 1148 "ext/date/lib/parse_date.re" +#line 1147 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); @@ -9806,7 +9805,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9810 "ext/date/lib/parse_date.c" +#line 9809 "ext/date/lib/parse_date.c" yy492: YYDEBUG(492, *YYCURSOR); yyaccept = 11; @@ -10116,7 +10115,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(523, *YYCURSOR); ++YYCURSOR; YYDEBUG(524, *YYCURSOR); -#line 1128 "ext/date/lib/parse_date.re" +#line 1127 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("mssqltime"); TIMELIB_INIT; @@ -10135,7 +10134,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 10139 "ext/date/lib/parse_date.c" +#line 10138 "ext/date/lib/parse_date.c" yy525: YYDEBUG(525, *YYCURSOR); yyaccept = 11; @@ -10241,7 +10240,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy541; yy535: YYDEBUG(535, *YYCURSOR); -#line 1310 "ext/date/lib/parse_date.re" +#line 1309 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datefull"); @@ -10255,7 +10254,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 10259 "ext/date/lib/parse_date.c" +#line 10258 "ext/date/lib/parse_date.c" yy536: YYDEBUG(536, *YYCURSOR); yych = *++YYCURSOR; @@ -10992,7 +10991,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(606, *YYCURSOR); ++YYCURSOR; YYDEBUG(607, *YYCURSOR); -#line 1325 "ext/date/lib/parse_date.re" +#line 1324 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pointed date YYYY"); TIMELIB_INIT; @@ -11003,7 +11002,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 11007 "ext/date/lib/parse_date.c" +#line 11006 "ext/date/lib/parse_date.c" yy608: YYDEBUG(608, *YYCURSOR); yyaccept = 11; @@ -11039,7 +11038,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy605; yy612: YYDEBUG(612, *YYCURSOR); -#line 1337 "ext/date/lib/parse_date.re" +#line 1336 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pointed date YY"); @@ -11052,7 +11051,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 11056 "ext/date/lib/parse_date.c" +#line 11055 "ext/date/lib/parse_date.c" yy613: YYDEBUG(613, *YYCURSOR); yyaccept = 11; @@ -11693,7 +11692,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy657: YYDEBUG(657, *YYCURSOR); -#line 1296 "ext/date/lib/parse_date.re" +#line 1295 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshort"); @@ -11706,7 +11705,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11710 "ext/date/lib/parse_date.c" +#line 11709 "ext/date/lib/parse_date.c" yy658: YYDEBUG(658, *YYCURSOR); yyaccept = 13; @@ -11812,7 +11811,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy667: YYDEBUG(667, *YYCURSOR); -#line 1240 "ext/date/lib/parse_date.re" +#line 1239 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("americanshort | american"); @@ -11827,7 +11826,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 11831 "ext/date/lib/parse_date.c" +#line 11830 "ext/date/lib/parse_date.c" yy668: YYDEBUG(668, *YYCURSOR); yyaccept = 14; @@ -12060,7 +12059,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy704; yy701: YYDEBUG(701, *YYCURSOR); -#line 1523 "ext/date/lib/parse_date.re" +#line 1522 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("clf"); @@ -12080,7 +12079,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12084 "ext/date/lib/parse_date.c" +#line 12083 "ext/date/lib/parse_date.c" yy702: YYDEBUG(702, *YYCURSOR); yych = *++YYCURSOR; @@ -12632,7 +12631,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy764: YYDEBUG(764, *YYCURSOR); -#line 1268 "ext/date/lib/parse_date.re" +#line 1267 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("iso8601date2"); @@ -12645,7 +12644,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 12649 "ext/date/lib/parse_date.c" +#line 12648 "ext/date/lib/parse_date.c" yy765: YYDEBUG(765, *YYCURSOR); yych = *++YYCURSOR; @@ -12684,7 +12683,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(771, *YYCURSOR); ++YYCURSOR; YYDEBUG(772, *YYCURSOR); -#line 1509 "ext/date/lib/parse_date.re" +#line 1508 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextreverse"); @@ -12697,7 +12696,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 12701 "ext/date/lib/parse_date.c" +#line 12700 "ext/date/lib/parse_date.c" yy773: YYDEBUG(773, *YYCURSOR); yych = *++YYCURSOR; @@ -12835,7 +12834,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy784: YYDEBUG(784, *YYCURSOR); -#line 1544 "ext/date/lib/parse_date.re" +#line 1543 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("year4"); TIMELIB_INIT; @@ -12843,7 +12842,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12847 "ext/date/lib/parse_date.c" +#line 12846 "ext/date/lib/parse_date.c" yy785: YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; @@ -12994,7 +12993,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy794: YYDEBUG(794, *YYCURSOR); -#line 1365 "ext/date/lib/parse_date.re" +#line 1364 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenodayrev"); @@ -13007,7 +13006,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 13011 "ext/date/lib/parse_date.c" +#line 13010 "ext/date/lib/parse_date.c" yy795: YYDEBUG(795, *YYCURSOR); yych = *++YYCURSOR; @@ -13222,7 +13221,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '7') goto yy817; yy815: YYDEBUG(815, *YYCURSOR); -#line 1476 "ext/date/lib/parse_date.re" +#line 1475 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweek"); @@ -13240,7 +13239,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13244 "ext/date/lib/parse_date.c" +#line 13243 "ext/date/lib/parse_date.c" yy816: YYDEBUG(816, *YYCURSOR); yych = *++YYCURSOR; @@ -13250,7 +13249,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(817, *YYCURSOR); ++YYCURSOR; YYDEBUG(818, *YYCURSOR); -#line 1457 "ext/date/lib/parse_date.re" +#line 1456 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweekday"); @@ -13268,7 +13267,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13272 "ext/date/lib/parse_date.c" +#line 13271 "ext/date/lib/parse_date.c" yy819: YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; @@ -13332,7 +13331,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy822: YYDEBUG(822, *YYCURSOR); -#line 1443 "ext/date/lib/parse_date.re" +#line 1442 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgydotd"); @@ -13345,7 +13344,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 13349 "ext/date/lib/parse_date.c" +#line 13348 "ext/date/lib/parse_date.c" yy823: YYDEBUG(823, *YYCURSOR); yych = *++YYCURSOR; @@ -13448,7 +13447,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy843: YYDEBUG(843, *YYCURSOR); -#line 1417 "ext/date/lib/parse_date.re" +#line 1416 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); @@ -13473,7 +13472,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 13477 "ext/date/lib/parse_date.c" +#line 13476 "ext/date/lib/parse_date.c" yy844: YYDEBUG(844, *YYCURSOR); yych = *++YYCURSOR; @@ -13735,7 +13734,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy849: YYDEBUG(849, *YYCURSOR); -#line 1405 "ext/date/lib/parse_date.re" +#line 1404 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenocolon"); TIMELIB_INIT; @@ -13746,7 +13745,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 13750 "ext/date/lib/parse_date.c" +#line 13749 "ext/date/lib/parse_date.c" yy850: YYDEBUG(850, *YYCURSOR); yych = *++YYCURSOR; @@ -14666,7 +14665,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy996; yy974: YYDEBUG(974, *YYCURSOR); -#line 1282 "ext/date/lib/parse_date.re" +#line 1281 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshorter"); @@ -14679,7 +14678,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 14683 "ext/date/lib/parse_date.c" +#line 14682 "ext/date/lib/parse_date.c" yy975: YYDEBUG(975, *YYCURSOR); yyaccept = 22; @@ -15688,7 +15687,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1068: YYDEBUG(1068, *YYCURSOR); -#line 1174 "ext/date/lib/parse_date.re" +#line 1173 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("gnunocolon"); TIMELIB_INIT; @@ -15710,7 +15709,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 15714 "ext/date/lib/parse_date.c" +#line 15713 "ext/date/lib/parse_date.c" yy1069: YYDEBUG(1069, *YYCURSOR); yych = *++YYCURSOR; @@ -15802,7 +15801,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1076: YYDEBUG(1076, *YYCURSOR); -#line 1220 "ext/date/lib/parse_date.re" +#line 1219 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("iso8601nocolon"); @@ -15821,7 +15820,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 15825 "ext/date/lib/parse_date.c" +#line 15824 "ext/date/lib/parse_date.c" yy1077: YYDEBUG(1077, *YYCURSOR); yyaccept = 25; @@ -16719,7 +16718,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1118: YYDEBUG(1118, *YYCURSOR); -#line 1616 "ext/date/lib/parse_date.re" +#line 1615 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16735,7 +16734,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16739 "ext/date/lib/parse_date.c" +#line 16738 "ext/date/lib/parse_date.c" yy1119: YYDEBUG(1119, *YYCURSOR); ++YYCURSOR; @@ -16786,7 +16785,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) YYDEBUG(1126, *YYCURSOR); ++YYCURSOR; YYDEBUG(1127, *YYCURSOR); -#line 1089 "ext/date/lib/parse_date.re" +#line 1088 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16807,7 +16806,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 16811 "ext/date/lib/parse_date.c" +#line 16810 "ext/date/lib/parse_date.c" yy1128: YYDEBUG(1128, *YYCURSOR); yyaccept = 26; @@ -16915,7 +16914,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1142: YYDEBUG(1142, *YYCURSOR); -#line 1592 "ext/date/lib/parse_date.re" +#line 1591 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16938,7 +16937,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16942 "ext/date/lib/parse_date.c" +#line 16941 "ext/date/lib/parse_date.c" yy1143: YYDEBUG(1143, *YYCURSOR); yych = *++YYCURSOR; @@ -19615,7 +19614,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy1298; yy1295: YYDEBUG(1295, *YYCURSOR); -#line 1066 "ext/date/lib/parse_date.re" +#line 1065 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("backof | frontof"); TIMELIB_INIT; @@ -19637,7 +19636,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19641 "ext/date/lib/parse_date.c" +#line 19640 "ext/date/lib/parse_date.c" yy1296: YYDEBUG(1296, *YYCURSOR); yyaccept = 28; @@ -21328,7 +21327,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1385; yy1387: YYDEBUG(1387, *YYCURSOR); -#line 1023 "ext/date/lib/parse_date.re" +#line 1022 "ext/date/lib/parse_date.re" { timelib_ull i; @@ -21353,7 +21352,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21357 "ext/date/lib/parse_date.c" +#line 21356 "ext/date/lib/parse_date.c" yy1388: YYDEBUG(1388, *YYCURSOR); yych = *++YYCURSOR; @@ -21789,7 +21788,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy1417: YYDEBUG(1417, *YYCURSOR); -#line 1011 "ext/date/lib/parse_date.re" +#line 1010 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("tomorrow"); TIMELIB_INIT; @@ -21800,7 +21799,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21804 "ext/date/lib/parse_date.c" +#line 21803 "ext/date/lib/parse_date.c" yy1418: YYDEBUG(1418, *YYCURSOR); yych = *++YYCURSOR; @@ -21835,7 +21834,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1420: YYDEBUG(1420, *YYCURSOR); -#line 1001 "ext/date/lib/parse_date.re" +#line 1000 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("midnight | today"); TIMELIB_INIT; @@ -21844,7 +21843,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21848 "ext/date/lib/parse_date.c" +#line 21847 "ext/date/lib/parse_date.c" yy1421: YYDEBUG(1421, *YYCURSOR); yych = *++YYCURSOR; @@ -23856,7 +23855,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1500: YYDEBUG(1500, *YYCURSOR); -#line 980 "ext/date/lib/parse_date.re" +#line 979 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("now"); TIMELIB_INIT; @@ -23864,7 +23863,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 23868 "ext/date/lib/parse_date.c" +#line 23867 "ext/date/lib/parse_date.c" yy1501: YYDEBUG(1501, *YYCURSOR); yych = *++YYCURSOR; @@ -24003,7 +24002,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } yy1508: YYDEBUG(1508, *YYCURSOR); -#line 989 "ext/date/lib/parse_date.re" +#line 988 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("noon"); TIMELIB_INIT; @@ -24014,7 +24013,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24018 "ext/date/lib/parse_date.c" +#line 24017 "ext/date/lib/parse_date.c" yy1509: YYDEBUG(1509, *YYCURSOR); yyaccept = 0; @@ -24547,7 +24546,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) ++YYCURSOR; yy1531: YYDEBUG(1531, *YYCURSOR); -#line 968 "ext/date/lib/parse_date.re" +#line 967 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("yesterday"); TIMELIB_INIT; @@ -24558,7 +24557,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24562 "ext/date/lib/parse_date.c" +#line 24561 "ext/date/lib/parse_date.c" yy1532: YYDEBUG(1532, *YYCURSOR); yyaccept = 0; @@ -24731,7 +24730,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy1531; } } -#line 1742 "ext/date/lib/parse_date.re" +#line 1741 "ext/date/lib/parse_date.re" } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 7efeb430c3be..014f6a09e2f3 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -614,8 +614,7 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr) char *begin = *ptr, *end; const timelib_relunit *tp, *value = NULL; - while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' && - **ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) { + while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') { ++*ptr; } end = *ptr; diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h index cc12eb38a6f0..a3d7793447b7 100644 --- a/ext/date/lib/timelib_structs.h +++ b/ext/date/lib/timelib_structs.h @@ -23,7 +23,37 @@ #include "timelib_config.h" -#include "php_stdint.h" +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#if defined(HAVE_INTTYPES_H) +#include +#elif defined(HAVE_STDINT_H) +#include +#endif + +#ifdef PHP_WIN32 +/* TODO: Remove these hacks/defs once we have the int definitions in main/ + rathen than in each 2nd extension and win32/ */ +# include "win32/php_stdint.h" +#else +# ifndef HAVE_INT32_T +# if SIZEOF_INT == 4 +typedef int int32_t; +# elif SIZEOF_LONG == 4 +typedef long int int32_t; +# endif +# endif + +# ifndef HAVE_UINT32_T +# if SIZEOF_INT == 4 +typedef unsigned int uint32_t; +# elif SIZEOF_LONG == 4 +typedef unsigned long int uint32_t; +# endif +# endif +#endif #include diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 1e5706cdccd3..2f9d8fe66803 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -766,8 +766,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70, 0x4A, 0x23, 0x1A, 0x00, 0x4A, 0x8D, 0xD5, 0x70, 0x4B, 0xDC, 0xC0, 0x80, 0x4C, 0x5D, 0xE5, 0x70, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x08, 0xBB, 0xA0, -0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xD8, 0xCB, 0xA0, -0x52, 0x05, 0x9E, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, +0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xDB, 0x6E, 0xA0, +0x52, 0x02, 0xFB, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, 0x53, 0xD7, 0x00, 0x20, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x55, 0x82, 0x26, 0x20, 0x55, 0xA9, 0xB3, 0x20, 0x56, 0x07, 0x4D, 0xA0, 0x57, 0x1C, 0x28, 0xA0, 0x57, 0x56, 0x2A, 0xA0, 0x57, 0x7D, 0xB7, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0x28, 0xDD, 0xA0, @@ -7248,7 +7248,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x45, 0x53, 0x54, 0x00, 0x7A, 0x7A, 0x7A, 0x00, 0x4D, 0x49, 0x53, 0x54, 0x00, 0x00, -0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, 0x05, 0x32, 0x58, 0x00, 0x00, 0x00, 0x10, 0x4D, 0x61, 0x63, 0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, @@ -8441,19 +8441,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -8465,7 +8465,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB9, 0xD2, 0x87, 0x01, 0x48, 0x67, 0xD4, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xB9, 0xCD, 0x1A, 0x01, 0x48, 0x6B, 0x85, 0x00, 0x00, 0x00, 0x00, /* Asia/Kabul */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9310,19 +9310,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -16249,19 +16249,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x78, 0x0E, 0xDB, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xCE, 0x9F, 0x70, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x8E, 0x63, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, +0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, +0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, +0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, @@ -18410,4 +18410,4 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2013.4", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2013.3", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 95c68f1a78ca..808dc5a37769 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1041,7 +1041,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) static char *date_format(char *format, int format_len, timelib_time *t, int localtime) { smart_str string = {0}; - int i, length = 0; + int i, length; char buffer[97]; timelib_time_offset *offset = NULL; timelib_sll isoweek, isoyear; @@ -1396,7 +1396,7 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) } /* }}} */ -/* {{{ php_parse_date: Backwards compatibility function */ +/* {{{ php_parse_date: Backwards compability function */ PHPAPI signed long php_parse_date(char *string, signed long *now) { timelib_time *parsed_time; @@ -1678,13 +1678,6 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) break; } } -#if defined(PHP_WIN32) && _MSC_VER >= 1700 - /* VS2012 strftime() returns number of characters, not bytes. - See VC++11 bug id 766205. */ - if (real_len > 0) { - real_len = strlen(buf); - } -#endif timelib_time_dtor(ts); if (!gmt) { @@ -2198,13 +2191,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* first we add the date and time in ISO format */ MAKE_STD_ZVAL(zv); ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0); - zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL); + zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL); /* then we add the timezone name (or similar) */ if (dateobj->time->is_localtime) { MAKE_STD_ZVAL(zv); ZVAL_LONG(zv, dateobj->time->zone_type); - zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL); + zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL); MAKE_STD_ZVAL(zv); switch (dateobj->time->zone_type) { @@ -2227,7 +2220,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) ZVAL_STRING(zv, dateobj->time->tz_abbr, 1); break; } - zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL); + zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL); } return props; @@ -2305,7 +2298,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) MAKE_STD_ZVAL(zv); ZVAL_LONG(zv, tzobj->type); - zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL); + zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL); MAKE_STD_ZVAL(zv); switch (tzobj->type) { @@ -2327,7 +2320,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) ZVAL_STRING(zv, tzobj->tzi.z.abbr, 1); break; } - zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL); + zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL); return props; } @@ -2391,10 +2384,19 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) return props; } +#define PHP_DATE_INTERVAL_ADD_PROPERTY_I64(n, f) \ + do { \ + char i64_buf[DATE_I64_BUF_LEN]; \ + MAKE_STD_ZVAL(zv); \ + DATE_I64A(intervalobj->diff->f, i64_buf, DATE_I64_BUF_LEN); \ + ZVAL_STRING(zv, i64_buf, 1); \ + zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL); \ + } while(0); + #define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \ MAKE_STD_ZVAL(zv); \ - ZVAL_LONG(zv, (long)intervalobj->diff->f); \ - zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL); + ZVAL_LONG(zv, intervalobj->diff->f); \ + zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL); PHP_DATE_INTERVAL_ADD_PROPERTY("y", y); PHP_DATE_INTERVAL_ADD_PROPERTY("m", m); @@ -2407,14 +2409,14 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of); PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert); if (intervalobj->diff->days != -99999) { - PHP_DATE_INTERVAL_ADD_PROPERTY("days", days); + PHP_DATE_INTERVAL_ADD_PROPERTY_I64("days", days); } else { MAKE_STD_ZVAL(zv); ZVAL_FALSE(zv); - zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL); + zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL); } PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type); - PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount); + PHP_DATE_INTERVAL_ADD_PROPERTY_I64("special_amount", special.amount); PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative); PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative); @@ -2538,8 +2540,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, timelib_time *now; timelib_tzinfo *tzi = NULL; timelib_error_container *err = NULL; - int type = TIMELIB_ZONETYPE_ID, new_dst = 0; - char *new_abbr = NULL; + int type = TIMELIB_ZONETYPE_ID, new_dst; + char *new_abbr; timelib_sll new_offset; if (dateobj->time) { @@ -3702,30 +3704,27 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez zval **z_timezone = NULL; zval **z_timezone_type = NULL; timelib_tzinfo *tzi; + char **offset; if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) { if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) { convert_to_long(*z_timezone_type); switch (Z_LVAL_PP(z_timezone_type)) { - case TIMELIB_ZONETYPE_OFFSET: { - char *offset, *offset_start; - - offset = emalloc(sizeof(char) * (Z_STRLEN_PP(z_timezone) + 1)); - memmove(offset, Z_STRVAL_PP(z_timezone), Z_STRLEN_PP(z_timezone)+1); - offset_start = offset; - - ++offset; - if(*offset_start == '+'){ - (*tzobj)->tzi.utc_offset = -1 * timelib_parse_tz_cor(&offset); + case TIMELIB_ZONETYPE_OFFSET: + offset = malloc(sizeof(char) * (Z_STRLEN_PP(z_timezone) + 1)); + *offset = (Z_STRVAL_PP(z_timezone)); + if(**offset == '+'){ + ++*offset; + (*tzobj)->tzi.utc_offset = -1 * timelib_parse_tz_cor((char **)offset); } else { - (*tzobj)->tzi.utc_offset = timelib_parse_tz_cor(&offset); + ++*offset; + (*tzobj)->tzi.utc_offset = timelib_parse_tz_cor((char **)offset); } - efree(offset_start); + free(offset); (*tzobj)->type = TIMELIB_ZONETYPE_OFFSET; (*tzobj)->initialized = 1; return SUCCESS; break; - } case TIMELIB_ZONETYPE_ABBR: case TIMELIB_ZONETYPE_ID: if (SUCCESS == timezone_initialize(&tzi, Z_STRVAL_PP(z_timezone) TSRMLS_CC)) { @@ -4064,11 +4063,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze ALLOC_INIT_ZVAL(retval); Z_SET_REFCOUNT_P(retval, 0); - if (value != -99999) { - ZVAL_LONG(retval, value); - } else { - ZVAL_FALSE(retval); - } + ZVAL_LONG(retval, value); if (member == &tmp_member) { zval_dtor(member); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 536629a25fa6..725590136c70 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -182,7 +182,7 @@ ZEND_END_MODULE_GLOBALS(date) #define DATEG(v) (date_globals.v) #endif -/* Backwards compatibility wrapper */ +/* Backwards compability wrapper */ PHPAPI signed long php_parse_date(char *string, signed long *now); PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt); PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); diff --git a/ext/date/tests/DateInterval_days_prop1.phpt b/ext/date/tests/DateInterval_days_prop1.phpt deleted file mode 100644 index 627b8f0b27f3..000000000000 --- a/ext/date/tests/DateInterval_days_prop1.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Wrong var_dump(DateInterval->days) value ---FILE-- -days); ---EXPECT-- -bool(false) diff --git a/ext/date/tests/DateTime_fix_createFromFormat.phpt b/ext/date/tests/DateTime_fix_createFromFormat.phpt deleted file mode 100644 index abde292775de..000000000000 --- a/ext/date/tests/DateTime_fix_createFromFormat.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test fix for DateTime when date have textual day with dot or other special char at end ---FILE-- -format("D., M. j, Y g:iA") . "\n"; -echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n"; - -?> -===DONE=== ---EXPECTF-- -*** Testing clone on DateTime objects *** -Format method: Thu., Nov. 29, 2012 5:00PM -createFromFormat method: Thu., Nov. 29, 2012 5:00PM -===DONE=== diff --git a/ext/date/tests/bug45682.phpt b/ext/date/tests/bug45682.phpt index ea8fa94706ef..094c7fdf45b3 100644 --- a/ext/date/tests/bug45682.phpt +++ b/ext/date/tests/bug45682.phpt @@ -34,11 +34,11 @@ object(DateInterval)#%d (15) { ["invert"]=> int(0) ["days"]=> - int(3) + string(1) "3" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug49778.phpt b/ext/date/tests/bug49778.phpt index 2062d69168d8..cc52a23b2549 100644 --- a/ext/date/tests/bug49778.phpt +++ b/ext/date/tests/bug49778.phpt @@ -34,7 +34,7 @@ object(DateInterval)#1 (15) { ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index 81e767b0f0c7..1d814377c699 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -4,6 +4,8 @@ Bug #52062 (large timestamps with DateTime::getTimestamp and DateTime::setTimest +--XFAIL-- +Waiting for resolution of the 32-bit case. --INI-- date.timezone=UTC --FILE-- diff --git a/ext/date/tests/bug52113.phpt b/ext/date/tests/bug52113.phpt index f4730c6a440c..862e92e96150 100644 --- a/ext/date/tests/bug52113.phpt +++ b/ext/date/tests/bug52113.phpt @@ -54,17 +54,17 @@ object(DateInterval)#3 (15) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } -string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}" +string(328) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:1:"0";s:12:"special_type";i:0;s:14:"special_amount";s:1:"0";s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}" DateInterval::__set_state(array( 'y' => 0, 'm' => 0, @@ -76,9 +76,9 @@ DateInterval::__set_state(array( 'weekday_behavior' => 0, 'first_last_day_of' => 0, 'invert' => 0, - 'days' => 0, + 'days' => '0', 'special_type' => 0, - 'special_amount' => 0, + 'special_amount' => '0', 'have_weekday_relative' => 0, 'have_special_relative' => 0, ))object(DateInterval)#5 (15) { @@ -103,11 +103,11 @@ DateInterval::__set_state(array( ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -150,11 +150,11 @@ object(DatePeriod)#6 (6) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -187,11 +187,11 @@ object(DateInterval)#8 (15) { ["invert"]=> int(1) ["days"]=> - int(2400) + string(4) "2400" ["special_type"]=> int(0) ["special_amount"]=> - int(-1) + string(2) "-1" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -234,11 +234,11 @@ object(DatePeriod)#9 (6) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug52808.phpt b/ext/date/tests/bug52808.phpt index 1f0fc84cd782..e3b38bb5ffd7 100644 --- a/ext/date/tests/bug52808.phpt +++ b/ext/date/tests/bug52808.phpt @@ -47,11 +47,11 @@ object(DateInterval)#%d (15) { ["invert"]=> int(1) ["days"]=> - int(437) + string(3) "437" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -79,11 +79,11 @@ object(DateInterval)#%d (15) { ["invert"]=> int(0) ["days"]=> - int(294) + string(3) "294" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -111,11 +111,11 @@ object(DateInterval)#%d (15) { ["invert"]=> int(0) ["days"]=> - int(294) + string(3) "294" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug53437.phpt b/ext/date/tests/bug53437.phpt index 2ea091453fa8..7a282ab6c2ee 100644 --- a/ext/date/tests/bug53437.phpt +++ b/ext/date/tests/bug53437.phpt @@ -77,7 +77,7 @@ object(DatePeriod)#1 (6) { ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -132,11 +132,11 @@ object(DatePeriod)#5 (6) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug53437_var2.phpt b/ext/date/tests/bug53437_var2.phpt index 50aebda57c24..70565960efbc 100644 --- a/ext/date/tests/bug53437_var2.phpt +++ b/ext/date/tests/bug53437_var2.phpt @@ -39,7 +39,7 @@ object(DateInterval)#1 (15) { ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> @@ -67,11 +67,11 @@ object(DateInterval)#2 (15) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug53437_var3.phpt b/ext/date/tests/bug53437_var3.phpt index 82b90f559b95..06f68df61ff6 100644 --- a/ext/date/tests/bug53437_var3.phpt +++ b/ext/date/tests/bug53437_var3.phpt @@ -1,7 +1,5 @@ --TEST-- -Bug #53437 DateInterval unserialize bad data, 32 bit ---SKIPIF-- - +Bug #53437 DateInterval unserialize bad data --FILE-- ==DONE== ---EXPECTF-- -object(DateInterval)#%d (15) { +--EXPECT-- +object(DateInterval)#1 (15) { ["y"]=> int(2) ["m"]=> @@ -34,11 +32,11 @@ object(DateInterval)#%d (15) { ["invert"]=> int(0) ["days"]=> - int(0) + string(1) "0" ["special_type"]=> int(0) ["special_amount"]=> - int(-1) + string(19) "9223372036854775807" ["have_weekday_relative"]=> int(9) ["have_special_relative"]=> diff --git a/ext/date/tests/bug53437_var4.phpt b/ext/date/tests/bug53437_var4.phpt deleted file mode 100644 index 88fd81c9db17..000000000000 --- a/ext/date/tests/bug53437_var4.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4 ---INI-- -date.timezone = Europe/Berlin ---FILE-- -diff(new DateTime('2009-10-13')); - -var_dump($df, - $df->y, - $df->m, - $df->d, - $df->h, - $df->i, - $df->s, - $df->invert, - $df->days); - -?> -==DONE== ---EXPECTF-- -object(DateInterval)#%d (15) { - ["y"]=> - int(0) - ["m"]=> - int(0) - ["d"]=> - int(2) - ["h"]=> - int(0) - ["i"]=> - int(0) - ["s"]=> - int(0) - ["weekday"]=> - int(0) - ["weekday_behavior"]=> - int(0) - ["first_last_day_of"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(2) - ["special_type"]=> - int(0) - ["special_amount"]=> - int(0) - ["have_weekday_relative"]=> - int(0) - ["have_special_relative"]=> - int(0) -} -int(0) -int(0) -int(2) -int(0) -int(0) -int(0) -int(0) -int(2) -==DONE== diff --git a/ext/date/tests/bug53437_var5.phpt b/ext/date/tests/bug53437_var5.phpt deleted file mode 100644 index e95fcdae9644..000000000000 --- a/ext/date/tests/bug53437_var5.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #53437 DateInterval unserialize bad data, 64 bit ---SKIPIF-- - ---FILE-- - -==DONE== ---EXPECTF-- -object(DateInterval)#%d (15) { - ["y"]=> - int(2) - ["m"]=> - int(0) - ["d"]=> - int(0) - ["h"]=> - int(6) - ["i"]=> - int(8) - ["s"]=> - int(0) - ["weekday"]=> - int(10) - ["weekday_behavior"]=> - int(10) - ["first_last_day_of"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(0) - ["special_type"]=> - int(0) - ["special_amount"]=> - int(9223372036854775807) - ["have_weekday_relative"]=> - int(9) - ["have_special_relative"]=> - int(0) -} -==DONE== diff --git a/ext/date/tests/bug55397.phpt b/ext/date/tests/bug55397.phpt index 7c9bbb01c1f3..13778a00b2c9 100644 --- a/ext/date/tests/bug55397.phpt +++ b/ext/date/tests/bug55397.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #55397 (comparison of incomplete DateTime causes SIGSEGV) +Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV) --INI-- --FILE-- int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/bug65184.phpt b/ext/date/tests/bug65184.phpt deleted file mode 100644 index 9bb68558aae8..000000000000 --- a/ext/date/tests/bug65184.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test bug #65184 strftime() returns insufficient-length string under multibyte locales ---SKIPIF-- - ---INI-- -date.timezone = UTC ---FILE-- - -===DONE=== ---EXPECT-- -90 85 97 6a 93 fa -6 -===DONE=== diff --git a/ext/date/tests/date_diff1.phpt b/ext/date/tests/date_diff1.phpt index a908cdba758a..3f3d1da7a806 100644 --- a/ext/date/tests/date_diff1.phpt +++ b/ext/date/tests/date_diff1.phpt @@ -50,11 +50,11 @@ object(DateInterval)#3 (15) { ["invert"]=> int(0) ["days"]=> - int(33) + string(2) "33" ["special_type"]=> int(0) ["special_amount"]=> - int(0) + string(1) "0" ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> diff --git a/ext/date/tests/date_sunrise_and_sunset_basic.phpt b/ext/date/tests/date_sunrise_and_sunset_basic.phpt index f89b63fd9334..a96fa830349e 100644 --- a/ext/date/tests/date_sunrise_and_sunset_basic.phpt +++ b/ext/date/tests/date_sunrise_and_sunset_basic.phpt @@ -14,7 +14,7 @@ offset: +1 GMT echo "Basic test for date_sunrise() and date_sunset()\n"; -// suppress date() function strict msgs +// supress date() function strict msgs error_reporting(E_ALL & ~E_STRICT); echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n"; diff --git a/ext/dba/config.m4 b/ext/dba/config.m4 index 5442bb141514..4b123518b46a 100644 --- a/ext/dba/config.m4 +++ b/ext/dba/config.m4 @@ -557,10 +557,10 @@ PHP_ARG_WITH(cdb,, [ --without-cdb[=DIR] DBA: CDB support (bundled)], $php_dba_enable, no) PHP_ARG_ENABLE(inifile,, -[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no) +[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no) PHP_ARG_ENABLE(flatfile,, -[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no) +[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no) # CDB if test "$PHP_CDB" = "yes"; then diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 8005101de34b..5273c05fabba 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -888,7 +888,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) RETURN_FALSE; } if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) { - /* Needed because some systems do not allow to write to the original + /* Needed becasue some systems do not allow to write to the original * file contents with O_APPEND being set. */ if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) { diff --git a/ext/dba/tests/bug38698.phpt b/ext/dba/tests/bug38698.phpt index 1d1ed674fef1..56dde852688d 100644 --- a/ext/dba/tests/bug38698.phpt +++ b/ext/dba/tests/bug38698.phpt @@ -8,18 +8,10 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't --FILE-- ===DONE=== --EXPECTF-- diff --git a/ext/dom/document.c b/ext/dom/document.c index efe6d9070fb7..d17c7cbd55f1 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1973,15 +1973,14 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type xmlDoc *docp; dom_object *intern; char *source = NULL, *valid_file = NULL; - int source_len = 0, valid_opts = 0; - long flags = 0; + int source_len = 0; xmlSchemaParserCtxtPtr parser; xmlSchemaPtr sptr; xmlSchemaValidCtxtPtr vptr; int is_valid; char resolved_path[MAXPATHLEN + 1]; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) { return; } @@ -2030,13 +2029,6 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type RETURN_FALSE; } -#if LIBXML_VERSION >= 20614 - if (flags & XML_SCHEMA_VAL_VC_I_CREATE) { - valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE; - } -#endif - - xmlSchemaSetValidOptions(vptr, valid_opts); xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); is_valid = xmlSchemaValidateDoc(vptr, docp); xmlSchemaFree(sptr); @@ -2050,14 +2042,14 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type } /* }}} */ -/* {{{ proto boolean dom_document_schema_validate_file(string filename, int flags); */ +/* {{{ proto boolean dom_document_schema_validate_file(string filename); */ PHP_FUNCTION(dom_document_schema_validate_file) { _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); } /* }}} end dom_document_schema_validate_file */ -/* {{{ proto boolean dom_document_schema_validate(string source, int flags); */ +/* {{{ proto boolean dom_document_schema_validate(string source); */ PHP_FUNCTION(dom_document_schema_validate_xml) { _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); diff --git a/ext/dom/element.c b/ext/dom/element.c index 606a23f9cbf0..f217ca2450d8 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -177,7 +177,7 @@ PHP_METHOD(domelement, __construct) RETURN_FALSE; } - /* Namespace logic is separate and only when uri passed in to insure no BC breakage */ + /* Namespace logic is seperate and only when uri passed in to insure no BC breakage */ if (uri_len > 0) { errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); if (errorcode == 0) { diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index db8ec83a4439..1e98567dcaa8 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1089,11 +1089,7 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC) void dom_objects_free_storage(void *object TSRMLS_DC) { dom_object *intern = (dom_object *)object; -#if defined(__GNUC__) && __GNUC__ >= 3 - int retcount __attribute__((unused)); /* keep compiler quiet */ -#else int retcount; -#endif zend_object_std_dtor(&intern->std TSRMLS_CC); diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile.phpt deleted file mode 100644 index 93a614903f78..000000000000 --- a/ext/dom/tests/DOMDocument_loadHTMLfile.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test DOMDocument::loadHTMLFile ---DESCRIPTION-- -Verifies the basic behaviour of the method ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__) . "/test.html"); -assert('$result === true'); -?> ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt deleted file mode 100644 index aee51966a3e4..000000000000 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test DOMDocument::loadHTMLFile when the file doesn't exist ---DESCRIPTION-- -Verifies that an error message is showed if the file doesn't exist ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__) . "/ffff/test.html"); -assert('$result === false'); -?> ---EXPECTF-- -%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): I/O warning : failed to load external entity %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt deleted file mode 100644 index e59ff56c5a83..000000000000 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test DOMDocument::loadHTMLFile when an empty string is passed ---DESCRIPTION-- -Verifies that an error message is showed if an empty string is passed as argument ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---FILE-- -loadHTMLFile(""); -assert('$result === false'); -?> ---EXPECTF-- -%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt deleted file mode 100644 index 2535772c7880..000000000000 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test DOMDocument::loadHTMLFile when an empty document is loaded ---DESCRIPTION-- -Verifies that an warning message is showed if an empty document is loaded ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__) . "/empty.html"); -assert('$result === true'); -?> ---EXPECTF-- -%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Document is empty %s diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt deleted file mode 100644 index 829686dd65fe..000000000000 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test DOMDocument::loadHTMLFile when a not-well formed document is loaded ---DESCRIPTION-- -Verifies the behavior if a not-well formed document is loaded ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__) . "/not_well.html"); -assert('$result === true'); -?> ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_basic.phpt b/ext/dom/tests/DOMDocument_loadXML_basic.phpt deleted file mode 100644 index 569593c00758..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_basic.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() basic behavior ---DESCRIPTION-- -This test verifies the basic behaviour of the method -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_error1.phpt b/ext/dom/tests/DOMDocument_loadXML_error1.phpt deleted file mode 100644 index 52d44ea291da..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_error1.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects an opening and ending tag mismatch -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error2.phpt b/ext/dom/tests/DOMDocument_loadXML_error2.phpt deleted file mode 100644 index 6ac4193dafd4..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_error2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects attributes values not closed between " or ' -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed2.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error3.phpt b/ext/dom/tests/DOMDocument_loadXML_error3.phpt deleted file mode 100644 index 07f7ca77383b..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_error3.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects a typo in tag names -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed3.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error4.phpt b/ext/dom/tests/DOMDocument_loadXML_error4.phpt deleted file mode 100644 index e35d3dcea5c8..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_error4.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects an unsupported xml version -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed4.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s diff --git a/ext/dom/tests/DOMDocument_loadXML_error5.phpt b/ext/dom/tests/DOMDocument_loadXML_error5.phpt deleted file mode 100644 index a4aa1858f58c..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_error5.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects extra content at the end of the document -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed5.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s diff --git a/ext/dom/tests/DOMDocument_loadXML_variation1.phpt b/ext/dom/tests/DOMDocument_loadXML_variation1.phpt deleted file mode 100644 index 558137526f27..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_variation1.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() with LIBXML_DTDLOAD option ---DESCRIPTION-- -This test verifies the right behaviour of the LIBXML_DTDLOAD constant -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book_with_dtd2.xml -LOAD_OPTIONS=LIBXML_DTDLOAD -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_variation2.phpt b/ext/dom/tests/DOMDocument_loadXML_variation2.phpt deleted file mode 100644 index 71f638efc142..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_variation2.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() with LIBXML_DTDVALID option ---DESCRIPTION-- -This test verifies the right behaviour of the LIBXML_DTDVALID constant -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/wrong_book_with_dtd2.xml -LOAD_OPTIONS=LIBXML_DTDVALID -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s diff --git a/ext/dom/tests/DOMDocument_loadXML_variation3.phpt b/ext/dom/tests/DOMDocument_loadXML_variation3.phpt deleted file mode 100644 index 8e61ec4dbcc5..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_variation3.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() with LIBXML_DTDVALID and LIBXML_NOERROR options ---DESCRIPTION-- -This test vrifies the right behaviour of the LIBXML_NOERROR constant -which avoids the display of the warning message -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/wrong_book_with_dtd.xml -LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_loadXML_variation4.phpt b/ext/dom/tests/DOMDocument_loadXML_variation4.phpt deleted file mode 100644 index 4f1ea37c1924..000000000000 --- a/ext/dom/tests/DOMDocument_loadXML_variation4.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test DOMDocument::loadXML() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS ---DESCRIPTION-- -This test verifies the right behaviour of the following constants: -LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book_with_dtd2.xml -LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentloadxml_test_method_savexml.php ---EXPECT-- - - - - - - - -]> -The Grapes of WrathJohn SteinbeckThe PearlJohn Steinbeckentity is only for test purposesdata for test diff --git a/ext/dom/tests/DOMDocument_load_basic.phpt b/ext/dom/tests/DOMDocument_load_basic.phpt deleted file mode 100644 index 6d70ed452220..000000000000 --- a/ext/dom/tests/DOMDocument_load_basic.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test DOMDocument::load() basic behavior ---DESCRIPTION-- -This test verifies the basic behaviour of the method -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_load_error1.phpt b/ext/dom/tests/DOMDocument_load_error1.phpt deleted file mode 100644 index 2ac3f50979c6..000000000000 --- a/ext/dom/tests/DOMDocument_load_error1.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Test DOMDocument::load() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects an opening and ending tag mismatch -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s diff --git a/ext/dom/tests/DOMDocument_load_error2.phpt b/ext/dom/tests/DOMDocument_load_error2.phpt deleted file mode 100644 index 23a5e4827d55..000000000000 --- a/ext/dom/tests/DOMDocument_load_error2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test DOMDocument::load() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects attributes values not closed between " or ' -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed2.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s - -Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s diff --git a/ext/dom/tests/DOMDocument_load_error3.phpt b/ext/dom/tests/DOMDocument_load_error3.phpt deleted file mode 100644 index b9ac49c46670..000000000000 --- a/ext/dom/tests/DOMDocument_load_error3.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::load() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects and opening and ending tag mismatch -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed3.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s diff --git a/ext/dom/tests/DOMDocument_load_error4.phpt b/ext/dom/tests/DOMDocument_load_error4.phpt deleted file mode 100644 index ca9ed79a3e84..000000000000 --- a/ext/dom/tests/DOMDocument_load_error4.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::load() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects an unsupported xml version -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed4.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s diff --git a/ext/dom/tests/DOMDocument_load_error5.phpt b/ext/dom/tests/DOMDocument_load_error5.phpt deleted file mode 100644 index a374f9474d14..000000000000 --- a/ext/dom/tests/DOMDocument_load_error5.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::load() detects not-well formed XML ---DESCRIPTION-- -This test verifies the method detects extra content at the end of the document -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/not_well_formed5.xml -LOAD_OPTIONS=0 -EXPECTED_RESULT=0 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s diff --git a/ext/dom/tests/DOMDocument_load_variation1.phpt b/ext/dom/tests/DOMDocument_load_variation1.phpt deleted file mode 100644 index b2b99e74c77a..000000000000 --- a/ext/dom/tests/DOMDocument_load_variation1.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test DOMDocument::load() with LIBXML_DTDLOAD option ---DESCRIPTION-- -This test verifies the right behaviour of the LIBXML_DTDLOAD constant -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book_with_dtd.xml -LOAD_OPTIONS=LIBXML_DTDLOAD -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_load_variation2.phpt b/ext/dom/tests/DOMDocument_load_variation2.phpt deleted file mode 100644 index c8460e55eb2e..000000000000 --- a/ext/dom/tests/DOMDocument_load_variation2.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::load() with LIBXML_DTDVALID option ---DESCRIPTION-- -This test verifies the right behaviour of the LIBXML_DTDVALID constant -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/wrong_book_with_dtd.xml -LOAD_OPTIONS=LIBXML_DTDVALID -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECTF-- -Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s diff --git a/ext/dom/tests/DOMDocument_load_variation3.phpt b/ext/dom/tests/DOMDocument_load_variation3.phpt deleted file mode 100644 index 77801d475e0b..000000000000 --- a/ext/dom/tests/DOMDocument_load_variation3.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test DOMDocument::load() with LIBXML_DTDVALID and LIBXML_NOERROR options ---DESCRIPTION-- -This test vrifies the right behaviour of the LIBXML_NOERROR constant -which avoids the display of the warning message -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/wrong_book_with_dtd.xml -LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentload_test_method.php ---EXPECT-- diff --git a/ext/dom/tests/DOMDocument_load_variation4.phpt b/ext/dom/tests/DOMDocument_load_variation4.phpt deleted file mode 100644 index 3bf7ccc04d85..000000000000 --- a/ext/dom/tests/DOMDocument_load_variation4.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test DOMDocument::load() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS ---DESCRIPTION-- -This test verifies the right behaviour of the following constants: -LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS -Environment variables used in the test: -- XML_FILE: the xml file to load -- LOAD_OPTIONS: the second parameter to pass to the method -- EXPECTED_RESULT: the expected result ---CREDITS-- -Antonio Diaz Ruiz ---INI-- -assert.bail=true ---SKIPIF-- - ---ENV-- -XML_FILE=/book_with_dtd.xml -LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS -EXPECTED_RESULT=1 ---FILE_EXTERNAL-- -domdocumentload_test_method_savexml.php ---EXPECT-- - - -The Grapes of WrathJohn SteinbeckThe PearlJohn Steinbeckentity is only for test purposesdata for test diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt deleted file mode 100644 index 994b94d0c853..000000000000 --- a/ext/dom/tests/DOMDocument_schemaValidateSource_addAttrs.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -DomDocument::schemaValidateSource() - Add missing attribute default values from schema ---CREDITS-- -Chris Wright ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book-attr.xml"); - -$xsd = file_get_contents(dirname(__FILE__)."/book.xsd"); - -$doc->schemaValidateSource($xsd, LIBXML_SCHEMA_CREATE); - -foreach ($doc->getElementsByTagName('book') as $book) { - var_dump($book->getAttribute('is-hardback')); -} - -?> ---EXPECT-- -string(5) "false" -string(4) "true" diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_error4.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_error4.phpt index f841b874288d..65c8d8678f8e 100644 --- a/ext/dom/tests/DOMDocument_schemaValidateSource_error4.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidateSource_error4.phpt @@ -17,5 +17,5 @@ var_dump($result); ?> --EXPECTF-- -Warning: DOMDocument::schemaValidateSource() expects at least 1 parameter, 0 given in %s.php on line %d +Warning: DOMDocument::schemaValidateSource() expects exactly 1 parameter, 0 given in %s.php on line %d NULL diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_missingAttrs.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_missingAttrs.phpt deleted file mode 100644 index 7c98a74b1da2..000000000000 --- a/ext/dom/tests/DOMDocument_schemaValidateSource_missingAttrs.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -DomDocument::schemaValidateSource() - Don't add missing attribute default values from schema ---CREDITS-- -Chris Wright ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book-attr.xml"); - -$xsd = file_get_contents(dirname(__FILE__)."/book.xsd"); - -$doc->schemaValidateSource($xsd); - -foreach ($doc->getElementsByTagName('book') as $book) { - var_dump($book->getAttribute('is-hardback')); -} - -?> ---EXPECT-- -string(0) "" -string(4) "true" diff --git a/ext/dom/tests/DOMDocument_schemaValidate_addAttrs.phpt b/ext/dom/tests/DOMDocument_schemaValidate_addAttrs.phpt deleted file mode 100644 index e0b5251b2333..000000000000 --- a/ext/dom/tests/DOMDocument_schemaValidate_addAttrs.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -DomDocument::schemaValidate() - Add missing attribute default values from schema ---CREDITS-- -Chris Wright ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book-attr.xml"); - -$doc->schemaValidate(dirname(__FILE__)."/book.xsd", LIBXML_SCHEMA_CREATE); - -foreach ($doc->getElementsByTagName('book') as $book) { - var_dump($book->getAttribute('is-hardback')); -} - -?> ---EXPECT-- -string(5) "false" -string(4) "true" diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error4.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error4.phpt index 9e4b6c4b7c96..d4817deca0b4 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error4.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error4.phpt @@ -17,5 +17,5 @@ var_dump($result); ?> --EXPECTF-- -Warning: DOMDocument::schemaValidate() expects at least 1 parameter, 0 given in %s.php on line %d +Warning: DOMDocument::schemaValidate() expects exactly 1 parameter, 0 given in %s.php on line %d NULL diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt index d5743bc6cf5c..d3f0658c1f9f 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error5.phpt @@ -1,5 +1,5 @@ --TEST-- -DomDocument::schemaValidate() - non-existent schema file +DomDocument::schemaValidate() - non-existant schema file --CREDITS-- Daniel Convissor # TestFest 2009 NYPHP @@ -12,14 +12,14 @@ $doc = new DOMDocument; $doc->load(dirname(__FILE__)."/book.xml"); -$result = $doc->schemaValidate(dirname(__FILE__)."/non-existent-file"); +$result = $doc->schemaValidate(dirname(__FILE__)."/non-existant-file"); var_dump($result); ?> --EXPECTF-- -Warning: DOMDocument::schemaValidate(): I/O warning : failed to load external entity "%snon-existent-file" in %s.php on line %d +Warning: DOMDocument::schemaValidate(): I/O warning : failed to load external entity "%snon-existant-file" in %s.php on line %d -Warning: DOMDocument::schemaValidate(): Failed to locate the main schema resource at '%s/non-existent-file'. in %s.php on line %d +Warning: DOMDocument::schemaValidate(): Failed to locate the main schema resource at '%s/non-existant-file'. in %s.php on line %d Warning: DOMDocument::schemaValidate(): Invalid Schema in %s.php on line %d bool(false) diff --git a/ext/dom/tests/DOMDocument_schemaValidate_missingAttrs.phpt b/ext/dom/tests/DOMDocument_schemaValidate_missingAttrs.phpt deleted file mode 100644 index d253ad969007..000000000000 --- a/ext/dom/tests/DOMDocument_schemaValidate_missingAttrs.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -DomDocument::schemaValidate() - Don't add missing attribute default values from schema ---CREDITS-- -Chris Wright ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book-attr.xml"); - -$doc->schemaValidate(dirname(__FILE__)."/book.xsd"); - -foreach ($doc->getElementsByTagName('book') as $book) { - var_dump($book->getAttribute('is-hardback')); -} - -?> ---EXPECT-- -string(0) "" -string(4) "true" diff --git a/ext/dom/tests/DOMNode_removeChild_basic.phpt b/ext/dom/tests/DOMNode_removeChild_basic.phpt index fb0977488e62..384eb47b5ecf 100644 --- a/ext/dom/tests/DOMNode_removeChild_basic.phpt +++ b/ext/dom/tests/DOMNode_removeChild_basic.phpt @@ -39,7 +39,7 @@ $root = $dom->documentElement; $children = $root->childNodes; $len = $children->length; -echo "original has $len nodes\n"; +echo "orignal has $len nodes\n"; for ($index = $children->length - 1; $index >=0; $index--) { echo "node $index\n"; $current = $children->item($index); @@ -58,7 +58,7 @@ for ($index = 0; $index < $children->length; $index++) { } --EXPECTF-- -original has 5 nodes +orignal has 5 nodes node 4 Course: no title:DOMText ~string(1) " diff --git a/ext/dom/tests/book-attr.xml b/ext/dom/tests/book-attr.xml deleted file mode 100644 index ba4298d0984c..000000000000 --- a/ext/dom/tests/book-attr.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/book.xsd b/ext/dom/tests/book.xsd index 6b4a8ea54569..45986fc4b398 100755 --- a/ext/dom/tests/book.xsd +++ b/ext/dom/tests/book.xsd @@ -9,7 +9,6 @@ - diff --git a/ext/dom/tests/book_with_dtd.xml b/ext/dom/tests/book_with_dtd.xml deleted file mode 100644 index de12e92102aa..000000000000 --- a/ext/dom/tests/book_with_dtd.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - - &entitest; - - - diff --git a/ext/dom/tests/book_with_dtd2.xml b/ext/dom/tests/book_with_dtd2.xml deleted file mode 100644 index aeb4f0b800d6..000000000000 --- a/ext/dom/tests/book_with_dtd2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - -]> - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - - &entitest; - - - diff --git a/ext/dom/tests/books.dtd b/ext/dom/tests/books.dtd deleted file mode 100644 index b3f03c1c1635..000000000000 --- a/ext/dom/tests/books.dtd +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/ext/dom/tests/bug44648.phpt b/ext/dom/tests/bug44648.phpt index 4ff7ac389cbf..d04f590acabb 100644 --- a/ext/dom/tests/bug44648.phpt +++ b/ext/dom/tests/bug44648.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #44648 (Attribute names not checked for well formedness) +Bug #44648 (Attribute names not checked for wellformedness) --SKIPIF-- --FILE-- diff --git a/ext/dom/tests/domdocumentload_test_method.php b/ext/dom/tests/domdocumentload_test_method.php deleted file mode 100644 index 7afce15c3a75..000000000000 --- a/ext/dom/tests/domdocumentload_test_method.php +++ /dev/null @@ -1,12 +0,0 @@ -load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options); - -$expectedResult = (bool) getenv('EXPECTED_RESULT'); -assert('$result === $expectedResult'); -?> diff --git a/ext/dom/tests/domdocumentload_test_method_savexml.php b/ext/dom/tests/domdocumentload_test_method_savexml.php deleted file mode 100644 index 8ffd9445246d..000000000000 --- a/ext/dom/tests/domdocumentload_test_method_savexml.php +++ /dev/null @@ -1,14 +0,0 @@ -load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options); - -$expectedResult = (bool) getenv('EXPECTED_RESULT'); -assert('$result === $expectedResult'); - -echo $doc->saveXML(); -?> diff --git a/ext/dom/tests/domdocumentload_utilities.php b/ext/dom/tests/domdocumentload_utilities.php deleted file mode 100644 index efd1e5a1a52b..000000000000 --- a/ext/dom/tests/domdocumentload_utilities.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/ext/dom/tests/domdocumentloadxml_test_method.php b/ext/dom/tests/domdocumentloadxml_test_method.php deleted file mode 100644 index 7c4be85cf1f2..000000000000 --- a/ext/dom/tests/domdocumentloadxml_test_method.php +++ /dev/null @@ -1,12 +0,0 @@ -loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), - $libxml_options); - -$expectedResult = (bool) getenv('EXPECTED_RESULT'); -assert('$result === $expectedResult'); -?> diff --git a/ext/dom/tests/domdocumentloadxml_test_method_savexml.php b/ext/dom/tests/domdocumentloadxml_test_method_savexml.php deleted file mode 100644 index 550219fb78c5..000000000000 --- a/ext/dom/tests/domdocumentloadxml_test_method_savexml.php +++ /dev/null @@ -1,14 +0,0 @@ -loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), - $libxml_options); - -$expectedResult = (bool) getenv('EXPECTED_RESULT'); -assert('$result === $expectedResult'); - -echo $doc->saveXML(); -?> diff --git a/ext/dom/tests/empty.html b/ext/dom/tests/empty.html deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/ext/dom/tests/not_well.html b/ext/dom/tests/not_well.html deleted file mode 100644 index 151f46295fdf..000000000000 --- a/ext/dom/tests/not_well.html +++ /dev/null @@ -1,8 +0,0 @@ - -Hello world - - -This is a not well-formed
-html files with undeclared entities  - - diff --git a/ext/dom/tests/not_well_formed.xml b/ext/dom/tests/not_well_formed.xml deleted file mode 100644 index d362e0c4b94e..000000000000 --- a/ext/dom/tests/not_well_formed.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - The Grapes of Wrath - <author>John Steinbeck</author> - </book> - <book> - <title>The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/not_well_formed2.xml b/ext/dom/tests/not_well_formed2.xml deleted file mode 100644 index da6b3bccbaf8..000000000000 --- a/ext/dom/tests/not_well_formed2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/not_well_formed3.xml b/ext/dom/tests/not_well_formed3.xml deleted file mode 100644 index 99b218907465..000000000000 --- a/ext/dom/tests/not_well_formed3.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/not_well_formed4.xml b/ext/dom/tests/not_well_formed4.xml deleted file mode 100644 index 581b8bd9625b..000000000000 --- a/ext/dom/tests/not_well_formed4.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/not_well_formed5.xml b/ext/dom/tests/not_well_formed5.xml deleted file mode 100644 index f42ead83ab36..000000000000 --- a/ext/dom/tests/not_well_formed5.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - diff --git a/ext/dom/tests/wrong_book_with_dtd.xml b/ext/dom/tests/wrong_book_with_dtd.xml deleted file mode 100644 index 3a2d48e355f8..000000000000 --- a/ext/dom/tests/wrong_book_with_dtd.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - The Grapes of Wrath - John Steinbeck - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/wrong_book_with_dtd2.xml b/ext/dom/tests/wrong_book_with_dtd2.xml deleted file mode 100644 index 6c49deb1f569..000000000000 --- a/ext/dom/tests/wrong_book_with_dtd2.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -]> - - - The Grapes of Wrath - John Steinbeck - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index d12ef30323ad..cf556a35054f 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = { static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */ { - zval **args = NULL; + zval **args; zval *retval; int result, i, ret; int error = 0; diff --git a/ext/enchant/config.m4 b/ext/enchant/config.m4 index db8a69c5d189..cc40d0bd0385 100755 --- a/ext/enchant/config.m4 +++ b/ext/enchant/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(enchant,for ENCHANT support, -[ --with-enchant[=DIR] Include enchant support. +[ --with-enchant[=DIR] Include enchant support. GNU Aspell version 1.1.3 or higher required.]) if test "$PHP_ENCHANT" != "no"; then diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 98b5c9fd8790..e4b42637663d 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_free_dict) /* }}} */ /* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag) - Whether a dictionary exists or not. Using non-empty tag */ + Wether a dictionary exists or not. Using non-empty tag */ PHP_FUNCTION(enchant_broker_dict_exists) { zval *broker; @@ -674,7 +674,7 @@ PHP_FUNCTION(enchant_broker_dict_exists) described/referred to by 'tag'. The ordering is a comma delimited list of provider names. As a special exception, the "*" tag can be used as a language tag to declare a default ordering for any - language that does not explicitly declare an ordering. */ + language that does not explictly declare an ordering. */ PHP_FUNCTION(enchant_broker_set_ordering) { diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4 index caec39d28502..f4f8190932ff 100644 --- a/ext/ereg/config0.m4 +++ b/ext/ereg/config0.m4 @@ -5,7 +5,7 @@ dnl dnl Check for regex library type dnl PHP_ARG_WITH(regex,, -[ --with-regex=TYPE Regex library type: system, php. [TYPE=php] +[ --with-regex=TYPE regex library type: system, php. [TYPE=php] WARNING: Do NOT use unless you know what you are doing!], php, no) case $PHP_REGEX in diff --git a/ext/exif/exif.c b/ext/exif/exif.c index ec121a6c326b..c69107589835 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -40,6 +40,16 @@ #include "php.h" #include "ext/standard/file.h" +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef PHP_WIN32 +# include "win32/php_stdint.h" +#endif + #if HAVE_EXIF /* When EXIF_DEBUG is defined the module generates a lot of debug messages @@ -2585,7 +2595,7 @@ static int exif_process_string_raw(char **result, char *value, size_t byte_count /* {{{ exif_process_string * Copy a string in Exif header to a character string and return length of allocated buffer if any. - * In contrast to exif_process_string this function does always return a string buffer */ + * In contrast to exif_process_string this function does allways return a string buffer */ static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) { /* we cannot use strlcpy - here the problem is that we cannot use strlen to * determin length of string and we cannot use strlcpy with len=byte_count+1 diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt index 0f9c1354205b..da899194c733 100644 --- a/ext/exif/tests/exif_tagname_variation1.phpt +++ b/ext/exif/tests/exif_tagname_variation1.phpt @@ -78,7 +78,7 @@ $values = array ( // loop through each element of the array and check the working of exif_tagname() -// when $index argument is supplied with different values +// when $index arugment is supplied with different values echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n"; $counter = 1; diff --git a/ext/ext_skel b/ext/ext_skel index 061e78d6493f..2492bf73da33 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -12,7 +12,7 @@ echo "" echo " --extname=module module is the name of your extension" echo " --proto=file file contains prototypes of functions to create" echo " --stubs=file generate only function stubs in file" -echo " --xml generate xml documentation to be added to phpdoc-svn" +echo " --xml generate xml documentation to be added to phpdoc-cvs" echo " --skel=dir path to the skeleton directory" echo " --full-xml generate xml documentation for a self-contained extension" echo " (not yet implemented)" @@ -187,43 +187,11 @@ if (PHP_$EXTNAME != "no") { eof -$ECHO_N " .gitignore$ECHO_C" -cat >.gitignore <.svnignore < #include @@ -3123,7 +3123,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1717,12 +1694,12 @@ +@@ -1717,9 +1694,9 @@ ms->o.buf = sbuf; ms->offset = soffset; if (rv == 1) { @@ -3134,11 +3134,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; -- free(rbuf); -+ efree(rbuf); - } - return rv; - + free(rbuf); @@ -1837,6 +1814,42 @@ return file_strncmp(a, b, len, flags); } diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index 0671fa99f9fa..c69fdb5a3e51 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -1630,7 +1630,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, /* Verify we have enough data to match magic type */ switch (m->type) { case FILE_BYTE: - if (nbytes < (offset + 1)) /* should always be true */ + if (nbytes < (offset + 1)) /* should alway be true */ return 0; break; @@ -1699,7 +1699,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, return -1; if (file_printf(ms, "%s", rbuf) == -1) return -1; - efree(rbuf); + free(rbuf); } return rv; diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt index feb4010f74b0..3593233c3996 100644 --- a/ext/fileinfo/tests/finfo_file_002.phpt +++ b/ext/fileinfo/tests/finfo_file_002.phpt @@ -18,7 +18,7 @@ ksort($results); var_dump($results); ?> --EXPECTF-- -array(8) { +array(7) { ["%s/resources/dir.zip"]=> string(15) "application/zip" ["%s/resources/test.awk"]=> @@ -29,8 +29,6 @@ array(8) { string(9) "image/gif" ["%s/resources/test.jpg"]=> string(10) "image/jpeg" - ["%s/resources/test.mp3"]=> - string(10) "audio/mpeg" ["%s/resources/test.pdf"]=> string(15) "application/pdf" ["%s/resources/test.png"]=> diff --git a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt index 7d1b008d5a05..c43ba4e298cf 100644 --- a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt +++ b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -Test finfo extension : loading into phpinfo() +Test finfo extention : loading into phpinfo() --SKIPIF-- --FILE-- diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic index aa75fb65bc1b..5266dd0dc551 100644 --- a/ext/fileinfo/tests/magic +++ b/ext/fileinfo/tests/magic @@ -3303,7 +3303,7 @@ >>>0x44 string =GLOB \b. >>>>0x60 beshort x \b%.4d -# Scripts that run in the embedded Python interpreter +# Scripts that run in the embeded Python interpreter 0 string #!BPY Blender3D BPython script #------------------------------------------------------------------------------ @@ -4957,7 +4957,7 @@ >>>>0 ubelong =0 \b, next free block index %lu >>>>0 ubelong !0 \b, next free block index %lu >>>512 default x dBase IV DBT -# DBF file name without extension +# DBF file name without extention >>>>8 string >\0 \b of %-.8s.DBF # size of blocks ; not reliable 0x2020204C #>>>>4 ulelong =0 \b, blocks size %lu @@ -11969,7 +11969,7 @@ #>65 string ZSYS (Pre-System 7 system file) #>65 string acf3 (Aldus FreeHand) #>65 string cdev (control panel) -#>65 string dfil (Desk Accessory suitcase) +#>65 string dfil (Desk Acessory suitcase) #>65 string libr (library) #>65 string nX^d (WriteNow word processor) #>65 string nX^w (WriteNow dictionary) @@ -13205,7 +13205,7 @@ # they have their real name at offset 22 >>>>>22 string >\0 \b%-.5s >4 uleshort&0x8000 0x0000 -# 32 bit sector addressing ( > 32 MB) for block devices +# 32 bit sector adressing ( > 32 MB) for block devices >>4 uleshort&0x0002 0x0002 \b,32-bit sector- # support by driver functions 13h, 17h, 18h >4 uleshort&0x0040 0x0040 \b,IOCTL- @@ -17951,7 +17951,7 @@ # 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ # 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................ # -# GRR this test is still too general as it catches example addressen.dbt +# GRR this test is still too general as it catches example adressen.dbt 0 belong 0x03000000 >8 ubelong 0xec020000 VMS Alpha executable >>75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption diff --git a/ext/fileinfo/tests/resources/test.mp3 b/ext/fileinfo/tests/resources/test.mp3 deleted file mode 100644 index ff6dc3ad7570..000000000000 Binary files a/ext/fileinfo/tests/resources/test.mp3 and /dev/null differ diff --git a/ext/filter/config.m4 b/ext/filter/config.m4 index 676f5d99ef3b..b4e32a21a474 100644 --- a/ext/filter/config.m4 +++ b/ext/filter/config.m4 @@ -5,7 +5,7 @@ PHP_ARG_ENABLE(filter, whether to enable input filter support, [ --disable-filter Disable input filter support], yes) PHP_ARG_WITH(pcre-dir, pcre install prefix, -[ --with-pcre-dir FILTER: pcre install prefix], no, no) +[ --with-pcre-dir FILTER: pcre install prefix], no, no) if test "$PHP_FILTER" != "no"; then diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 12aebcf366f8..da951feb042d 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -243,7 +243,7 @@ PHP_MINIT_FUNCTION(filter) REGISTER_LONG_CONSTANT("FILTER_SANITIZE_STRIPPED", FILTER_SANITIZE_STRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_ENCODED", FILTER_SANITIZE_ENCODED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_FULL_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_EMAIL", FILTER_SANITIZE_EMAIL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_URL", FILTER_SANITIZE_URL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FILTER_SANITIZE_NUMBER_INT", FILTER_SANITIZE_NUMBER_INT, CONST_CS | CONST_PERSISTENT); diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt index 340c1ccd6b20..3f365cc43121 100644 --- a/ext/filter/tests/bug49510.phpt +++ b/ext/filter/tests/bug49510.phpt @@ -1,7 +1,5 @@ --TEST-- -Bug #49510 boolean validation fails with FILTER_NULL_ON_FAILURE ---SKIPIF-- - +#49510 boolean validation fails with FILTER_NULL_ON_FAILURE --FILE-- #elif defined(NETWARE) -#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), at least for now */ +#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ #include #else #include @@ -182,7 +182,6 @@ ftp_close(ftpbuf_t *ftp) #if HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); - SSL_free(ftp->ssl_handle); } #endif closesocket(ftp->fd); @@ -298,7 +297,6 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) if (SSL_connect(ftp->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS handshake failed"); SSL_shutdown(ftp->ssl_handle); - SSL_free(ftp->ssl_handle); return 0; } @@ -612,7 +610,7 @@ ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filenam /* {{{ ftp_alloc */ int -ftp_alloc(ftpbuf_t *ftp, const long size, char **response) +ftp_alloc(ftpbuf_t *ftp, const int size, char **response) { char buffer[64]; @@ -620,8 +618,8 @@ ftp_alloc(ftpbuf_t *ftp, const long size, char **response) return 0; } - snprintf(buffer, sizeof(buffer) - 1, "%ld", size); - + snprintf(buffer, sizeof(buffer) - 1, "%d", size); + if (!ftp_putcmd(ftp, "ALLO", buffer)) { return 0; } @@ -787,9 +785,10 @@ ftp_pasv(ftpbuf_t *ftp, int pasv) /* {{{ ftp_get */ int -ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC) +ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) { databuf_t *data = NULL; + int lastch; size_t rcvd; char arg[11]; @@ -807,7 +806,11 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, ftp->data = data; if (resumepos > 0) { - snprintf(arg, sizeof(arg), "%ld", resumepos); + if (resumepos > 2147483647) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483647 bytes."); + goto bail; + } + snprintf(arg, sizeof(arg), "%u", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -827,6 +830,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, goto bail; } + lastch = 0; while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { if (rcvd == -1) { goto bail; @@ -879,10 +883,10 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, /* {{{ ftp_put */ int -ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) +ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) { databuf_t *data = NULL; - long size; + int size; char *ptr; int ch; char arg[11]; @@ -899,7 +903,11 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, l ftp->data = data; if (startpos > 0) { - snprintf(arg, sizeof(arg), "%ld", startpos); + if (startpos > 2147483647) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes."); + goto bail; + } + snprintf(arg, sizeof(arg), "%u", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -956,7 +964,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, l /* {{{ ftp_size */ -long +int ftp_size(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) { @@ -971,7 +979,7 @@ ftp_size(ftpbuf_t *ftp, const char *path) if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } - return atol(ftp->inbuf); + return atoi(ftp->inbuf); } /* }}} */ @@ -1133,7 +1141,7 @@ ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) int ftp_readline(ftpbuf_t *ftp) { - long size, rcvd; + int size, rcvd; char *data, *eol; /* shift the extra to the front */ @@ -1185,9 +1193,12 @@ ftp_readline(ftpbuf_t *ftp) int ftp_getresp(ftpbuf_t *ftp) { + char *buf; + if (ftp == NULL) { return 0; } + buf = ftp->inbuf; ftp->resp = 0; while (1) { @@ -1223,8 +1234,7 @@ ftp_getresp(ftpbuf_t *ftp) int my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { - long size, sent; - int n; + int n, size, sent; size = len; while (size) { @@ -1538,7 +1548,6 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) if (SSL_connect(data->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed"); SSL_shutdown(data->ssl_handle); - SSL_free(data->ssl_handle); return 0; } @@ -1556,21 +1565,13 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data) { -#if HAVE_OPENSSL_EXT - SSL_CTX *ctx; -#endif if (data == NULL) { return NULL; } if (data->listener != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { - - ctx = SSL_get_SSL_CTX(data->ssl_handle); - SSL_CTX_free(ctx); - SSL_shutdown(data->ssl_handle); - SSL_free(data->ssl_handle); data->ssl_active = 0; } #endif @@ -1579,11 +1580,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data) if (data->fd != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { - ctx = SSL_get_SSL_CTX(data->ssl_handle); - SSL_CTX_free(ctx); - SSL_shutdown(data->ssl_handle); - SSL_free(data->ssl_handle); data->ssl_active = 0; } #endif @@ -1707,7 +1704,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) /* {{{ ftp_nb_get */ int -ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC) +ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; @@ -1725,7 +1722,14 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ } if (resumepos>0) { - snprintf(arg, sizeof(arg), "%ld", resumepos); + /* We are working on an architecture that supports 64-bit integers + * since php is 32 bit by design, we bail out with warning + */ + if (resumepos > 2147483647) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483648 bytes."); + goto bail; + } + snprintf(arg, sizeof(arg), "%u", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1824,7 +1828,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC) /* {{{ ftp_nb_put */ int -ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC) +ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; @@ -1839,7 +1843,11 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type goto bail; } if (startpos > 0) { - snprintf(arg, sizeof(arg), "%ld", startpos); + if (startpos > 2147483647) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes."); + goto bail; + } + snprintf(arg, sizeof(arg), "%u", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1876,7 +1884,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC) { - long size; + int size; char *ptr; int ch; diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 69de7dbb78ac..c7db45789a5d 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -146,7 +146,7 @@ int ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int fi * however some servers will not accept STOR or APPE until ALLO is confirmed. * If response is passed, it is estrdup()ed from ftp->inbuf and must be freed * or assigned to a zval returned to the user */ -int ftp_alloc(ftpbuf_t *ftp, const long size, char **response); +int ftp_alloc(ftpbuf_t *ftp, const int size, char **response); /* returns a NULL-terminated array of filenames in the given path * or NULL on error. the return array must be freed (but don't @@ -169,15 +169,15 @@ int ftp_pasv(ftpbuf_t *ftp, int pasv); /* retrieves a file and saves its contents to outfp * returns true on success, false on error */ -int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC); +int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ -int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC); +int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); /* returns the size of the given file, or -1 on error */ -long ftp_size(ftpbuf_t *ftp, const char *path); +int ftp_size(ftpbuf_t *ftp, const char *path); /* returns the last modified time of the given file, or -1 on error */ time_t ftp_mdtm(ftpbuf_t *ftp, const char *path); @@ -194,12 +194,12 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd); /* retrieves part of a file and saves its contents to outfp * returns true on success, false on error */ -int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC); +int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ -int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC); +int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); /* continues a previous nb_(f)get command */ diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index da22e0b63eb3..73071936e0fb 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -784,8 +784,8 @@ PHP_FUNCTION(ftp_nb_fget) ftptype_t xtype; php_stream *stream; char *file; - int file_len; - long mode, resumepos=0, ret; + int file_len, ret; + long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; @@ -968,7 +968,9 @@ PHP_FUNCTION(ftp_nb_get) RETURN_LONG(PHP_FTP_FAILED); } - php_stream_close(outstream); + if (ret == PHP_FTP_FINISHED) { + php_stream_close(outstream); + } RETURN_LONG(ret); } @@ -980,7 +982,7 @@ PHP_FUNCTION(ftp_nb_continue) { zval *z_ftp; ftpbuf_t *ftp; - long ret; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; @@ -1118,7 +1120,7 @@ PHP_FUNCTION(ftp_put) ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - long remote_len, local_len; + int remote_len, local_len; long mode, startpos=0; php_stream *instream; @@ -1171,8 +1173,8 @@ PHP_FUNCTION(ftp_nb_put) ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; - int remote_len, local_len; - long mode, startpos=0, ret; + int remote_len, local_len, ret; + long mode, startpos=0; php_stream *instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { diff --git a/ext/ftp/tests/filesize_large.phpt b/ext/ftp/tests/filesize_large.phpt deleted file mode 100644 index 05f12a3e5b8e..000000000000 --- a/ext/ftp/tests/filesize_large.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Verify php can handle filesizes >32bit ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(5368709120) diff --git a/ext/ftp/tests/ftp_fget_basic.phpt b/ext/ftp/tests/ftp_fget_basic.phpt index 355b8b846914..d736f8c45e8d 100644 --- a/ext/ftp/tests/ftp_fget_basic.phpt +++ b/ext/ftp/tests/ftp_fget_basic.phpt @@ -27,7 +27,7 @@ var_dump(ftp_fget($ftp, $fp, 'binary data.bin', FTP_BINARY)); fseek($fp, $postition); var_dump(urlencode(fgets($fp))); -//test non-existent file request +//test non-existant file request ftp_fget($ftp, $fp ,'a warning.txt', FTP_ASCII); //remove file diff --git a/ext/ftp/tests/ftp_get_basic.phpt b/ext/ftp/tests/ftp_get_basic.phpt index 2fd8c7914919..23fd8d07f3f6 100644 --- a/ext/ftp/tests/ftp_get_basic.phpt +++ b/ext/ftp/tests/ftp_get_basic.phpt @@ -27,7 +27,7 @@ var_dump(ftp_get($ftp, $tmpfname, 'binary data.bin', FTP_BINARY)); var_dump(urlencode(file_get_contents($tmpfname))); unlink($tmpfname); -//test non-existent file request +//test non-existant file request ftp_get($ftp, $tmpfname ,'a warning.txt', FTP_ASCII); ?> --EXPECTF-- diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt deleted file mode 100644 index 3fbf2a4831d1..000000000000 --- a/ext/ftp/tests/ftp_nb_get_large.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Testing ftp_nb_fget can handle large files incl. resume ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECT-- -string(1) "X" -int(5368709120) diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index 7dc8fa08d99f..86178806233f 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -357,17 +357,7 @@ if ($pid) { $transfer_type = $ascii? 'ASCII' : 'BINARY' ; fputs($fs, "Bar\r\n"); fputs($s, "226 Closing data Connection.\r\n"); - break; - case "fget_large": - fputs($s, "150 File status okay; about to open data connection.\r\n"); - $transfer_type = $ascii? 'ASCII' : 'BINARY' ; - if ($GLOBALS['rest_pos'] == '5368709119') { - fputs($fs, "X"); - } else { - fputs($fs, "Y"); - } - fputs($s, "226 Closing data Connection.\r\n"); - break; + break; default: fputs($s, "550 {$matches[1]}: No such file or directory \r\n"); break; @@ -403,12 +393,11 @@ if ($pid) { }elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) { fputs($s, "425 Error establishing connection\r\n"); - }elseif (preg_match('/^REST (\d+)/', $buf, $matches)) { - $GLOBALS['rest_pos'] = $matches[1]; + }elseif (preg_match('/^REST \d+/', $buf, $matches)) { fputs($s, "350 OK\r\n"); - }elseif (preg_match('/^SIZE largefile/', $buf)) { - fputs($s, "213 5368709120\r\n"); - }else { + } + + else { fputs($s, "500 Syntax error, command unrecognized.\r\n"); dump_and_exit($buf); } @@ -418,4 +407,4 @@ if ($pid) { } fclose($socket); -?> +?> \ No newline at end of file diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index c9e080faab7c..957284e78fc8 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -7,11 +7,11 @@ dnl Configure options dnl PHP_ARG_WITH(gd, for GD support, -[ --with-gd[=DIR] Include GD support. DIR is the GD library base +[ --with-gd[=DIR] Include GD support. DIR is the GD library base install directory [BUNDLED]]) if test -z "$PHP_VPX_DIR"; then PHP_ARG_WITH(vpx-dir, for the location of libvpx, - [ --with-vpx-dir[=DIR] GD: Set the path to libvpx install prefix], no, no) + [ --with-vpx-dir[=DIR] GD: Set the path to libvpx install prefix], no, no) fi if test -z "$PHP_JPEG_DIR"; then @@ -39,10 +39,10 @@ PHP_ARG_WITH(t1lib, for T1lib support, [ --with-t1lib[=DIR] GD: Include T1lib support. T1lib version >= 5.0.0 required], no, no) PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD, -[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no) +[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no) PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD, -[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no) +[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no) dnl dnl Checks for the configure options @@ -266,10 +266,6 @@ dnl dnl Common for both builtin and external GD dnl if test "$PHP_GD" != "no"; then - -dnl PNG is required by GD library - test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes - dnl Various checks for GD features PHP_GD_ZLIB PHP_GD_TTSTR @@ -296,6 +292,9 @@ if test "$PHP_GD" = "yes"; then dnl check for fabsf and floorf which are available since C99 AC_CHECK_FUNCS(fabsf floorf) +dnl PNG is required by GD library + test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes + dnl These are always available with bundled library AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ]) AC_DEFINE(HAVE_GD_PNG, 1, [ ]) diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 1420b11e6e95..e6fbc49ea23c 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -69,7 +69,7 @@ if (PHP_GD != "no") { /D HAVE_GD_WBMP \ /D HAVE_GD_XBM \ /D HAVE_GD_XPM \ -/D HAVE_GD_FREETYPE=1 \ +/D HAVE_LIBFREETYPE=1 \ /D HAVE_LIBGD13=1 \ /D HAVE_LIBGD15=1 \ /D HAVE_LIBGD20=1 \ diff --git a/ext/gd/gd.c b/ext/gd/gd.c index d8a90f5fb6a5..7c72e6f75298 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -57,8 +57,9 @@ # include #endif +#ifndef HAVE_GD_BUNDLED # include "gd_compat.h" - +#endif /* HAVE_GD_BUNDLED */ static int le_gd, le_gd_font; #if HAVE_LIBT1 @@ -104,7 +105,7 @@ int overflow2(int a, int b); /* IMPORTANT NOTE FOR NEW FILTER * Do not forget to update: * IMAGE_FILTER_MAX: define the last filter index - * IMAGE_FILTER_MAX_ARGS: define the biggest amount of arguments + * IMAGE_FILTER_MAX_ARGS: define the biggest amout of arguments * image_filter array in PHP_FUNCTION(imagefilter) * */ #define IMAGE_FILTER_NEGATE 0 @@ -844,28 +845,28 @@ ZEND_BEGIN_ARG_INFO(arginfo_imagecrop, 0) ZEND_ARG_INFO(0, rect) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_imagecropauto, 0, 0, 1) +ZEND_BEGIN_ARG_INFO(arginfo_imagecropauto, 0) ZEND_ARG_INFO(0, im) ZEND_ARG_INFO(0, mode) ZEND_ARG_INFO(0, threshold) ZEND_ARG_INFO(0, color) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_imagescale, 0, 0, 2) +ZEND_BEGIN_ARG_INFO(arginfo_imagescale, 0) ZEND_ARG_INFO(0, im) ZEND_ARG_INFO(0, new_width) ZEND_ARG_INFO(0, new_height) ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_imageaffine, 0, 0, 2) +ZEND_BEGIN_ARG_INFO(arginfo_imageaffine, 0) ZEND_ARG_INFO(0, im) ZEND_ARG_INFO(0, affine) - ZEND_ARG_INFO(0, clip) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_imageaffinematrixget, 0, 0, 1) - ZEND_ARG_INFO(0, type) +ZEND_BEGIN_ARG_INFO(arginfo_imageaffinematrixget, 0) + ZEND_ARG_INFO(0, im) + ZEND_ARG_INFO(0, matrox) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -1475,7 +1476,9 @@ PHP_FUNCTION(imageloadfont) body_size = font->w * font->h * font->nchars; } - if (overflow2(font->nchars, font->h) || overflow2(font->nchars * font->h, font->w )) { + if ((font->nchars <= 0 || font->h <= 0 || font->w <= 0 ) || \ + (font->nchars > INT_MAX / font->h) || \ + (font->nchars * font->h > INT_MAX / font->w)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header"); efree(font); php_stream_close(stream); @@ -2369,12 +2372,30 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, } } - stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL); if (stream == NULL) { RETURN_FALSE; } + ioctx_func_p = NULL; /* don't allow sockets without IOCtx */ + + if (image_type == PHP_GDIMG_TYPE_WEBP) { + size_t buff_size; + char *buff; + + /* needs to be malloc (persistent) - GD will free() it later */ + buff_size = php_stream_copy_to_mem(stream, &buff, PHP_STREAM_COPY_ALL, 1); + if (!buff_size) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data"); + goto out_err; + } + im = (*ioctx_func_p)(buff_size, buff); + if (!im) { + goto out_err; + } + goto register_im; + } + /* try and avoid allocating a FILE* if the stream is not naturally a FILE* */ if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) { if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS)) { @@ -2409,7 +2430,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, io_ctx->gd_free(io_ctx); pefree(buff, 1); } - else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) { + else { /* try and force the stream to be FILE* */ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) { goto out_err; @@ -2442,7 +2463,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, fflush(fp); } -/* register_im: */ +register_im: if (im) { ZEND_REGISTER_RESOURCE(return_value, im, le_gd); php_stream_close(stream); @@ -2486,11 +2507,11 @@ PHP_FUNCTION(imagecreatefrompng) #endif /* HAVE_GD_PNG */ #ifdef HAVE_GD_WEBP -/* {{{ proto resource imagecreatefromwebp(string filename) - Create a new image from WEBP file or URL */ +/* {{{ proto resource imagecreatefrompng(string filename) + Create a new image from PNG file or URL */ PHP_FUNCTION(imagecreatefromwebp) { - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageCreateFromWebp, gdImageCreateFromWebpCtx); + _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageCreateFromWebpPtr, gdImageCreateFromWebpPtr); } /* }}} */ #endif /* HAVE_GD_VPX */ @@ -2726,7 +2747,7 @@ PHP_FUNCTION(imagepng) #ifdef HAVE_GD_WEBP /* {{{ proto bool imagewebp(resource im [, string filename[, quality]] ) - Output WEBP image to browser or file */ + Output PNG image to browser or file */ PHP_FUNCTION(imagewebp) { _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WEBP, "WEBP", gdImageWebpCtx); @@ -4955,7 +4976,7 @@ PHP_FUNCTION(imagecrop) zval *z_rect; zval **tmp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &z_rect) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|a", &IM, &z_rect) == FAILURE) { return; } @@ -5095,7 +5116,7 @@ PHP_FUNCTION(imagescale) } /* }}} */ -/* {{{ proto resource imageaffine(resource src, array affine[, array clip]) +/* {{{ proto resource imageaffine(resource dst, resource src, array affine, array clip) Return an image containing the affine tramsformed src image, using an optional clipping area */ PHP_FUNCTION(imageaffine) { @@ -5200,7 +5221,7 @@ PHP_FUNCTION(imageaffine) PHP_FUNCTION(imageaffinematrixget) { double affine[6]; - long type; + gdAffineStandardMatrix type; zval *options; zval **tmp; int res = GD_FALSE, i; @@ -5209,7 +5230,7 @@ PHP_FUNCTION(imageaffinematrixget) return; } - switch((gdAffineStandardMatrix)type) { + switch(type) { case GD_AFFINE_TRANSLATE: case GD_AFFINE_SCALE: { double x, y; @@ -5259,7 +5280,7 @@ PHP_FUNCTION(imageaffinematrixget) } default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", type); RETURN_FALSE; } @@ -5349,7 +5370,7 @@ PHP_FUNCTION(imagesetinterpolation) { zval *IM; gdImagePtr im; - long method = GD_BILINEAR_FIXED; + gdInterpolationMethod method = GD_BILINEAR_FIXED; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM, &method) == FAILURE) { return; diff --git a/ext/gd/gd_compat.c b/ext/gd/gd_compat.c index dc6a95ae1165..35b64578584c 100644 --- a/ext/gd/gd_compat.c +++ b/ext/gd/gd_compat.c @@ -10,7 +10,6 @@ #endif #include "gd_compat.h" -#include "php.h" #ifdef HAVE_GD_JPG int gdJpegGetVersionInt() @@ -46,18 +45,3 @@ const char * gdPngGetVersionString() } #endif -int overflow2(int a, int b) -{ - TSRMLS_FETCH(); - - if(a <= 0 || b <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n"); - return 1; - } - if(a > INT_MAX / b) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n"); - return 1; - } - return 0; -} - diff --git a/ext/gd/gd_compat.h b/ext/gd/gd_compat.h index db757f59883e..ea812ea2c411 100644 --- a/ext/gd/gd_compat.h +++ b/ext/gd/gd_compat.h @@ -1,14 +1,8 @@ #ifndef GD_COMPAT_H #define GD_COMPAT_H 1 -#ifndef HAVE_GD_BUNDLED -/* from gd_compat.c */ const char * gdPngGetVersionString(); const char * gdJpegGetVersionString(); int gdJpegGetVersionInt(); -#endif - -/* from gd_compat.c of libgd/gd_security.c */ -int overflow2(int a, int b); #endif /* GD_COMPAT_H */ diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 54890bc1777e..81eba52c826b 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -3011,6 +3011,7 @@ void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) int gdImagePaletteToTrueColor(gdImagePtr src) { unsigned int y; + unsigned char alloc_y = 0; unsigned int yy; if (src == NULL) { @@ -3043,7 +3044,7 @@ int gdImagePaletteToTrueColor(gdImagePtr src) for (x = 0; x < sx; x++) { const unsigned char c = *(src_row + x); if (c == src->transparent) { - *(dst_row + x) = gdTrueColorAlpha(0, 0, 0, 127); + *(dst_row + x) = gdTrueColorAlpha(0, 0, 0, 127);; } else { *(dst_row + x) = gdTrueColorAlpha(src->red[c], src->green[c], src->blue[c], src->alpha[c]); } @@ -3060,12 +3061,6 @@ int gdImagePaletteToTrueColor(gdImagePtr src) src->pixels = NULL; src->alphaBlendingFlag = 0; src->saveAlphaFlag = 1; - - if (src->transparent >= 0) { - const unsigned char c = src->transparent; - src->transparent = gdTrueColorAlpha(src->red[c], src->green[c], src->blue[c], src->alpha[c]); - } - return 1; clean_on_error: diff --git a/ext/gd/libgd/gd_crop.c b/ext/gd/libgd/gd_crop.c index f0b888a4f1c6..9ce48273b640 100644 --- a/ext/gd/libgd/gd_crop.c +++ b/ext/gd/libgd/gd_crop.c @@ -69,7 +69,7 @@ printf("rect->x: %i\nrect->y: %i\nrect->width: %i\nrect->height: %i\n", crop->x, if (src->trueColor) { unsigned int dst_y = 0; while (y < (crop->y + (crop->height - 1))) { - /* TODO: replace 4 w/byte per channel||pitch once available */ + /* TODO: replace 4 w/byte per channel||pitch once avaiable */ memcpy(dst->tpixels[dst_y++], src->tpixels[y++] + crop->x, crop->width * 4); } } else { diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index e34242bb7364..ec9a79c03be7 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -1063,7 +1063,6 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt if (tmp_im == NULL) { return NULL; } - gdImageSetInterpolationMethod(tmp_im, src->interpolation_id); _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height); dst = gdImageCreateTrueColor(new_width, new_height); @@ -1071,7 +1070,6 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt gdFree(tmp_im); return NULL; } - gdImageSetInterpolationMethod(dst, src->interpolation_id); _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height); gdFree(tmp_im); @@ -1086,9 +1084,8 @@ gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const unsig if (tmp_im == NULL) { return NULL; } - gdImageSetInterpolationMethod(tmp_im, src->interpolation_id); - _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height); + _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height); gdFree(tmp_im); @@ -1675,6 +1672,13 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co unsigned int i; gdImagePtr dst; + /* impact perf a bit, but not that much. Implementation for palette + images can be done at a later point. + */ + if (src->trueColor == 0) { + gdImagePaletteToTrueColor(src); + } + dst = gdImageCreateTrueColor(new_width, new_height); if (!dst) { return NULL; @@ -1684,8 +1688,8 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co unsigned int j; dst_offset_x = 0; for (j = 0; j < new_width; j++) { - gdFixed f_i = gd_itofx((int)i - (int)new_height/2); - gdFixed f_j = gd_itofx((int)j - (int)new_width/2); + gdFixed f_i = gd_itofx(i - new_height/2); + gdFixed f_j = gd_itofx(j-new_width/2); gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H; gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W; long m = gd_fxtoi(f_m); @@ -1731,11 +1735,17 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y) : 0; - if (bgColor < 0) { return NULL; } + /* impact perf a bit, but not that much. Implementation for palette + images can be done at a later point. + */ + if (src->trueColor == 0) { + gdImagePaletteToTrueColor(src); + } + dst = gdImageCreateTrueColor(new_width, new_height); if (!dst) { return NULL; @@ -1746,8 +1756,8 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b unsigned int j; dst_offset_x = 0; for (j = 0; j < new_width; j++) { - gdFixed f_i = gd_itofx((int)i - (int)new_height/ 2); - gdFixed f_j = gd_itofx((int)j - (int)new_width / 2); + gdFixed f_i = gd_itofx(i - new_height/ 2); + gdFixed f_j = gd_itofx(j -new_width / 2); gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H; gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W; long m = gd_fxtoi(f_m); @@ -1789,6 +1799,13 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int unsigned int src_offset_x, src_offset_y; gdImagePtr dst; + /* impact perf a bit, but not that much. Implementation for palette + images can be done at a later point. + */ + if (src->trueColor == 0) { + gdImagePaletteToTrueColor(src); + } + dst = gdImageCreateTrueColor(new_width, new_height); if (dst == NULL) { return NULL; @@ -1800,8 +1817,8 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int dst_offset_x = 0; for (j=0; j < new_width; j++) { - const gdFixed f_i = gd_itofx((int)i - (int)new_height/2); - const gdFixed f_j = gd_itofx((int)j - (int)new_width/2); + const gdFixed f_i = gd_itofx(i-new_height/2); + const gdFixed f_j = gd_itofx(j-new_width/2); const gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H; const gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W; const unsigned int m = gd_fxtoi(f_m); @@ -1816,18 +1833,18 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int const gdFixed f_w4 = gd_mulfx(f_f, f_g); if (n < src_w - 1) { - src_offset_x = n + 1; - src_offset_y = m; + src_offset_x = m + 1; + src_offset_y = n; } if (m < src_h-1) { - src_offset_x = n; - src_offset_y = m + 1; + src_offset_x = m; + src_offset_y = n + 1; } if (!((n >= src_w-1) || (m >= src_h-1))) { - src_offset_x = n + 1; - src_offset_y = m + 1; + src_offset_x = m + 1; + src_offset_y = n + 1; } { const int pixel1 = src->tpixels[src_offset_y][src_offset_x]; @@ -1908,6 +1925,13 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const unsigned int i; gdImagePtr dst; + /* impact perf a bit, but not that much. Implementation for palette + images can be done at a later point. + */ + if (src->trueColor == 0) { + gdImagePaletteToTrueColor(src); + } + dst = gdImageCreateTrueColor(new_width, new_height); if (dst == NULL) { @@ -1920,8 +1944,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const dst_offset_x = 0; for (j=0; j < new_width; j++) { - const gdFixed f_i = gd_itofx((int)i - (int)new_height/2); - const gdFixed f_j = gd_itofx((int)j - (int)new_width/2); + const gdFixed f_i = gd_itofx(i-new_height/2); + const gdFixed f_j = gd_itofx(j-new_width/2); const gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H; const gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W; const int m = gd_fxtoi(f_m); @@ -2156,21 +2180,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor) { const int angle_rounded = (int)floor(angle * 100); - + if (bgcolor < 0) { return NULL; } - /* impact perf a bit, but not that much. Implementation for palette - images can be done at a later point. - */ - if (src->trueColor == 0) { - if (bgcolor >= 0) { - bgcolor = gdTrueColorAlpha(src->red[bgcolor], src->green[bgcolor], src->blue[bgcolor], src->alpha[bgcolor]); - } - gdImagePaletteToTrueColor(src); - } - /* no interpolation needed here */ switch (angle_rounded) { case 9000: diff --git a/ext/gd/libgd/gd_webp.c b/ext/gd/libgd/gd_webp.c index bf9ac9dd0e1a..889f5f10a6e1 100644 --- a/ext/gd/libgd/gd_webp.c +++ b/ext/gd/libgd/gd_webp.c @@ -58,13 +58,11 @@ gdImagePtr gdImageCreateFromWebpPtr (int size, void *data) return im; } -#define GD_WEBP_ALLOC_STEP (4*1024) - gdImagePtr gdImageCreateFromWebpCtx (gdIOCtx * infile) { int width, height, ret; - unsigned char *filedata = NULL; - unsigned char *read, *temp; + unsigned char *filedata; + unsigned char dummy[1024]; unsigned char *Y = NULL; unsigned char *U = NULL; unsigned char *V = NULL; @@ -72,25 +70,16 @@ gdImagePtr gdImageCreateFromWebpCtx (gdIOCtx * infile) gdImagePtr im; do { - temp = gdRealloc(filedata, size+GD_WEBP_ALLOC_STEP); - if (temp) { - filedata = temp; - read = temp + size; - } else { - if (filedata) { - gdFree(filedata); - } - php_gd_error("WebP decode: realloc failed"); - return NULL; - } - - n = gdGetBuf(read, GD_WEBP_ALLOC_STEP, infile); - /* differs from upstream where gdGetBuf return 0 instead of EOF */ - if (n>0 && n!=EOF) { - size += n; - } - } while (n>0 && n!=EOF); + n = gdGetBuf(dummy, 1024, infile); + size += n; + } while (n != EOF); + filedata = gdMalloc(size); + if (!filedata) { + php_gd_error("WebP decode: alloc failed"); + return NULL; + } + gdGetBuf(filedata, size, infile); ret = WebPDecode(filedata, size, &Y, &U, &V, &width, &height); gdFree(filedata); if (ret != webp_success) { diff --git a/ext/gd/libgd/webpimg.h b/ext/gd/libgd/webpimg.h index db23de5bb24a..8a05429a73c4 100644 --- a/ext/gd/libgd/webpimg.h +++ b/ext/gd/libgd/webpimg.h @@ -84,7 +84,7 @@ WebPResult WebPDecode(const uint8* data, * height. * 6. y_stride: The width (in bytes) of one row of Y data. This may not * match width if there is end of row padding (e.g., for 32 - * bit row alignment). + * bit row aligment). * 7. QP: the quantization parameter. This parameter controls the * compression vs quality tradeoff. Use smaller numbers for better * quality (compression will be lesser) and vice versa. 20 is a diff --git a/ext/gd/tests/bug43073.phpt b/ext/gd/tests/bug43073.phpt index 8ddd32442197..4f448f2b4abc 100644 --- a/ext/gd/tests/bug43073.phpt +++ b/ext/gd/tests/bug43073.phpt @@ -33,19 +33,19 @@ imagepng($g, "$cwd/bug43073.png"); --CLEAN-- --EXPECTF-- -(500, 40%d), (610, 40%d), (610, 376), (500, 376) +(500, 402), (610, 402), (610, 376), (500, 376) (492, 363), (591, 322), (580, 295), (480, 336) (470, 331), (548, 254), (527, 233), (449, 310) (439, 309), (483, 202), (461, 193), (416, 299) -(40%d, 300), (40%d, 183), (38%d, 183), (38%d, 300) +(401, 300), (401, 183), (381, 183), (381, 300) (362, 307), (316, 195), (291, 205), (337, 318) (330, 329), (246, 244), (224, 265), (308, 350) (308, 360), (202, 316), (190, 344), (296, 388) -(300, %d), (18%d, %d), (18%d, 425), (%d, 425) +(300, 399), (186, 399), (186, 425), (300, 425) (306, 437), (195, 483), (206, 510), (318, 464) (328, 469), (240, 557), (260, 578), (349, 491) (359, 491), (312, 607), (334, 616), (382, 501) -(%d, 500), (%d, 618), (41%d, 618), (41%d, 500) +(398, 500), (398, 618), (418, 618), (418, 500) (436, 493), (483, 607), (507, 597), (461, 482) (468, 471), (555, 558), (577, 538), (490, 450) (490, 440), (600, 485), (611, 457), (502, 412) diff --git a/ext/gd/tests/bug48801.phpt b/ext/gd/tests/bug48801.phpt index 773564f78275..fd25541a5201 100644 --- a/ext/gd/tests/bug48801.phpt +++ b/ext/gd/tests/bug48801.phpt @@ -20,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n"; ?> --EXPECTF-- (-1, 15) -(15%d, 15) -(15%d, -48) +(155, 15) +(155, -48) (-1, -48) diff --git a/ext/gd/tests/imagecopyresampled_basic.phpt b/ext/gd/tests/imagecopyresampled_basic.phpt index fd96ab692843..a0454faf865e 100644 --- a/ext/gd/tests/imagecopyresampled_basic.phpt +++ b/ext/gd/tests/imagecopyresampled_basic.phpt @@ -35,9 +35,9 @@ imagefilledellipse($image_lge, 200, 150, 300, 200, $col_ellipse); imagepng($image_lge, $dest_lge); // Get new dimensions -$percent = 0.5; // new image 50% of original +$percent = 0.5; // new image 50% of orginal list($width, $height) = getimagesize($dest_lge); -echo "Size of original: width=". $width . " height=" . $height . "\n"; +echo "Size of orginal: width=". $width . " height=" . $height . "\n"; $new_width = $width * $percent; $new_height = $height * $percent; @@ -66,6 +66,6 @@ echo "Done\n"; ?> --EXPECT-- Simple test of imagecopyresampled() function -Size of original: width=400 height=300 +Size of orginal: width=400 height=300 Size of copy: width=200 height=150 Done diff --git a/ext/gd/tests/imagecrop_auto.phpt b/ext/gd/tests/imagecrop_auto.phpt index 1c1929d8e8d7..c2b5177fbfe5 100644 --- a/ext/gd/tests/imagecrop_auto.phpt +++ b/ext/gd/tests/imagecrop_auto.phpt @@ -57,8 +57,6 @@ $im_crop = imagecropauto($im, IMG_CROP_THRESHOLD, 0.1, 0x0); imagepng($im_crop, __DIR__ . "/crop_threshold.png"); var_dump(imagesx($im_crop)); var_dump(imagesy($im_crop)); - -@unlink(__DIR__ . "/crop_threshold.png"); ?> --EXPECT-- TC IMG_CROP_DEFAULT diff --git a/ext/gd/tests/imageloadfont_invalid.phpt b/ext/gd/tests/imageloadfont_invalid.phpt index 6cf0e336b69e..07bf150ac890 100644 --- a/ext/gd/tests/imageloadfont_invalid.phpt +++ b/ext/gd/tests/imageloadfont_invalid.phpt @@ -3,6 +3,7 @@ imageloadfont() function crashes --SKIPIF-- --FILE-- = 0 ? (x) : -(x)) +/* True global resources - no need for thread safety here */ +static int le_gmp; + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_init, 0, 0, 1) ZEND_ARG_INFO(0, number) @@ -306,18 +308,9 @@ zend_module_entry gmp_module_entry = { ZEND_GET_MODULE(gmp) #endif -zend_class_entry *gmp_ce; -static zend_object_handlers gmp_object_handlers; - -typedef struct _gmp_object { - zend_object std; - mpz_t num; -} gmp_object; +static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); -typedef struct _gmp_temp { - mpz_t num; - zend_bool is_used; -} gmp_temp_t; +#define GMP_RESOURCE_NAME "GMP integer" #define GMP_ROUND_ZERO 0 #define GMP_ROUND_PLUSINF 1 @@ -331,123 +324,6 @@ typedef struct _gmp_temp { # define MAX_BASE 36 #endif -#define IS_GMP(zval) \ - (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce TSRMLS_CC)) - -#define GET_GMP_FROM_ZVAL(zval) \ - (((gmp_object *) zend_object_store_get_object((zval) TSRMLS_CC))->num) - -/* The FETCH_GMP_ZVAL_* family of macros is used to fetch a gmp number - * (mpz_ptr) from a zval. If the zval is not a GMP instance, then we - * try to convert the value to a temporary gmp number using convert_to_gmp. - * This temporary number is stored in the temp argument, which is of type - * gmp_temp_t. This temporary value needs to be freed lateron using the - * FREE_GMP_TEMP macro. - * - * If the conversion to a gmp number fails, the macros return false. - * The _DEP / _DEP_DEP variants additionally free the temporary values - * passed in the last / last two arguments. - * - * If one zval can sometimes be fetched as a long you have to set the - * is_used member of the corresponding gmp_temp_t value to 0, otherwise - * the FREE_GMP_TEMP and *_DEP macros will not work properly. - * - * The three FETCH_GMP_ZVAL_* macros below are mostly copy & paste code - * as I couldn't find a way to combine them. - */ - -#define FREE_GMP_TEMP(temp) \ - if (temp.is_used) { \ - mpz_clear(temp.num); \ - } - -#define FETCH_GMP_ZVAL_DEP_DEP(gmpnumber, zval, temp, dep1, dep2) \ -if (IS_GMP(zval)) { \ - gmpnumber = GET_GMP_FROM_ZVAL(zval); \ - temp.is_used = 0; \ -} else { \ - mpz_init(temp.num); \ - if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \ - mpz_clear(temp.num); \ - FREE_GMP_TEMP(dep1); \ - FREE_GMP_TEMP(dep2); \ - RETURN_FALSE; \ - } \ - temp.is_used = 1; \ - gmpnumber = temp.num; \ -} - -#define FETCH_GMP_ZVAL_DEP(gmpnumber, zval, temp, dep) \ -if (IS_GMP(zval)) { \ - gmpnumber = GET_GMP_FROM_ZVAL(zval); \ - temp.is_used = 0; \ -} else { \ - mpz_init(temp.num); \ - if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \ - mpz_clear(temp.num); \ - FREE_GMP_TEMP(dep); \ - RETURN_FALSE; \ - } \ - temp.is_used = 1; \ - gmpnumber = temp.num; \ -} - -#define FETCH_GMP_ZVAL(gmpnumber, zval, temp) \ -if (IS_GMP(zval)) { \ - gmpnumber = GET_GMP_FROM_ZVAL(zval); \ - temp.is_used = 0; \ -} else { \ - mpz_init(temp.num); \ - if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \ - mpz_clear(temp.num); \ - RETURN_FALSE; \ - } \ - temp.is_used = 1; \ - gmpnumber = temp.num; \ -} - -#define INIT_GMP_RETVAL(gmpnumber) \ - gmp_create_ex(return_value, &gmpnumber TSRMLS_CC) - -static void gmp_strval(zval *result, mpz_t gmpnum, long base); -static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC); -static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC); - -/* - * The gmp_*_op functions provide an implementation for several common types - * of GMP functions. The gmp_zval_(unary|binary)_*_op functions have to be manually - * passed zvals to work on, whereas the gmp_(unary|binary)_*_op macros already - * include parameter parsing. - */ -typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); -typedef int (*gmp_unary_opl_t)(mpz_srcptr); - -typedef void (*gmp_unary_ui_op_t)(mpz_ptr, unsigned long); - -typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr); - -typedef void (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); -typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef void (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); - -static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC); -static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC); -static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC); -static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC); - -/* Binary operations */ -#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop, 0) -#define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL, 0) -#define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_binary_ui_op_no_zero(op, uop) \ - _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop, 1) - -/* Unary operations */ -#define gmp_unary_op(op) _gmp_unary_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) - /* {{{ gmp_emalloc */ static void *gmp_emalloc(size_t size) @@ -472,245 +348,6 @@ static void gmp_efree(void *ptr, size_t size) } /* }}} */ -static inline long gmp_get_long(zval *zv) /* {{{ */ -{ - if (Z_TYPE_P(zv) == IS_LONG) { - return Z_LVAL_P(zv); - } else { - zval tmp_zv; - MAKE_COPY_ZVAL(&zv, &tmp_zv); - convert_to_long(&tmp_zv); - return Z_LVAL(tmp_zv); - } -} -/* }}} */ - -static void gmp_free_object_storage(gmp_object *intern TSRMLS_DC) /* {{{ */ -{ - mpz_clear(intern->num); - - zend_object_std_dtor(&intern->std TSRMLS_CC); - efree(intern); -} -/* }}} */ - -static inline zend_object_value gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */ -{ - zend_object_value retval; - gmp_object *intern = emalloc(sizeof(gmp_object)); - - zend_object_std_init(&intern->std, ce TSRMLS_CC); - object_properties_init(&intern->std, ce); - - mpz_init(intern->num); - *gmpnum_target = intern->num; - - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, - (zend_objects_free_object_storage_t) gmp_free_object_storage, - NULL TSRMLS_CC - ); - retval.handlers = &gmp_object_handlers; - - return retval; -} -/* }}} */ - -static zend_object_value gmp_create_object(zend_class_entry *ce TSRMLS_DC) /* {{{ */ -{ - mpz_ptr gmpnum_dummy; - return gmp_create_object_ex(ce, &gmpnum_dummy TSRMLS_CC); -} -/* }}} */ - -static inline void gmp_create_ex(zval *target, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */ -{ - Z_TYPE_P(target) = IS_OBJECT; - Z_OBJVAL_P(target) = gmp_create_object_ex(gmp_ce, gmpnum_target TSRMLS_CC); -} -/* }}} */ - -static zval *gmp_create(mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */ -{ - zval *obj; - MAKE_STD_ZVAL(obj); - gmp_create_ex(obj, gmpnum_target TSRMLS_CC); - return obj; -} -/* }}} */ - -static int gmp_cast_object(zval *readobj, zval *writeobj, int type TSRMLS_DC) /* {{{ */ -{ - mpz_ptr gmpnum; - switch (type) { - case IS_STRING: - gmpnum = GET_GMP_FROM_ZVAL(readobj); - INIT_PZVAL(writeobj); - gmp_strval(writeobj, gmpnum, 10); - return SUCCESS; - case IS_LONG: - gmpnum = GET_GMP_FROM_ZVAL(readobj); - INIT_PZVAL(writeobj); - ZVAL_LONG(writeobj, mpz_get_si(gmpnum)); - return SUCCESS; - case IS_DOUBLE: - gmpnum = GET_GMP_FROM_ZVAL(readobj); - INIT_PZVAL(writeobj); - ZVAL_DOUBLE(writeobj, mpz_get_d(gmpnum)); - return SUCCESS; - default: - return FAILURE; - } -} -/* }}} */ - -static HashTable *gmp_get_properties(zval *obj TSRMLS_DC) /* {{{ */ -{ - HashTable *ht = zend_std_get_properties(obj TSRMLS_CC); - mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(obj); - zval *zv; - - MAKE_STD_ZVAL(zv); - gmp_strval(zv, gmpnum, 10); - zend_hash_update(ht, "num", sizeof("num"), &zv, sizeof(zval *), NULL); - - return ht; -} -/* }}} */ - -static zend_object_value gmp_clone_obj(zval *obj TSRMLS_DC) /* {{{ */ -{ - gmp_object *old_object = zend_object_store_get_object(obj TSRMLS_CC); - zend_object_value new_object_val = gmp_create_object(Z_OBJCE_P(obj) TSRMLS_CC); - gmp_object *new_object = zend_object_store_get_object_by_handle( - new_object_val.handle TSRMLS_CC - ); - - zend_objects_clone_members( - &new_object->std, new_object_val, - &old_object->std, Z_OBJ_HANDLE_P(obj) TSRMLS_CC - ); - - mpz_set(new_object->num, old_object->num); - - return new_object_val; -} -/* }}} */ - -static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2 TSRMLS_DC) { - zval op2_copy; - if (Z_TYPE_P(op2) != IS_LONG) { - op2_copy = *op2; - zval_copy_ctor(&op2_copy); - convert_to_long(&op2_copy); - op2 = &op2_copy; - } - - if (Z_LVAL_P(op2) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shift cannot be negative"); - RETVAL_FALSE; - } else { - mpz_ptr gmpnum_op, gmpnum_result; - gmp_temp_t temp; - - FETCH_GMP_ZVAL(gmpnum_op, op1, temp); - INIT_GMP_RETVAL(gmpnum_result); - op(gmpnum_result, gmpnum_op, (unsigned long) Z_LVAL_P(op2)); - FREE_GMP_TEMP(temp); - } -} - -#define DO_BINARY_UI_OP_EX(op, uop, check_b_zero) \ - gmp_zval_binary_ui_op( \ - result, op1, op2, op, (gmp_binary_ui_op_t) uop, \ - check_b_zero TSRMLS_CC \ - ); \ - return SUCCESS; - -#define DO_BINARY_UI_OP(op) DO_BINARY_UI_OP_EX(op, op ## _ui, 0) -#define DO_BINARY_OP(op) DO_BINARY_UI_OP_EX(op, NULL, 0) - -#define DO_UNARY_OP(op) \ - gmp_zval_unary_op(result, op1, op TSRMLS_CC); \ - return SUCCESS; - -static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ -{ - switch (opcode) { - case ZEND_ADD: - DO_BINARY_UI_OP(mpz_add); - case ZEND_SUB: - DO_BINARY_UI_OP(mpz_sub); - case ZEND_MUL: - DO_BINARY_UI_OP(mpz_mul); - case ZEND_DIV: - DO_BINARY_UI_OP_EX(mpz_tdiv_q, mpz_tdiv_q_ui, 1); - case ZEND_MOD: - DO_BINARY_UI_OP_EX(mpz_mod, mpz_mod_ui, 1); - case ZEND_SL: - shift_operator_helper(mpz_mul_2exp, result, op1, op2 TSRMLS_CC); - return SUCCESS; - case ZEND_SR: - shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2 TSRMLS_CC); - return SUCCESS; - case ZEND_BW_OR: - DO_BINARY_OP(mpz_ior); - case ZEND_BW_AND: - DO_BINARY_OP(mpz_and); - case ZEND_BW_XOR: - DO_BINARY_OP(mpz_xor); - case ZEND_BW_NOT: - DO_UNARY_OP(mpz_com); - - default: - return FAILURE; - } -} -/* }}} */ - -static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ -{ - gmp_cmp(result, op1, op2 TSRMLS_CC); - if (Z_TYPE_P(result) == IS_BOOL) { - ZVAL_LONG(result, 1); - } - return SUCCESS; -} -/* }}} */ - -PHP_METHOD(GMP, __wakeup) /* {{{ */ -{ - HashTable *props; - zval **num_zv; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - props = zend_std_get_properties(getThis() TSRMLS_CC); - if (zend_hash_find(props, "num", sizeof("num"), (void **) &num_zv) == SUCCESS - && Z_TYPE_PP(num_zv) == IS_STRING && Z_STRLEN_PP(num_zv) > 0 - ) { - mpz_ptr gmpnumber = GET_GMP_FROM_ZVAL(getThis()); - if (convert_to_gmp(gmpnumber, *num_zv, 10 TSRMLS_CC) == SUCCESS) { - return; - } - } - - zend_throw_exception( - NULL, "Invalid serialization data", 0 TSRMLS_CC - ); -} -/* }}} */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_wakeup, 0, 0, 0) -ZEND_END_ARG_INFO() - -const zend_function_entry gmp_methods[] = { - PHP_ME(GMP, __wakeup, arginfo_wakeup, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - /* {{{ ZEND_GINIT_FUNCTION */ static ZEND_GINIT_FUNCTION(gmp) @@ -721,20 +358,9 @@ static ZEND_GINIT_FUNCTION(gmp) /* {{{ ZEND_MINIT_FUNCTION */ -ZEND_MINIT_FUNCTION(gmp) +ZEND_MODULE_STARTUP_D(gmp) { - zend_class_entry tmp_ce; - INIT_CLASS_ENTRY(tmp_ce, "GMP", gmp_methods); /* No methods on the class for now */ - gmp_ce = zend_register_internal_class(&tmp_ce TSRMLS_CC); - gmp_ce->create_object = gmp_create_object; - - memcpy(&gmp_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - gmp_object_handlers.cast_object = gmp_cast_object; - gmp_object_handlers.get_properties = gmp_get_properties; - gmp_object_handlers.clone_obj = gmp_clone_obj; - gmp_object_handlers.do_operation = gmp_do_operation; - gmp_object_handlers.compare = gmp_compare; - + le_gmp = zend_register_list_destructors_ex(_php_gmpnum_free, NULL, GMP_RESOURCE_NAME, module_number); REGISTER_LONG_CONSTANT("GMP_ROUND_ZERO", GMP_ROUND_ZERO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_PLUSINF", GMP_ROUND_PLUSINF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_MINUSINF", GMP_ROUND_MINUSINF, CONST_CS | CONST_PERSISTENT); @@ -777,211 +403,246 @@ ZEND_MODULE_INFO_D(gmp) } /* }}} */ +/* Fetch zval to be GMP number. + Initially, zval can be also number or string */ +#define FETCH_GMP_ZVAL(gmpnumber, zval, tmp_resource) \ +if (Z_TYPE_PP(zval) == IS_RESOURCE) { \ + ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp); \ + tmp_resource = 0; \ +} else { \ + if (convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) { \ + RETURN_FALSE; \ + } \ + tmp_resource = ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp); \ +} + +#define FREE_GMP_TEMP(tmp_resource) \ + if(tmp_resource) { \ + zend_list_delete(tmp_resource); \ + } + + +/* create a new initialized GMP number */ +#define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } +#define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } /* {{{ convert_to_gmp * Convert zval to be gmp number */ -static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC) +static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base TSRMLS_DC) { - switch (Z_TYPE_P(val)) { + int ret = 0; + int skip_lead = 0; + + *gmpnumber = emalloc(sizeof(mpz_t)); + + switch (Z_TYPE_PP(val)) { case IS_LONG: case IS_BOOL: - case IS_CONSTANT: { - mpz_set_si(gmpnumber, gmp_get_long(val)); - return SUCCESS; - } - case IS_STRING: { - char *numstr = Z_STRVAL_P(val); - int skip_lead = 0; - - if (Z_STRLEN_P(val) > 2) { - if (numstr[0] == '0') { - if (numstr[1] == 'x' || numstr[1] == 'X') { - base = 16; - skip_lead = 1; - } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) { - base = 2; - skip_lead = 1; + case IS_CONSTANT: + { + convert_to_long_ex(val); + mpz_init_set_si(**gmpnumber, Z_LVAL_PP(val)); + } + break; + case IS_STRING: + { + char *numstr = Z_STRVAL_PP(val); + + if (Z_STRLEN_PP(val) > 2) { + if (numstr[0] == '0') { + if (numstr[1] == 'x' || numstr[1] == 'X') { + base = 16; + skip_lead = 1; + } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) { + base = 2; + skip_lead = 1; + } } } + ret = mpz_init_set_str(**gmpnumber, (skip_lead ? &numstr[2] : numstr), base); } - - return mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), base); - } + break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert variable to GMP - wrong type"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to convert variable to GMP - wrong type"); + efree(*gmpnumber); return FAILURE; } -} -/* }}} */ - -static void gmp_strval(zval *result, mpz_t gmpnum, long base) /* {{{ */ -{ - int num_len; - char *out_string; - num_len = mpz_sizeinbase(gmpnum, abs(base)); - if (mpz_sgn(gmpnum) < 0) { - num_len++; + if (ret) { + FREE_GMP_NUM(*gmpnumber); + return FAILURE; } - - out_string = emalloc(num_len + 1); - mpz_get_str(out_string, base, gmpnum); - /* - * From GMP documentation for mpz_sizeinbase(): - * The returned value will be exact or 1 too big. If base is a power of - * 2, the returned value will always be exact. - * - * So let's check to see if we already have a \0 byte... - */ - - if (out_string[num_len - 1] == '\0') { - num_len--; - } else { - out_string[num_len] = '\0'; - } - - ZVAL_STRINGL(result, out_string, num_len, 0); + return SUCCESS; } /* }}} */ -static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {{{ */ -{ - mpz_ptr gmpnum_a, gmpnum_b; - gmp_temp_t temp_a, temp_b; - zend_bool use_si = 0; - long res; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); +/* {{{ typedefs + */ +typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); +typedef int (*gmp_unary_opl_t)(mpz_srcptr); - if (Z_TYPE_P(b_arg) == IS_LONG) { - use_si = 1; - temp_b.is_used = 0; - } else { - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); - } +typedef void (*gmp_unary_ui_op_t)(mpz_ptr, unsigned long); - if (use_si) { - res = mpz_cmp_si(gmpnum_a, Z_LVAL_P(b_arg)); - } else { - res = mpz_cmp(gmpnum_a, gmpnum_b); - } +typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr); +typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr); - FREE_GMP_TEMP(temp_a); - FREE_GMP_TEMP(temp_b); - - RETURN_LONG(res); -} +typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); +typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); +typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); /* }}} */ -/* {{{ gmp_zval_binary_ui_op +#define gmp_zval_binary_ui_op(r, a, b, o, u) gmp_zval_binary_ui_op_ex(r, a, b, o, u, 0, 0, 0 TSRMLS_CC) +#define gmp_zval_binary_ui_op2(r, a, b, o, u) gmp_zval_binary_ui_op2_ex(r, a, b, o, u, 0, 0, 0 TSRMLS_CC) + +#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) +#define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL) +#define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) + +/* Unary operations */ +#define gmp_unary_op(op) _gmp_unary_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) +#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) +#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) + +/* {{{ gmp_zval_binary_ui_op_ex Execute GMP binary operation. + May return GMP resource or long if operation allows this */ -static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC) +static inline void gmp_zval_binary_ui_op_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int allow_ui_return, int check_b_zero, int use_sign TSRMLS_DC) { - mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result; + mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; + unsigned long long_result = 0; int use_ui = 0; - gmp_temp_t temp_a, temp_b; + int arga_tmp = 0, argb_tmp = 0; - FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); + FETCH_GMP_ZVAL(gmpnum_a, a_arg, arga_tmp); - if (gmp_ui_op && Z_TYPE_P(b_arg) == IS_LONG && Z_LVAL_P(b_arg) >= 0) { + if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { use_ui = 1; - temp_b.is_used = 0; } else { - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, argb_tmp); } - if (check_b_zero) { + if(check_b_zero) { int b_is_zero = 0; - if (use_ui) { - b_is_zero = (Z_LVAL_P(b_arg) == 0); + if(use_ui) { + b_is_zero = (Z_LVAL_PP(b_arg) == 0); } else { - b_is_zero = !mpz_cmp_ui(gmpnum_b, 0); + b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); } - if (b_is_zero) { + if(b_is_zero) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); - FREE_GMP_TEMP(temp_a); - FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); RETURN_FALSE; } } - INIT_GMP_RETVAL(gmpnum_result); + INIT_GMP_NUM(gmpnum_result); - if (use_ui) { - gmp_ui_op(gmpnum_result, gmpnum_a, (unsigned long) Z_LVAL_P(b_arg)); + if (use_ui && gmp_ui_op) { + if (allow_ui_return) { + long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); + if (use_sign && mpz_sgn(*gmpnum_a) == -1) { + long_result = -long_result; + } + } else { + gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); + } } else { - gmp_op(gmpnum_result, gmpnum_a, gmpnum_b); + gmp_op(*gmpnum_result, *gmpnum_a, *gmpnum_b); } - FREE_GMP_TEMP(temp_a); - FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); + + if (use_ui && allow_ui_return) { + FREE_GMP_NUM(gmpnum_result); + RETURN_LONG((long)long_result); + } else { + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); + } } /* }}} */ -/* {{{ gmp_zval_binary_ui_op2 +/* {{{ gmp_zval_binary_ui_op2_ex Execute GMP binary operation which returns 2 values. + May return GMP resources or longs if operation allows this. */ -static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC) +static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int allow_ui_return, int check_b_zero TSRMLS_DC) { - mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result1, gmpnum_result2; + mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result1, *gmpnum_result2; + zval r; int use_ui = 0; - gmp_temp_t temp_a, temp_b; + unsigned long long_result = 0; + int arga_tmp = 0, argb_tmp = 0; - FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); + FETCH_GMP_ZVAL(gmpnum_a, a_arg, arga_tmp); - if (gmp_ui_op && Z_TYPE_P(b_arg) == IS_LONG && Z_LVAL_P(b_arg) >= 0) { + if (gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { /* use _ui function */ use_ui = 1; - temp_b.is_used = 0; } else { - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, argb_tmp); } - if (check_b_zero) { + if(check_b_zero) { int b_is_zero = 0; - if (use_ui) { - b_is_zero = (Z_LVAL_P(b_arg) == 0); + if(use_ui) { + b_is_zero = (Z_LVAL_PP(b_arg) == 0); } else { - b_is_zero = !mpz_cmp_ui(gmpnum_b, 0); + b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); } - if (b_is_zero) { + if(b_is_zero) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); - FREE_GMP_TEMP(temp_a); - FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); RETURN_FALSE; } } - array_init(return_value); - add_index_zval(return_value, 0, gmp_create(&gmpnum_result1 TSRMLS_CC)); - add_index_zval(return_value, 1, gmp_create(&gmpnum_result2 TSRMLS_CC)); + INIT_GMP_NUM(gmpnum_result1); + INIT_GMP_NUM(gmpnum_result2); - if (use_ui) { - gmp_ui_op(gmpnum_result1, gmpnum_result2, gmpnum_a, (unsigned long) Z_LVAL_P(b_arg)); + if (use_ui && gmp_ui_op) { + if (allow_ui_return) { + long_result = gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); + } else { + gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); + } } else { - gmp_op(gmpnum_result1, gmpnum_result2, gmpnum_a, gmpnum_b); + gmp_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, *gmpnum_b); } - FREE_GMP_TEMP(temp_a); - FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(arga_tmp); + FREE_GMP_TEMP(argb_tmp); + + array_init(return_value); + ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); + add_index_resource(return_value, 0, Z_LVAL(r)); + if (use_ui && allow_ui_return) { + mpz_clear(*gmpnum_result2); + add_index_long(return_value, 1, long_result); + } else { + ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); + add_index_resource(return_value, 1, Z_LVAL(r)); + } } /* }}} */ /* {{{ _gmp_binary_ui_op */ -static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero) +static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) { - zval *a_arg, *b_arg; + zval **a_arg, **b_arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero TSRMLS_CC); + gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op); } /* }}} */ @@ -989,28 +650,33 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op /* {{{ gmp_zval_unary_op */ -static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC) +static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op TSRMLS_DC) { - mpz_ptr gmpnum_a, gmpnum_result; - gmp_temp_t temp_a; + mpz_t *gmpnum_a, *gmpnum_result; + int temp_a; FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - INIT_GMP_RETVAL(gmpnum_result); - gmp_op(gmpnum_result, gmpnum_a); + INIT_GMP_NUM(gmpnum_result); + gmp_op(*gmpnum_result, *gmpnum_a); FREE_GMP_TEMP(temp_a); + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ gmp_zval_unary_ui_op */ -static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC) +static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC) { - mpz_ptr gmpnum_result; + mpz_t *gmpnum_result; + + convert_to_long_ex(a_arg); - INIT_GMP_RETVAL(gmpnum_result); - gmp_op(gmpnum_result, gmp_get_long(a_arg)); + INIT_GMP_NUM(gmpnum_result); + gmp_op(*gmpnum_result, Z_LVAL_PP(a_arg)); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ @@ -1019,9 +685,9 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_una */ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) { - zval *a_arg; + zval **a_arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } @@ -1033,9 +699,9 @@ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_o */ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) { - zval *a_arg; + zval **a_arg; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } @@ -1047,16 +713,16 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm */ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - RETVAL_LONG(gmp_op(gmpnum_a)); + RETVAL_LONG(gmp_op(*gmpnum_a)); FREE_GMP_TEMP(temp_a); } /* }}} */ @@ -1065,33 +731,33 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t */ static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) { - zval *a_arg, *b_arg; - mpz_ptr gmpnum_a, gmpnum_b; - gmp_temp_t temp_a, temp_b; + zval **a_arg, **b_arg; + mpz_t *gmpnum_a, *gmpnum_b; + int temp_a, temp_b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); - RETVAL_LONG(gmp_op(gmpnum_a, gmpnum_b)); + RETVAL_LONG(gmp_op(*gmpnum_a, *gmpnum_b)); FREE_GMP_TEMP(temp_a); FREE_GMP_TEMP(temp_b); } /* }}} */ -/* {{{ proto GMP gmp_init(mixed number [, int base]) +/* {{{ proto resource gmp_init(mixed number [, int base]) Initializes GMP number */ ZEND_FUNCTION(gmp_init) { - zval *number_arg; - mpz_ptr gmpnumber; - long base = 0; + zval **number_arg; + mpz_t * gmpnumber; + long base=0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &number_arg, &base) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &number_arg, &base) == FAILURE) { return; } @@ -1100,42 +766,48 @@ ZEND_FUNCTION(gmp_init) RETURN_FALSE; } - INIT_GMP_RETVAL(gmpnumber); - if (convert_to_gmp(gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); + if (convert_to_gmp(&gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) { RETURN_FALSE; } + + /* Write your own code here to handle argument number. */ + ZEND_REGISTER_RESOURCE(return_value, gmpnumber, le_gmp); } /* }}} */ -/* {{{ proto int gmp_intval(mixed gmpnumber) +/* {{{ proto int gmp_intval(resource gmpnumber) Gets signed long value of GMP number */ ZEND_FUNCTION(gmp_intval) { - zval *gmpnumber_arg; + zval **gmpnumber_arg; + mpz_t * gmpnum; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &gmpnumber_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &gmpnumber_arg) == FAILURE){ return; } - if (IS_GMP(gmpnumber_arg)) { - RETVAL_LONG(mpz_get_si(GET_GMP_FROM_ZVAL(gmpnumber_arg))); + if (Z_TYPE_PP(gmpnumber_arg) == IS_RESOURCE) { + ZEND_FETCH_RESOURCE(gmpnum, mpz_t *, gmpnumber_arg, -1, GMP_RESOURCE_NAME, le_gmp); + RETVAL_LONG(mpz_get_si(*gmpnum)); } else { - RETVAL_LONG(gmp_get_long(gmpnumber_arg)); + convert_to_long_ex(gmpnumber_arg); + RETVAL_LONG(Z_LVAL_PP(gmpnumber_arg)); } } /* }}} */ -/* {{{ proto string gmp_strval(mixed gmpnumber [, int base]) +/* {{{ proto string gmp_strval(resource gmpnumber [, int base]) Gets string representation of GMP number */ ZEND_FUNCTION(gmp_strval) { - zval *gmpnumber_arg; + zval **gmpnumber_arg; + int num_len; long base = 10; - mpz_ptr gmpnum; - gmp_temp_t temp_a; + mpz_t * gmpnum; + char *out_string; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &base) == FAILURE) { + if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &gmpnumber_arg, &base ) == FAILURE ) { return; } @@ -1153,138 +825,162 @@ ZEND_FUNCTION(gmp_strval) FETCH_GMP_ZVAL(gmpnum, gmpnumber_arg, temp_a); - gmp_strval(return_value, gmpnum, base); - + num_len = mpz_sizeinbase(*gmpnum, abs(base)); + out_string = emalloc(num_len+2); + if (mpz_sgn(*gmpnum) < 0) { + num_len++; + } + mpz_get_str(out_string, base, *gmpnum); + FREE_GMP_TEMP(temp_a); + + /* + From GMP documentation for mpz_sizeinbase(): + The returned value will be exact or 1 too big. If base is a power of + 2, the returned value will always be exact. + + So let's check to see if we already have a \0 byte... + */ + + if (out_string[num_len-1] == '\0') { + num_len--; + } else { + out_string[num_len] = '\0'; + } + RETVAL_STRINGL(out_string, num_len, 0); } /* }}} */ -/* {{{ proto GMP gmp_add(mixed a, mixed b) +/* {{{ proto resource gmp_add(resource a, resource b) Add a and b */ ZEND_FUNCTION(gmp_add) { - gmp_binary_ui_op(mpz_add, mpz_add_ui); + gmp_binary_ui_op(mpz_add, (gmp_binary_ui_op_t)mpz_add_ui); } /* }}} */ -/* {{{ proto GMP gmp_sub(mixed a, mixed b) +/* {{{ proto resource gmp_sub(resource a, resource b) Subtract b from a */ ZEND_FUNCTION(gmp_sub) { - gmp_binary_ui_op(mpz_sub, mpz_sub_ui); + gmp_binary_ui_op(mpz_sub, (gmp_binary_ui_op_t)mpz_sub_ui); } /* }}} */ -/* {{{ proto GMP gmp_mul(mixed a, mixed b) +/* {{{ proto resource gmp_mul(resource a, resource b) Multiply a and b */ ZEND_FUNCTION(gmp_mul) { - gmp_binary_ui_op(mpz_mul, mpz_mul_ui); + gmp_binary_ui_op(mpz_mul, (gmp_binary_ui_op_t)mpz_mul_ui); } /* }}} */ -/* {{{ proto array gmp_div_qr(mixed a, mixed b [, int round]) +/* {{{ proto array gmp_div_qr(resource a, resource b [, int round]) Divide a by b, returns quotient and reminder */ ZEND_FUNCTION(gmp_div_qr) { - zval *a_arg, *b_arg; + zval **a_arg, **b_arg; long round = GMP_ROUND_ZERO; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l", &a_arg, &b_arg, &round) == FAILURE) { return; } switch (round) { case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t) mpz_tdiv_qr_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t)mpz_tdiv_qr_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t) mpz_cdiv_qr_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t)mpz_cdiv_qr_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t) mpz_fdiv_qr_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t)mpz_fdiv_qr_ui, 0, 1 TSRMLS_CC); break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode"); - RETURN_FALSE; } + } /* }}} */ -/* {{{ proto GMP gmp_div_r(mixed a, mixed b [, int round]) +/* {{{ proto resource gmp_div_r(resource a, resource b [, int round]) Divide a by b, returns reminder only */ ZEND_FUNCTION(gmp_div_r) { - zval *a_arg, *b_arg; + zval **a_arg, **b_arg; long round = GMP_ROUND_ZERO; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l", &a_arg, &b_arg, &round) == FAILURE) { return; } switch (round) { case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t) mpz_tdiv_r_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui, 1, 1, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t) mpz_cdiv_r_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui, 1, 1, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t) mpz_fdiv_r_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui, 1, 1, 1 TSRMLS_CC); break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode"); - RETURN_FALSE; } } /* }}} */ -/* {{{ proto GMP gmp_div_q(mixed a, mixed b [, int round]) +/* {{{ proto resource gmp_div_q(resource a, resource b [, int round]) Divide a by b, returns quotient only */ ZEND_FUNCTION(gmp_div_q) { - zval *a_arg, *b_arg; + zval **a_arg, **b_arg; long round = GMP_ROUND_ZERO; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|l", &a_arg, &b_arg, &round) == FAILURE) { return; } switch (round) { case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t) mpz_tdiv_q_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t)mpz_tdiv_q_ui, 0, 1, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t) mpz_cdiv_q_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t)mpz_cdiv_q_ui, 0, 1, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t) mpz_fdiv_q_ui, 1 TSRMLS_CC); + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t)mpz_fdiv_q_ui, 0, 1, 1 TSRMLS_CC); break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode"); - RETURN_FALSE; } } /* }}} */ -/* {{{ proto GMP gmp_mod(mixed a, mixed b) +/* {{{ proto resource gmp_mod(resource a, resource b) Computes a modulo b */ ZEND_FUNCTION(gmp_mod) { - gmp_binary_ui_op_no_zero(mpz_mod, (gmp_binary_ui_op_t) mpz_mod_ui); + zval **a_arg, **b_arg; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ + return; + } + + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1, 1, 0 TSRMLS_CC); } /* }}} */ -/* {{{ proto GMP gmp_divexact(mixed a, mixed b) +/* {{{ proto resource gmp_divexact(resource a, resource b) Divide a by b using exact division algorithm */ ZEND_FUNCTION(gmp_divexact) { - gmp_binary_ui_op_no_zero(mpz_divexact, NULL); + zval **a_arg, **b_arg; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ + return; + } + + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_divexact, NULL, 0, 1, 1 TSRMLS_CC); } /* }}} */ -/* {{{ proto GMP gmp_neg(mixed a) +/* {{{ proto resource gmp_neg(resource a) Negates a number */ ZEND_FUNCTION(gmp_neg) { @@ -1292,7 +988,7 @@ ZEND_FUNCTION(gmp_neg) } /* }}} */ -/* {{{ proto GMP gmp_abs(mixed a) +/* {{{ proto resource gmp_abs(resource a) Calculates absolute value */ ZEND_FUNCTION(gmp_abs) { @@ -1300,92 +996,99 @@ ZEND_FUNCTION(gmp_abs) } /* }}} */ -/* {{{ proto GMP gmp_fact(int a) +/* {{{ proto resource gmp_fact(int a) Calculates factorial function */ ZEND_FUNCTION(gmp_fact) { - zval *a_arg; + zval **a_arg; + mpz_t *gmpnum_tmp; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } - if (IS_GMP(a_arg)) { - mpz_ptr gmpnum_tmp = GET_GMP_FROM_ZVAL(a_arg); - if (mpz_sgn(gmpnum_tmp) < 0) { + if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { + FETCH_GMP_ZVAL(gmpnum_tmp, a_arg, temp_a); /* no need to free this since it's IS_RESOURCE */ + if (mpz_sgn(*gmpnum_tmp) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0"); RETURN_FALSE; } } else { - if (gmp_get_long(a_arg) < 0) { + convert_to_long_ex(a_arg); + if (Z_LVAL_PP(a_arg) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0"); RETURN_FALSE; } } - + gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui TSRMLS_CC); } /* }}} */ -/* {{{ proto GMP gmp_pow(mixed base, int exp) +/* {{{ proto resource gmp_pow(resource base, int exp) Raise base to power exp */ ZEND_FUNCTION(gmp_pow) { - zval *base_arg; - mpz_ptr gmpnum_result, gmpnum_base; - gmp_temp_t temp_base; + zval **base_arg; + mpz_t *gmpnum_result, *gmpnum_base; + int use_ui = 0; + int temp_base; long exp; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &base_arg, &exp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &base_arg, &exp) == FAILURE) { return; } + if (Z_TYPE_PP(base_arg) == IS_LONG && Z_LVAL_PP(base_arg) >= 0) { + use_ui = 1; + } else { + FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base); + } + if (exp < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative exponent not supported"); RETURN_FALSE; } - INIT_GMP_RETVAL(gmpnum_result); - if (Z_TYPE_P(base_arg) == IS_LONG && Z_LVAL_P(base_arg) >= 0) { - mpz_ui_pow_ui(gmpnum_result, Z_LVAL_P(base_arg), exp); + INIT_GMP_NUM(gmpnum_result); + if (use_ui) { + mpz_ui_pow_ui(*gmpnum_result, Z_LVAL_PP(base_arg), exp); } else { - FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base); - mpz_pow_ui(gmpnum_result, gmpnum_base, exp); + mpz_pow_ui(*gmpnum_result, *gmpnum_base, exp); FREE_GMP_TEMP(temp_base); } + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ -/* {{{ proto GMP gmp_powm(mixed base, mixed exp, mixed mod) +/* {{{ proto resource gmp_powm(resource base, resource exp, resource mod) Raise base to power exp and take result modulo mod */ ZEND_FUNCTION(gmp_powm) { - zval *base_arg, *exp_arg, *mod_arg; - mpz_ptr gmpnum_base, gmpnum_exp, gmpnum_mod, gmpnum_result; + zval **base_arg, **exp_arg, **mod_arg; + mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; int use_ui = 0; - gmp_temp_t temp_base = {0}, temp_exp = {0}, temp_mod; + int temp_base, temp_exp, temp_mod; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz", &base_arg, &exp_arg, &mod_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ", &base_arg, &exp_arg, &mod_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_base, base_arg, temp_base); - if (Z_TYPE_P(exp_arg) == IS_LONG && Z_LVAL_P(exp_arg) >= 0) { + if (Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) { use_ui = 1; - temp_exp.is_used = 0; } else { - FETCH_GMP_ZVAL_DEP(gmpnum_exp, exp_arg, temp_exp, temp_base); - if (mpz_sgn(gmpnum_exp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter cannot be less than 0"); - FREE_GMP_TEMP(temp_base); - FREE_GMP_TEMP(temp_exp); + FETCH_GMP_ZVAL(gmpnum_exp, exp_arg, temp_exp); + if (mpz_sgn(*gmpnum_exp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); RETURN_FALSE; } } - FETCH_GMP_ZVAL_DEP_DEP(gmpnum_mod, mod_arg, temp_mod, temp_exp, temp_base); + FETCH_GMP_ZVAL(gmpnum_mod, mod_arg, temp_mod); - if (!mpz_cmp_ui(gmpnum_mod, 0)) { + if (!mpz_cmp_ui(*gmpnum_mod, 0)) { FREE_GMP_TEMP(temp_base); if (use_ui) { FREE_GMP_TEMP(temp_exp); @@ -1394,175 +1097,202 @@ ZEND_FUNCTION(gmp_powm) RETURN_FALSE; } - INIT_GMP_RETVAL(gmpnum_result); + INIT_GMP_NUM(gmpnum_result); if (use_ui) { - mpz_powm_ui(gmpnum_result, gmpnum_base, (unsigned long) Z_LVAL_P(exp_arg), gmpnum_mod); + mpz_powm_ui(*gmpnum_result, *gmpnum_base, (unsigned long)Z_LVAL_PP(exp_arg), *gmpnum_mod); } else { - mpz_powm(gmpnum_result, gmpnum_base, gmpnum_exp, gmpnum_mod); + mpz_powm(*gmpnum_result, *gmpnum_base, *gmpnum_exp, *gmpnum_mod); FREE_GMP_TEMP(temp_exp); } FREE_GMP_TEMP(temp_base); FREE_GMP_TEMP(temp_mod); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); + } /* }}} */ -/* {{{ proto GMP gmp_sqrt(mixed a) +/* {{{ proto resource gmp_sqrt(resource a) Takes integer part of square root of a */ ZEND_FUNCTION(gmp_sqrt) { - zval *a_arg; - mpz_ptr gmpnum_a, gmpnum_result; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a, *gmpnum_result; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - if (mpz_sgn(gmpnum_a) < 0) { + if (mpz_sgn(*gmpnum_a) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0"); FREE_GMP_TEMP(temp_a); RETURN_FALSE; } - - INIT_GMP_RETVAL(gmpnum_result); - mpz_sqrt(gmpnum_result, gmpnum_a); + + INIT_GMP_NUM(gmpnum_result); + mpz_sqrt(*gmpnum_result, *gmpnum_a); FREE_GMP_TEMP(temp_a); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ -/* {{{ proto array gmp_sqrtrem(mixed a) +/* {{{ proto array gmp_sqrtrem(resource a) Square root with remainder */ ZEND_FUNCTION(gmp_sqrtrem) { - zval *a_arg; - mpz_ptr gmpnum_a, gmpnum_result1, gmpnum_result2; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a, *gmpnum_result1, *gmpnum_result2; + zval r; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - - if (mpz_sgn(gmpnum_a) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0"); - FREE_GMP_TEMP(temp_a); + + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); RETURN_FALSE; } - array_init(return_value); - add_index_zval(return_value, 0, gmp_create(&gmpnum_result1 TSRMLS_CC)); - add_index_zval(return_value, 1, gmp_create(&gmpnum_result2 TSRMLS_CC)); + INIT_GMP_NUM(gmpnum_result1); + INIT_GMP_NUM(gmpnum_result2); - mpz_sqrtrem(gmpnum_result1, gmpnum_result2, gmpnum_a); + mpz_sqrtrem(*gmpnum_result1, *gmpnum_result2, *gmpnum_a); FREE_GMP_TEMP(temp_a); + + array_init(return_value); + ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); + add_index_resource(return_value, 0, Z_LVAL(r)); + ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); + add_index_resource(return_value, 1, Z_LVAL(r)); } /* }}} */ -/* {{{ proto bool gmp_perfect_square(mixed a) +/* {{{ proto bool gmp_perfect_square(resource a) Checks if a is an exact square */ ZEND_FUNCTION(gmp_perfect_square) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - RETVAL_BOOL((mpz_perfect_square_p(gmpnum_a) != 0)); + RETVAL_BOOL((mpz_perfect_square_p(*gmpnum_a)!=0)); FREE_GMP_TEMP(temp_a); } /* }}} */ -/* {{{ proto int gmp_prob_prime(mixed a[, int reps]) +/* {{{ proto int gmp_prob_prime(resource a[, int reps]) Checks if a is "probably prime" */ ZEND_FUNCTION(gmp_prob_prime) { - zval *gmpnumber_arg; - mpz_ptr gmpnum_a; + zval **gmpnumber_arg; + mpz_t *gmpnum_a; long reps = 10; - gmp_temp_t temp_a; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &reps) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &gmpnumber_arg, &reps) == FAILURE) { return; } FETCH_GMP_ZVAL(gmpnum_a, gmpnumber_arg, temp_a); - RETVAL_LONG(mpz_probab_prime_p(gmpnum_a, reps)); + RETVAL_LONG(mpz_probab_prime_p(*gmpnum_a, reps)); FREE_GMP_TEMP(temp_a); } /* }}} */ -/* {{{ proto GMP gmp_gcd(mixed a, mixed b) +/* {{{ proto resource gmp_gcd(resource a, resource b) Computes greatest common denominator (gcd) of a and b */ ZEND_FUNCTION(gmp_gcd) { - gmp_binary_ui_op(mpz_gcd, (gmp_binary_ui_op_t) mpz_gcd_ui); + zval **a_arg, **b_arg; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ + return; + } + + gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_gcd, (gmp_binary_ui_op_t)mpz_gcd_ui, 0, 0, 1 TSRMLS_CC); } /* }}} */ -/* {{{ proto array gmp_gcdext(mixed a, mixed b) +/* {{{ proto array gmp_gcdext(resource a, resource b) Computes G, S, and T, such that AS + BT = G = `gcd' (A, B) */ ZEND_FUNCTION(gmp_gcdext) { - zval *a_arg, *b_arg; - mpz_ptr gmpnum_a, gmpnum_b, gmpnum_t, gmpnum_s, gmpnum_g; - gmp_temp_t temp_a, temp_b; + zval **a_arg, **b_arg; + mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_t, *gmpnum_s, *gmpnum_g; + zval r; + int temp_a, temp_b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); - array_init(return_value); - add_assoc_zval(return_value, "g", gmp_create(&gmpnum_g TSRMLS_CC)); - add_assoc_zval(return_value, "s", gmp_create(&gmpnum_s TSRMLS_CC)); - add_assoc_zval(return_value, "t", gmp_create(&gmpnum_t TSRMLS_CC)); + INIT_GMP_NUM(gmpnum_g); + INIT_GMP_NUM(gmpnum_s); + INIT_GMP_NUM(gmpnum_t); - mpz_gcdext(gmpnum_g, gmpnum_s, gmpnum_t, gmpnum_a, gmpnum_b); + mpz_gcdext(*gmpnum_g, *gmpnum_s, *gmpnum_t, *gmpnum_a, *gmpnum_b); FREE_GMP_TEMP(temp_a); FREE_GMP_TEMP(temp_b); + + array_init(return_value); + + ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp); + add_assoc_resource(return_value, "g", Z_LVAL(r)); + ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp); + add_assoc_resource(return_value, "s", Z_LVAL(r)); + ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp); + add_assoc_resource(return_value, "t", Z_LVAL(r)); } /* }}} */ -/* {{{ proto GMP gmp_invert(mixed a, mixed b) +/* {{{ proto resource gmp_invert(resource a, resource b) Computes the inverse of a modulo b */ ZEND_FUNCTION(gmp_invert) { - zval *a_arg, *b_arg; - mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result; - gmp_temp_t temp_a, temp_b; + zval **a_arg, **b_arg; + mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; + int temp_a, temp_b; int res; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); - INIT_GMP_RETVAL(gmpnum_result); - res = mpz_invert(gmpnum_result, gmpnum_a, gmpnum_b); + INIT_GMP_NUM(gmpnum_result); + res=mpz_invert(*gmpnum_result, *gmpnum_a, *gmpnum_b); FREE_GMP_TEMP(temp_a); FREE_GMP_TEMP(temp_b); - if (!res) { - zval_dtor(return_value); + if (res) { + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); + } else { + FREE_GMP_NUM(gmpnum_result); RETURN_FALSE; } } /* }}} */ -/* {{{ proto int gmp_jacobi(mixed a, mixed b) +/* {{{ proto int gmp_jacobi(resource a, resource b) Computes Jacobi symbol */ ZEND_FUNCTION(gmp_jacobi) { @@ -1570,7 +1300,7 @@ ZEND_FUNCTION(gmp_jacobi) } /* }}} */ -/* {{{ proto int gmp_legendre(mixed a, mixed b) +/* {{{ proto int gmp_legendre(resource a, resource b) Computes Legendre symbol */ ZEND_FUNCTION(gmp_legendre) { @@ -1578,51 +1308,69 @@ ZEND_FUNCTION(gmp_legendre) } /* }}} */ -/* {{{ proto int gmp_cmp(mixed a, mixed b) +/* {{{ proto int gmp_cmp(resource a, resource b) Compares two numbers */ ZEND_FUNCTION(gmp_cmp) { - zval *a_arg, *b_arg; + zval **a_arg, **b_arg; + mpz_t *gmpnum_a, *gmpnum_b; + int use_si = 0, res; + int temp_a, temp_b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } - gmp_cmp(return_value, a_arg, b_arg TSRMLS_CC); + FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); + + if (Z_TYPE_PP(b_arg) == IS_LONG) { + use_si = 1; + } else { + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); + } + + if (use_si) { + res = mpz_cmp_si(*gmpnum_a, Z_LVAL_PP(b_arg)); + } else { + res = mpz_cmp(*gmpnum_a, *gmpnum_b); + } + FREE_GMP_TEMP(temp_a); + + RETURN_LONG(res); } /* }}} */ -/* {{{ proto int gmp_sign(mixed a) +/* {{{ proto int gmp_sign(resource a) Gets the sign of the number */ ZEND_FUNCTION(gmp_sign) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - RETVAL_LONG(mpz_sgn(gmpnum_a)); + RETVAL_LONG(mpz_sgn(*gmpnum_a)); FREE_GMP_TEMP(temp_a); } /* }}} */ -/* {{{ proto GMP gmp_random([int limiter]) +/* {{{ proto resource gmp_random([int limiter]) Gets random number */ ZEND_FUNCTION(gmp_random) { long limiter = 20; - mpz_ptr gmpnum_result; + mpz_t *gmpnum_result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &limiter) == FAILURE) { return; } - INIT_GMP_RETVAL(gmpnum_result); + INIT_GMP_NUM(gmpnum_result); if (!GMPG(rand_initialized)) { /* Initialize */ @@ -1634,14 +1382,15 @@ ZEND_FUNCTION(gmp_random) GMPG(rand_initialized) = 1; } #ifdef GMP_LIMB_BITS - mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS); + mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS); #else - mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB); + mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB); #endif + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ -/* {{{ proto GMP gmp_and(mixed a, mixed b) +/* {{{ proto resource gmp_and(resource a, resource b) Calculates logical AND of a and b */ ZEND_FUNCTION(gmp_and) { @@ -1649,7 +1398,7 @@ ZEND_FUNCTION(gmp_and) } /* }}} */ -/* {{{ proto GMP gmp_or(mixed a, mixed b) +/* {{{ proto resource gmp_or(resource a, resource b) Calculates logical OR of a and b */ ZEND_FUNCTION(gmp_or) { @@ -1657,7 +1406,7 @@ ZEND_FUNCTION(gmp_or) } /* }}} */ -/* {{{ proto GMP gmp_com(mixed a) +/* {{{ proto resource gmp_com(resource a) Calculates one's complement of a */ ZEND_FUNCTION(gmp_com) { @@ -1665,7 +1414,7 @@ ZEND_FUNCTION(gmp_com) } /* }}} */ -/* {{{ proto GMP gmp_nextprime(mixed a) +/* {{{ proto resource gmp_nextprime(resource a) Finds next prime of a */ ZEND_FUNCTION(gmp_nextprime) { @@ -1673,22 +1422,21 @@ ZEND_FUNCTION(gmp_nextprime) } /* }}} */ -/* {{{ proto GMP gmp_xor(mixed a, mixed b) +/* {{{ proto resource gmp_xor(resource a, resource b) Calculates logical exclusive OR of a and b */ ZEND_FUNCTION(gmp_xor) { - gmp_binary_op(mpz_xor); - /* use formula: a^b = (a|b)&~(a&b) */ - /*zval **a_arg, **b_arg; + /* use formula: a^b = (a|b)&^(a&b) */ + zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result, *gmpnum_t; - gmp_temp_t temp_a, temp_b; + int temp_a, temp_b; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); INIT_GMP_NUM(gmpnum_result); INIT_GMP_NUM(gmpnum_t); @@ -1703,172 +1451,186 @@ ZEND_FUNCTION(gmp_xor) FREE_GMP_TEMP(temp_a); FREE_GMP_TEMP(temp_b); - RETVAL_GMP(gmpnum_result);*/ + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ -/* {{{ proto void gmp_setbit(GMP &a, int index[, bool set_clear]) +/* {{{ proto void gmp_setbit(resource &a, int index[, bool set_clear]) Sets or clear bit in a */ ZEND_FUNCTION(gmp_setbit) { - zval *a_arg; + zval **a_arg; long index; zend_bool set = 1; - mpz_ptr gmpnum_a; + mpz_t *gmpnum_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|b", &a_arg, &index, &set) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); + if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); return; } - gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); - if (set) { - mpz_setbit(gmpnum_a, index); + mpz_setbit(*gmpnum_a, index); } else { - mpz_clrbit(gmpnum_a, index); + mpz_clrbit(*gmpnum_a, index); } } /* }}} */ -/* {{{ proto void gmp_clrbit(GMP &a, int index) +/* {{{ proto void gmp_clrbit(resource &a, int index) Clears bit in a */ ZEND_FUNCTION(gmp_clrbit) { - zval *a_arg; + zval **a_arg; long index; - mpz_ptr gmpnum_a; + mpz_t *gmpnum_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &a_arg, gmp_ce, &index) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &a_arg, &index) == FAILURE){ return; } + ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); + if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); return; } - gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); - mpz_clrbit(gmpnum_a, index); + mpz_clrbit(*gmpnum_a, index); } /* }}} */ -/* {{{ proto bool gmp_testbit(mixed a, int index) +/* {{{ proto bool gmp_testbit(resource a, int index) Tests if bit is set in a */ ZEND_FUNCTION(gmp_testbit) { - zval *a_arg; + zval **a_arg; long index; - mpz_ptr gmpnum_a; + mpz_t *gmpnum_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &index) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &a_arg, &index) == FAILURE){ return; } + ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); + if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); RETURN_FALSE; } - gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); - RETURN_BOOL(mpz_tstbit(gmpnum_a, index)); + if (mpz_tstbit(*gmpnum_a, index)) { + RETURN_TRUE; + } + RETURN_FALSE; } /* }}} */ -/* {{{ proto int gmp_popcount(mixed a) +/* {{{ proto int gmp_popcount(resource a) Calculates the population count of a */ ZEND_FUNCTION(gmp_popcount) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &a_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - RETVAL_LONG(mpz_popcount(gmpnum_a)); + RETVAL_LONG(mpz_popcount(*gmpnum_a)); FREE_GMP_TEMP(temp_a); } /* }}} */ -/* {{{ proto int gmp_hamdist(mixed a, mixed b) +/* {{{ proto int gmp_hamdist(resource a, resource b) Calculates hamming distance between a and b */ ZEND_FUNCTION(gmp_hamdist) { - zval *a_arg, *b_arg; - mpz_ptr gmpnum_a, gmpnum_b; - gmp_temp_t temp_a, temp_b; + zval **a_arg, **b_arg; + mpz_t *gmpnum_a, *gmpnum_b; + int temp_a, temp_b; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ", &a_arg, &b_arg) == FAILURE){ return; } FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a); + FETCH_GMP_ZVAL(gmpnum_b, b_arg, temp_b); - RETVAL_LONG(mpz_hamdist(gmpnum_a, gmpnum_b)); + RETVAL_LONG(mpz_hamdist(*gmpnum_a, *gmpnum_b)); FREE_GMP_TEMP(temp_a); FREE_GMP_TEMP(temp_b); } /* }}} */ -/* {{{ proto int gmp_scan0(mixed a, int start) +/* {{{ proto int gmp_scan0(resource a, int start) Finds first zero bit */ ZEND_FUNCTION(gmp_scan0) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; long start; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &a_arg, &start) == FAILURE){ return; } + FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); + if (start < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero"); RETURN_FALSE; } - FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - - RETVAL_LONG(mpz_scan0(gmpnum_a, start)); + RETVAL_LONG(mpz_scan0(*gmpnum_a, start)); FREE_GMP_TEMP(temp_a); } /* }}} */ -/* {{{ proto int gmp_scan1(mixed a, int start) +/* {{{ proto int gmp_scan1(resource a, int start) Finds first non-zero bit */ ZEND_FUNCTION(gmp_scan1) { - zval *a_arg; - mpz_ptr gmpnum_a; - gmp_temp_t temp_a; + zval **a_arg; + mpz_t *gmpnum_a; + int temp_a; long start; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &a_arg, &start) == FAILURE){ return; } + FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); if (start < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero"); RETURN_FALSE; } - FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a); - - RETVAL_LONG(mpz_scan1(gmpnum_a, start)); + RETVAL_LONG(mpz_scan1(*gmpnum_a, start)); FREE_GMP_TEMP(temp_a); } /* }}} */ +/* {{{ _php_gmpnum_free + */ +static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) +{ + mpz_t *gmpnum = (mpz_t *)rsrc->ptr; + + FREE_GMP_NUM(gmpnum); +} +/* }}} */ + #endif /* HAVE_GMP */ /* diff --git a/ext/gmp/tests/004.phpt b/ext/gmp/tests/004.phpt index 088dd08fd8ee..a0fa1cd133c9 100644 --- a/ext/gmp/tests/004.phpt +++ b/ext/gmp/tests/004.phpt @@ -38,6 +38,8 @@ int(2342344) Notice: Object of class stdClass could not be converted to int in %s on line %d int(1) int(0) -int(%d) + +Warning: gmp_intval(): supplied resource is not a valid GMP integer resource in %s on line %d +bool(false) int(12345678) Done diff --git a/ext/gmp/tests/005.phpt b/ext/gmp/tests/005.phpt index 4ae0cb750a41..7907ffbf53e9 100644 --- a/ext/gmp/tests/005.phpt +++ b/ext/gmp/tests/005.phpt @@ -47,7 +47,7 @@ bool(false) Warning: gmp_strval() expects parameter 2 to be long, string given in %s on line %d NULL -Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d +Warning: gmp_strval(): supplied resource is not a valid GMP integer resource in %s on line %d bool(false) string(7) "9765456" diff --git a/ext/gmp/tests/006.phpt b/ext/gmp/tests/006.phpt index 740760631d4e..dedbcd04726a 100644 --- a/ext/gmp/tests/006.phpt +++ b/ext/gmp/tests/006.phpt @@ -35,15 +35,9 @@ NULL Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(2) "-1" -} +resource(%d) of type (GMP integer) string(2) "-1" -object(GMP)#%d (1) { - ["num"]=> - string(5) "10001" -} +resource(%d) of type (GMP integer) string(5) "10001" Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d diff --git a/ext/gmp/tests/007.phpt b/ext/gmp/tests/007.phpt index e391c121f8d1..4d4a993a1729 100644 --- a/ext/gmp/tests/007.phpt +++ b/ext/gmp/tests/007.phpt @@ -8,16 +8,34 @@ gmp_div_qr() tests var_dump(gmp_div_qr()); var_dump(gmp_div_qr("")); -var_dump(gmp_div_qr(0,1)); -var_dump(gmp_div_qr(1,0)); -var_dump(gmp_div_qr(12653,23482734)); -var_dump(gmp_div_qr(12653,23482734, 10)); -var_dump(gmp_div_qr(1123123,123)); -var_dump(gmp_div_qr(1123123,123, 1)); -var_dump(gmp_div_qr(1123123,123, 2)); -var_dump(gmp_div_qr(1123123,123, GMP_ROUND_ZERO)); -var_dump(gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF)); -var_dump(gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF)); +var_dump($r = gmp_div_qr(0,1)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1,0)); +var_dump($r = gmp_div_qr(12653,23482734)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(12653,23482734, 10)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123, 1)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123, 2)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_ZERO)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); +var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF)); +var_dump(gmp_strval($r[0])); +var_dump(gmp_strval($r[1])); $fp = fopen(__FILE__, 'r'); @@ -34,108 +52,80 @@ Warning: gmp_div_qr() expects at least 2 parameters, 1 given in %s on line %d NULL array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(1) "0" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(1) "0" - } + resource(%d) of type (GMP integer) } +string(1) "0" +string(1) "0" Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d bool(false) array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(1) "0" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(5) "12653" - } + resource(%d) of type (GMP integer) } +string(1) "0" +string(5) "12653" +NULL + +Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d +bool(false) -Warning: gmp_div_qr(): Invalid rounding mode in %s on line %d +Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(2) "10" - } + resource(%d) of type (GMP integer) } +string(4) "9131" +string(2) "10" array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9132" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "-113" - } + resource(%d) of type (GMP integer) } +string(4) "9132" +string(4) "-113" array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(2) "10" - } + resource(%d) of type (GMP integer) } +string(4) "9131" +string(2) "10" array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(2) "10" - } + resource(%d) of type (GMP integer) } +string(4) "9131" +string(2) "10" array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9132" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "-113" - } + resource(%d) of type (GMP integer) } +string(4) "9132" +string(4) "-113" array(2) { [0]=> - object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" - } + resource(%d) of type (GMP integer) [1]=> - object(GMP)#%d (1) { - ["num"]=> - string(2) "10" - } + resource(%d) of type (GMP integer) } +string(4) "9131" +string(2) "10" -Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d +Warning: gmp_div_qr(): supplied resource is not a valid GMP integer resource in %s on line %d bool(false) Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d diff --git a/ext/gmp/tests/008.phpt b/ext/gmp/tests/008.phpt index c1874c86f901..4e44ec10bf88 100644 --- a/ext/gmp/tests/008.phpt +++ b/ext/gmp/tests/008.phpt @@ -9,15 +9,24 @@ var_dump(gmp_div_r()); var_dump(gmp_div_r("")); var_dump($r = gmp_div_r(0,1)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1,0)); var_dump($r = gmp_div_r(12653,23482734)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(12653,23482734, 10)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123, 1)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123, 2)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_ZERO)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_PLUSINF)); +var_dump(gmp_strval($r)); var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_MINUSINF)); +var_dump(gmp_strval($r)); $fp = fopen(__FILE__, 'r'); @@ -32,46 +41,31 @@ NULL Warning: gmp_div_r() expects at least 2 parameters, 1 given in %s on line %d NULL -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} +int(0) +string(1) "0" Warning: gmp_div_r(): Zero operand not allowed in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(5) "12653" -} +int(12653) +string(5) "12653" +NULL -Warning: gmp_div_r(): Invalid rounding mode in %s on line %d +Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(2) "10" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "-113" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "10" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "10" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "-113" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "10" -} +int(10) +string(2) "10" +int(113) +string(3) "113" +int(10) +string(2) "10" +int(10) +string(2) "10" +int(113) +string(3) "113" +int(10) +string(2) "10" -Warning: gmp_div_r(): Unable to convert variable to GMP - wrong type in %s on line %d +Warning: gmp_div_r(): supplied resource is not a valid GMP integer resource in %s on line %d bool(false) Warning: gmp_div_r(): Unable to convert variable to GMP - wrong type in %s on line %d diff --git a/ext/gmp/tests/009.phpt b/ext/gmp/tests/009.phpt index 3b75a48e1825..745a4ef63841 100644 --- a/ext/gmp/tests/009.phpt +++ b/ext/gmp/tests/009.phpt @@ -8,16 +8,25 @@ gmp_div_q() tests var_dump(gmp_div_q()); var_dump(gmp_div_q("")); -var_dump(gmp_div_q(0,1)); -var_dump(gmp_div_q(1,0)); -var_dump(gmp_div_q(12653,23482734)); -var_dump(gmp_div_q(12653,23482734, 10)); -var_dump(gmp_div_q(1123123,123)); -var_dump(gmp_div_q(1123123,123, 1)); -var_dump(gmp_div_q(1123123,123, 2)); -var_dump(gmp_div_q(1123123,123, GMP_ROUND_ZERO)); -var_dump(gmp_div_q(1123123,123, GMP_ROUND_PLUSINF)); -var_dump(gmp_div_q(1123123,123, GMP_ROUND_MINUSINF)); +var_dump($r = gmp_div_q(0,1)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1,0)); +var_dump($r = gmp_div_q(12653,23482734)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(12653,23482734, 10)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123, 1)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123, 2)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_ZERO)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_PLUSINF)); +var_dump(gmp_strval($r)); +var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_MINUSINF)); +var_dump(gmp_strval($r)); $fp = fopen(__FILE__, 'r'); @@ -32,46 +41,31 @@ NULL Warning: gmp_div_q() expects at least 2 parameters, 1 given in %s on line %d NULL -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} +resource(%d) of type (GMP integer) +string(1) "0" Warning: gmp_div_q(): Zero operand not allowed in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} +resource(%d) of type (GMP integer) +string(1) "0" +NULL -Warning: gmp_div_q(): Invalid rounding mode %s on line %d +Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "9132" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "9132" -} -object(GMP)#%d (1) { - ["num"]=> - string(4) "9131" -} +resource(%d) of type (GMP integer) +string(4) "9131" +resource(%d) of type (GMP integer) +string(4) "9132" +resource(%d) of type (GMP integer) +string(4) "9131" +resource(%d) of type (GMP integer) +string(4) "9131" +resource(%d) of type (GMP integer) +string(4) "9132" +resource(%d) of type (GMP integer) +string(4) "9131" -Warning: gmp_div_q(): Unable to convert variable to GMP - wrong type in %s on line %d +Warning: gmp_div_q(): supplied resource is not a valid GMP integer resource in %s on line %d bool(false) Warning: gmp_div_q(): Unable to convert variable to GMP - wrong type in %s on line %d diff --git a/ext/gmp/tests/010.phpt b/ext/gmp/tests/010.phpt index e3f85ec44f1e..293a2a0bf20c 100644 --- a/ext/gmp/tests/010.phpt +++ b/ext/gmp/tests/010.phpt @@ -28,22 +28,13 @@ NULL Warning: gmp_mod() expects exactly 2 parameters, 1 given in %s on line %d NULL bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} +int(0) +resource(%d) of type (GMP integer) Warning: gmp_mod(): Zero operand not allowed in %s on line %d bool(false) Warning: gmp_mod(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(5) "31161" -} +resource(%d) of type (GMP integer) Done diff --git a/ext/gmp/tests/014.phpt b/ext/gmp/tests/014.phpt index 6afccaf936cc..40e10c6fbe03 100644 --- a/ext/gmp/tests/014.phpt +++ b/ext/gmp/tests/014.phpt @@ -43,7 +43,7 @@ string(19) "2432902008176640000" string(65) "30414093201713378043612608166064768844377641568960512000000000000" string(7) "3628800" string(1) "1" -string(9) "479001600" +string(11) "87178291200" Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d string(1) "0" @@ -53,9 +53,6 @@ NULL Warning: gmp_fact() expects exactly 1 parameter, 2 given in %s on line %d NULL -object(GMP)#%d (1) { - ["num"]=> - string(1) "1" -} +resource(%d) of type (GMP integer) string(1) "1" Done diff --git a/ext/gmp/tests/016.phpt b/ext/gmp/tests/016.phpt index 8a0b34458fe3..44360865ca8a 100644 --- a/ext/gmp/tests/016.phpt +++ b/ext/gmp/tests/016.phpt @@ -69,8 +69,5 @@ NULL Warning: gmp_powm(): Second parameter cannot be less than 0 in %s on line %d bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(1) "1" -} +resource(%d) of type (GMP integer) Done diff --git a/ext/gmp/tests/033.phpt b/ext/gmp/tests/033.phpt index 99848959d52d..38ff5be5bf94 100644 --- a/ext/gmp/tests/033.phpt +++ b/ext/gmp/tests/033.phpt @@ -52,13 +52,13 @@ string(12) "100008388608" string(12) "100000000000" string(12) "100000000008" -Warning: gmp_setbit() expects parameter 1 to be GMP, string given in %s on line %d +Warning: gmp_setbit(): supplied argument is not a valid GMP integer resource in %s on line %d Warning: gmp_setbit() expects at least 2 parameters, 1 given in %s on line %d Warning: gmp_setbit() expects at most 3 parameters, 4 given in %s on line %d -Warning: gmp_setbit() expects parameter 1 to be GMP, string given in %s on line %d +Warning: gmp_setbit() expects parameter 2 to be long, array given in %s on line %d -Warning: gmp_setbit() expects parameter 1 to be GMP, array given in %s on line %d +Warning: gmp_setbit() expects parameter 2 to be long, array given in %s on line %d Done diff --git a/ext/gmp/tests/034.phpt b/ext/gmp/tests/034.phpt index 079d5d669f37..601102990557 100644 --- a/ext/gmp/tests/034.phpt +++ b/ext/gmp/tests/034.phpt @@ -46,7 +46,7 @@ string(7) "1000000" string(7) "1000000" string(30) "238462734628347239571822592658" -Warning: gmp_clrbit() expects parameter 1 to be GMP, array given in %s on line %d +Warning: gmp_clrbit(): supplied argument is not a valid GMP integer resource in %s on line %d Warning: gmp_clrbit() expects exactly 2 parameters, 3 given in %s on line %d diff --git a/ext/gmp/tests/040.phpt b/ext/gmp/tests/040.phpt index 9cc497edc6c1..3af18cce59aa 100644 --- a/ext/gmp/tests/040.phpt +++ b/ext/gmp/tests/040.phpt @@ -18,10 +18,7 @@ var_dump(gmp_strval(gmp_init("993247326237679187178",3))); echo "Done\n"; ?> --EXPECTF-- -object(GMP)#%d (1) { - ["num"]=> - string(8) "98765678" -} +resource(%d) of type (GMP integer) string(8) "98765678" Warning: gmp_init() expects at least 1 parameter, 0 given in %s on line %d diff --git a/ext/gmp/tests/cast.phpt b/ext/gmp/tests/cast.phpt deleted file mode 100644 index eb1832c4dd91..000000000000 --- a/ext/gmp/tests/cast.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GMP casting using casting operators ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -42 -string(2) "42" -int(42) -float(42) - -Catchable fatal error: Object of class GMP could not be converted to boolean in %s on line %d diff --git a/ext/gmp/tests/clone.phpt b/ext/gmp/tests/clone.phpt deleted file mode 100644 index 56b5ca3dfeee..000000000000 --- a/ext/gmp/tests/clone.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Cloning GMP instances ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -object(GMP)#1 (1) { - ["num"]=> - string(1) "2" -} -object(GMP)#2 (1) { - ["num"]=> - string(1) "3" -} diff --git a/ext/gmp/tests/comparison.phpt b/ext/gmp/tests/comparison.phpt deleted file mode 100644 index 1f3a423267ee..000000000000 --- a/ext/gmp/tests/comparison.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Overloaded GMP comparison in sort() etc ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(4) { - [0]=> - int(-3) - [1]=> - object(GMP)#1 (1) { - ["num"]=> - string(1) "0" - } - [2]=> - int(1) - [3]=> - object(GMP)#2 (1) { - ["num"]=> - string(1) "2" - } -} -object(GMP)#3 (1) { - ["num"]=> - string(1) "3" -} -int(4) diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt deleted file mode 100644 index 18e0bb2aa9df..000000000000 --- a/ext/gmp/tests/overloading.phpt +++ /dev/null @@ -1,259 +0,0 @@ ---TEST-- -GMP operator overloading ---SKIPIF-- - ---FILE-- -> 2); -var_dump(-$a >> 2); - -var_dump(~$a); -var_dump(-$a); -var_dump(+$a); - -var_dump($a == $b); -var_dump($a != $b); -var_dump($a < $b); -var_dump($a <= $b); -var_dump($a > $b); -var_dump($a >= $b); - -var_dump($a == $a); -var_dump($a != $a); - -var_dump($a == 42); -var_dump($a != 42); -var_dump($a < 42); -var_dump($a <= 42); -var_dump($a > 42); -var_dump($a >= 42); - -var_dump($a == new stdClass); - -$a += 1; -var_dump($a); -$a -= 1; -var_dump($a); - -var_dump(++$a); -var_dump($a++); -var_dump($a); - -var_dump(--$a); -var_dump($a--); -var_dump($a); - -?> ---EXPECTF-- -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "25" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "25" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "25" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "2" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "2" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "2" -} - -Warning: main(): Zero operand not allowed in %s on line %d -bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(1) "8" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "8" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "8" -} - -Warning: main(): Zero operand not allowed in %s on line %d -bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} -object(GMP)#%d (1) { - ["num"]=> - string(1) "0" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "59" -} -object(GMP)#%d (1) { - ["num"]=> - string(7) "5505024" -} -object(GMP)#%d (1) { - ["num"]=> - string(7) "5505024" -} -object(GMP)#%d (1) { - ["num"]=> - string(7) "5505024" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "10" -} -object(GMP)#%d (1) { - ["num"]=> - string(3) "-11" -} -object(GMP)#%d (1) { - ["num"]=> - string(3) "-43" -} -object(GMP)#%d (1) { - ["num"]=> - string(3) "-42" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "42" -} -bool(false) -bool(true) -bool(false) -bool(false) -bool(true) -bool(true) -bool(true) -bool(false) -bool(true) -bool(false) -bool(false) -bool(true) -bool(false) -bool(true) - -Warning: main(): Unable to convert variable to GMP - wrong type in %s on line %d -bool(false) -object(GMP)#%d (1) { - ["num"]=> - string(2) "43" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "42" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "43" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "43" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "44" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "43" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "43" -} -object(GMP)#%d (1) { - ["num"]=> - string(2) "42" -} - diff --git a/ext/gmp/tests/serialize.phpt b/ext/gmp/tests/serialize.phpt deleted file mode 100644 index 26716b659c36..000000000000 --- a/ext/gmp/tests/serialize.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GMP serialization and unserialization ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -object(GMP)#%d (1) { - ["num"]=> - string(2) "42" -} -string(33) "O:3:"GMP":1:{s:3:"num";s:2:"42";}" -object(GMP)#%d (1) { - ["num"]=> - string(2) "42" -} diff --git a/ext/hash/config.m4 b/ext/hash/config.m4 index 5174db3b71fa..79ac25e19f97 100644 --- a/ext/hash/config.m4 +++ b/ext/hash/config.m4 @@ -2,7 +2,7 @@ dnl $Id$ dnl config.m4 for extension hash PHP_ARG_WITH(mhash, for mhash support, -[ --with-mhash[=DIR] Include mhash support]) +[ --with-mhash[=DIR] Include mhash support]) PHP_ARG_ENABLE(hash, whether to enable hash support, [ --disable-hash Disable hash support], yes) @@ -31,7 +31,7 @@ if test "$PHP_HASH" != "no"; then EXT_HASH_HEADERS="php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \ php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h \ php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h \ - php_hash_fnv.h php_hash_joaat.h" + php_hash_fnv.h php_hash_joaat.h php_hash_types.h" PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, $ext_shared) ifdef([PHP_INSTALL_HEADERS], [ diff --git a/ext/hash/config.w32 b/ext/hash/config.w32 index 8e9d4c3d48c9..abe8675f3063 100644 --- a/ext/hash/config.w32 +++ b/ext/hash/config.w32 @@ -19,6 +19,7 @@ if (PHP_HASH != "no") { PHP_INSTALL_HEADERS("ext/hash/", "php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h " + "php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h " + - "php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h"); + "php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h " + + "php_hash_types.h"); } diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 117221484e36..9492387dbb71 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -597,7 +597,7 @@ PHP_FUNCTION(hash_algos) array_init(return_value); for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos); - (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTENT; + (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) { add_next_index_stringl(return_value, str, str_len-1, 1); } @@ -659,9 +659,6 @@ PHP_FUNCTION(hash_pbkdf2) /* Setup Main Loop to build a long enough result */ if (length == 0) { length = ops->digest_size; - if (!raw_output) { - length = length * 2; - } } digest_length = length; if (!raw_output) { @@ -1042,7 +1039,7 @@ PHP_MINFO_FUNCTION(hash) long type; for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos); - (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTENT; + (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) { s += slprintf(s, e - s, "%s ", str); } diff --git a/ext/hash/package.xml b/ext/hash/package.xml index 25a598a4a152..119cdd673daa 100644 --- a/ext/hash/package.xml +++ b/ext/hash/package.xml @@ -42,6 +42,7 @@ Supported Algorithms: + diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index 3f5e7ced3a19..4bfddbacd9c4 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -22,6 +22,7 @@ #define PHP_HASH_H #include "php.h" +#include "php_hash_types.h" #define PHP_HASH_EXTNAME "hash" #define PHP_HASH_EXTVER "1.0" @@ -29,12 +30,6 @@ #define PHP_HASH_HMAC 0x0001 -#define L64 INT64_C -#define php_hash_int32 int32_t -#define php_hash_uint32 uint32_t -#define php_hash_int64 int64_t -#define php_hash_uint64 uint64_t - typedef void (*php_hash_init_func_t)(void *context); typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count); typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context); diff --git a/ext/hash/php_hash_types.h b/ext/hash/php_hash_types.h new file mode 100644 index 000000000000..8793da55d672 --- /dev/null +++ b/ext/hash/php_hash_types.h @@ -0,0 +1,71 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2013 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michael Wallner | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef PHP_HASH_TYPES_H +#define PHP_HASH_TYPES_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#ifndef PHP_WIN32 +#include "php_config.h" +#endif +#endif + +#ifndef PHP_WIN32 +#if SIZEOF_LONG == 8 +#define L64(x) x +typedef unsigned long php_hash_uint64; +#if SIZEOF_INT == 4 +typedef unsigned int php_hash_uint32; +#elif SIZEOF_SHORT == 4 +typedef unsigned short php_hash_uint32; +#else +#error "Need a 32bit integer type" +#endif +#elif SIZEOF_LONG_LONG == 8 +#define L64(x) x##LL +typedef unsigned long long php_hash_uint64; +#if SIZEOF_INT == 4 +typedef unsigned int php_hash_uint32; +#elif SIZEOF_LONG == 4 +typedef unsigned long php_hash_uint32; +#else +#error "Need a 32bit integer type" +#endif +#else +#error "Need a 64bit integer type" +#endif +#else +#define L64(x) x##i64 +typedef unsigned __int64 php_hash_uint64; +typedef unsigned __int32 php_hash_uint32; +#endif + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: sw=4 ts=4 fdm=marker + * vim<600: sw=4 ts=4 + */ diff --git a/ext/hash/tests/bug64745.phpt b/ext/hash/tests/bug64745.phpt deleted file mode 100644 index 427f89b72875..000000000000 --- a/ext/hash/tests/bug64745.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #64745 hash_pbkdf2() truncates data when using default length and hex output ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6" -string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6" - diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index 96c41e643219..e1380301c28e 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -23,8 +23,8 @@ file_put_contents( $filename, 'The quick brown fox jumped over the lazy dog.' ); echo "\n-- Testing hash_file() function with an unknown algorithm --\n"; var_dump( hash_file( 'foobar', $filename ) ); -echo "\n-- Testing hash_file() function with a non-existent file --\n"; -var_dump( hash_file( 'md5', 'nonexistent.txt' ) ); +echo "\n-- Testing hash_file() function with a non-existant file --\n"; +var_dump( hash_file( 'md5', 'nonexistant.txt' ) ); echo "\n-- Testing hash_file() function with less than expected no. of arguments --\n"; var_dump( hash_file( 'md5' ) ); @@ -50,7 +50,7 @@ unlink( $filename ); Warning: hash_file(): Unknown hashing algorithm: %s in %s on line %d bool(false) --- Testing hash_file() function with a non-existent file -- +-- Testing hash_file() function with a non-existant file -- Warning: hash_file(%s): failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/hash/tests/mhash_002.phpt b/ext/hash/tests/mhash_002.phpt index 45cf09fb7718..7bcafd389665 100644 --- a/ext/hash/tests/mhash_002.phpt +++ b/ext/hash/tests/mhash_002.phpt @@ -24,7 +24,7 @@ $supported_hash_al = array( "CRC32" => 4, "CRC32B" => 4, "ADLER32" => 4, -"NA_XYZ" => 0 /* verify that the algorithm works */ +"NA_XYZ" => 0 /* verify that the algorythm works */ ); $hc = mhash_count() + 1; diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index 10d21ccc6de6..d673b0adba45 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(iconv, for iconv support, -[ --without-iconv[=DIR] Exclude iconv support], yes) +[ --without-iconv[=DIR] Exclude iconv support], yes) if test "$PHP_ICONV" != "no"; then diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index d7deae102662..3ad7c107ddac 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -95,7 +95,7 @@ AC_DEFUN([PHP_IMAP_SSL_CHK], [ PHP_ARG_WITH(imap,for IMAP support, -[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix]) +[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix]) PHP_ARG_WITH(kerberos,for IMAP Kerberos support, [ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install prefix], no, no) @@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) fi - if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then + if test -r "$IMAP_DIR/c-client/c-client.a"; then ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 - elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then + elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 fi diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index d697fa79116b..b154cb86b04b 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1270,6 +1270,7 @@ PHP_FUNCTION(imap_reopen) int mailbox_len; long options = 0, retries = 0; pils *imap_le_struct; + MAILSTREAM *imap_stream; long flags=NIL; long cl_flags=NIL; @@ -1297,12 +1298,12 @@ PHP_FUNCTION(imap_reopen) RETURN_FALSE; } - imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags); - if (imap_le_struct->imap_stream == NIL) { - zend_list_delete(Z_RESVAL_P(streamind)); + imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags); + if (imap_stream == NIL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream"); RETURN_FALSE; } + imap_le_struct->imap_stream = imap_stream; RETURN_TRUE; } /* }}} */ diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index b33a10e5e85f..ed36239572fd 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -61,7 +61,7 @@ function displayOverviewFields($resp, $fields=null) { * @param string mailbox_suffix Suffix used to uniquely identify mailboxes * @param int message_count number of test msgs to be written to new mailbox * - * @return IMAP stream to new mailbox on success; FALSE on failure + * @return IMAP stream to new mailbox on sucesss; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ global $server, $default_mailbox, $username, $password; diff --git a/ext/interbase/config.m4 b/ext/interbase/config.m4 index dfd850b00ad8..603145ad6c30 100644 --- a/ext/interbase/config.m4 +++ b/ext/interbase/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(interbase,for InterBase support, -[ --with-interbase[=DIR] Include InterBase support. DIR is the InterBase base +[ --with-interbase[=DIR] Include InterBase support. DIR is the InterBase base install directory [/usr/interbase]]) if test "$PHP_INTERBASE" != "no"; then diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index c5167c132e46..5b16ac291767 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -18,7 +18,7 @@ InterBase: transactions /* Difference between default and other transactions: -default committed when you call ibase_close(). +default commited when you call ibase_close(). Other transaction doing rollback. If you not open default transaction with @@ -158,7 +158,7 @@ three transaction on default link ibase_free_result($res); - /* tr_4 IBASE_COMMITTED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */ + /* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */ $res = ibase_query($tr_4, "select * from test5"); echo "three rows in fourth transaction with deadlock\n"; diff --git a/ext/intl/ERROR.CONVENTIONS b/ext/intl/ERROR.CONVENTIONS index 41cd14ec0601..6f9079c56d04 100644 --- a/ext/intl/ERROR.CONVENTIONS +++ b/ext/intl/ERROR.CONVENTIONS @@ -18,7 +18,7 @@ message set by the PHP wrapping code, not by ICU. The message should include the name of the function that failed in order to make debugging easier (though if you activate warnings with intl.error_level or exceptions with intl.use_exceptions you get more fine-grained information about where the -error occurred). +error ocurred). The internal PHP code can set the global last error with: void intl_error_set_code(intl_error* err, UErrorCode err_code TSRMLS_DC); diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 7ca7e94c95f7..7bf271a344f3 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -245,32 +245,32 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_void, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_locale, 0, 0, 0) - ZEND_ARG_INFO(0, locale) + ZEND_ARG_INFO(0, "locale") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_setText, 0, 0, 1) - ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, "text") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_next, 0, 0, 0) - ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, "offset") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_offset, 0, 0, 1) - ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, "offset") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_get_locale, 0, 0, 1) - ZEND_ARG_INFO(0, locale_type) + ZEND_ARG_INFO(0, "locale_type") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_getPartsIterator, 0, 0, 0) - ZEND_ARG_INFO(0, key_type) + ZEND_ARG_INFO(0, "key_type") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(ainfo_rbbi___construct, 0, 0, 1) - ZEND_ARG_INFO(0, rules) - ZEND_ARG_INFO(0, areCompiled) + ZEND_ARG_INFO(0, "rules") + ZEND_ARG_INFO(0, "areCompiled") ZEND_END_ARG_INFO() /* }}} */ diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h index a955f3a8e7f2..71620724147e 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.h +++ b/ext/intl/breakiterator/breakiterator_iterators.h @@ -39,4 +39,4 @@ U_CFUNC zend_object_iterator *_breakiterator_get_iterator( zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D); -#endif +#endif \ No newline at end of file diff --git a/ext/intl/breakiterator/breakiterator_methods.h b/ext/intl/breakiterator/breakiterator_methods.h index bc9ce801051c..a479ac92e854 100644 --- a/ext/intl/breakiterator/breakiterator_methods.h +++ b/ext/intl/breakiterator/breakiterator_methods.h @@ -61,4 +61,4 @@ PHP_FUNCTION(breakiter_get_error_code); PHP_FUNCTION(breakiter_get_error_message); -#endif +#endif \ No newline at end of file diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h index 933347b859b4..988b91c2009c 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.h +++ b/ext/intl/breakiterator/codepointiterator_internal.h @@ -95,4 +95,4 @@ namespace PHP { }; } -#endif +#endif \ No newline at end of file diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index a833cf185359..ae7e526eadac 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -41,4 +41,4 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point) BREAKITER_METHOD_FETCH_OBJECT; RETURN_LONG(fetch_cpbi(bio)->getLastCodePoint()); -} +} \ No newline at end of file diff --git a/ext/intl/breakiterator/codepointiterator_methods.h b/ext/intl/breakiterator/codepointiterator_methods.h index ad3b710fc847..d34e5b61e221 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.h +++ b/ext/intl/breakiterator/codepointiterator_methods.h @@ -21,4 +21,4 @@ PHP_FUNCTION(cpbi_get_last_code_point); -#endif +#endif \ No newline at end of file diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h index 861ca4253fda..edea4ea2a697 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.h +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.h @@ -29,4 +29,4 @@ PHP_FUNCTION(rbbi_get_rule_status_vec); PHP_FUNCTION(rbbi_get_binary_rules); -#endif +#endif \ No newline at end of file diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index e13425097d95..beb65f718f43 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -361,10 +361,6 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_setLenient, 0, 0, 1) ZEND_ARG_INFO(0, isLenient) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_set_minimal_days_in_first_week, 0, 0, 1) - ZEND_ARG_INFO(0, numberOfDays) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_from_date_time, 0, 0, 1) ZEND_ARG_INFO(0, dateTime) ZEND_END_ARG_INFO() @@ -437,7 +433,6 @@ static const zend_function_entry Calendar_class_functions[] = { #endif PHP_ME_MAPPING(setFirstDayOfWeek, intlcal_set_first_day_of_week, ainfo_cal_dow, ZEND_ACC_PUBLIC) PHP_ME_MAPPING(setLenient, intlcal_set_lenient, ainfo_cal_setLenient, ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(setMinimalDaysInFirstWeek,intlcal_set_minimal_days_in_first_week,ainfo_cal_set_minimal_days_in_first_week,ZEND_ACC_PUBLIC) PHP_ME_MAPPING(equals, intlcal_equals, ainfo_cal_other_cal, ZEND_ACC_PUBLIC) #if U_ICU_VERSION_MAJOR_NUM >= 49 PHP_ME_MAPPING(getRepeatedWallTimeOption,intlcal_get_repeated_wall_time_option,ainfo_cal_void, ZEND_ACC_PUBLIC) @@ -528,7 +523,7 @@ void calendar_register_IntlCalendar_class(TSRMLS_D) CALENDAR_DECL_LONG_CONST("FIELD_JULIAN_DAY", UCAL_JULIAN_DAY); CALENDAR_DECL_LONG_CONST("FIELD_MILLISECONDS_IN_DAY", UCAL_MILLISECONDS_IN_DAY); CALENDAR_DECL_LONG_CONST("FIELD_IS_LEAP_MONTH", UCAL_IS_LEAP_MONTH); - CALENDAR_DECL_LONG_CONST("FIELD_FIELD_COUNT", UCAL_FIELD_COUNT); + CALENDAR_DECL_LONG_CONST("FIELD_FIELD_COUNT ", UCAL_FIELD_COUNT); CALENDAR_DECL_LONG_CONST("FIELD_DAY_OF_MONTH", UCAL_DAY_OF_MONTH); CALENDAR_DECL_LONG_CONST("DOW_SUNDAY", UCAL_SUNDAY); diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index ae7d0093f784..2d33bd1952f2 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -184,6 +184,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale) U_CFUNC PHP_FUNCTION(intlcal_get_now) { + UErrorCode status = U_ZERO_ERROR; intl_error_reset(NULL TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { @@ -996,32 +997,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient) RETURN_TRUE; } -U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week) -{ - long num_days; - CALENDAR_METHOD_INIT_VARS; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), - "Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC); - RETURN_FALSE; - } - - if (num_days < 1 || num_days > 7) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_minimal_days_in_first_week: invalid number of days; " - "must be between 1 and 7", 0 TSRMLS_CC); - RETURN_FALSE; - } - - CALENDAR_METHOD_FETCH_OBJECT; - - co->ucal->setMinimalDaysInFirstWeek((uint8_t)num_days); - - RETURN_TRUE; -} - U_CFUNC PHP_FUNCTION(intlcal_equals) { zval *other_object; diff --git a/ext/intl/calendar/calendar_methods.h b/ext/intl/calendar/calendar_methods.h index dfd0bbeeaf67..2be13e492022 100644 --- a/ext/intl/calendar/calendar_methods.h +++ b/ext/intl/calendar/calendar_methods.h @@ -91,8 +91,6 @@ PHP_FUNCTION(intlcal_set_first_day_of_week); PHP_FUNCTION(intlcal_set_lenient); -PHP_FUNCTION(intlcal_set_minimal_days_in_first_week); - PHP_FUNCTION(intlcal_equals); PHP_FUNCTION(intlcal_get_repeated_wall_time_option); diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index 08b894964c99..3c05253de1e1 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -38,6 +38,7 @@ static inline GregorianCalendar *fetch_greg(Calendar_object *co) { static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) { + zval *object = getThis(); zval **tz_object = NULL; zval **args_a[6] = {0}, ***args = &args_a[0]; @@ -83,7 +84,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS) } // instantion of ICU object - GregorianCalendar *gcal = NULL; + GregorianCalendar *gcal; if (variant <= 2) { // From timezone and locale (0 to 2 arguments) diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 2a3ac10fbf00..e989d4c65a2d 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -139,7 +139,7 @@ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* stat zend_hash_internal_pointer_reset( hash ); while( ( hashKeyType = zend_hash_get_current_key( hash, &hashKey, &hashIndex, 0 ) ) - != HASH_KEY_NON_EXISTENT ) + != HASH_KEY_NON_EXISTANT ) { /* Convert current hash item from UTF-8 to UTF-16LE. */ collator_convert_hash_item_from_utf8_to_utf16( @@ -164,7 +164,7 @@ void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* stat zend_hash_internal_pointer_reset( hash ); while( ( hashKeyType = zend_hash_get_current_key( hash, &hashKey, &hashIndex, 0 ) ) - != HASH_KEY_NON_EXISTENT ) + != HASH_KEY_NON_EXISTANT ) { /* Convert current hash item from UTF-16LE to UTF-8. */ collator_convert_hash_item_from_utf16_to_utf8( diff --git a/ext/intl/doc/Tutorial.txt b/ext/intl/doc/Tutorial.txt index 3bb31b00ec7d..4a66dc18440a 100644 --- a/ext/intl/doc/Tutorial.txt +++ b/ext/intl/doc/Tutorial.txt @@ -7,7 +7,7 @@ Examle of locales format: 'en_US', 'ru_UA', 'ua_UA' (see http://demo.icu-project 2. Collator::getDisplayName( $obj_locale, $disp_locale ). -Get name of the object for the desired Locale, in the desired language. Both arguments +Get name of the object for the desired Locale, in the desired langauge. Both arguments must be from getAvailableLocales method. @param string $obj_locale Locale to get display name for. diff --git a/ext/intl/doc/grapheme_api.php b/ext/intl/doc/grapheme_api.php index e22d165cbbcd..465453fd324c 100644 --- a/ext/intl/doc/grapheme_api.php +++ b/ext/intl/doc/grapheme_api.php @@ -98,7 +98,7 @@ function grapheme_substr($string, $start, $length = -1) {} * @param string $haystack The input string. * @param string $needle The string to look for. * @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the - haystack before the first occurrence of the needle. + haystack before the first occurence of the needle. * @return string Returns the portion of string, or FALSE if needle is not found. */ function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {} @@ -109,7 +109,7 @@ function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {} * @param string $haystack The input string. * @param string $needle The string to look for. * @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the - haystack before the first occurrence of the needle. + haystack before the first occurence of the needle. * @return string Returns the portion of string, or FALSE if needle is not found. */ function grapheme_stristr($haystack, $needle, $before_needle = FALSE) {} diff --git a/ext/intl/doc/msgfmt_api.php b/ext/intl/doc/msgfmt_api.php index 3df6f0de1144..e4d047b9790f 100644 --- a/ext/intl/doc/msgfmt_api.php +++ b/ext/intl/doc/msgfmt_api.php @@ -31,7 +31,7 @@ public static function create($locale, $pattern) {} /** * Format the message * @param array $args arguments to insert into the pattern string - * @return string the formatted string, or false if an error occurred + * @return string the formatted string, or false if an error ocurred */ public function format($args) {} @@ -124,7 +124,7 @@ function msgfmt_create($locale, $pattern) {} * Format the message * @param MessageFormatter $fmt The message formatter * @param array $args arguments to insert into the pattern string - * @return string the formatted string, or false if an error occurred + * @return string the formatted string, or false if an error ocurred */ function msgfmt_format($fmt, $args) {} diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 8a094e015e43..475bbe418479 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -113,7 +113,7 @@ PHP_FUNCTION(grapheme_strpos) unsigned char *found; long loffset = 0; int32_t offset = 0; - int ret_pos; + int ret_pos, uchar_pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { @@ -160,10 +160,10 @@ PHP_FUNCTION(grapheme_strpos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 0 /* fIgnoreCase */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_LONG(ret_pos + offset); } else { RETURN_FALSE; } @@ -180,7 +180,7 @@ PHP_FUNCTION(grapheme_stripos) unsigned char *found; long loffset = 0; int32_t offset = 0; - int ret_pos; + int ret_pos, uchar_pos; int is_ascii; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) { @@ -235,10 +235,10 @@ PHP_FUNCTION(grapheme_stripos) } /* do utf16 part of the strpos */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 1 /* fIgnoreCase */ TSRMLS_CC ); if ( ret_pos >= 0 ) { - RETURN_LONG(ret_pos); + RETURN_LONG(ret_pos + offset); } else { RETURN_FALSE; } @@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC); + ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 0 /* f_ignore_case */ TSRMLS_CC); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos) /* else we need to continue via utf16 */ } - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC); + ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 1 /* f_ignore_case */ TSRMLS_CC); if ( ret_pos >= 0 ) { RETURN_LONG(ret_pos); @@ -434,7 +434,6 @@ PHP_FUNCTION(grapheme_substr) grapheme_substr_ascii((char *)str, str_len, start, length, ZEND_NUM_ARGS(), (char **) &sub_str, &sub_str_len); if ( NULL == sub_str ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 TSRMLS_CC ); RETURN_FALSE; } @@ -531,15 +530,6 @@ PHP_FUNCTION(grapheme_substr) RETURN_STRINGL(((char *)sub_str), sub_str_len, 0); } - if(length == 0) { - /* empty length - we've validated start, we can return "" now */ - if (ustr) { - efree(ustr); - } - ubrk_close(bi); - RETURN_EMPTY_STRING(); - } - /* find the end point of the string to return */ if ( length < 0 ) { @@ -564,31 +554,25 @@ PHP_FUNCTION(grapheme_substr) length += iter_val; } - ubrk_close(bi); - if ( UBRK_DONE == sub_str_end_pos) { if(length < 0) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC ); efree(ustr); + ubrk_close(bi); RETURN_FALSE; } else { sub_str_end_pos = ustr_len; } } - - if(sub_str_start_pos > sub_str_end_pos) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 TSRMLS_CC ); - - efree(ustr); - RETURN_FALSE; - } sub_str = NULL; status = U_ZERO_ERROR; intl_convert_utf16_to_utf8((char **)&sub_str, &sub_str_len, ustr + sub_str_start_pos, ( sub_str_end_pos - sub_str_start_pos ), &status); efree( ustr ); + ubrk_close( bi ); if ( U_FAILURE( status ) ) { /* Set global error code. */ @@ -659,7 +643,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas } /* need to work in utf16 */ - ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC ); + ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case TSRMLS_CC ); if ( ret_pos < 0 ) { RETURN_FALSE; diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index c752b02372e2..92008554d47b 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "ext/standard/php_string.h" @@ -48,8 +47,49 @@ grapheme_close_global_iterator( TSRMLS_D ) } /* }}} */ +/* {{{ grapheme_intl_case_fold: convert string to lowercase */ +void +grapheme_intl_case_fold(UChar** ptr_to_free, UChar **str, int32_t *str_len, UErrorCode *pstatus ) +{ + UChar *dest; + int32_t dest_len, size_required; + + /* allocate a destination string that is a bit larger than the src, hoping that is enough */ + dest_len = (*str_len) + ( *str_len / 10 ); + dest = (UChar*) eumalloc(dest_len); + + *pstatus = U_ZERO_ERROR; + size_required = u_strFoldCase(dest, dest_len, *str, *str_len, U_FOLD_CASE_DEFAULT, pstatus); + + dest_len = size_required; + + if ( U_BUFFER_OVERFLOW_ERROR == *pstatus ) { + + dest = (UChar*) eurealloc(dest, dest_len); + + *pstatus = U_ZERO_ERROR; + size_required = u_strFoldCase(dest, dest_len, *str, *str_len, U_FOLD_CASE_DEFAULT, pstatus); + } + + if ( U_FAILURE(*pstatus) ) { + return; + } + + if ( NULL != ptr_to_free) { + efree(*ptr_to_free); + *ptr_to_free = dest; + } + + *str = dest; + *str_len = dest_len; + + return; +} +/* }}} */ + /* {{{ grapheme_substr_ascii f='from' - starting point, l='length' */ -void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char **sub_str, int *sub_str_len) +void +grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char **sub_str, int *sub_str_len) { *sub_str = NULL; @@ -107,101 +147,225 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char } /* }}} */ -#define STRPOS_CHECK_STATUS(status, error) \ - if ( U_FAILURE( (status) ) ) { \ - intl_error_set_code( NULL, (status) TSRMLS_CC ); \ - intl_error_set_custom_msg( NULL, (error), 0 TSRMLS_CC ); \ - if (uhaystack) { \ - efree( uhaystack ); \ - } \ - if (uneedle) { \ - efree( uneedle ); \ - } \ - if(bi) { \ - ubrk_close (bi); \ - } \ - if(src) { \ - usearch_close(src); \ - } \ - return -1; \ +/* {{{ grapheme_strrpos_utf16 - strrpos using utf16 */ +int +grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC) +{ + UChar *uhaystack, *puhaystack, *uhaystack_end, *uneedle; + int32_t uhaystack_len, uneedle_len; + UErrorCode status; + unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; + UBreakIterator* bi = NULL; + int ret_pos, pos; + + /* convert the strings to UTF-16. */ + uhaystack = NULL; + uhaystack_len = 0; + status = U_ZERO_ERROR; + intl_convert_utf8_to_utf16(&uhaystack, &uhaystack_len, (char *) haystack, haystack_len, &status ); + + if ( U_FAILURE( status ) ) { + /* Set global error code. */ + intl_error_set_code( NULL, status TSRMLS_CC ); + + /* Set error messages. */ + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); + } + return -1; + } + + if ( f_ignore_case ) { + grapheme_intl_case_fold(&uhaystack, &uhaystack, &uhaystack_len, &status ); + } + + /* get a pointer to the haystack taking into account the offset */ + bi = NULL; + status = U_ZERO_ERROR; + bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); + + puhaystack = grapheme_get_haystack_offset(bi, uhaystack, uhaystack_len, offset); + + if ( NULL == puhaystack ) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); + } + ubrk_close (bi); + return -1; + } + + uneedle = NULL; + uneedle_len = 0; + status = U_ZERO_ERROR; + intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); + + if ( U_FAILURE( status ) ) { + /* Set global error code. */ + intl_error_set_code( NULL, status TSRMLS_CC ); + + /* Set error messages. */ + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); + } + if (uneedle) { + efree( uneedle ); + } + ubrk_close (bi); + return -1; + } + + if ( f_ignore_case ) { + grapheme_intl_case_fold(&uneedle, &uneedle, &uneedle_len, &status ); + } + + ret_pos = -1; /* -1 represents 'not found' */ + + /* back up until there's needle_len characters to compare */ + + uhaystack_end = uhaystack + uhaystack_len; + pos = ubrk_last(bi); + puhaystack = uhaystack + pos; + + while ( uhaystack_end - puhaystack < uneedle_len ) { + + pos = ubrk_previous(bi); + + if ( UBRK_DONE == pos ) { + break; + } + + puhaystack = uhaystack + pos; + } + + /* is there enough haystack left to hold the needle? */ + if ( ( uhaystack_end - puhaystack ) < uneedle_len ) { + /* not enough, not found */ + goto exit; + } + + while ( UBRK_DONE != pos ) { + + if (!u_memcmp(uneedle, puhaystack, uneedle_len)) { /* needle_len - 1 in zend memnstr? */ + + /* does the grapheme in the haystack end at the same place as the last grapheme in the needle? */ + + if ( ubrk_isBoundary(bi, pos + uneedle_len) ) { + + /* found it, get grapheme count offset */ + ret_pos = grapheme_count_graphemes(bi, uhaystack, pos); + break; + } + + /* set position back */ + ubrk_isBoundary(bi, pos); + } + + pos = ubrk_previous(bi); + puhaystack = uhaystack + pos; + } + +exit: + if (uhaystack) { + efree( uhaystack ); + } + if (uneedle) { + efree( uneedle ); } + ubrk_close (bi); + + return ret_pos; +} +/* }}} */ /* {{{ grapheme_strpos_utf16 - strrpos using utf16*/ -int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC) +int +grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case TSRMLS_DC) { - UChar *uhaystack = NULL, *uneedle = NULL; - int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0; + UChar *uhaystack, *puhaystack, *uneedle; + int32_t uhaystack_len, uneedle_len; + int ret_pos; unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE]; - UBreakIterator* bi = NULL; + UBreakIterator* bi; UErrorCode status; - UStringSearch* src = NULL; - UCollator *coll; - if(puchar_pos) { - *puchar_pos = -1; - } + *puchar_pos = -1; + /* convert the strings to UTF-16. */ + uhaystack = NULL; + uhaystack_len = 0; status = U_ZERO_ERROR; intl_convert_utf8_to_utf16(&uhaystack, &uhaystack_len, (char *) haystack, haystack_len, &status ); - STRPOS_CHECK_STATUS(status, "Error converting input string to UTF-16"); - status = U_ZERO_ERROR; - intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); - STRPOS_CHECK_STATUS(status, "Error converting input string to UTF-16"); + if ( U_FAILURE( status ) ) { + /* Set global error code. */ + intl_error_set_code( NULL, status TSRMLS_CC ); + + /* Set error messages. */ + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); + } + return -1; + } /* get a pointer to the haystack taking into account the offset */ + bi = NULL; status = U_ZERO_ERROR; bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC ); - STRPOS_CHECK_STATUS(status, "Failed to get iterator"); - status = U_ZERO_ERROR; - ubrk_setText(bi, uhaystack, uhaystack_len, &status); - STRPOS_CHECK_STATUS(status, "Failed to set up iterator"); - - status = U_ZERO_ERROR; - src = usearch_open(uneedle, uneedle_len, uhaystack, uhaystack_len, "", bi, &status); - STRPOS_CHECK_STATUS(status, "Error creating search object"); + + puhaystack = grapheme_get_haystack_offset(bi, uhaystack, uhaystack_len, offset); + uhaystack_len = (uhaystack_len - ( puhaystack - uhaystack)); - if(f_ignore_case) { - coll = usearch_getCollator(src); - status = U_ZERO_ERROR; - ucol_setAttribute(coll, UCOL_STRENGTH, UCOL_SECONDARY, &status); - STRPOS_CHECK_STATUS(status, "Error setting collation strength"); - usearch_reset(src); + if ( NULL == puhaystack ) { + + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); + } + ubrk_close (bi); + + return -1; } - if(offset != 0) { - offset_pos = grapheme_get_haystack_offset(bi, offset); - if(offset_pos == -1) { - status = U_ILLEGAL_ARGUMENT_ERROR; - STRPOS_CHECK_STATUS(status, "Invalid search offset"); - } - status = U_ZERO_ERROR; - usearch_setOffset(src, offset_pos, &status); - STRPOS_CHECK_STATUS(status, "Invalid search offset"); + if ( f_ignore_case ) { + grapheme_intl_case_fold(&uhaystack, &puhaystack, &uhaystack_len, &status ); } + uneedle = NULL; + uneedle_len = 0; + status = U_ZERO_ERROR; + intl_convert_utf8_to_utf16(&uneedle, &uneedle_len, (char *) needle, needle_len, &status ); + + if ( U_FAILURE( status ) ) { + /* Set global error code. */ + intl_error_set_code( NULL, status TSRMLS_CC ); - if(last) { - char_pos = usearch_last(src, &status); - if(char_pos < offset_pos) { - /* last one is beyound our start offset */ - char_pos = USEARCH_DONE; + /* Set error messages. */ + intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC ); + if (uhaystack) { + efree( uhaystack ); } - } else { - char_pos = usearch_next(src, &status); - } - STRPOS_CHECK_STATUS(status, "Error looking up string"); - if(char_pos != USEARCH_DONE && ubrk_isBoundary(bi, char_pos)) { - ret_pos = grapheme_count_graphemes(bi, uhaystack,char_pos); - if(puchar_pos) { - *puchar_pos = char_pos; + if (uneedle) { + efree( uneedle ); } - } else { - ret_pos = -1; + ubrk_close (bi); + + return -1; + } + + if ( f_ignore_case ) { + grapheme_intl_case_fold(&uneedle, &uneedle, &uneedle_len, &status ); } + ret_pos = grapheme_memnstr_grapheme(bi, puhaystack, uneedle, uneedle_len, puhaystack + uhaystack_len ); + + *puchar_pos = ubrk_current(bi); + if (uhaystack) { efree( uhaystack ); } @@ -209,7 +373,6 @@ int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigne efree( uneedle ); } ubrk_close (bi); - usearch_close (src); return ret_pos; } @@ -269,7 +432,8 @@ int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_a /* }}} */ /* {{{ grapheme_count_graphemes */ -int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) +int32_t +grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len) { int ret_len = 0; int pos = 0; @@ -291,16 +455,85 @@ int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t stri } /* }}} */ +/* {{{ grapheme_memnstr_grapheme: find needle in haystack using grapheme boundaries */ +int32_t +grapheme_memnstr_grapheme(UBreakIterator *bi, UChar *haystack, UChar *needle, int32_t needle_len, UChar *end) +{ + UChar *p = haystack; + UChar ne = needle[needle_len-1]; + UErrorCode status; + int32_t grapheme_offset; + + end -= needle_len; + + while (p <= end) { + + if ((p = u_memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { + + if (!u_memcmp(needle, p, needle_len - 1)) { /* needle_len - 1 works because if needle_len is 1, we've already tested the char */ + + /* does the grapheme end here? */ + + status = U_ZERO_ERROR; + ubrk_setText (bi, haystack, (end - haystack) + needle_len, &status); + + if ( ubrk_isBoundary (bi, (p - haystack) + needle_len) ) { + + /* found it, get grapheme count offset */ + grapheme_offset = grapheme_count_graphemes(bi, haystack, (p - haystack)); + + return grapheme_offset; + } + } + } + + if (p == NULL) { + return -1; + } + + p++; + } + + return -1; +} + +/* }}} */ + +/* {{{ grapheme_memrstr_grapheme: reverse find needle in haystack using grapheme boundaries */ +inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n) +{ + register unsigned char *e; + + if (n <= 0) { + return NULL; + } + + for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) { + if (*e == (unsigned char)c) { + return (void *)e; + } + } + + return NULL; +} +/* }}} */ /* {{{ grapheme_get_haystack_offset - bump the haystack pointer based on the grapheme count offset */ -int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) +UChar * +grapheme_get_haystack_offset(UBreakIterator* bi, UChar *uhaystack, int32_t uhaystack_len, int32_t offset) { + UErrorCode status; int32_t pos; int32_t (*iter_op)(UBreakIterator* bi); int iter_incr; + if ( NULL != bi ) { + status = U_ZERO_ERROR; + ubrk_setText (bi, uhaystack, uhaystack_len, &status); + } + if ( 0 == offset ) { - return 0; + return uhaystack; } if ( offset < 0 ) { @@ -325,10 +558,10 @@ int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset) } if ( offset != 0 ) { - return -1; + return NULL; } - return pos; + return uhaystack + pos; } /* }}} */ @@ -374,7 +607,8 @@ grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned c /* }}} */ /* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */ -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ) +UBreakIterator* +grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ) { int32_t buffer_size; diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 14f3f22c456b..c91aeaff7dd1 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -23,25 +23,35 @@ /* get_break_interator: get a break iterator from the global structure */ UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); -void grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len); +void +grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len); -int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC); +int +grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC); -int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last TSRMLS_DC); +int +grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case TSRMLS_DC); int grapheme_ascii_check(const unsigned char *day, int32_t len); int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC ); -int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); +int32_t +grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); + +int32_t +grapheme_memnstr_grapheme(UBreakIterator *bi, UChar *haystack, UChar *needle, int32_t needle_len, UChar *end); inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n); -int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); +UChar * +grapheme_get_haystack_offset(UBreakIterator* bi, UChar *uhaystack, int32_t uhaystack_len, int32_t offset); -int32_t grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset); +int32_t +grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset); -UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); +UBreakIterator* +grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ #define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (long) max_len : offset >= (long) max_len) ) diff --git a/ext/intl/intl_cppshims.h b/ext/intl/intl_cppshims.h index e58ec3bd45b7..2fb70edfd0e2 100644 --- a/ext/intl/intl_cppshims.h +++ b/ext/intl/intl_cppshims.h @@ -31,4 +31,4 @@ #define _MSC_STDINT_H_ 1 #endif -#endif +#endif \ No newline at end of file diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c4456d54f3c8..9ee1cdcfb0d1 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -487,7 +487,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, } case Formattable::kLong: { - int32_t tInt32 = 0; + int32_t tInt32; retry_klong: if (Z_TYPE_PP(elem) == IS_DOUBLE) { if (Z_DVAL_PP(elem) > (double)INT32_MAX || @@ -517,7 +517,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, } case Formattable::kInt64: { - int64_t tInt64 = 0; + int64_t tInt64; retry_kint64: if (Z_TYPE_PP(elem) == IS_DOUBLE) { if (Z_DVAL_PP(elem) > (double)U_INT64_MAX || diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 65e53c8b5e82..a2c4d77651d4 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -590,11 +590,6 @@ ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_set_lenient, 0, 0, 2 ) ZEND_ARG_INFO( 0, isLenient ) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_set_minimal_days_in_first_week, 0, 0, 2 ) - ZEND_ARG_OBJ_INFO( 0, calendar, IntlCalendar, 0 ) - ZEND_ARG_INFO( 0, numberOfDays ) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_from_date_time, 0, 0, 1) ZEND_ARG_INFO(0, dateTime) ZEND_END_ARG_INFO() @@ -833,7 +828,6 @@ zend_function_entry intl_functions[] = { #endif PHP_FE( intlcal_set_first_day_of_week, ainfo_cal_dow ) PHP_FE( intlcal_set_lenient, ainfo_cal_set_lenient ) - PHP_FE( intlcal_set_minimal_days_in_first_week, ainfo_cal_set_minimal_days_in_first_week ) PHP_FE( intlcal_equals, ainfo_cal_other_cal ) PHP_FE( intlcal_from_date_time, ainfo_cal_from_date_time ) PHP_FE( intlcal_to_date_time, ainfo_cal_only_cal ) diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c index f5475faf1c5a..6d39dfb7e082 100644 --- a/ext/intl/resourcebundle/resourcebundle.c +++ b/ext/intl/resourcebundle/resourcebundle.c @@ -41,7 +41,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so case URES_STRING: ufield = ures_getString( source->child, &ilen, &INTL_DATA_ERROR_CODE(source) ); INTL_METHOD_CHECK_STATUS(source, "Failed to retrieve string value"); - INTL_METHOD_RETVAL_UTF8(source, (UChar *)ufield, ilen, 0); + INTL_METHOD_RETVAL_UTF8(source, ufield, ilen, 0); break; case URES_BINARY: diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index dc1212431a9a..db46bf5b16c8 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -161,8 +161,9 @@ PHP_FUNCTION( resourcebundle_create ) /* {{{ resourcebundle_array_fetch */ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC) { - int32_t meindex = 0; - char * mekey = NULL; + int32_t meindex; + char * mekey; + long mekeylen; zend_bool is_numeric = 0; char *pbuf; ResourceBundle_object *rb; @@ -176,6 +177,7 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_ rb->child = ures_getByIndex( rb->me, meindex, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else if(Z_TYPE_P(offset) == IS_STRING) { mekey = Z_STRVAL_P(offset); + mekeylen = Z_STRLEN_P(offset); rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) ); } else { intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR, diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt index b2120977f372..b8f48b371eb3 100644 --- a/ext/intl/tests/badargs.phpt +++ b/ext/intl/tests/badargs.phpt @@ -1,5 +1,5 @@ --TEST-- -Check that bad arguments return the same +Check that bad argumens return the same --SKIPIF-- --FILE-- diff --git a/ext/intl/tests/bug61860.phpt b/ext/intl/tests/bug61860.phpt deleted file mode 100644 index 123d9ff23926..000000000000 --- a/ext/intl/tests/bug61860.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #61860: Offsets may be wrong for grapheme_stri* functions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(20) -string(40) "Paris habe ich mit dem Fahrer gesprochen" -string(40) "Paris habe ich mit dem Fahrer gesprochen" diff --git a/ext/intl/tests/bug62759.phpt b/ext/intl/tests/bug62759.phpt deleted file mode 100644 index d4126b752fcb..000000000000 --- a/ext/intl/tests/bug62759.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #62759: Buggy grapheme_substr() on edge case ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -string(0) "" -bool(false) -string(61) "grapheme_substr: invalid parameters: U_ILLEGAL_ARGUMENT_ERROR" -string(0) "" -bool(false) -string(65) "grapheme_substr: length is beyond start: U_ILLEGAL_ARGUMENT_ERROR" -string(0) "" diff --git a/ext/intl/tests/calendar_const_field_field_count.phpt b/ext/intl/tests/calendar_const_field_field_count.phpt deleted file mode 100644 index bae438fbbc4c..000000000000 --- a/ext/intl/tests/calendar_const_field_field_count.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -IntlCalendar::FIELD_FIELD_COUNT ---INI-- -date.timezone=Atlantic/Azores ---SKIPIF-- -setMinimalDaysInFirstWeek(6), - $intlcal->getMinimalDaysInFirstWeek(), - intlcal_set_minimal_days_in_first_week($intlcal, 5), - $intlcal->getMinimalDaysInFirstWeek() -); -?> -==DONE== ---EXPECT-- -bool(true) -int(6) -bool(true) -int(5) -==DONE== diff --git a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt deleted file mode 100644 index c133558ddc5c..000000000000 --- a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -IntlCalendar::setMinimalDaysInFirstWeek(): bad arguments ---INI-- -date.timezone=Atlantic/Azores ---SKIPIF-- -setMinimalDaysInFirstWeek()); -var_dump($c->setMinimalDaysInFirstWeek(1, 2)); -var_dump($c->setMinimalDaysInFirstWeek(0)); - -var_dump(intlcal_set_minimal_days_in_first_week($c, 0)); -var_dump(intlcal_set_minimal_days_in_first_week(1, 2)); - ---EXPECTF-- -Warning: IntlCalendar::setMinimalDaysInFirstWeek() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setMinimalDaysInFirstWeek() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: invalid number of days; must be between 1 and 7 in %s on line %d -bool(false) - -Warning: intlcal_set_minimal_days_in_first_week(): intlcal_set_minimal_days_in_first_week: invalid number of days; must be between 1 and 7 in %s on line %d -bool(false) - -Catchable fatal error: Argument 1 passed to intlcal_set_minimal_days_in_first_week() must be an instance of IntlCalendar, integer given in %s on line %d - diff --git a/ext/intl/tests/transliterator_create_error.phpt b/ext/intl/tests/transliterator_create_error.phpt index 4f2d04ae7825..31aef68feb98 100644 --- a/ext/intl/tests/transliterator_create_error.phpt +++ b/ext/intl/tests/transliterator_create_error.phpt @@ -6,15 +6,15 @@ Transliterator::create (error) ===DONE=== --CLEAN-- diff --git a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt index c8c7985826cd..966612f65281 100644 --- a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt +++ b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt @@ -35,7 +35,7 @@ function rebind_proc ($ds, $ldap_url) { $link = ldap_connect($host, $port); var_dump(ldap_set_rebind_proc($link)); var_dump(ldap_set_rebind_proc($link, "rebind_proc", "Additional data")); -var_dump(ldap_set_rebind_proc($link, "rebind_proc_inexistent")); +var_dump(ldap_set_rebind_proc($link, "rebind_proc_inexistant")); ?> ===DONE=== --EXPECTF-- @@ -45,6 +45,6 @@ bool(false) Warning: ldap_set_rebind_proc() expects exactly 2 parameters, 3 given in %s on line %d bool(false) -Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistent' to be a valid callback in %s on line %d +Warning: ldap_set_rebind_proc(): Two arguments expected for 'rebind_proc_inexistant' to be a valid callback in %s on line %d bool(false) ===DONE=== diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 05b8df4d0d53..b1cb45db7645 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -44,7 +44,6 @@ #include #ifdef LIBXML_SCHEMAS_ENABLED #include -#include #endif #include "php_libxml.h" @@ -293,8 +292,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char php_stream_statbuf ssbuf; php_stream_context *context = NULL; php_stream_wrapper *wrapper = NULL; - char *resolved_path; - const char *path_to_open = NULL; + char *resolved_path, *path_to_open = NULL; void *ret_val = NULL; int isescaped=0; xmlURI *uri; @@ -800,11 +798,6 @@ static PHP_MINIT_FUNCTION(libxml) #endif REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT); - /* Schema validation options */ -#if defined(LIBXML_SCHEMAS_ENABLED) && LIBXML_VERSION >= 20614 - REGISTER_LONG_CONSTANT("LIBXML_SCHEMA_CREATE", XML_SCHEMA_VAL_VC_I_CREATE, CONST_CS | CONST_PERSISTENT); -#endif - /* Additional constants for use with loading html */ #if LIBXML_VERSION >= 20707 REGISTER_LONG_CONSTANT("LIBXML_HTML_NOIMPLIED", HTML_PARSE_NOIMPLIED, CONST_CS | CONST_PERSISTENT); diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt index 75d0006a3f35..94da3d848191 100644 --- a/ext/libxml/tests/bug61367-read.phpt +++ b/ext/libxml/tests/bug61367-read.phpt @@ -8,7 +8,7 @@ error_reporting=E_ALL & ~E_NOTICE --FILE-- status = 0; - filter->cache = 0; - CK((*filter->output_function)(w, filter->data)); -} - - /* * UTF-8 => wchar */ @@ -111,102 +100,109 @@ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { int s, c1, w = 0, flag = 0; -retry: - switch (filter->status & 0xff) { - case 0x00: - if (c < 0x80) { + if (c < 0x80) { + if (filter->status != 0) { + w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } + if (c >= 0) { CK((*filter->output_function)(c, filter->data)); - } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ - filter->status = 0x10; - filter->cache = c & 0x1f; - } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ - filter->status = 0x20; - filter->cache = c & 0xf; - } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ - filter->status = 0x30; - filter->cache = c & 0x7; - } else { - mbfl_filt_put_invalid_char(c, filter); } - break; - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - if (c >= 0x80 && c <= 0xbf) { - s = (filter->cache<<6) | (c & 0x3f); + } else if (c < 0xc0) { + int status = filter->status & 0xff; + switch (status) { + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + s = filter->cache | (c & 0x3f); filter->cache = 0; - CK((*filter->output_function)(s, filter->data)); - } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = (filter->cache<<6) | (c & 0x3f); - c1 = filter->cache & 0xf; - - if ((c >= 0x80 && c <= 0xbf) && - ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd))) { - filter->cache = s; + if ((status == 0x10 && s >= 0x80) || + (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || + (status == 0x32 && s >= 0x10000 && s < 0x110000)) { + CK((*filter->output_function)(s, filter->data)); + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; + } + break; + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ + s = filter->cache | ((c & 0x3f) << 6); + c1 = (s >> 12) & 0xf; + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; + } + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ + filter->cache |= ((c & 0x3f) << 6); filter->status++; + break; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = filter->cache | ((c & 0x3f) << 12); + c1 = (s >> 18) & 0x7; + if ((c1 == 0x0 && c >= 0x90) || + (c1 > 0x0 && c1 < 0x4) || + (c1 == 0x4 && c < 0x90)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; + } + break; + default: + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + break; + } + } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ + if (filter->status == 0x0) { + filter->status = 0x10; + filter->cache = (c & 0x1f) << 6; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ - s = (filter->cache<<6) | (c & 0x3f); - c1 = filter->cache & 0x7; - - if ((c >= 0x80 && c <= 0xbf) && - ((c1 == 0x0 && c >= 0x90) || - (c1 == 0x4 && c < 0x90) || - (c1 > 0x0 && c1 != 0x4))) { - filter->cache = s; - filter->status++; + } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ + if (filter->status == 0x0) { + filter->status = 0x20; + filter->cache = (c & 0xf) << 12; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ - if (c >= 0x80 && c <= 0xbf) { - filter->cache = (filter->cache<<6) | (c & 0x3f); - filter->status++; + } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ + if (filter->status == 0x0) { + filter->status = 0x30; + filter->cache = (c & 0x7) << 18; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - default: - filter->status = 0; - break; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - return c; -} - -int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter) -{ - int status, cache; - - status = filter->status; - cache = filter->cache; - - filter->status = 0; - filter->cache = 0; - - if (status != 0) { - mbfl_filt_put_invalid_char(cache, filter); + if (flag) { + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; } - if (filter->flush_function != NULL) { - (*filter->flush_function)(filter->data); - } - return 0; + return c; } /* diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h b/ext/mbstring/libmbfl/filters/mbfilter_utf8.h index 970ace6462a4..07bf655022a1 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.h +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.h @@ -37,6 +37,5 @@ extern const struct mbfl_convert_vtbl vtbl_wchar_utf8; int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter); -int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter); #endif /* MBFL_MBFILTER_UTF8_H */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c index f9b643c17de6..62feca40b6f7 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c @@ -37,7 +37,6 @@ #include "mbfilter_sjis_mobile.h" extern int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter); -extern int mbfl_filt_conv_utf8_wchar_flush(mbfl_convert_filter *filter); extern const unsigned char mblen_table_utf8[]; @@ -116,7 +115,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_docomo_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_utf8_wchar_flush + mbfl_filt_conv_common_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_docomo = { @@ -134,7 +133,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_kddi_a_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_utf8_wchar_flush + mbfl_filt_conv_common_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_kddi_a = { @@ -152,7 +151,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_kddi_b_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_utf8_wchar_flush + mbfl_filt_conv_common_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_kddi_b = { @@ -170,7 +169,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_sb_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_mobile_wchar, - mbfl_filt_conv_utf8_wchar_flush + mbfl_filt_conv_common_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8_sb = { @@ -192,97 +191,119 @@ int mbfl_filt_conv_utf8_mobile_wchar(int c, mbfl_convert_filter *filter) int s, w = 0, flag = 0; int s1 = 0, c1 = 0, snd = 0; -retry: - switch (filter->status & 0xff) { - case 0x00: - if (c < 0x80) { + if (c < 0x80) { + if (c >= 0) { CK((*filter->output_function)(c, filter->data)); - } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ - filter->status = 0x10; - filter->cache = c & 0x1f; - } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ - filter->status = 0x20; - filter->cache = c & 0xf; - } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ - filter->status = 0x30; - filter->cache = c & 0x7; - } else { - mbfl_filt_put_invalid_char(c, filter); } - break; - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ filter->status = 0; - if (c >= 0x80 && c <= 0xbf) { - s = (filter->cache<<6) | (c & 0x3f); + } else if (c < 0xc0) { + int status = filter->status & 0xff; + switch (status) { + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + s = filter->cache | (c & 0x3f); filter->cache = 0; - - if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { - s = mbfilter_sjis_emoji_docomo2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_a && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua, 7) > 0) { - s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_b && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua_b, 8) > 0) { - s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); - } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_sb && - mbfilter_conv_r_map_tbl(s, &s1, mbfl_sb2uni_pua, 6) > 0) { - s = mbfilter_sjis_emoji_sb2unicode(s1, &snd); + if ((status == 0x10 && s >= 0x80) || + (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || + (status == 0x32 && s >= 0x10000 && s < 0x110000)) { + + if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { + s = mbfilter_sjis_emoji_docomo2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_a && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua, 7) > 0) { + s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_kddi_b && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_kddi2uni_pua_b, 8) > 0) { + s = mbfilter_sjis_emoji_kddi2unicode(s1, &snd); + } else if (filter->from->no_encoding == mbfl_no_encoding_utf8_sb && + mbfilter_conv_r_map_tbl(s, &s1, mbfl_sb2uni_pua, 6) > 0) { + s = mbfilter_sjis_emoji_sb2unicode(s1, &snd); + } + + if (snd > 0) { + CK((*filter->output_function)(snd, filter->data)); + } + CK((*filter->output_function)(s, filter->data)); + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; } - - if (snd > 0) { - CK((*filter->output_function)(snd, filter->data)); + break; + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ + s = filter->cache | ((c & 0x3f) << 6); + c1 = (s >> 12) & 0xf; + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; } - CK((*filter->output_function)(s, filter->data)); - } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = (filter->cache<<6) | (c & 0x3f); - c1 = filter->cache & 0xf; - - if ((c >= 0x80 && c <= 0xbf) && - ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd))) { - filter->cache = s; + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ + filter->cache |= ((c & 0x3f) << 6); filter->status++; + break; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = filter->cache | ((c & 0x3f) << 12); + c1 = (s >> 18) & 0x7; + if ((c1 == 0x0 && c >= 0x90) || + (c1 > 0x0 && c1 < 0x4) || + (c1 == 0x4 && c < 0x90)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + flag = 1; + } + break; + default: + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + break; + } + } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ + if (filter->status == 0x0) { + filter->status = 0x10; + filter->cache = (c & 0x1f) << 6; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ - s = (filter->cache<<6) | (c & 0x3f); - c1 = filter->cache & 0x7; - - if ((c >= 0x80 && c <= 0xbf) && - ((c1 == 0x0 && c >= 0x90) || - (c1 == 0x4 && c < 0x90) || - (c1 > 0x0 && c1 != 0x4))) { - filter->cache = s; - filter->status++; + } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ + if (filter->status == 0x0) { + filter->status = 0x20; + filter->cache = (c & 0xf) << 12; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ - if (c >= 0x80 && c <= 0xbf) { - filter->cache = (filter->cache<<6) | (c & 0x3f); - filter->status++; + } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ + if (filter->status == 0x0) { + filter->status = 0x30; + filter->cache = (c & 0x7) << 18; } else { - mbfl_filt_put_invalid_char(filter->cache, filter); - goto retry; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; } - break; - default: + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } + + if (flag) { + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); filter->status = 0; - break; + filter->cache = 0; } return c; diff --git a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h index cb6c445e75d6..5ae282e91ba4 100644 --- a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h +++ b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h @@ -4643,7 +4643,7 @@ static const int ucs_r2_jisx0213_min = 0xFA0F; static const int ucs_r2_jisx0213_max = 0xFA6A; /* - CJK Compatibility Ideographs: U+F900 - U+FAFF (separate mapping for U+F9XX) + CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX) */ static const unsigned short ucs_r2b_jisx0213_cmap_key[] = { 0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc}; diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY index 7add6f9a90ea..06f38c246a99 100644 --- a/ext/mbstring/oniguruma/HISTORY +++ b/ext/mbstring/oniguruma/HISTORY @@ -878,7 +878,7 @@ History 2004/10/18: [impl] (thanks Imai Yasumasa) enclose #include by #ifndef __BORLANDC__. 2004/10/18: [bug] (thanks Imai Yasumasa) - memory access violation in select_opt_exact_info(). + memory acess violation in select_opt_exact_info(). 2004/09/25: [dist] fix doc/API and doc/API.ja. 2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() for the case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE @@ -1812,7 +1812,7 @@ History 2003/01/31: [impl] rename TTRANS() to TOLOWER(). 2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile. 2003/01/30: [impl] add -DNOT_RUBY to Makefile.in. - NOT_RUBY is referred in regint.h for escape double + NOT_RUBY is refered in regint.h for escape double including config.h. 2003/01/30: [impl] when string hasn't case ambiguity, don't compile to ignore case opcode. diff --git a/ext/mbstring/oniguruma/oniguruma.h b/ext/mbstring/oniguruma/oniguruma.h index bf00e20f63b7..3b557639f1da 100644 --- a/ext/mbstring/oniguruma/oniguruma.h +++ b/ext/mbstring/oniguruma/oniguruma.h @@ -96,13 +96,8 @@ extern "C" { #define UChar OnigUChar #endif -#ifdef _WIN32 -# include -typedef ULONG_PTR OnigCodePoint; -#else -typedef unsigned long OnigCodePoint; -#endif typedef unsigned char OnigUChar; +typedef unsigned long OnigCodePoint; typedef unsigned int OnigCtype; typedef unsigned int OnigDistance; diff --git a/ext/mbstring/oniguruma/st.h b/ext/mbstring/oniguruma/st.h index 6f9387021459..da65e7fef830 100644 --- a/ext/mbstring/oniguruma/st.h +++ b/ext/mbstring/oniguruma/st.h @@ -6,12 +6,7 @@ #define ST_INCLUDED -#ifdef _WIN32 -# include -typedef ULONG_PTR st_data_t; -#else typedef unsigned long st_data_t; -#endif #define ST_DATA_T_DEFINED typedef struct st_table st_table; diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 607921ebb6b8..145ee0c13fac 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -648,7 +648,7 @@ _php_mb_regex_init_options(const char *parg, int narg, OnigOptionType *option, O /* }}} */ /* - * php functions + * php funcions */ /* {{{ proto string mb_regex_encoding([string encoding]) diff --git a/ext/mbstring/tests/bug65045.phpt b/ext/mbstring/tests/bug65045.phpt deleted file mode 100644 index 03a090ded2d4..000000000000 --- a/ext/mbstring/tests/bug65045.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #65045: mb_convert_encoding breaks well-formed character ---SKIPIF-- - ---FILE-- -> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 3); + $s = chk_enc(pack('C3', 0xe0 | ($i >> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 2); if ($s === false) { $cnt++; } else { diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt index 6f149bfc9fe1..7fb3335fe22b 100644 --- a/ext/mbstring/tests/mb_http_output.phpt +++ b/ext/mbstring/tests/mb_http_output.phpt @@ -4,7 +4,7 @@ mb_http_output() --FILE-- --FILE-- num_persistent = 0; mssql_globals->get_column_content = php_mssql_get_column_content_with_type; - if (cfg_get_long("mssql.compatibility_mode", &compatibility_mode) == SUCCESS) { - if (compatibility_mode) { + if (cfg_get_long("mssql.compatability_mode", &compatability_mode) == SUCCESS) { + if (compatability_mode) { mssql_globals->get_column_content = php_mssql_get_column_content_without_type; } } diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h index 2b7d3e19c3a3..b73c8420462d 100644 --- a/ext/mssql/php_mssql.h +++ b/ext/mssql/php_mssql.h @@ -166,7 +166,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mssql) long min_error_severity, min_message_severity; long cfg_min_error_severity, cfg_min_message_severity; long connect_timeout, timeout; - zend_bool compatibility_mode; + zend_bool compatability_mode; void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type TSRMLS_DC); long textsize, textlimit, batchsize; zend_bool datetimeconvert; diff --git a/ext/mysql/CREDITS b/ext/mysql/CREDITS index 15b00a9a8eb2..e5a6208babc1 100644 --- a/ext/mysql/CREDITS +++ b/ext/mysql/CREDITS @@ -1,2 +1,2 @@ MySQL -Zeev Suraski, Zak Greant, Georg Richter, Andrey Hristov +Zeev Suraski, Zak Greant, Georg Richter diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4 index fd7f52ef3ada..5968c43346ae 100644 --- a/ext/mysql/config.m4 +++ b/ext/mysql/config.m4 @@ -40,14 +40,13 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ PHP_ARG_WITH(mysql, for MySQL support, -[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base +[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory, if no DIR is passed or the value is mysqlnd the MySQL native driver will be used]) PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, -[ --with-mysql-sock[=SOCKPATH] - MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. - If unspecified, the default locations are searched], no, no) +[ --with-mysql-sock[=DIR] MySQL/MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. + If unspecified, the default locations are searched], no, no) if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 88bb9ab21ef9..a41f2a5cb9c5 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -296,7 +296,7 @@ static const zend_function_entry mysql_functions[] = { #ifdef MYSQL_HAS_SET_CHARSET PHP_FE(mysql_set_charset, arginfo_mysql_set_charset) #endif - /* for downwards compatibility */ + /* for downwards compatability */ PHP_DEP_FALIAS(mysql, mysql_db_query, arginfo_mysql_db_query) PHP_DEP_FALIAS(mysql_fieldname, mysql_field_name, arginfo_mysql_field_name) PHP_DEP_FALIAS(mysql_fieldtable, mysql_field_table, arginfo_mysql_field_seek) @@ -720,7 +720,7 @@ PHP_MINFO_FUNCTION(mysql) static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL; - int user_len = 0, passwd_len = 0, host_len = 0; + int user_len, passwd_len, host_len; char *hashed_details=NULL; int hashed_details_length, port = MYSQL_PORT; long client_flags = 0; @@ -1922,7 +1922,7 @@ PHP_FUNCTION(mysql_result) /* johannes TODO: -Do 2 zend_parse_parameters calls instead of type "z" and switch below +Do 2 zend_parse_paramters calls instead of type "z" and switch below Q: String or long first? */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &result, &row, &field) == FAILURE) { diff --git a/ext/mysql/tests/bug55473.phpt b/ext/mysql/tests/bug55473.phpt index 98fd0091dcd1..1cc2dc928251 100644 --- a/ext/mysql/tests/bug55473.phpt +++ b/ext/mysql/tests/bug55473.phpt @@ -69,26 +69,18 @@ mysql.allow_persistent=1 ?> --EXPECTF-- Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 0 Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] Setting openened files... - -Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 1 Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected - -Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 2 Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected - -Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 3 Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index f6c86e762bbb..687b42289830 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -3,14 +3,13 @@ dnl $Id$ dnl config.m4 for extension mysqli PHP_ARG_WITH(mysqli, for MySQLi support, -[ --with-mysqli[=FILE] Include MySQLi support. FILE is the path +[ --with-mysqli[=FILE] Include MySQLi support. FILE is the path to mysql_config. If no value or mysqlnd is passed as FILE, the MySQL native driver will be used]) PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support, -[ --enable-embedded-mysqli - MYSQLi: Enable embedded support - Note: Does not work with MySQL native driver!], no, no) +[ --enable-embedded-mysqli MYSQLi: Enable embedded support + Note: Does not work with MySQL native driver!], no, no) if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then dnl This needs to be set in any extension which wishes to use mysqlnd diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index ad4e25c66f32..d14b61682736 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -531,7 +531,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_ #include "ext/mysqlnd/mysqlnd_reverse_api.h" static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) { - if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry TSRMLS_CC)) { + if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJCE_P(zv) == mysqli_link_class_entry) { MY_MYSQL * mysql; MYSQLI_RESOURCE * my_res; mysqli_object * intern = (mysqli_object *)zend_object_store_get_object(zv TSRMLS_CC); @@ -842,7 +842,7 @@ PHP_MINIT_FUNCTION(mysqli) REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, CONST_CS | CONST_PERSISTENT); #endif -#if (MYSQL_VERSION_ID >= 50611 && defined(CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS)) || defined(MYSQLI_USE_MYSQLND) +#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND) REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT); #endif diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 3ee5c803a550..3d651fc20474 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1698,7 +1698,7 @@ static int mysqli_options_get_option_zval_type(int option) #ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); #endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */ -#if (MYSQL_VERSION_ID >= 50611 && defined(CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS)) || defined(MYSQLI_USE_MYSQLND) +#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND) case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: #endif return IS_LONG; diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index c24b974de862..398c15919b4f 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -562,7 +562,7 @@ PHP_FUNCTION(mysqli_query) MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; - MYSQL_RES *result = NULL; + MYSQL_RES *result; char *query = NULL; int query_len; long resultmode = MYSQLI_STORE_RESULT; @@ -833,7 +833,7 @@ PHP_FUNCTION(mysqli_reap_async_query) MY_MYSQL *mysql; zval *mysql_link; MYSQLI_RESOURCE *mysqli_resource; - MYSQL_RES *result = NULL; + MYSQL_RES *result; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 4fe87f4c0095..1ea89d9beea7 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -16,7 +16,7 @@ class DbConnection { var_dump($link); $link = mysqli_init(); - /* @ is to suppress 'Property access is not allowed yet' */ + /* @ is to supress 'Property access is not allowed yet' */ @var_dump($link); $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket); diff --git a/ext/mysqli/tests/mysqli_driver.phpt b/ext/mysqli/tests/mysqli_driver.phpt index 023e4d229995..4e266a0533e0 100644 --- a/ext/mysqli/tests/mysqli_driver.phpt +++ b/ext/mysqli/tests/mysqli_driver.phpt @@ -53,7 +53,7 @@ require_once('skipifconnectfailure.inc'); } catch (mysqli_sql_exception $e) { $ok = true; if ('' == $e->getMessage()) - printf("[008] getMessage() has returned an empty string.\n"); + printf("[008] getMessage() has returned an emptry string.\n"); if ('' == $e->getCode()) printf("[009] getCode() has returned an empty string.\n"); if ('' == $e->getFile()) diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt b/ext/mysqli/tests/mysqli_expire_password.phpt index 4fdf902c79e2..ce89a2167077 100644 --- a/ext/mysqli/tests/mysqli_expire_password.phpt +++ b/ext/mysqli/tests/mysqli_expire_password.phpt @@ -127,11 +127,11 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'% ?> --EXPECTF-- -Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d -[001] Cannot connect [1862] %s +Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d +[001] Cannot connect [1820] %s -Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d -[003] Cannot connect [1862] %s +Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d +[003] Cannot connect [1820] %s [006] Connect allowed, query fail, [1820] %s [008] Connect allowed, pw set, [0%A array(1) { diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt index ac2e7c00015a..fa00ecda15d2 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt @@ -17,7 +17,7 @@ mysqli_fetch_assoc() - utf8 die("skip Looks like UTF8 is not available on the server"); if (strtolower($tmp['Charset']) !== 'utf8') - die("skip Not sure if UTF8 is available, canceling the test"); + die("skip Not sure if UTF8 is available, cancelling the test"); mysqli_free_result($res); @@ -28,7 +28,7 @@ mysqli_fetch_assoc() - utf8 die("skip Looks like UCS2 is not available on the server"); if (strtolower($tmp['Charset']) !== 'ucs2') - die("skip Not sure if UCS2 is available, canceling the test"); + die("skip Not sure if UCS2 is available, cancelling the test"); mysqli_free_result($res); mysqli_close($link); diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index a22fc58f53fe..ef5ef6ee69c0 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -166,7 +166,7 @@ mysqlnd.collect_memory_statistics=1 mysqli_get_client_stats_assert_gt('bytes_sent', $info, $expected, $test_counter); mysqli_get_client_stats_assert_gt('bytes_received', $info, $expected, $test_counter); - // real_data_* get incremented after mysqli_*fetch*() + // real_data_* get incremeneted after mysqli_*fetch*() mysqli_get_client_stats_assert_eq('bytes_received_real_data_normal', $info, "0", $test_counter); mysqli_get_client_stats_assert_eq('bytes_received_real_data_ps', $info, "0", $test_counter); diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt index 5daaa597fabb..2f7986d3fe44 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc'); $valid_options = array( MYSQLI_READ_DEFAULT_GROUP => "MYSQLI_READ_DEFAULT_GROUP", - MYSQLI_READ_DEFAULT_FILE => "MYSQLI_READ_DEFAULT_FILE", + MYSQLI_READ_DEFAULT_FILE => "MYSQLI_READ_DEFAUTL_FILE", MYSQLI_OPT_CONNECT_TIMEOUT => "MYSQLI_OPT_CONNECT_TIMEOUT", MYSQLI_OPT_LOCAL_INFILE => "MYSQLI_OPT_LOCAL_INFILE", MYSQLI_INIT_COMMAND => "MYSQLI_INIT_COMMAND", diff --git a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt deleted file mode 100644 index d7a78f1cf06d..000000000000 --- a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -mysqli_stmt_prepare() ---SKIPIF-- - ---FILE-- -prepare("SHOW STATUS WHERE 1 = ? AND 1 IN {$params}")) { - - $stmt->bind_param('iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii', $model, $cleanupIds[0], $cleanupIds[1], $cleanupIds[2], $cleanupIds[3], $cleanupIds[4], $cleanupIds[5], $cleanupIds[6], $cleanupIds[7], $cleanupIds[8], $cleanupIds[9], $cleanupIds[10], $cleanupIds[11], $cleanupIds[12], $cleanupIds[13], $cleanupIds[14], $cleanupIds[15], $cleanupIds[16], $cleanupIds[17], $cleanupIds[18], $cleanupIds[19], $cleanupIds[20], $cleanupIds[21], $cleanupIds[22], $cleanupIds[23], $cleanupIds[24], $cleanupIds[25], $cleanupIds[26], $cleanupIds[27], $cleanupIds[28], $cleanupIds[29], $cleanupIds[30], $cleanupIds[31], $cleanupIds[32], $cleanupIds[33], $cleanupIds[34], $cleanupIds[35], $cleanupIds[36], $cleanupIds[37], $cleanupIds[38], $cleanupIds[39], $cleanupIds[40], $cleanupIds[41], $cleanupIds[42], $cleanupIds[43], $cleanupIds[44], $cleanupIds[45], $cleanupIds[46], $cleanupIds[47], $cleanupIds[48], $cleanupIds[49], $cleanupIds[50], $cleanupIds[51], $cleanupIds[52], $cleanupIds[53], $cleanupIds[54], $cleanupIds[55], $cleanupIds[56], $cleanupIds[57], $cleanupIds[58], $cleanupIds[59], $cleanupIds[60], $cleanupIds[61], $cleanupIds[62], $cleanupIds[63], $cleanupIds[64], $cleanupIds[65], $cleanupIds[66], $cleanupIds[67], $cleanupIds[68], $cleanupIds[69], $cleanupIds[70], $cleanupIds[71], $cleanupIds[72], $cleanupIds[73], $cleanupIds[74], $cleanupIds[75], $cleanupIds[76], $cleanupIds[77], $cleanupIds[78], $cleanupIds[79], $cleanupIds[80], $cleanupIds[81], $cleanupIds[82], $cleanupIds[83], $cleanupIds[84], $cleanupIds[85], $cleanupIds[86], $cleanupIds[87], $cleanupIds[88], $cleanupIds[89], $cleanupIds[90], $cleanupIds[91], $cleanupIds[92], $cleanupIds[93], $cleanupIds[94], $cleanupIds[95], $cleanupIds[96], $cleanupIds[97], $cleanupIds[98], $cleanupIds[99], $cleanupIds[100], $cleanupIds[101], $cleanupIds[102], $cleanupIds[103], $cleanupIds[104], $cleanupIds[105], $cleanupIds[106], $cleanupIds[107], $cleanupIds[108], $cleanupIds[109], $cleanupIds[110], $cleanupIds[111], $cleanupIds[112], $cleanupIds[113], $cleanupIds[114], $cleanupIds[115], $cleanupIds[116], $cleanupIds[117], $cleanupIds[118], $cleanupIds[119], $cleanupIds[120], $cleanupIds[121], $cleanupIds[122], $cleanupIds[123], $cleanupIds[124], $cleanupIds[125], $cleanupIds[126], $cleanupIds[127], $cleanupIds[128], $cleanupIds[129], $cleanupIds[130], $cleanupIds[131], $cleanupIds[132], $cleanupIds[133], $cleanupIds[134], $cleanupIds[135], $cleanupIds[136], $cleanupIds[137], $cleanupIds[138], $cleanupIds[139], $cleanupIds[140], $cleanupIds[141], $cleanupIds[142], $cleanupIds[143], $cleanupIds[144], $cleanupIds[145], $cleanupIds[146], $cleanupIds[147], $cleanupIds[148], $cleanupIds[149], $cleanupIds[150], $cleanupIds[151], $cleanupIds[152], $cleanupIds[153], $cleanupIds[154], $cleanupIds[155], $cleanupIds[156], $cleanupIds[157], $cleanupIds[158], $cleanupIds[159], $cleanupIds[160], $cleanupIds[161], $cleanupIds[162], $cleanupIds[163], $cleanupIds[164], $cleanupIds[165], $cleanupIds[166], $cleanupIds[167], $cleanupIds[168], $cleanupIds[169], $cleanupIds[170], $cleanupIds[171], $cleanupIds[172], $cleanupIds[173], $cleanupIds[174], $cleanupIds[175], $cleanupIds[176], $cleanupIds[177], $cleanupIds[178], $cleanupIds[179], $cleanupIds[180], $cleanupIds[181], $cleanupIds[182], $cleanupIds[183], $cleanupIds[184], $cleanupIds[185], $cleanupIds[186], $cleanupIds[187], $cleanupIds[188], $cleanupIds[189], $cleanupIds[190], $cleanupIds[191], $cleanupIds[192], $cleanupIds[193], $cleanupIds[194], $cleanupIds[195], $cleanupIds[196], $cleanupIds[197], $cleanupIds[198], $cleanupIds[199], $cleanupIds[200], $cleanupIds[201], $cleanupIds[202], $cleanupIds[203], $cleanupIds[204], $cleanupIds[205], $cleanupIds[206], $cleanupIds[207], $cleanupIds[208], $cleanupIds[209], $cleanupIds[210], $cleanupIds[211], $cleanupIds[212], $cleanupIds[213], $cleanupIds[214], $cleanupIds[215], $cleanupIds[216], $cleanupIds[217], $cleanupIds[218], $cleanupIds[219], $cleanupIds[220], $cleanupIds[221], $cleanupIds[222], $cleanupIds[223], $cleanupIds[224], $cleanupIds[225], $cleanupIds[226], $cleanupIds[227], $cleanupIds[228], $cleanupIds[229], $cleanupIds[230], $cleanupIds[231], $cleanupIds[232], $cleanupIds[233], $cleanupIds[234], $cleanupIds[235], $cleanupIds[236], $cleanupIds[237], $cleanupIds[238], $cleanupIds[239], $cleanupIds[240], $cleanupIds[241], $cleanupIds[242], $cleanupIds[243], $cleanupIds[244], $cleanupIds[245], $cleanupIds[246], $cleanupIds[247], $cleanupIds[248], $cleanupIds[249], $cleanupIds[250], $cleanupIds[251], $cleanupIds[252], $cleanupIds[253], $cleanupIds[254], $cleanupIds[255], $cleanupIds[256], $cleanupIds[257], $cleanupIds[258], $cleanupIds[259], $cleanupIds[260], $cleanupIds[261], $cleanupIds[262], $cleanupIds[263], $cleanupIds[264], $cleanupIds[265], $cleanupIds[266], $cleanupIds[267], $cleanupIds[268], $cleanupIds[269], $cleanupIds[270], $cleanupIds[271], $cleanupIds[272], $cleanupIds[273], $cleanupIds[274], $cleanupIds[275], $cleanupIds[276], $cleanupIds[277], $cleanupIds[278], $cleanupIds[279], $cleanupIds[280], $cleanupIds[281], $cleanupIds[282], $cleanupIds[283], $cleanupIds[284], $cleanupIds[285], $cleanupIds[286], $cleanupIds[287], $cleanupIds[288], $cleanupIds[289], $cleanupIds[290], $cleanupIds[291], $cleanupIds[292], $cleanupIds[293], $cleanupIds[294], $cleanupIds[295], $cleanupIds[296], $cleanupIds[297], $cleanupIds[298], $cleanupIds[299], $cleanupIds[300], $cleanupIds[301], $cleanupIds[302], $cleanupIds[303], $cleanupIds[304], $cleanupIds[305], $cleanupIds[306], $cleanupIds[307], $cleanupIds[308], $cleanupIds[309], $cleanupIds[310], $cleanupIds[311], $cleanupIds[312], $cleanupIds[313], $cleanupIds[314], $cleanupIds[315], $cleanupIds[316], $cleanupIds[317], $cleanupIds[318], $cleanupIds[319], $cleanupIds[320], $cleanupIds[321], $cleanupIds[322], $cleanupIds[323], $cleanupIds[324], $cleanupIds[325], $cleanupIds[326], $cleanupIds[327], $cleanupIds[328], $cleanupIds[329], $cleanupIds[330], $cleanupIds[331], $cleanupIds[332], $cleanupIds[333], $cleanupIds[334], $cleanupIds[335], $cleanupIds[336], $cleanupIds[337], $cleanupIds[338], $cleanupIds[339], $cleanupIds[340], $cleanupIds[341], $cleanupIds[342], $cleanupIds[343], $cleanupIds[344], $cleanupIds[345], $cleanupIds[346], $cleanupIds[347], $cleanupIds[348], $cleanupIds[349], $cleanupIds[350], $cleanupIds[351], $cleanupIds[352], $cleanupIds[353], $cleanupIds[354], $cleanupIds[355], $cleanupIds[356], $cleanupIds[357], $cleanupIds[358], $cleanupIds[359], $cleanupIds[360], $cleanupIds[361], $cleanupIds[362], $cleanupIds[363], $cleanupIds[364], $cleanupIds[365], $cleanupIds[366], $cleanupIds[367], $cleanupIds[368], $cleanupIds[369], $cleanupIds[370], $cleanupIds[371], $cleanupIds[372], $cleanupIds[373], $cleanupIds[374], $cleanupIds[375], $cleanupIds[376], $cleanupIds[377], $cleanupIds[378], $cleanupIds[379], $cleanupIds[380], $cleanupIds[381], $cleanupIds[382], $cleanupIds[383], $cleanupIds[384], $cleanupIds[385], $cleanupIds[386], $cleanupIds[387], $cleanupIds[388], $cleanupIds[389], $cleanupIds[390], $cleanupIds[391], $cleanupIds[392], $cleanupIds[393], $cleanupIds[394], $cleanupIds[395], $cleanupIds[396], $cleanupIds[397], $cleanupIds[398], $cleanupIds[399], $cleanupIds[400], $cleanupIds[401], $cleanupIds[402], $cleanupIds[403], $cleanupIds[404], $cleanupIds[405], $cleanupIds[406], $cleanupIds[407], $cleanupIds[408], $cleanupIds[409], $cleanupIds[410], $cleanupIds[411], $cleanupIds[412], $cleanupIds[413], $cleanupIds[414], $cleanupIds[415], $cleanupIds[416], $cleanupIds[417], $cleanupIds[418], $cleanupIds[419], $cleanupIds[420], $cleanupIds[421], $cleanupIds[422], $cleanupIds[423], $cleanupIds[424], $cleanupIds[425], $cleanupIds[426], $cleanupIds[427], $cleanupIds[428], $cleanupIds[429], $cleanupIds[430], $cleanupIds[431], $cleanupIds[432], $cleanupIds[433], $cleanupIds[434], $cleanupIds[435], $cleanupIds[436], $cleanupIds[437], $cleanupIds[438], $cleanupIds[439], $cleanupIds[440], $cleanupIds[441], $cleanupIds[442], $cleanupIds[443], $cleanupIds[444], $cleanupIds[445], $cleanupIds[446], $cleanupIds[447], $cleanupIds[448], $cleanupIds[449], $cleanupIds[450], $cleanupIds[451], $cleanupIds[452], $cleanupIds[453], $cleanupIds[454], $cleanupIds[455], $cleanupIds[456], $cleanupIds[457], $cleanupIds[458], $cleanupIds[459], $cleanupIds[460], $cleanupIds[461], $cleanupIds[462], $cleanupIds[463], $cleanupIds[464], $cleanupIds[465], $cleanupIds[466], $cleanupIds[467], $cleanupIds[468], $cleanupIds[469], $cleanupIds[470], $cleanupIds[471], $cleanupIds[472], $cleanupIds[473], $cleanupIds[474], $cleanupIds[475], $cleanupIds[476], $cleanupIds[477], $cleanupIds[478], $cleanupIds[479], $cleanupIds[480], $cleanupIds[481], $cleanupIds[482], $cleanupIds[483], $cleanupIds[484], $cleanupIds[485], $cleanupIds[486], $cleanupIds[487], $cleanupIds[488], $cleanupIds[489], $cleanupIds[490], $cleanupIds[491], $cleanupIds[492], $cleanupIds[493], $cleanupIds[494], $cleanupIds[495], $cleanupIds[496], $cleanupIds[497], $cleanupIds[498], $cleanupIds[499], $cleanupIds[500], $cleanupIds[501], $cleanupIds[502], $cleanupIds[503], $cleanupIds[504], $cleanupIds[505], $cleanupIds[506], $cleanupIds[507], $cleanupIds[508], $cleanupIds[509], $cleanupIds[510], $cleanupIds[511], $cleanupIds[512], $cleanupIds[513], $cleanupIds[514], $cleanupIds[515], $cleanupIds[516], $cleanupIds[517], $cleanupIds[518], $cleanupIds[519], $cleanupIds[520], $cleanupIds[521], $cleanupIds[522], $cleanupIds[523], $cleanupIds[524], $cleanupIds[525], $cleanupIds[526], $cleanupIds[527], $cleanupIds[528], $cleanupIds[529], $cleanupIds[530], $cleanupIds[531], $cleanupIds[532], $cleanupIds[533], $cleanupIds[534], $cleanupIds[535], $cleanupIds[536], $cleanupIds[537], $cleanupIds[538], $cleanupIds[539], $cleanupIds[540], $cleanupIds[541], $cleanupIds[542], $cleanupIds[543], $cleanupIds[544], $cleanupIds[545], $cleanupIds[546], $cleanupIds[547], $cleanupIds[548], $cleanupIds[549], $cleanupIds[550], $cleanupIds[551], $cleanupIds[552], $cleanupIds[553], $cleanupIds[554], $cleanupIds[555], $cleanupIds[556], $cleanupIds[557], $cleanupIds[558], $cleanupIds[559], $cleanupIds[560], $cleanupIds[561], $cleanupIds[562], $cleanupIds[563], $cleanupIds[564], $cleanupIds[565], $cleanupIds[566], $cleanupIds[567], $cleanupIds[568], $cleanupIds[569], $cleanupIds[570], $cleanupIds[571], $cleanupIds[572], $cleanupIds[573], $cleanupIds[574], $cleanupIds[575], $cleanupIds[576], $cleanupIds[577], $cleanupIds[578], $cleanupIds[579], $cleanupIds[580], $cleanupIds[581], $cleanupIds[582], $cleanupIds[583], $cleanupIds[584], $cleanupIds[585], $cleanupIds[586], $cleanupIds[587], $cleanupIds[588], $cleanupIds[589], $cleanupIds[590], $cleanupIds[591], $cleanupIds[592], $cleanupIds[593], $cleanupIds[594], $cleanupIds[595], $cleanupIds[596], $cleanupIds[597], $cleanupIds[598], $cleanupIds[599], $cleanupIds[600], $cleanupIds[601], $cleanupIds[602], $cleanupIds[603], $cleanupIds[604], $cleanupIds[605], $cleanupIds[606], $cleanupIds[607], $cleanupIds[608], $cleanupIds[609], $cleanupIds[610], $cleanupIds[611], $cleanupIds[612], $cleanupIds[613], $cleanupIds[614], $cleanupIds[615], $cleanupIds[616], $cleanupIds[617], $cleanupIds[618], $cleanupIds[619], $cleanupIds[620], $cleanupIds[621], $cleanupIds[622], $cleanupIds[623], $cleanupIds[624], $cleanupIds[625], $cleanupIds[626], $cleanupIds[627], $cleanupIds[628], $cleanupIds[629], $cleanupIds[630], $cleanupIds[631], $cleanupIds[632], $cleanupIds[633], $cleanupIds[634], $cleanupIds[635], $cleanupIds[636], $cleanupIds[637], $cleanupIds[638], $cleanupIds[639], $cleanupIds[640], $cleanupIds[641], $cleanupIds[642], $cleanupIds[643], $cleanupIds[644], $cleanupIds[645], $cleanupIds[646], $cleanupIds[647], $cleanupIds[648], $cleanupIds[649], $cleanupIds[650], $cleanupIds[651], $cleanupIds[652], $cleanupIds[653], $cleanupIds[654], $cleanupIds[655], $cleanupIds[656], $cleanupIds[657], $cleanupIds[658], $cleanupIds[659], $cleanupIds[660], $cleanupIds[661], $cleanupIds[662], $cleanupIds[663], $cleanupIds[664], $cleanupIds[665], $cleanupIds[666], $cleanupIds[667], $cleanupIds[668], $cleanupIds[669], $cleanupIds[670], $cleanupIds[671], $cleanupIds[672], $cleanupIds[673], $cleanupIds[674], $cleanupIds[675], $cleanupIds[676], $cleanupIds[677], $cleanupIds[678], $cleanupIds[679], $cleanupIds[680], $cleanupIds[681], $cleanupIds[682], $cleanupIds[683], $cleanupIds[684], $cleanupIds[685], $cleanupIds[686], $cleanupIds[687], $cleanupIds[688], $cleanupIds[689], $cleanupIds[690], $cleanupIds[691], $cleanupIds[692], $cleanupIds[693], $cleanupIds[694], $cleanupIds[695], $cleanupIds[696], $cleanupIds[697], $cleanupIds[698], $cleanupIds[699], $cleanupIds[700], $cleanupIds[701], $cleanupIds[702], $cleanupIds[703], $cleanupIds[704], $cleanupIds[705], $cleanupIds[706], $cleanupIds[707], $cleanupIds[708], $cleanupIds[709], $cleanupIds[710], $cleanupIds[711], $cleanupIds[712], $cleanupIds[713], $cleanupIds[714], $cleanupIds[715], $cleanupIds[716], $cleanupIds[717], $cleanupIds[718], $cleanupIds[719], $cleanupIds[720], $cleanupIds[721], $cleanupIds[722], $cleanupIds[723], $cleanupIds[724], $cleanupIds[725], $cleanupIds[726], $cleanupIds[727], $cleanupIds[728], $cleanupIds[729], $cleanupIds[730], $cleanupIds[731], $cleanupIds[732], $cleanupIds[733], $cleanupIds[734], $cleanupIds[735], $cleanupIds[736], $cleanupIds[737], $cleanupIds[738], $cleanupIds[739], $cleanupIds[740], $cleanupIds[741], $cleanupIds[742], $cleanupIds[743], $cleanupIds[744], $cleanupIds[745], $cleanupIds[746], $cleanupIds[747], $cleanupIds[748], $cleanupIds[749], $cleanupIds[750], $cleanupIds[751], $cleanupIds[752], $cleanupIds[753], $cleanupIds[754], $cleanupIds[755], $cleanupIds[756], $cleanupIds[757], $cleanupIds[758], $cleanupIds[759], $cleanupIds[760], $cleanupIds[761], $cleanupIds[762], $cleanupIds[763], $cleanupIds[764], $cleanupIds[765], $cleanupIds[766], $cleanupIds[767], $cleanupIds[768], $cleanupIds[769], $cleanupIds[770], $cleanupIds[771], $cleanupIds[772], $cleanupIds[773], $cleanupIds[774], $cleanupIds[775], $cleanupIds[776], $cleanupIds[777], $cleanupIds[778], $cleanupIds[779], $cleanupIds[780], $cleanupIds[781], $cleanupIds[782], $cleanupIds[783], $cleanupIds[784], $cleanupIds[785], $cleanupIds[786], $cleanupIds[787], $cleanupIds[788], $cleanupIds[789], $cleanupIds[790], $cleanupIds[791], $cleanupIds[792], $cleanupIds[793], $cleanupIds[794], $cleanupIds[795], $cleanupIds[796], $cleanupIds[797], $cleanupIds[798], $cleanupIds[799], $cleanupIds[800], $cleanupIds[801], $cleanupIds[802], $cleanupIds[803], $cleanupIds[804], $cleanupIds[805], $cleanupIds[806], $cleanupIds[807], $cleanupIds[808], $cleanupIds[809], $cleanupIds[810], $cleanupIds[811], $cleanupIds[812], $cleanupIds[813], $cleanupIds[814], $cleanupIds[815], $cleanupIds[816], $cleanupIds[817], $cleanupIds[818], $cleanupIds[819], $cleanupIds[820], $cleanupIds[821], $cleanupIds[822], $cleanupIds[823], $cleanupIds[824], $cleanupIds[825], $cleanupIds[826], $cleanupIds[827], $cleanupIds[828], $cleanupIds[829], $cleanupIds[830], $cleanupIds[831], $cleanupIds[832], $cleanupIds[833], $cleanupIds[834], $cleanupIds[835], $cleanupIds[836], $cleanupIds[837], $cleanupIds[838], $cleanupIds[839], $cleanupIds[840], $cleanupIds[841], $cleanupIds[842], $cleanupIds[843], $cleanupIds[844], $cleanupIds[845], $cleanupIds[846], $cleanupIds[847], $cleanupIds[848], $cleanupIds[849], $cleanupIds[850], $cleanupIds[851], $cleanupIds[852], $cleanupIds[853], $cleanupIds[854], $cleanupIds[855], $cleanupIds[856], $cleanupIds[857], $cleanupIds[858], $cleanupIds[859], $cleanupIds[860], $cleanupIds[861], $cleanupIds[862], $cleanupIds[863], $cleanupIds[864], $cleanupIds[865], $cleanupIds[866], $cleanupIds[867], $cleanupIds[868], $cleanupIds[869], $cleanupIds[870], $cleanupIds[871], $cleanupIds[872], $cleanupIds[873], $cleanupIds[874], $cleanupIds[875], $cleanupIds[876], $cleanupIds[877], $cleanupIds[878], $cleanupIds[879], $cleanupIds[880], $cleanupIds[881], $cleanupIds[882], $cleanupIds[883], $cleanupIds[884], $cleanupIds[885], $cleanupIds[886], $cleanupIds[887], $cleanupIds[888], $cleanupIds[889], $cleanupIds[890], $cleanupIds[891], $cleanupIds[892], $cleanupIds[893], $cleanupIds[894], $cleanupIds[895], $cleanupIds[896], $cleanupIds[897], $cleanupIds[898], $cleanupIds[899], $cleanupIds[900], $cleanupIds[901], $cleanupIds[902], $cleanupIds[903], $cleanupIds[904], $cleanupIds[905], $cleanupIds[906], $cleanupIds[907], $cleanupIds[908], $cleanupIds[909], $cleanupIds[910], $cleanupIds[911], $cleanupIds[912], $cleanupIds[913], $cleanupIds[914], $cleanupIds[915], $cleanupIds[916], $cleanupIds[917], $cleanupIds[918], $cleanupIds[919], $cleanupIds[920], $cleanupIds[921], $cleanupIds[922], $cleanupIds[923], $cleanupIds[924], $cleanupIds[925], $cleanupIds[926], $cleanupIds[927], $cleanupIds[928], $cleanupIds[929], $cleanupIds[930], $cleanupIds[931], $cleanupIds[932], $cleanupIds[933], $cleanupIds[934], $cleanupIds[935], $cleanupIds[936], $cleanupIds[937], $cleanupIds[938], $cleanupIds[939], $cleanupIds[940], $cleanupIds[941], $cleanupIds[942], $cleanupIds[943], $cleanupIds[944], $cleanupIds[945], $cleanupIds[946], $cleanupIds[947], $cleanupIds[948], $cleanupIds[949], $cleanupIds[950], $cleanupIds[951], $cleanupIds[952], $cleanupIds[953], $cleanupIds[954], $cleanupIds[955], $cleanupIds[956], $cleanupIds[957], $cleanupIds[958], $cleanupIds[959], $cleanupIds[960], $cleanupIds[961], $cleanupIds[962], $cleanupIds[963], $cleanupIds[964], $cleanupIds[965], $cleanupIds[966], $cleanupIds[967], $cleanupIds[968], $cleanupIds[969], $cleanupIds[970], $cleanupIds[971], $cleanupIds[972], $cleanupIds[973], $cleanupIds[974], $cleanupIds[975], $cleanupIds[976], $cleanupIds[977], $cleanupIds[978], $cleanupIds[979], $cleanupIds[980], $cleanupIds[981], $cleanupIds[982], $cleanupIds[983], $cleanupIds[984], $cleanupIds[985], $cleanupIds[986], $cleanupIds[987], $cleanupIds[988], $cleanupIds[989], $cleanupIds[990], $cleanupIds[991], $cleanupIds[992], $cleanupIds[993], $cleanupIds[994], $cleanupIds[995], $cleanupIds[996], $cleanupIds[997], $cleanupIds[998], $cleanupIds[999], $cleanupIds[1000], $cleanupIds[1001], $cleanupIds[1002], $cleanupIds[1003], $cleanupIds[1004], $cleanupIds[1005], $cleanupIds[1006], $cleanupIds[1007], $cleanupIds[1008], $cleanupIds[1009], $cleanupIds[1010], $cleanupIds[1011], $cleanupIds[1012], $cleanupIds[1013], $cleanupIds[1014], $cleanupIds[1015], $cleanupIds[1016], $cleanupIds[1017], $cleanupIds[1018], $cleanupIds[1019], $cleanupIds[1020], $cleanupIds[1021], $cleanupIds[1022], $cleanupIds[1023], $cleanupIds[1024], $cleanupIds[1025], $cleanupIds[1026], $cleanupIds[1027], $cleanupIds[1028], $cleanupIds[1029], $cleanupIds[1030], $cleanupIds[1031], $cleanupIds[1032], $cleanupIds[1033], $cleanupIds[1034], $cleanupIds[1035], $cleanupIds[1036], $cleanupIds[1037], $cleanupIds[1038], $cleanupIds[1039], $cleanupIds[1040], $cleanupIds[1041], $cleanupIds[1042], $cleanupIds[1043], $cleanupIds[1044], $cleanupIds[1045], $cleanupIds[1046], $cleanupIds[1047], $cleanupIds[1048], $cleanupIds[1049], $cleanupIds[1050], $cleanupIds[1051], $cleanupIds[1052], $cleanupIds[1053], $cleanupIds[1054], $cleanupIds[1055], $cleanupIds[1056], $cleanupIds[1057], $cleanupIds[1058], $cleanupIds[1059], $cleanupIds[1060], $cleanupIds[1061], $cleanupIds[1062], $cleanupIds[1063], $cleanupIds[1064], $cleanupIds[1065], $cleanupIds[1066], $cleanupIds[1067], $cleanupIds[1068], $cleanupIds[1069], $cleanupIds[1070], $cleanupIds[1071], $cleanupIds[1072], $cleanupIds[1073], $cleanupIds[1074], $cleanupIds[1075], $cleanupIds[1076], $cleanupIds[1077], $cleanupIds[1078], $cleanupIds[1079], $cleanupIds[1080], $cleanupIds[1081], $cleanupIds[1082], $cleanupIds[1083], $cleanupIds[1084], $cleanupIds[1085], $cleanupIds[1086], $cleanupIds[1087], $cleanupIds[1088], $cleanupIds[1089], $cleanupIds[1090], $cleanupIds[1091], $cleanupIds[1092], $cleanupIds[1093], $cleanupIds[1094], $cleanupIds[1095], $cleanupIds[1096], $cleanupIds[1097], $cleanupIds[1098], $cleanupIds[1099], $cleanupIds[1100], $cleanupIds[1101], $cleanupIds[1102], $cleanupIds[1103], $cleanupIds[1104], $cleanupIds[1105], $cleanupIds[1106], $cleanupIds[1107], $cleanupIds[1108], $cleanupIds[1109], $cleanupIds[1110], $cleanupIds[1111], $cleanupIds[1112], $cleanupIds[1113], $cleanupIds[1114], $cleanupIds[1115], $cleanupIds[1116], $cleanupIds[1117], $cleanupIds[1118], $cleanupIds[1119], $cleanupIds[1120], $cleanupIds[1121], $cleanupIds[1122], $cleanupIds[1123], $cleanupIds[1124], $cleanupIds[1125], $cleanupIds[1126], $cleanupIds[1127], $cleanupIds[1128], $cleanupIds[1129], $cleanupIds[1130], $cleanupIds[1131], $cleanupIds[1132], $cleanupIds[1133], $cleanupIds[1134], $cleanupIds[1135], $cleanupIds[1136], $cleanupIds[1137], $cleanupIds[1138], $cleanupIds[1139], $cleanupIds[1140], $cleanupIds[1141], $cleanupIds[1142], $cleanupIds[1143], $cleanupIds[1144], $cleanupIds[1145], $cleanupIds[1146], $cleanupIds[1147], $cleanupIds[1148], $cleanupIds[1149], $cleanupIds[1150], $cleanupIds[1151], $cleanupIds[1152], $cleanupIds[1153], $cleanupIds[1154], $cleanupIds[1155], $cleanupIds[1156], $cleanupIds[1157], $cleanupIds[1158], $cleanupIds[1159], $cleanupIds[1160], $cleanupIds[1161], $cleanupIds[1162], $cleanupIds[1163], $cleanupIds[1164], $cleanupIds[1165], $cleanupIds[1166], $cleanupIds[1167], $cleanupIds[1168], $cleanupIds[1169], $cleanupIds[1170], $cleanupIds[1171], $cleanupIds[1172], $cleanupIds[1173], $cleanupIds[1174], $cleanupIds[1175], $cleanupIds[1176], $cleanupIds[1177], $cleanupIds[1178], $cleanupIds[1179], $cleanupIds[1180], $cleanupIds[1181], $cleanupIds[1182], $cleanupIds[1183], $cleanupIds[1184], $cleanupIds[1185], $cleanupIds[1186], $cleanupIds[1187], $cleanupIds[1188], $cleanupIds[1189], $cleanupIds[1190], $cleanupIds[1191], $cleanupIds[1192], $cleanupIds[1193], $cleanupIds[1194], $cleanupIds[1195], $cleanupIds[1196], $cleanupIds[1197], $cleanupIds[1198], $cleanupIds[1199], $cleanupIds[1200], $cleanupIds[1201], $cleanupIds[1202], $cleanupIds[1203], $cleanupIds[1204], $cleanupIds[1205], $cleanupIds[1206], $cleanupIds[1207], $cleanupIds[1208], $cleanupIds[1209], $cleanupIds[1210], $cleanupIds[1211], $cleanupIds[1212], $cleanupIds[1213], $cleanupIds[1214], $cleanupIds[1215], $cleanupIds[1216], $cleanupIds[1217], $cleanupIds[1218], $cleanupIds[1219], $cleanupIds[1220], $cleanupIds[1221], $cleanupIds[1222], $cleanupIds[1223], $cleanupIds[1224], $cleanupIds[1225], $cleanupIds[1226], $cleanupIds[1227], $cleanupIds[1228], $cleanupIds[1229], $cleanupIds[1230], $cleanupIds[1231], $cleanupIds[1232], $cleanupIds[1233], $cleanupIds[1234], $cleanupIds[1235], $cleanupIds[1236], $cleanupIds[1237], $cleanupIds[1238], $cleanupIds[1239], $cleanupIds[1240], $cleanupIds[1241], $cleanupIds[1242], $cleanupIds[1243], $cleanupIds[1244], $cleanupIds[1245], $cleanupIds[1246], $cleanupIds[1247], $cleanupIds[1248], $cleanupIds[1249], $cleanupIds[1250], $cleanupIds[1251], $cleanupIds[1252], $cleanupIds[1253], $cleanupIds[1254], $cleanupIds[1255], $cleanupIds[1256], $cleanupIds[1257], $cleanupIds[1258], $cleanupIds[1259], $cleanupIds[1260], $cleanupIds[1261], $cleanupIds[1262], $cleanupIds[1263], $cleanupIds[1264], $cleanupIds[1265], $cleanupIds[1266], $cleanupIds[1267], $cleanupIds[1268], $cleanupIds[1269], $cleanupIds[1270], $cleanupIds[1271], $cleanupIds[1272], $cleanupIds[1273], $cleanupIds[1274], $cleanupIds[1275], $cleanupIds[1276], $cleanupIds[1277], $cleanupIds[1278], $cleanupIds[1279], $cleanupIds[1280], $cleanupIds[1281], $cleanupIds[1282], $cleanupIds[1283], $cleanupIds[1284], $cleanupIds[1285], $cleanupIds[1286], $cleanupIds[1287], $cleanupIds[1288], $cleanupIds[1289], $cleanupIds[1290], $cleanupIds[1291], $cleanupIds[1292], $cleanupIds[1293], $cleanupIds[1294], $cleanupIds[1295], $cleanupIds[1296], $cleanupIds[1297], $cleanupIds[1298], $cleanupIds[1299], $cleanupIds[1300], $cleanupIds[1301], $cleanupIds[1302], $cleanupIds[1303], $cleanupIds[1304], $cleanupIds[1305], $cleanupIds[1306], $cleanupIds[1307], $cleanupIds[1308], $cleanupIds[1309], $cleanupIds[1310], $cleanupIds[1311], $cleanupIds[1312], $cleanupIds[1313], $cleanupIds[1314], $cleanupIds[1315], $cleanupIds[1316], $cleanupIds[1317], $cleanupIds[1318], $cleanupIds[1319], $cleanupIds[1320], $cleanupIds[1321], $cleanupIds[1322], $cleanupIds[1323], $cleanupIds[1324], $cleanupIds[1325], $cleanupIds[1326], $cleanupIds[1327], $cleanupIds[1328], $cleanupIds[1329], $cleanupIds[1330], $cleanupIds[1331], $cleanupIds[1332], $cleanupIds[1333], $cleanupIds[1334], $cleanupIds[1335], $cleanupIds[1336], $cleanupIds[1337], $cleanupIds[1338], $cleanupIds[1339], $cleanupIds[1340], $cleanupIds[1341], $cleanupIds[1342], $cleanupIds[1343], $cleanupIds[1344], $cleanupIds[1345], $cleanupIds[1346], $cleanupIds[1347], $cleanupIds[1348], $cleanupIds[1349], $cleanupIds[1350], $cleanupIds[1351], $cleanupIds[1352], $cleanupIds[1353], $cleanupIds[1354], $cleanupIds[1355], $cleanupIds[1356], $cleanupIds[1357], $cleanupIds[1358], $cleanupIds[1359], $cleanupIds[1360], $cleanupIds[1361], $cleanupIds[1362], $cleanupIds[1363], $cleanupIds[1364], $cleanupIds[1365], $cleanupIds[1366], $cleanupIds[1367], $cleanupIds[1368], $cleanupIds[1369], $cleanupIds[1370], $cleanupIds[1371], $cleanupIds[1372], $cleanupIds[1373], $cleanupIds[1374], $cleanupIds[1375], $cleanupIds[1376], $cleanupIds[1377], $cleanupIds[1378], $cleanupIds[1379], $cleanupIds[1380], $cleanupIds[1381], $cleanupIds[1382], $cleanupIds[1383], $cleanupIds[1384], $cleanupIds[1385], $cleanupIds[1386], $cleanupIds[1387], $cleanupIds[1388], $cleanupIds[1389], $cleanupIds[1390], $cleanupIds[1391], $cleanupIds[1392], $cleanupIds[1393], $cleanupIds[1394], $cleanupIds[1395], $cleanupIds[1396], $cleanupIds[1397], $cleanupIds[1398], $cleanupIds[1399], $cleanupIds[1400], $cleanupIds[1401], $cleanupIds[1402], $cleanupIds[1403], $cleanupIds[1404], $cleanupIds[1405], $cleanupIds[1406], $cleanupIds[1407], $cleanupIds[1408], $cleanupIds[1409], $cleanupIds[1410], $cleanupIds[1411], $cleanupIds[1412], $cleanupIds[1413], $cleanupIds[1414], $cleanupIds[1415], $cleanupIds[1416], $cleanupIds[1417], $cleanupIds[1418], $cleanupIds[1419], $cleanupIds[1420], $cleanupIds[1421], $cleanupIds[1422], $cleanupIds[1423], $cleanupIds[1424], $cleanupIds[1425], $cleanupIds[1426], $cleanupIds[1427], $cleanupIds[1428], $cleanupIds[1429], $cleanupIds[1430], $cleanupIds[1431], $cleanupIds[1432], $cleanupIds[1433], $cleanupIds[1434], $cleanupIds[1435], $cleanupIds[1436], $cleanupIds[1437], $cleanupIds[1438], $cleanupIds[1439], $cleanupIds[1440], $cleanupIds[1441], $cleanupIds[1442], $cleanupIds[1443], $cleanupIds[1444], $cleanupIds[1445], $cleanupIds[1446], $cleanupIds[1447], $cleanupIds[1448], $cleanupIds[1449], $cleanupIds[1450], $cleanupIds[1451], $cleanupIds[1452], $cleanupIds[1453], $cleanupIds[1454], $cleanupIds[1455], $cleanupIds[1456], $cleanupIds[1457], $cleanupIds[1458], $cleanupIds[1459], $cleanupIds[1460], $cleanupIds[1461], $cleanupIds[1462], $cleanupIds[1463], $cleanupIds[1464], $cleanupIds[1465], $cleanupIds[1466], $cleanupIds[1467], $cleanupIds[1468], $cleanupIds[1469], $cleanupIds[1470], $cleanupIds[1471], $cleanupIds[1472], $cleanupIds[1473], $cleanupIds[1474], $cleanupIds[1475], $cleanupIds[1476], $cleanupIds[1477], $cleanupIds[1478], $cleanupIds[1479], $cleanupIds[1480], $cleanupIds[1481], $cleanupIds[1482], $cleanupIds[1483], $cleanupIds[1484], $cleanupIds[1485], $cleanupIds[1486], $cleanupIds[1487], $cleanupIds[1488], $cleanupIds[1489], $cleanupIds[1490], $cleanupIds[1491], $cleanupIds[1492], $cleanupIds[1493], $cleanupIds[1494], $cleanupIds[1495], $cleanupIds[1496], $cleanupIds[1497], $cleanupIds[1498], $cleanupIds[1499], $cleanupIds[1500], $cleanupIds[1501], $cleanupIds[1502], $cleanupIds[1503], $cleanupIds[1504], $cleanupIds[1505], $cleanupIds[1506], $cleanupIds[1507], $cleanupIds[1508], $cleanupIds[1509], $cleanupIds[1510], $cleanupIds[1511], $cleanupIds[1512], $cleanupIds[1513], $cleanupIds[1514], $cleanupIds[1515], $cleanupIds[1516], $cleanupIds[1517], $cleanupIds[1518], $cleanupIds[1519], $cleanupIds[1520], $cleanupIds[1521], $cleanupIds[1522], $cleanupIds[1523], $cleanupIds[1524], $cleanupIds[1525], $cleanupIds[1526], $cleanupIds[1527], $cleanupIds[1528], $cleanupIds[1529], $cleanupIds[1530], $cleanupIds[1531], $cleanupIds[1532], $cleanupIds[1533], $cleanupIds[1534], $cleanupIds[1535], $cleanupIds[1536], $cleanupIds[1537], $cleanupIds[1538], $cleanupIds[1539], $cleanupIds[1540], $cleanupIds[1541], $cleanupIds[1542], $cleanupIds[1543], $cleanupIds[1544], $cleanupIds[1545], $cleanupIds[1546], $cleanupIds[1547], $cleanupIds[1548], $cleanupIds[1549], $cleanupIds[1550], $cleanupIds[1551], $cleanupIds[1552], $cleanupIds[1553], $cleanupIds[1554], $cleanupIds[1555], $cleanupIds[1556], $cleanupIds[1557], $cleanupIds[1558], $cleanupIds[1559], $cleanupIds[1560], $cleanupIds[1561], $cleanupIds[1562], $cleanupIds[1563], $cleanupIds[1564], $cleanupIds[1565], $cleanupIds[1566], $cleanupIds[1567], $cleanupIds[1568], $cleanupIds[1569], $cleanupIds[1570], $cleanupIds[1571], $cleanupIds[1572], $cleanupIds[1573], $cleanupIds[1574], $cleanupIds[1575], $cleanupIds[1576], $cleanupIds[1577], $cleanupIds[1578], $cleanupIds[1579], $cleanupIds[1580], $cleanupIds[1581], $cleanupIds[1582], $cleanupIds[1583], $cleanupIds[1584], $cleanupIds[1585], $cleanupIds[1586], $cleanupIds[1587], $cleanupIds[1588], $cleanupIds[1589], $cleanupIds[1590], $cleanupIds[1591], $cleanupIds[1592], $cleanupIds[1593], $cleanupIds[1594], $cleanupIds[1595], $cleanupIds[1596], $cleanupIds[1597], $cleanupIds[1598], $cleanupIds[1599], $cleanupIds[1600], $cleanupIds[1601], $cleanupIds[1602], $cleanupIds[1603], $cleanupIds[1604], $cleanupIds[1605], $cleanupIds[1606], $cleanupIds[1607], $cleanupIds[1608], $cleanupIds[1609], $cleanupIds[1610], $cleanupIds[1611], $cleanupIds[1612], $cleanupIds[1613], $cleanupIds[1614], $cleanupIds[1615], $cleanupIds[1616], $cleanupIds[1617], $cleanupIds[1618], $cleanupIds[1619], $cleanupIds[1620], $cleanupIds[1621], $cleanupIds[1622], $cleanupIds[1623], $cleanupIds[1624], $cleanupIds[1625], $cleanupIds[1626], $cleanupIds[1627], $cleanupIds[1628], $cleanupIds[1629], $cleanupIds[1630], $cleanupIds[1631], $cleanupIds[1632], $cleanupIds[1633], $cleanupIds[1634], $cleanupIds[1635], $cleanupIds[1636], $cleanupIds[1637], $cleanupIds[1638], $cleanupIds[1639], $cleanupIds[1640], $cleanupIds[1641], $cleanupIds[1642], $cleanupIds[1643], $cleanupIds[1644], $cleanupIds[1645], $cleanupIds[1646], $cleanupIds[1647], $cleanupIds[1648], $cleanupIds[1649], $cleanupIds[1650], $cleanupIds[1651], $cleanupIds[1652], $cleanupIds[1653], $cleanupIds[1654], $cleanupIds[1655], $cleanupIds[1656], $cleanupIds[1657], $cleanupIds[1658], $cleanupIds[1659], $cleanupIds[1660], $cleanupIds[1661], $cleanupIds[1662], $cleanupIds[1663], $cleanupIds[1664], $cleanupIds[1665], $cleanupIds[1666], $cleanupIds[1667], $cleanupIds[1668], $cleanupIds[1669], $cleanupIds[1670], $cleanupIds[1671], $cleanupIds[1672], $cleanupIds[1673], $cleanupIds[1674], $cleanupIds[1675], $cleanupIds[1676], $cleanupIds[1677], $cleanupIds[1678], $cleanupIds[1679], $cleanupIds[1680], $cleanupIds[1681], $cleanupIds[1682], $cleanupIds[1683], $cleanupIds[1684], $cleanupIds[1685], $cleanupIds[1686], $cleanupIds[1687], $cleanupIds[1688], $cleanupIds[1689], $cleanupIds[1690], $cleanupIds[1691], $cleanupIds[1692], $cleanupIds[1693], $cleanupIds[1694], $cleanupIds[1695], $cleanupIds[1696], $cleanupIds[1697], $cleanupIds[1698], $cleanupIds[1699], $cleanupIds[1700], $cleanupIds[1701], $cleanupIds[1702], $cleanupIds[1703], $cleanupIds[1704], $cleanupIds[1705], $cleanupIds[1706], $cleanupIds[1707], $cleanupIds[1708], $cleanupIds[1709], $cleanupIds[1710], $cleanupIds[1711], $cleanupIds[1712], $cleanupIds[1713], $cleanupIds[1714], $cleanupIds[1715], $cleanupIds[1716], $cleanupIds[1717], $cleanupIds[1718], $cleanupIds[1719], $cleanupIds[1720], $cleanupIds[1721], $cleanupIds[1722], $cleanupIds[1723], $cleanupIds[1724], $cleanupIds[1725], $cleanupIds[1726], $cleanupIds[1727], $cleanupIds[1728], $cleanupIds[1729], $cleanupIds[1730], $cleanupIds[1731], $cleanupIds[1732], $cleanupIds[1733], $cleanupIds[1734], $cleanupIds[1735], $cleanupIds[1736], $cleanupIds[1737], $cleanupIds[1738], $cleanupIds[1739], $cleanupIds[1740], $cleanupIds[1741], $cleanupIds[1742], $cleanupIds[1743], $cleanupIds[1744], $cleanupIds[1745], $cleanupIds[1746], $cleanupIds[1747], $cleanupIds[1748], $cleanupIds[1749], $cleanupIds[1750], $cleanupIds[1751], $cleanupIds[1752], $cleanupIds[1753], $cleanupIds[1754], $cleanupIds[1755], $cleanupIds[1756], $cleanupIds[1757], $cleanupIds[1758], $cleanupIds[1759], $cleanupIds[1760], $cleanupIds[1761], $cleanupIds[1762], $cleanupIds[1763], $cleanupIds[1764], $cleanupIds[1765], $cleanupIds[1766], $cleanupIds[1767], $cleanupIds[1768], $cleanupIds[1769], $cleanupIds[1770], $cleanupIds[1771], $cleanupIds[1772], $cleanupIds[1773], $cleanupIds[1774], $cleanupIds[1775], $cleanupIds[1776], $cleanupIds[1777], $cleanupIds[1778], $cleanupIds[1779], $cleanupIds[1780], $cleanupIds[1781], $cleanupIds[1782], $cleanupIds[1783], $cleanupIds[1784], $cleanupIds[1785], $cleanupIds[1786], $cleanupIds[1787], $cleanupIds[1788], $cleanupIds[1789], $cleanupIds[1790], $cleanupIds[1791], $cleanupIds[1792], $cleanupIds[1793], $cleanupIds[1794], $cleanupIds[1795], $cleanupIds[1796], $cleanupIds[1797], $cleanupIds[1798], $cleanupIds[1799], $cleanupIds[1800], $cleanupIds[1801], $cleanupIds[1802], $cleanupIds[1803], $cleanupIds[1804], $cleanupIds[1805], $cleanupIds[1806], $cleanupIds[1807], $cleanupIds[1808], $cleanupIds[1809], $cleanupIds[1810], $cleanupIds[1811], $cleanupIds[1812], $cleanupIds[1813], $cleanupIds[1814], $cleanupIds[1815], $cleanupIds[1816], $cleanupIds[1817], $cleanupIds[1818], $cleanupIds[1819], $cleanupIds[1820], $cleanupIds[1821], $cleanupIds[1822], $cleanupIds[1823], $cleanupIds[1824], $cleanupIds[1825], $cleanupIds[1826], $cleanupIds[1827], $cleanupIds[1828], $cleanupIds[1829], $cleanupIds[1830], $cleanupIds[1831], $cleanupIds[1832], $cleanupIds[1833], $cleanupIds[1834], $cleanupIds[1835], $cleanupIds[1836], $cleanupIds[1837], $cleanupIds[1838], $cleanupIds[1839], $cleanupIds[1840], $cleanupIds[1841], $cleanupIds[1842], $cleanupIds[1843], $cleanupIds[1844], $cleanupIds[1845], $cleanupIds[1846], $cleanupIds[1847], $cleanupIds[1848], $cleanupIds[1849], $cleanupIds[1850], $cleanupIds[1851], $cleanupIds[1852], $cleanupIds[1853], $cleanupIds[1854], $cleanupIds[1855], $cleanupIds[1856], $cleanupIds[1857], $cleanupIds[1858], $cleanupIds[1859], $cleanupIds[1860], $cleanupIds[1861], $cleanupIds[1862], $cleanupIds[1863], $cleanupIds[1864], $cleanupIds[1865], $cleanupIds[1866], $cleanupIds[1867], $cleanupIds[1868], $cleanupIds[1869], $cleanupIds[1870], $cleanupIds[1871], $cleanupIds[1872], $cleanupIds[1873], $cleanupIds[1874], $cleanupIds[1875], $cleanupIds[1876], $cleanupIds[1877], $cleanupIds[1878], $cleanupIds[1879], $cleanupIds[1880], $cleanupIds[1881], $cleanupIds[1882], $cleanupIds[1883], $cleanupIds[1884], $cleanupIds[1885], $cleanupIds[1886], $cleanupIds[1887], $cleanupIds[1888], $cleanupIds[1889], $cleanupIds[1890], $cleanupIds[1891], $cleanupIds[1892], $cleanupIds[1893], $cleanupIds[1894], $cleanupIds[1895], $cleanupIds[1896], $cleanupIds[1897], $cleanupIds[1898], $cleanupIds[1899], $cleanupIds[1900], $cleanupIds[1901], $cleanupIds[1902], $cleanupIds[1903], $cleanupIds[1904], $cleanupIds[1905], $cleanupIds[1906], $cleanupIds[1907], $cleanupIds[1908], $cleanupIds[1909], $cleanupIds[1910], $cleanupIds[1911], $cleanupIds[1912], $cleanupIds[1913], $cleanupIds[1914], $cleanupIds[1915], $cleanupIds[1916], $cleanupIds[1917], $cleanupIds[1918], $cleanupIds[1919], $cleanupIds[1920], $cleanupIds[1921], $cleanupIds[1922], $cleanupIds[1923], $cleanupIds[1924], $cleanupIds[1925], $cleanupIds[1926], $cleanupIds[1927], $cleanupIds[1928], $cleanupIds[1929], $cleanupIds[1930], $cleanupIds[1931], $cleanupIds[1932], $cleanupIds[1933], $cleanupIds[1934], $cleanupIds[1935], $cleanupIds[1936], $cleanupIds[1937], $cleanupIds[1938], $cleanupIds[1939], $cleanupIds[1940], $cleanupIds[1941], $cleanupIds[1942], $cleanupIds[1943], $cleanupIds[1944], $cleanupIds[1945], $cleanupIds[1946], $cleanupIds[1947], $cleanupIds[1948], $cleanupIds[1949], $cleanupIds[1950], $cleanupIds[1951], $cleanupIds[1952], $cleanupIds[1953], $cleanupIds[1954], $cleanupIds[1955], $cleanupIds[1956], $cleanupIds[1957], $cleanupIds[1958], $cleanupIds[1959], $cleanupIds[1960], $cleanupIds[1961], $cleanupIds[1962], $cleanupIds[1963], $cleanupIds[1964], $cleanupIds[1965], $cleanupIds[1966], $cleanupIds[1967], $cleanupIds[1968], $cleanupIds[1969], $cleanupIds[1970], $cleanupIds[1971], $cleanupIds[1972], $cleanupIds[1973], $cleanupIds[1974], $cleanupIds[1975], $cleanupIds[1976], $cleanupIds[1977], $cleanupIds[1978], $cleanupIds[1979], $cleanupIds[1980], $cleanupIds[1981], $cleanupIds[1982], $cleanupIds[1983], $cleanupIds[1984], $cleanupIds[1985], $cleanupIds[1986], $cleanupIds[1987], $cleanupIds[1988], $cleanupIds[1989], $cleanupIds[1990], $cleanupIds[1991], $cleanupIds[1992], $cleanupIds[1993], $cleanupIds[1994], $cleanupIds[1995], $cleanupIds[1996], $cleanupIds[1997], $cleanupIds[1998], $cleanupIds[1999], $cleanupIds[2000], $cleanupIds[2001], $cleanupIds[2002], $cleanupIds[2003], $cleanupIds[2004], $cleanupIds[2005], $cleanupIds[2006]); - - /* execute query */ - $stmt->execute(); - - /* close statement */ - $stmt->close(); - } - - mysqli_close($link); - print "done!"; -?> ---CLEAN-- - ---EXPECTF-- -done! diff --git a/ext/mysqlnd/CREDITS b/ext/mysqlnd/CREDITS index 5a7d69d665b7..5aed316e896f 100644 --- a/ext/mysqlnd/CREDITS +++ b/ext/mysqlnd/CREDITS @@ -1,2 +1,2 @@ MySQLnd -Andrey Hristov, Ulf Wendel, Georg Richter, Johannes Schlüter +Andrey Hristov, Ulf Wendel, Georg Richter diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 index 0e08b977af94..3fc767b231d6 100644 --- a/ext/mysqlnd/config9.m4 +++ b/ext/mysqlnd/config9.m4 @@ -8,11 +8,11 @@ PHP_ARG_ENABLE(mysqlnd, whether to enable mysqlnd, PHP_ARG_ENABLE(mysqlnd_compression_support, whether to disable compressed protocol support in mysqlnd, [ --disable-mysqlnd-compression-support - Disable support for the MySQL compressed protocol in mysqlnd], yes, no) + Disable support for the MySQL compressed protocol in mysqlnd], yes, no) if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, - [ --with-zlib-dir[=DIR] mysqlnd: Set the path to libz install prefix], no, no) + [ --with-zlib-dir[=DIR] mysqlnd: Set the path to libz install prefix], no, no) fi dnl If some extension uses mysqlnd it will get compiled in PHP core @@ -48,4 +48,16 @@ fi if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes" || test "$PHP_MYSQLI" != "no"; then PHP_ADD_BUILD_DIR([ext/mysqlnd], 1) + + dnl This creates a file so it has to be after above macros + PHP_CHECK_TYPES([int8 uint8 int16 uint16 int32 uint32 uchar ulong int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t], [ + ext/mysqlnd/php_mysqlnd_config.h + ],[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif + ]) fi diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index b41e5424f590..724876e899d4 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1180,7 +1180,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query); - enum_func_status ret = FAIL; + enum_func_status ret; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); @@ -1225,7 +1225,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC #include "php_network.h" -/* {{{ mysqlnd_stream_array_to_fd_set */ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC) { int cnt = 0; @@ -1256,17 +1255,14 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS } return ret; } -/* }}} */ -/* {{{ mysqlnd_stream_array_to_fd_set */ +/* {{{ stream_select mysqlnd_stream_array_to_fd_set functions */ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC) { php_socket_t this_fd; - php_stream *stream = NULL; - unsigned int cnt = 0; + int cnt = 0; MYSQLND **p = conn_array; - DBG_ENTER("mysqlnd_stream_array_to_fd_set"); while (*p) { /* get the fd. @@ -1274,9 +1270,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC); - DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream); - if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + if (SUCCESS == php_stream_cast((*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { PHP_SAFE_FD_SET(this_fd, fds); @@ -1288,25 +1282,20 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p } p++; } - DBG_RETURN(cnt ? 1 : 0); + return cnt ? 1 : 0; } -/* }}} */ - -/* {{{ mysqlnd_stream_array_from_fd_set */ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC) { php_socket_t this_fd; - php_stream *stream = NULL; int ret = 0; zend_bool disproportion = FALSE; + + MYSQLND **fwd = conn_array, **bckwd = conn_array; - DBG_ENTER("mysqlnd_stream_array_from_fd_set"); while (*fwd) { - stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC); - DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream); - if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + if (SUCCESS == php_stream_cast((*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { if (disproportion) { @@ -1323,7 +1312,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds } *bckwd = NULL;/* NULL-terminate the list */ - DBG_RETURN(ret); + return ret; } /* }}} */ @@ -1466,7 +1455,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c } if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) { - DBG_ERR("Error occurred while reading metadata"); + DBG_ERR("Error ocurred while reading metadata"); result->m.free_result(result, TRUE TSRMLS_CC); result = NULL; break; @@ -1598,7 +1587,7 @@ static ulong MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string); - ulong ret = FAIL; + ulong ret; DBG_ENTER("mysqlnd_conn_data::escape_string"); DBG_INF_FMT("conn=%llu", conn->thread_id); diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index c9127ef93c0c..4ace69adcf9a 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -104,7 +104,7 @@ #define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION | \ - CLIENT_MULTI_RESULTS | CLIENT_LOCAL_FILES | CLIENT_PLUGIN_AUTH) + CLIENT_MULTI_RESULTS | CLIENT_PS_MULTI_RESULTS | CLIENT_LOCAL_FILES | CLIENT_PLUGIN_AUTH) #define MYSQLND_NET_FLAG_USE_COMPRESSION 1 diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index fabceb4c8d66..ba2b1745ef49 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -805,7 +805,7 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum /* Switch to non-blocking mode and try to consume something from the line, if possible, then continue. This saves us from looking for - the actual place where out-of-order packets have been sent. + the actuall place where out-of-order packets have been sent. If someone is completely sure that everything is fine, he can switch it off. */ diff --git a/ext/mysqlnd/mysqlnd_portability.h b/ext/mysqlnd/mysqlnd_portability.h index 72a156a79500..b9479150ae03 100644 --- a/ext/mysqlnd/mysqlnd_portability.h +++ b/ext/mysqlnd/mysqlnd_portability.h @@ -36,6 +36,8 @@ This file is public domain and comes with NO WARRANTY of any kind */ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) # include "ext/mysqlnd/config-win.h" +#else +# include #endif /* _WIN32... */ #if __STDC_VERSION__ < 199901L && !defined(atoll) @@ -43,7 +45,14 @@ This file is public domain and comes with NO WARRANTY of any kind */ #define atoll atol #endif -#include "php_stdint.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) #define _LONG_LONG 1 /* For AIX string library */ @@ -61,6 +70,102 @@ This file is public domain and comes with NO WARRANTY of any kind */ #define HAVE_LONG_LONG 1 #endif + +/* Typdefs for easyier portability */ +#ifndef HAVE_INT8_T +#ifndef HAVE_INT8 +typedef signed char int8_t; /* Signed integer >= 8 bits */ +#else +typedef int8 int8_t; /* Signed integer >= 8 bits */ +#endif +#endif + +#ifndef HAVE_UINT8_T +#ifndef HAVE_UINT8 +typedef unsigned char uint8_t; /* Unsigned integer >= 8 bits */ +#else +typedef uint8 uint8_t; /* Signed integer >= 8 bits */ +#endif +#endif + +#ifndef HAVE_INT16_T +#ifndef HAVE_INT16 +typedef signed short int16_t; /* Signed integer >= 16 bits */ +#else +typedef int16 int16_t; /* Signed integer >= 16 bits */ +#endif +#endif + +#ifndef HAVE_UINT16_T +#ifndef HAVE_UINT16 +typedef unsigned short uint16_t; /* Signed integer >= 16 bits */ +#else +typedef uint16 uint16_t; /* Signed integer >= 16 bits */ +#endif +#endif + + +#ifndef HAVE_INT32_T +#ifdef HAVE_INT32 +typedef int32 int32_t; +#elif SIZEOF_INT == 4 +typedef signed int int32_t; +#elif SIZEOF_LONG == 4 +typedef signed long int32_t; +#else +error "Neither int nor long is of 4 bytes width" +#endif +#endif /* HAVE_INT32_T */ + +#ifndef HAVE_UINT32_T +#ifdef HAVE_UINT32 +typedef uint32 uint32_t; +#elif SIZEOF_INT == 4 +typedef unsigned int uint32_t; +#elif SIZEOF_LONG == 4 +typedef unsigned long uint32_t; +#else +#error "Neither int nor long is of 4 bytes width" +#endif +#endif /* HAVE_UINT32_T */ + +#ifndef HAVE_INT64_T +#ifdef HAVE_INT64 +typedef int64 int64_t; +#elif SIZEOF_INT == 8 +typedef signed int int64_t; +#elif SIZEOF_LONG == 8 +typedef signed long int64_t; +#elif SIZEOF_LONG_LONG == 8 +#ifdef PHP_WIN32 +typedef __int64 int64_t; +#else +typedef signed long long int64_t; +#endif +#else +#error "Neither int nor long nor long long is of 8 bytes width" +#endif +#endif /* HAVE_INT64_T */ + +#ifndef HAVE_UINT64_T +#ifdef HAVE_UINT64 +typedef uint64 uint64_t; +#elif SIZEOF_INT == 8 +typedef unsigned int uint64_t; +#elif SIZEOF_LONG == 8 +typedef unsigned long uint64_t; +#elif SIZEOF_LONG_LONG == 8 +#ifdef PHP_WIN32 +typedef unsigned __int64 uint64_t; +#else +typedef unsigned long long uint64_t; +#endif +#else +#error "Neither int nor long nor long long is of 8 bytes width" +#endif +#endif /* HAVE_INT64_T */ + + #ifdef PHP_WIN32 #define MYSQLND_LLU_SPEC "%I64u" #define MYSQLND_LL_SPEC "%I64d" diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index d8ad06c60810..9961d68e4383 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -559,7 +559,6 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar *p += null_count; } - left = (*buf_len - (*p - *buf)); /* 1. Store type information */ /* check if need to send the types even if stmt->send_types_to_server is 0. This is because diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 20d941e05b6f..b4725feb2b7e 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -486,7 +486,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s mnd_efree(conn->current_result); conn->current_result = NULL; } - DBG_ERR("Error occurred while reading metadata"); + DBG_ERR("Error ocurred while reading metadata"); break; } @@ -498,7 +498,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s break; } if (FAIL == (ret = PACKET_READ(fields_eof, conn))) { - DBG_ERR("Error occurred while reading the EOF packet"); + DBG_ERR("Error ocurred while reading the EOF packet"); result->m.free_result_contents(result TSRMLS_CC); mnd_efree(result); if (!stmt) { diff --git a/ext/oci8/README b/ext/oci8/README index af5beeb5c074..420d5dac58e4 100644 --- a/ext/oci8/README +++ b/ext/oci8/README @@ -6,8 +6,8 @@ Use the OCI8 extension to access Oracle Database. Documentation is at http://php.net/oci8 The extension can be built with PHP versions 4.3.9 to 5.x using Oracle -Database 9.2, 10, 11 or 12 client libraries. Oracle's standard -cross-version connectivity applies. For example PHP linked with -Oracle 11.2 client libraries can connect to Oracle Database 9.2 -onwards. See Oracle's note "Oracle Client / Server Interoperability -Support" (ID 207303.1) for details. +9.2, 10, or 11 client libraries. Oracle's standard cross-version +connectivity applies. For example PHP linked with Oracle 11.2 client +libraries can connect to Oracle Database 9.2 onwards. See Oracle's +note "Oracle Client / Server Interoperability Support" (ID 207303.1) +for details. diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index 49998d18f08b..34ae76c44b02 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -15,6 +15,22 @@ else PHP_OCI8_TAIL1="tail -1" fi +AC_DEFUN([PHP_OCI_IF_DEFINED],[ + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$3 + AC_EGREP_CPP(yes,[ +#include +#if defined($1) + yes +#endif + ],[ + CPPFLAGS=$old_CPPFLAGS + $2 + ],[ + CPPFLAGS=$old_CPPFLAGS + ]) +]) + AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[ AC_MSG_CHECKING([ORACLE_HOME library validity]) if test ! -d "$OCI8_DIR"; then @@ -82,99 +98,13 @@ AC_DEFUN([AC_OCI8_ORACLE_VERSION],[ AC_MSG_RESULT($OCI8_ORACLE_VERSION) ]) -dnl -dnl OCI8_INIT_DTRACE(providerdesc, header-file, sources) -dnl This mimics PHP_INIT_DTRACE from PHP 5.4's acinclude.m4. It is -dnl necessarily different from PHP_INIT_DTRACE which doesn't currently -dnl support DTrace for extensions. Creating OCI8_INIT_DTRACE -dnl independently instead of using a refactored PHP_INIT_DTRACE allows -dnl OCI8 to be DTraced on versions of PHP where core PHP DTrace support -dnl isn't available. -dnl -AC_DEFUN([OCI8_INIT_DTRACE],[ - ac_srcdir=[]PHP_EXT_SRCDIR([oci8])/ - ac_bdir=[]PHP_EXT_BUILDDIR([oci8])/ - -dnl providerdesc - ac_provsrc=$1 - -dnl header-file - ac_hdrobj=$2 - -dnl DTrace objects - old_IFS=[$]IFS - for ac_src in $3; do - IFS=. - set $ac_src - ac_obj=[$]1 - IFS=$old_IFS - - OCI8_DTRACE_OBJS="[$]OCI8_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" - done; - - for ac_lo in $OCI8_DTRACE_OBJS; do - dtrace_oci8_objs="[$]dtrace_oci8_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" - done; - -dnl Generate Makefile.objects entry -dnl The empty $ac_provsrc command stops an implicit circular dependency -dnl in GNU Make which causes the .d file to be overwritten (Bug 61268) - cat>>Makefile.objects< \$[]@ - -\$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj - -EOF - - case $host_alias in - *solaris*|*linux*) - dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o" - dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs" - dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o" - dtrace_nolib_objs='$(OCI8_DTRACE_OBJS:.lo=.o)' - for ac_lo in $OCI8_DTRACE_OBJS; do - dtrace_oci8_lib_objs="[$]dtrace_oci8_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" - done; -dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692) - cat>>Makefile.objects< \$[]@ - @test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir - if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\] - echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "pic_object='none'" >> \$[]@ [;\\] - fi - if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\] - echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\] - else [\\] - echo "non_pic_object='none'" >> \$[]@ [;\\] - fi - -EOF - ;; - *) - AC_MSG_WARN([OCI8 extension: OCI8 DTrace support is not confirmed on this platform]) -cat>>Makefile.objects< | + | Authors: Stig Sæther Bakken | | Thies C. Arntzen | | Maxim Maletsky | | | @@ -37,6 +37,13 @@ #include "php_ini.h" #include "ext/standard/php_smart_str.h" +#ifdef HAVE_STDINT_H +#include +#endif +#ifdef PHP_WIN32 +#include "win32/php_stdint.h" +#endif + #if HAVE_OCI8 #if PHP_MAJOR_VERSION > 5 @@ -51,17 +58,11 @@ #include "php_oci8_int.h" #include "zend_hash.h" -#if defined(__PTRDIFF_TYPE__) -# define OCI8_INT_TO_PTR(I) ((void*)(__PTRDIFF_TYPE__)(I)) -# define OCI8_PTR_TO_INT(P) ((int)(__PTRDIFF_TYPE__)(P)) -#elif !defined(__GNUC__) -#define OCI8_INT_TO_PTR(I) ((void*)&((char*)0)[I]) -#define OCI8_PTR_TO_INT(P) ((int)(((char*)P)-(char*)0)) -#elif defined(HAVE_STDINT_H) -#define OCI8_INT_TO_PTR(I) ((void*)(intptr_t)(I)) +#if defined(HAVE_STDINT_H) || defined(PHP_WIN32) +#define OCI8_INT_TO_PTR(I) ((void *)(intptr_t)(I)) #define OCI8_PTR_TO_INT(P) ((int)(intptr_t)(P)) #else -#define OCI8_INT_TO_PTR(I) ((void*)(I)) +#define OCI8_INT_TO_PTR(I) ((void *)(I)) #define OCI8_PTR_TO_INT(P) ((int)(P)) #endif @@ -127,7 +128,7 @@ zend_class_entry *oci_coll_class_entry_ptr; #define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT) #endif -/* {{{ static protos */ +/* static protos {{{ */ static void php_oci_connection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); static void php_oci_pconnection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC); static void php_oci_pconnection_list_np_dtor (zend_rsrc_list_entry * TSRMLS_DC); @@ -424,10 +425,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_parse, 0, 0, 2) ZEND_ARG_INFO(0, sql_text) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_get_implicit_resultset, 0, 0, 1) -ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_prefetch, 0, 0, 2) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_INFO(0, number_of_rows) @@ -701,7 +698,6 @@ static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_N #define arginfo_oci_error NULL #define arginfo_oci_num_fields NULL #define arginfo_oci_parse NULL -#define arginfo_oci_get_implicit_resultset NULL #define arginfo_oci_set_prefetch NULL #define arginfo_oci_set_client_identifier NULL #define arginfo_oci_set_edition NULL @@ -790,7 +786,6 @@ PHP_FUNCTION(oci_rollback); PHP_FUNCTION(oci_new_descriptor); PHP_FUNCTION(oci_num_fields); PHP_FUNCTION(oci_parse); -PHP_FUNCTION(oci_get_implicit_resultset); PHP_FUNCTION(oci_new_cursor); PHP_FUNCTION(oci_result); PHP_FUNCTION(oci_client_version); @@ -867,7 +862,6 @@ zend_function_entry php_oci_functions[] = { PHP_FE(oci_internal_debug, arginfo_oci_internal_debug) PHP_FE(oci_num_fields, arginfo_oci_num_fields) PHP_FE(oci_parse, arginfo_oci_parse) - PHP_FE(oci_get_implicit_resultset, arginfo_oci_get_implicit_resultset) PHP_FE(oci_new_cursor, arginfo_oci_new_cursor) PHP_FE(oci_result, arginfo_oci_result) PHP_FE(oci_client_version, arginfo_oci_client_version) @@ -1061,12 +1055,8 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, ONUPDATELONGFUNC, statement_cache_size, zend_oci_globals, oci_globals) STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, ONUPDATELONGFUNC, default_prefetch, zend_oci_globals, oci_globals) STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics,zend_oci_globals, oci_globals) -#if (OCI_MAJOR_VERSION >= 11) STD_PHP_INI_ENTRY( "oci8.connection_class", "", PHP_INI_ALL, OnUpdateString, connection_class, zend_oci_globals, oci_globals) -#endif -#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) STD_PHP_INI_BOOLEAN("oci8.events", "0", PHP_INI_SYSTEM, OnUpdateBool, events, zend_oci_globals, oci_globals) -#endif PHP_INI_END() /* }}} */ @@ -1142,8 +1132,7 @@ static void php_oci_init_global_handles(TSRMLS_D) } } } -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_cleanup_global_handles() * @@ -1160,8 +1149,7 @@ static void php_oci_cleanup_global_handles(TSRMLS_D) PHP_OCI_CALL(OCIHandleFree, ((dvoid *) OCI_G(env), OCI_HTYPE_ENV)); OCI_G(env) = NULL; } -} -/* }}} */ +} /* }}} */ /* {{{ PHP_GINIT_FUNCTION * @@ -1306,6 +1294,7 @@ PHP_MINIT_FUNCTION(oci) PHP_RINIT_FUNCTION(oci) { + OCI_G(debug_mode) = 0; /* start "fresh" */ OCI_G(num_links) = OCI_G(num_persistent); OCI_G(errcode) = 0; OCI_G(edition) = NULL; @@ -1347,26 +1336,22 @@ PHP_RSHUTDOWN_FUNCTION(oci) PHP_MINFO_FUNCTION(oci) { char buf[32]; -#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) char *ver; -#endif php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); -#if defined(HAVE_OCI8_DTRACE) - php_info_print_table_row(2, "OCI8 DTrace Support", "enabled"); -#else - php_info_print_table_row(2, "OCI8 DTrace Support", "disabled"); -#endif - php_info_print_table_row(2, "OCI8 Version", PHP_OCI8_VERSION); + php_info_print_table_row(2, "Version", PHP_OCI8_VERSION); php_info_print_table_row(2, "Revision", "$Id$"); + snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); + php_info_print_table_row(2, "Active Persistent Connections", buf); + snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links)); + php_info_print_table_row(2, "Active Connections", buf); + #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) php_oci_client_get_version(&ver TSRMLS_CC); php_info_print_table_row(2, "Oracle Run-time Client Library Version", ver); efree(ver); -#else - php_info_print_table_row(2, "Oracle Run-time Client Library Version", "Unknown"); #endif #if defined(OCI_MAJOR_VERSION) && defined(OCI_MINOR_VERSION) snprintf(buf, sizeof(buf), "%d.%d", OCI_MAJOR_VERSION, OCI_MINOR_VERSION); @@ -1376,9 +1361,9 @@ PHP_MINFO_FUNCTION(oci) snprintf(buf, sizeof(buf), "Unknown"); #endif #if defined(HAVE_OCI_INSTANT_CLIENT) - php_info_print_table_row(2, "Oracle Compile-time Instant Client Version", buf); + php_info_print_table_row(2, "Oracle Instant Client Version", buf); #else - php_info_print_table_row(2, "Oracle Compile-time Version", buf); + php_info_print_table_row(2, "Oracle Version", buf); #endif #if !defined(PHP_WIN32) && !defined(HAVE_OCI_INSTANT_CLIENT) @@ -1390,22 +1375,14 @@ PHP_MINFO_FUNCTION(oci) #endif #endif - + php_info_print_table_row(2, "Temporary Lob support", "enabled"); + php_info_print_table_row(2, "Collections support", "enabled"); php_info_print_table_end(); - DISPLAY_INI_ENTRIES(); - - php_info_print_table_start(); - php_info_print_table_header(2, "Statistics", ""); - snprintf(buf, sizeof(buf), "%ld", OCI_G(num_persistent)); - php_info_print_table_row(2, "Active Persistent Connections", buf); - snprintf(buf, sizeof(buf), "%ld", OCI_G(num_links)); - php_info_print_table_row(2, "Active Connections", buf); - php_info_print_table_end(); } /* }}} */ -/* {{{ list destructors */ +/* list destructors {{{ */ /* {{{ php_oci_connection_list_dtor() * @@ -1419,8 +1396,7 @@ static void php_oci_connection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) php_oci_connection_close(connection TSRMLS_CC); OCI_G(num_links)--; } -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_pconnection_list_dtor() * @@ -1435,8 +1411,7 @@ static void php_oci_pconnection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) OCI_G(num_persistent)--; OCI_G(num_links)--; } -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_pconnection_list_np_dtor() * @@ -1474,12 +1449,11 @@ static void php_oci_pconnection_list_np_dtor(zend_rsrc_list_entry *entry TSRMLS_ OCI_G(num_persistent)--; } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_P_DTOR_CLOSE_ENABLED()) { - DTRACE_OCI8_CONNECT_P_DTOR_CLOSE(connection); + if (OCI_G(debug_mode)) { + php_printf ("OCI8 DEBUG L1: np_dtor cleaning up: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); } -#endif /* HAVE_OCI8_DTRACE */ - } else { + } + else { /* * Release the connection to underlying pool. We do this unconditionally so that * out-of-scope pconnects are now consistent with oci_close and out-of-scope new connect @@ -1491,14 +1465,11 @@ static void php_oci_pconnection_list_np_dtor(zend_rsrc_list_entry *entry TSRMLS_ */ php_oci_connection_release(connection TSRMLS_CC); -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_P_DTOR_RELEASE_ENABLED()) { - DTRACE_OCI8_CONNECT_P_DTOR_RELEASE(connection); + if (OCI_G(debug_mode)) { + php_printf ("OCI8 DEBUG L1: np_dtor releasing: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); } -#endif /* HAVE_OCI8_DTRACE */ } -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_statement_list_dtor() * @@ -1508,8 +1479,7 @@ static void php_oci_statement_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) { php_oci_statement *statement = (php_oci_statement *)entry->ptr; php_oci_statement_free(statement TSRMLS_CC); -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_descriptor_list_dtor() * @@ -1519,8 +1489,7 @@ static void php_oci_descriptor_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) { php_oci_descriptor *descriptor = (php_oci_descriptor *)entry->ptr; php_oci_lob_free(descriptor TSRMLS_CC); -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_list_dtor() * @@ -1530,12 +1499,11 @@ static void php_oci_collection_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) { php_oci_collection *collection = (php_oci_collection *)entry->ptr; php_oci_collection_close(collection TSRMLS_CC); -} -/* }}} */ +} /* }}} */ /* }}} */ -/* {{{ Hash Destructors */ +/* Hash Destructors {{{ */ /* {{{ php_oci_define_hash_dtor() * @@ -1637,17 +1605,18 @@ void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_D } /* }}} */ + /* {{{ php_oci_error() * * Fetch & print out error message if we get an error * Returns an Oracle error number */ -sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC) +sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC) { text *errbuf = (text *)NULL; - sb4 errcode = 0; /* Oracle error number */ + sb4 errcode = 0; - switch (errstatus) { + switch (status) { case OCI_SUCCESS: break; case OCI_SUCCESS_WITH_INFO: @@ -1690,16 +1659,9 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC) php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CONTINUE"); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", errstatus); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", status); break; } - -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_ERROR_ENABLED()) { - DTRACE_OCI8_ERROR((int)errstatus, (long)errcode); - } -#endif /* HAVE_OCI8_DTRACE */ - return errcode; } /* }}} */ @@ -1728,8 +1690,7 @@ sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC) } } return error_code; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_fetch_sqltext_offset() * @@ -1757,8 +1718,7 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u return 1; } return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_do_connect() * @@ -1778,32 +1738,18 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus return; } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_ENTRY_ENABLED()) { - DTRACE_OCI8_CONNECT_ENTRY(username, dbname, charset, session_mode, persistent, exclusive); - } -#endif /* HAVE_OCI8_DTRACE */ - if (!charset_len) { charset = NULL; } connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC); -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_RETURN_ENABLED()) { - DTRACE_OCI8_CONNECT_RETURN(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - - if (!connection) { RETURN_FALSE; } - RETURN_RESOURCE(connection->id); + RETURN_RESOURCE(connection->rsrc_id); -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_do_connect_ex() * @@ -1962,11 +1908,16 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char } } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_LOOKUP_ENABLED()) { - DTRACE_OCI8_CONNECT_LOOKUP(connection, connection && connection->is_stub ? 1 : 0); - } -#endif /* HAVE_OCI8_DTRACE */ + /* Debug statements {{{ */ + if (OCI_G(debug_mode)) { + if (connection && connection->is_stub) { + php_printf ("OCI8 DEBUG L1: Got a cached stub: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); + } else if (connection) { + php_printf ("OCI8 DEBUG L1: Got a cached connection: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); + } else { + php_printf ("OCI8 DEBUG L1: Got NO cached connection at (%s:%d) \n", __FILE__, __LINE__); + } + } /* }}} */ /* If we got a pconnection stub, then 'load'(OCISessionGet) the real connection from its * private spool A connection is a stub if it is only a cached structure and the real @@ -2012,20 +1963,24 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* okay, the connection is open and the server is still alive */ connection->used_this_request = 1; - tmp = (php_oci_connection *)zend_list_find(connection->id, &rsrc_type); + tmp = (php_oci_connection *)zend_list_find(connection->rsrc_id, &rsrc_type); if (tmp != NULL && rsrc_type == le_pconnection && strlen(tmp->hash_key) == hashed_details.len && - memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->id) == SUCCESS) { + memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) { /* do nothing */ } else { - PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) + connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC); +#else + connection->rsrc_id = zend_list_insert(connection, le_pconnection); +#endif /* Persistent connections: For old close semantics we artificially * bump up the refcount to prevent the non-persistent destructor * from getting called until request shutdown. The refcount is * decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - zend_list_addref(connection->id); + zend_list_addref(connection->rsrc_id); } } smart_str_free_ex(&hashed_details, 0); @@ -2036,7 +1991,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char } else { /* we do not ping non-persistent connections */ smart_str_free_ex(&hashed_details, 0); - zend_list_addref(connection->id); + zend_list_addref(connection->rsrc_id); return connection; } } /* is_open is true? */ @@ -2053,7 +2008,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* We have to do a hash_del but need to preserve the resource if there is a positive * refcount. Set the data pointer in the list entry to NULL */ - if (connection == zend_list_find(connection->id, &rsrc_type) && rsrc_type == le_pconnection) { + if (connection == zend_list_find(connection->rsrc_id, &rsrc_type) && rsrc_type == le_pconnection) { le->ptr = NULL; } @@ -2130,8 +2085,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char smart_str_free_ex(&hashed_details, 0); return NULL; } - } - /* }}} */ + } /* }}} */ connection->idle_expiry = (OCI_G(persistent_timeout) > 0) ? (timestamp + OCI_G(persistent_timeout)) : 0; @@ -2170,34 +2124,50 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char new_le.ptr = connection; new_le.type = le_pconnection; connection->used_this_request = 1; - PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) + connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC); +#else + connection->rsrc_id = zend_list_insert(connection, le_pconnection); +#endif /* Persistent connections: For old close semantics we artificially bump up the refcount to * prevent the non-persistent destructor from getting called until request shutdown. The * refcount is decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - zend_list_addref(connection->id); + zend_list_addref(connection->rsrc_id); } zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); OCI_G(num_persistent)++; OCI_G(num_links)++; } else if (!exclusive) { - PHP_OCI_REGISTER_RESOURCE(connection, le_connection); - new_le.ptr = OCI8_INT_TO_PTR(connection->id); +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) + connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC); +#else + connection->rsrc_id = zend_list_insert(connection, le_connection); +#endif + new_le.ptr = OCI8_INT_TO_PTR(connection->rsrc_id); new_le.type = le_index_ptr; zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL); OCI_G(num_links)++; } else { - PHP_OCI_REGISTER_RESOURCE(connection, le_connection); +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) + connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC); +#else + connection->rsrc_id = zend_list_insert(connection, le_connection); +#endif OCI_G(num_links)++; } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_TYPE_ENABLED()) { - DTRACE_OCI8_CONNECT_TYPE(connection->is_persistent ? 1 : 0, exclusive ? 1 : 0, connection, OCI_G(num_persistent), OCI_G(num_links)); - } -#endif /* HAVE_OCI8_DTRACE */ + /* Debug statements {{{ */ + if (OCI_G(debug_mode)) { + if (connection->is_persistent) { + php_printf ("OCI8 DEBUG L1: New Persistent Connection address: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); + } else { + php_printf ("OCI8 DEBUG L1: New Non-Persistent Connection address: (%p) at (%s:%d) \n", connection, __FILE__, __LINE__); + } + php_printf ("OCI8 DEBUG L1: num_persistent=(%ld), num_links=(%ld) at (%s:%d) \n", OCI_G(num_persistent), OCI_G(num_links), __FILE__, __LINE__); + } /* }}} */ return connection; } @@ -2209,24 +2179,20 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char */ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) { - sword errstatus; - - OCI_G(errcode) = 0; /* assume ping is successful */ - /* Use OCIPing instead of OCIServerVersion. If OCIPing returns ORA-1010 (invalid OCI operation) * such as from Pre-10.1 servers, the error is still from the server and we would have * successfully performed a roundtrip and validated the connection. Use OCIServerVersion for * Pre-10.2 clients */ #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIPing available 10.2 onwards */ - PHP_OCI_CALL_RETURN(errstatus, OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT)); #else char version[256]; /* use good old OCIServerVersion() */ - PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, OCI_G(err), (text *)version, sizeof(version), OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion, (connection->svc, OCI_G(err), (text *)version, sizeof(version), OCI_HTYPE_SVCCTX)); #endif - if (errstatus == OCI_SUCCESS) { + if (OCI_G(errcode) == OCI_SUCCESS) { return 1; } else { sb4 error_code = 0; @@ -2237,9 +2203,10 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) if (error_code == 1010) { return 1; } - OCI_G(errcode) = error_code; } + /* ignore errors here, just return failure + * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ return 0; } /* }}} */ @@ -2250,17 +2217,17 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC) */ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC) { - ub4 ss = OCI_SERVER_NOT_CONNECTED; - sword errstatus; + ub4 ss = 0; /* get OCI_ATTR_SERVER_STATUS */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->server, OCI_HTYPE_SERVER, (dvoid *)&ss, (ub4 *)0, OCI_ATTR_SERVER_STATUS, OCI_G(err))); - if (errstatus == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { + if (OCI_G(errcode) == OCI_SUCCESS && ss == OCI_SERVER_NORMAL) { return 1; } - /* ignore errors here, just return failure */ + /* ignore errors here, just return failure + * php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); */ return 0; } /* }}} */ @@ -2271,20 +2238,16 @@ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC) */ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC) { - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCITransRollback, (connection->svc, connection->err, (ub4) 0)); - connection->rb_on_disconnect = 0; + PHP_OCI_CALL_RETURN(connection->errcode, OCITransRollback, (connection->svc, connection->err, (ub4) 0)); + connection->needs_commit = 0; - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_connection_commit() * @@ -2292,20 +2255,16 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC) */ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC) { - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCITransCommit, (connection->svc, connection->err, (ub4) 0)); - connection->rb_on_disconnect = 0; + PHP_OCI_CALL_RETURN(connection->errcode, OCITransCommit, (connection->svc, connection->err, (ub4) 0)); + connection->needs_commit = 0; - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_connection_close() * @@ -2316,19 +2275,13 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) int result = 0; zend_bool in_call_save = OCI_G(in_call); -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECTION_CLOSE_ENABLED()) { - DTRACE_OCI8_CONNECTION_CLOSE(connection); - } -#endif /* HAVE_OCI8_DTRACE */ - if (!connection->is_stub) { /* Release resources associated with connection */ php_oci_connection_release(connection TSRMLS_CC); } if (!connection->using_spool && connection->svc) { - PHP_OCI_CALL(OCISessionEnd, (connection->svc, connection->err, connection->session, (ub4) 0)); + PHP_OCI_CALL(OCISessionEnd, (connection->svc, connection->err, connection->session, (ub4) 0)); } if (connection->err) { @@ -2349,7 +2302,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) } if (connection->svc) { - PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL(OCIHandleFree, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX)); } if (connection->server) { @@ -2380,8 +2333,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC) connection = NULL; OCI_G(in_call) = in_call_save; return result; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_connection_release() * @@ -2405,7 +2357,7 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) if (connection->svc) { /* rollback outstanding transactions */ - if (connection->rb_on_disconnect) { + if (connection->needs_commit) { if (php_oci_connection_rollback(connection TSRMLS_CC)) { /* rollback failed */ result = 1; @@ -2456,7 +2408,7 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) connection->server = NULL; connection->session = NULL; - connection->is_attached = connection->is_open = connection->rb_on_disconnect = connection->used_this_request = 0; + connection->is_attached = connection->is_open = connection->needs_commit = connection->used_this_request = 0; connection->is_stub = 1; /* Cut the link between the connection structure and the time_t structure allocated within @@ -2467,8 +2419,7 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) OCI_G(in_call) = in_call_save; return result; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_password_change() * @@ -2476,20 +2427,17 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC) */ int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC) { - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ connection->passwd_changed = 1; return 0; -} -/* }}} */ +} /* }}} */ + /* {{{ php_oci_client_get_version() * @@ -2498,21 +2446,21 @@ int php_oci_password_change(php_oci_connection *connection, char *user, int user void php_oci_client_get_version(char **version TSRMLS_DC) { char version_buff[256]; -#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIClientVersion only available 10.2 onwards */ sword major_version = 0; sword minor_version = 0; sword update_num = 0; sword patch_num = 0; sword port_update_num = 0; +#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIClientVersion only available 10.2 onwards */ PHP_OCI_CALL(OCIClientVersion, (&major_version, &minor_version, &update_num, &patch_num, &port_update_num)); snprintf(version_buff, sizeof(version_buff), "%d.%d.%d.%d.%d", major_version, minor_version, update_num, patch_num, port_update_num); #else memcpy(version_buff, "Unknown", sizeof("Unknown")); #endif *version = estrdup(version_buff); -} -/* }}} */ +} /* }}} */ + /* {{{ php_oci_server_get_version() * @@ -2520,21 +2468,19 @@ void php_oci_client_get_version(char **version TSRMLS_DC) */ int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC) { - sword errstatus; char version_buff[256]; - PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } *version = estrdup(version_buff); return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_column_to_zval() * @@ -2618,19 +2564,14 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR } /* }}} */ - /* {{{ php_oci_fetch_row() * * Fetch the next row from the given statement - * Has logic for Oracle 12c Implicit Result Sets */ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args) { zval *z_statement, *array; - php_oci_statement *statement; /* statement that will be fetched from */ -#if (OCI_MAJOR_VERSION >= 12) - php_oci_statement *invokedstatement; /* statement this function was invoked with */ -#endif /* OCI_MAJOR_VERSION */ + php_oci_statement *statement; php_oci_out_column *column; ub4 nrows = 1; int i; @@ -2676,64 +2617,12 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg } } -#if (OCI_MAJOR_VERSION < 12) PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - RETURN_FALSE; /* end of fetch */ - } -#else /* OCI_MAJOR_VERSION */ - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, invokedstatement); - - if (invokedstatement->impres_flag == PHP_OCI_IMPRES_NO_CHILDREN) { - /* Already know there are no Implicit Result Sets */ - statement = invokedstatement; - } else if (invokedstatement->impres_flag == PHP_OCI_IMPRES_HAS_CHILDREN) { - /* Previously saw an Implicit Result Set in an earlier invocation of php_oci_fetch_row */ - statement = (php_oci_statement *)invokedstatement->impres_child_stmt; - } else { - sword errstatus; - - /* Check for an Implicit Result Set on this statement handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)invokedstatement->stmt, OCI_HTYPE_STMT, - (dvoid *) &invokedstatement->impres_count, - (ub4 *)NULL, OCI_ATTR_IMPLICIT_RESULT_COUNT, invokedstatement->err)); - if (errstatus) { - RETURN_FALSE; - } - if (invokedstatement->impres_count > 0) { - /* Make it so the fetch occurs on the first Implicit Result Set */ - statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC); - if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC)) - RETURN_FALSE; - invokedstatement->impres_count--; - invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement; - invokedstatement->impres_flag = PHP_OCI_IMPRES_HAS_CHILDREN; - } else { - statement = invokedstatement; /* didn't find Implicit Result Sets */ - invokedstatement->impres_flag = PHP_OCI_IMPRES_NO_CHILDREN; /* Don't bother checking again */ - } + RETURN_FALSE; } - if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - /* End of fetch */ - if (invokedstatement->impres_count > 0) { - /* Check next Implicit Result Set */ - statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC); - if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC)) - RETURN_FALSE; - invokedstatement->impres_count--; - invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement; - if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) { - /* End of all fetches */ - RETURN_FALSE; - } - } else { - RETURN_FALSE; - } - } -#endif /* OCI_MAJOR_VERSION */ - array_init(return_value); for (i = 0; i < statement->ncolumns; i++) { @@ -2799,11 +2688,9 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC) connection = (php_oci_connection *)le->ptr; if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) { -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CONNECT_EXPIRY_ENABLED()) { - DTRACE_OCI8_CONNECT_EXPIRY(connection, connection->is_stub ? 1 : 0, (long)connection->idle_expiry, (long)timestamp); + if (OCI_G(debug_mode)) { + php_printf ("OCI8 DEBUG L1: persistent_helper processing for timeout: (%p stub=%d) at (%s:%d) \n", connection, connection->is_stub, __FILE__, __LINE__); } -#endif /* HAVE_OCI8_DTRACE */ if (connection->idle_expiry < timestamp) { /* connection has timed out */ return ZEND_HASH_APPLY_REMOVE; @@ -2811,8 +2698,7 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC) } } return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_create_spool() * @@ -2824,7 +2710,6 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha zend_bool iserror = 0; ub4 poolmode = OCI_DEFAULT; /* Mode to be passed to OCISessionPoolCreate */ OCIAuthInfo *spoolAuth = NULL; - sword errstatus; /* Allocate sessionpool out of persistent memory */ session_pool = (php_oci_spool *) calloc(1, sizeof(php_oci_spool)); @@ -2849,10 +2734,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha } /* Allocate the pool handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0)); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2861,10 +2746,10 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha * generic bug which can free up the OCI_G(err) variable before destroying connections. We * cannot use this for other roundtrip calls as there is no way the user can access this error */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0)); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; } @@ -2877,56 +2762,52 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha #endif #if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) - /* {{{ Allocate auth handle for session pool */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL)); + /* Allocate auth handle for session pool {{{ */ + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL)); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; - } - /* }}} */ + } /* }}} */ - /* {{{ Set the edition attribute on the auth handle */ + /* Set the edition attribute on the auth handle {{{ */ if (OCI_G(edition)) { - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err))); + PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; } - } - /* }}} */ + } /* }}} */ - /* {{{ Set the driver name attribute on the auth handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); + /* Set the driver name attribute on the auth handle {{{ */ + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; - } - /* }}} */ + } /* }}} */ - /* {{{ Set the auth handle on the session pool */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err))); + /* Set the auth handle on the session pool {{{ */ + PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; goto exit_create_spool; - } - /* }}} */ + } /* }}} */ #endif /* Create the homogeneous session pool - We have different session pools for every different * username, password, charset and dbname. */ - PHP_OCI_CALL_RETURN(errstatus, OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode)); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); iserror = 1; } @@ -2940,15 +2821,12 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha PHP_OCI_CALL(OCIHandleFree, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO)); } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_CREATE_ENABLED()) { - DTRACE_OCI8_SESSPOOL_CREATE(session_pool); + if (OCI_G(debug_mode)) { + php_printf ("OCI8 DEBUG L1: create_spool: (%p) at (%s:%d) \n", session_pool, __FILE__, __LINE__); } -#endif /* HAVE_OCI8_DTRACE */ return session_pool; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_get_spool() * @@ -2963,7 +2841,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * zend_rsrc_list_entry *spool_out_le = NULL; zend_bool iserror = 0; - /* {{{ Create the spool hash key */ + /* Create the spool hash key {{{ */ smart_str_appendl_ex(&spool_hashed_details, "oci8spool***", sizeof("oci8spool***") - 1, 0); smart_str_appendl_ex(&spool_hashed_details, username, username_len, 0); smart_str_appendl_ex(&spool_hashed_details, "**", sizeof("**") - 1, 0); @@ -3002,7 +2880,11 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * } spool_le.ptr = session_pool; spool_le.type = le_psessionpool; - PHP_OCI_REGISTER_RESOURCE(session_pool, le_psessionpool); +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) + zend_list_insert(session_pool, le_psessionpool TSRMLS_CC); +#else + zend_list_insert(session_pool, le_psessionpool); +#endif zend_hash_update(&EG(persistent_list), session_pool->spool_hash_key, strlen(session_pool->spool_hash_key)+1,(void *)&spool_le, sizeof(zend_rsrc_list_entry),NULL); } else if (spool_out_le->type == le_psessionpool && strlen(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == spool_hashed_details.len && @@ -3020,8 +2902,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char * return session_pool; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_create_env() * @@ -3052,8 +2933,7 @@ static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC) return NULL; } return retenv; -} -/* }}} */ +}/* }}} */ /* {{{ php_oci_old_create_session() * @@ -3064,58 +2944,57 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna { ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ? OCI_G(statement_cache_size) : 0; + if (OCI_G(debug_mode)) { + php_printf ("OCI8 DEBUG: Bypassing client-side session pool for session create at (%s:%d) \n", __FILE__, __LINE__); + } + /* Create the OCI environment separate for each connection */ if (!(connection->env = php_oci_create_env(connection->charset TSRMLS_CC))) { return 1; } - /* {{{ Allocate our server handle */ + /* Allocate our server handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ - /* {{{ Attach to the server */ + /* Attach to the server {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text *)dbname, dbname_len, (ub4) OCI_DEFAULT)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ connection->is_attached = 1; - /* {{{ Allocate our session handle */ + /* Allocate our session handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ - /* {{{ Allocate our private error-handle */ + /* Allocate our private error-handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ - /* {{{ Allocate our service-context */ + /* Allocate our service-context {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL)); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ - /* {{{ Set the username */ + /* Set the username {{{ */ if (username) { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err))); @@ -3123,10 +3002,9 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; } - } - /* }}} */ + }/* }}} */ - /* {{{ Set the password */ + /* Set the password {{{ */ if (password) { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err))); @@ -3134,10 +3012,9 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; } - } - /* }}} */ + }/* }}} */ - /* {{{ Set the edition attribute on the session handle */ + /* Set the edition attribute on the session handle {{{ */ #if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) if (OCI_G(edition)) { PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(edition), (ub4) (strlen(OCI_G(edition))), (ub4) OCI_ATTR_EDITION, OCI_G(err))); @@ -3147,10 +3024,9 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna return 1; } } -#endif -/* }}} */ +#endif /* }}} */ - /* {{{ Set the driver name attribute on the session handle */ + /* Set the driver name attribute on the session handle {{{ */ #if (OCI_MAJOR_VERSION >= 11) PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err))); @@ -3158,29 +3034,26 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; } -#endif -/* }}} */ +#endif /* }}} */ - /* {{{ Set the server handle in the service handle */ + /* Set the server handle in the service handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ - /* {{{ Set the authentication handle in the service handle */ + /* Set the authentication handle in the service handle {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ if (new_password) { - /* {{{ Try to change password if new one was provided */ + /* Try to change password if new one was provided {{{ */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH)); if (OCI_G(errcode) != OCI_SUCCESS) { @@ -3193,10 +3066,9 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; - } - /* }}} */ + } /* }}} */ } else { - /* {{{ start the session */ + /* start the session {{{ */ ub4 cred_type = OCI_CRED_RDBMS; /* Extract the overloaded session_mode parameter into valid Oracle credential and session mode values */ @@ -3217,8 +3089,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna if (OCI_G(errcode) != OCI_SUCCESS_WITH_INFO) { return 1; } - } - /* }}} */ + } /* }}} */ } /* Brand new connection: Init and update the next_ping in the connection */ @@ -3236,8 +3107,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna /* Successfully created session */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_create_session() * @@ -3268,11 +3138,13 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool connection->using_spool = 1; } -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_TYPE_ENABLED()) { - DTRACE_OCI8_SESSPOOL_TYPE(session_pool ? 1 : 0, session_pool ? session_pool : connection->private_spool); + if (OCI_G(debug_mode)) { + if (session_pool) { + php_printf ("OCI8 DEBUG L1: using shared pool: (%p) at (%s:%d) \n", session_pool, __FILE__, __LINE__); + } else { + php_printf ("OCI8 DEBUG L1: using private pool: (%p) at (%s:%d) \n", connection->private_spool, __FILE__, __LINE__); + } } -#endif /* HAVE_OCI8_DTRACE */ /* The passed in "connection" can be a cached stub from plist or freshly created. In the former * case, we do not have to allocate any handles @@ -3298,7 +3170,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool /* Set the Connection class and purity if OCI client version >= 11g */ #if (OCI_MAJOR_VERSION > 10) - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)(strlen(OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err))); + PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)(strlen(OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err))); if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); @@ -3317,20 +3189,16 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool return 1; } #endif - } - /* }}} */ + } /* }}} */ - /* {{{ Debug statements */ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SESSPOOL_STATS_ENABLED()) { + /* Debug statements {{{ */ + if (OCI_G(debug_mode)) { ub4 numfree = 0, numbusy = 0, numopen = 0; PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numopen, (ub4 *)0, OCI_ATTR_SPOOL_OPEN_COUNT, OCI_G(err))); PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)actual_spool->poolh, OCI_HTYPE_SPOOL, (dvoid *)&numbusy, (ub4 *)0, OCI_ATTR_SPOOL_BUSY_COUNT, OCI_G(err))); numfree = numopen - numbusy; /* number of free connections in the pool */ - DTRACE_OCI8_SESSPOOL_STATS(numfree, numbusy, numopen); - } -#endif /* HAVE_OCI8_DTRACE */ - /* }}} */ + php_printf ("OCI8 DEBUG L1: (numopen=%d)(numbusy=%d)(numfree=%d) at (%s:%d) \n", numopen, numbusy, numfree, __FILE__, __LINE__); + } /* }}} */ /* Ping loop: Ping and loop till we get a good connection. When a database instance goes * down, it can leave several bad connections that need to be flushed out before getting a @@ -3357,8 +3225,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool /* {{{ Populate the session and server fields of the connection */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->server), (ub4 *)0, OCI_ATTR_SERVER, OCI_G(err))); - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err))); - /* }}} */ + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err))); /* }}} */ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextGetValue, (connection->session, OCI_G(err), (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), (void **)&(connection->next_pingp))); if (OCI_G(errcode) != OCI_SUCCESS) { @@ -3398,8 +3265,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool connection->is_attached = connection->is_open = 1; return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_spool_list_dtor() * @@ -3414,8 +3280,7 @@ static void php_oci_spool_list_dtor(zend_rsrc_list_entry *entry TSRMLS_DC) } return; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_spool_close() * @@ -3445,8 +3310,7 @@ static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC) } free(session_pool); -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_ping_init() * @@ -3489,22 +3353,7 @@ static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TS connection->next_pingp = next_pingp; return OCI_SUCCESS; -} -/* }}} */ - -/* {{{ php_oci_dtrace_check_connection() - * - * DTrace output for connections that may have become invalid and marked for reopening - */ -void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus) -{ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_CHECK_CONNECTION_ENABLED()) { - DTRACE_OCI8_CHECK_CONNECTION(connection, connection && connection->is_open ? 1 : 0, (long)errcode, (unsigned long)serverStatus); - } -#endif /* HAVE_OCI8_DTRACE */ -} -/* }}} */ +} /* }}} */ #endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 320e90a5b899..763e12e9249d 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -44,22 +44,21 @@ /* {{{ php_oci_collection_create() Create and return connection handle */ -php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) +php_oci_collection * php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC) { dvoid *dschp1 = NULL; dvoid *parmp1; dvoid *parmp2; php_oci_collection *collection; - sword errstatus; collection = emalloc(sizeof(php_oci_collection)); collection->connection = connection; collection->collection = NULL; - zend_list_addref(collection->connection->id); + zend_list_addref(collection->connection->rsrc_id); /* get type handle by name */ - PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, + PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByName, ( connection->env, connection->err, @@ -76,19 +75,19 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* allocate describe handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIHandleAlloc, (connection->env, (dvoid **) &dschp1, (ub4) OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* describe TDO */ - PHP_OCI_CALL_RETURN(errstatus, OCIDescribeAny, + PHP_OCI_CALL_RETURN(connection->errcode, OCIDescribeAny, ( connection->svc, connection->err, @@ -101,19 +100,19 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* get first parameter handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ((dvoid *) dschp1, (ub4) OCI_HTYPE_DESCRIBE, (dvoid *)&parmp1, (ub4 *)0, (ub4)OCI_ATTR_PARAM, connection->err)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* get the collection type code of the attribute */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, + PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ( (dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, @@ -124,7 +123,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } @@ -132,7 +131,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch case OCI_TYPECODE_TABLE: case OCI_TYPECODE_VARRAY: /* get collection element handle */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, + PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ( (dvoid*) parmp1, (ub4) OCI_DTYPE_PARAM, @@ -143,12 +142,12 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* get REF of the TDO for the type */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, + PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ( (dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, @@ -159,12 +158,12 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* get the TDO (only header) */ - PHP_OCI_CALL_RETURN(errstatus, OCITypeByRef, + PHP_OCI_CALL_RETURN(connection->errcode, OCITypeByRef, ( connection->env, connection->err, @@ -175,12 +174,12 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* get typecode */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, + PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet, ( (dvoid*) parmp2, (ub4) OCI_DTYPE_PARAM, @@ -191,7 +190,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } break; @@ -202,7 +201,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch } /* Create object to hold return table */ - PHP_OCI_CALL_RETURN(errstatus, OCIObjectNew, + PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectNew, ( connection->env, connection->err, @@ -216,14 +215,13 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch ) ); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { goto CLEANUP; } /* free the describe handle (Bug #44113) */ PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); PHP_OCI_REGISTER_RESOURCE(collection, le_collection); - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return collection; CLEANUP: @@ -232,31 +230,27 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch /* free the describe handle (Bug #44113) */ PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE)); } - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); php_oci_collection_close(collection TSRMLS_CC); return NULL; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_size() Return size of the collection */ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC) { php_oci_connection *connection = collection->connection; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); + PHP_OCI_CALL_RETURN(connection->errcode, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_max() Return max number of elements in the collection */ @@ -268,27 +262,23 @@ int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC) /* error handling is not necessary here? */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_trim() Trim collection to the given number of elements */ int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC) { php_oci_connection *connection = collection->connection; - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection)); + + PHP_OCI_CALL_RETURN(connection->errcode, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection)); - if (errstatus != OCI_SUCCESS) { - errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_append_null() Append NULL element to the end of the collection */ @@ -296,20 +286,17 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC) { OCIInd null_index = OCI_IND_NULL; php_oci_connection *connection = collection->connection; - sword errstatus; /* append NULL element */ - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection)); - if (errstatus != OCI_SUCCESS) { - errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_append_date() Append DATE element to the end of the collection (use "DD-MON-YY" format) */ @@ -318,19 +305,18 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; php_oci_connection *connection = collection->connection; - sword errstatus; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, ( connection->env, connection->err, @@ -340,16 +326,14 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_append_number() Append NUMBER to the end of the collection */ @@ -359,7 +343,6 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - sword errstatus; #if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10) /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */ @@ -369,15 +352,15 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe element_double = zend_strtod(number, NULL); #endif - PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); + PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, ( connection->env, connection->err, @@ -387,16 +370,14 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_append_string() Append STRING to the end of the collection */ @@ -405,17 +386,16 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAppend, ( connection->env, connection->err, @@ -425,16 +405,14 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_append() Append wrapper. Appends any supported element to the end of the collection */ @@ -474,8 +452,7 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int } /* never reached */ return 1; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_get() Get the element with the given index */ @@ -487,14 +464,11 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z boolean exists; oratext buff[1024]; ub4 buff_len = 1024; - sword errstatus; MAKE_STD_ZVAL(*result_element); ZVAL_NULL(*result_element); - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - - PHP_OCI_CALL_RETURN(errstatus, OCICollGetElem, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollGetElem, ( connection->env, connection->err, @@ -506,8 +480,8 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -526,10 +500,10 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z switch (collection->element_typecode) { case OCI_TYPECODE_DATE: - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -569,10 +543,10 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z { double double_number; - PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); + PHP_OCI_CALL_RETURN(connection->errcode, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); FREE_ZVAL(*result_element); return 1; @@ -591,8 +565,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z } /* never reached */ return 1; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_set_null() Set the element with the given index to NULL */ @@ -600,20 +573,17 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, long ind { OCIInd null_index = OCI_IND_NULL; php_oci_connection *connection = collection->connection; - sword errstatus; /* set NULL element */ - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_set_date() Change element's value to the given DATE */ @@ -622,19 +592,18 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind OCIInd new_index = OCI_IND_NOTNULL; OCIDate oci_date; php_oci_connection *connection = collection->connection; - sword errstatus; /* format and language are NULLs, so format is "DD-MON-YY" and language is the default language of the session */ - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)date, date_len, NULL, 0, NULL, 0, &oci_date)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, ( connection->env, connection->err, @@ -645,16 +614,14 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_set_number() Change element's value to the given NUMBER */ @@ -664,7 +631,6 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i double element_double; OCINumber oci_number; php_oci_connection *connection = collection->connection; - sword errstatus; #if (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10) /* minimum PHP version ext/oci8/config.m4 accepts is 4.3.9 */ @@ -674,15 +640,15 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i element_double = zend_strtod(number, NULL); #endif - PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); + PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, ( connection->env, connection->err, @@ -693,16 +659,14 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_set_string() Change element's value to the given string */ @@ -711,17 +675,16 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i OCIInd new_index = OCI_IND_NOTNULL; OCIString *ocistr = (OCIString *)0; php_oci_connection *connection = collection->connection; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssignElem, ( connection->env, connection->err, @@ -732,16 +695,14 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_element_set() Collection element setter */ @@ -781,51 +742,44 @@ int php_oci_collection_element_set(php_oci_collection *collection, long index, c } /* never reached */ return 1; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_assign() Assigns a value to the collection from another collection */ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC) { php_oci_connection *connection = collection_dest->connection; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); + PHP_OCI_CALL_RETURN(connection->errcode, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_collection_close() Destroy collection and all associated resources */ void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC) { php_oci_connection *connection = collection->connection; - sword errstatus; if (collection->collection) { - PHP_OCI_CALL_RETURN(errstatus, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } } - zend_list_delete(collection->connection->id); + zend_list_delete(collection->connection->rsrc_id); + efree(collection); return; -} -/* }}} */ +} /* }}} */ #endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_dtrace.d b/ext/oci8/oci8_dtrace.d deleted file mode 100644 index 8ac94105c13c..000000000000 --- a/ext/oci8/oci8_dtrace.d +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/3_01.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Christopher Jones | - +----------------------------------------------------------------------+ -*/ - -provider php { - probe oci8__check__connection(void *connection, int is_open, long errcode, unsigned long server_status); - probe oci8__connect__entry(char *username, char *dbname, char *charset, long session_mode, int persistent, int exclusive); - probe oci8__connect__return(void *connection); - probe oci8__connection__close(void *connection); - probe oci8__error(int status, long errcode); - probe oci8__execute__mode(void *connection, unsigned int mode); - probe oci8__sqltext(void *connection, char *sql); - - probe oci8__connect__p__dtor__close(void *connection); - probe oci8__connect__p__dtor__release(void *connection); - probe oci8__connect__lookup(void *connection, int is_stub); - probe oci8__connect__expiry(void *connection, int is_stub, long idle_expiry, long timestamp); - probe oci8__connect__type(int persistent, int exclusive, void *connection, long num_persistent, long num_connections); - probe oci8__sesspool__create(void *session_pool); - probe oci8__sesspool__stats(unsigned long free, unsigned long busy, unsigned long open); - probe oci8__sesspool__type(int type, void *session_pool); -}; diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 8d70aff9c2b4..e51d3c92f527 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -1308,7 +1308,12 @@ PHP_FUNCTION(oci_field_is_null) Toggle internal debugging output for the OCI extension */ PHP_FUNCTION(oci_internal_debug) { - /* NOP in OCI8 2.0. Obsoleted by DTrace probes */ + zend_bool on_off; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &on_off) == FAILURE) { + return; + } + OCI_G(debug_mode) = on_off; } /* }}} */ @@ -1578,7 +1583,7 @@ PHP_FUNCTION(oci_close) } PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - zend_list_delete(connection->id); + zend_list_delete(connection->rsrc_id); ZVAL_NULL(z_connection); @@ -1586,7 +1591,7 @@ PHP_FUNCTION(oci_close) } /* }}} */ -/* {{{ proto resource oci_new_connect(string user, string pass [, string db, string charset [, int session_mode ]]) +/* {{{ proto resource oci_new_connect(string user, string pass [, string db]) Connect to an Oracle database and log on. Returns a new session. */ PHP_FUNCTION(oci_new_connect) { @@ -1602,7 +1607,7 @@ PHP_FUNCTION(oci_connect) } /* }}} */ -/* {{{ proto resource oci_pconnect(string user, string pass [, string db [, string charset [, int session_mode ]]) +/* {{{ proto resource oci_pconnect(string user, string pass [, string db [, string charset ]]) Connect to an Oracle database using a persistent connection and log on. Returns a new session. */ PHP_FUNCTION(oci_pconnect) { @@ -1619,6 +1624,7 @@ PHP_FUNCTION(oci_error) php_oci_connection *connection; text *errbuf; sb4 errcode = 0; + sword error = OCI_SUCCESS; dvoid *errh = NULL; ub2 error_offset = 0; text *sqltext = NULL; @@ -1629,9 +1635,10 @@ PHP_FUNCTION(oci_error) if (ZEND_NUM_ARGS() > 0) { statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement); + if (statement) { errh = statement->err; - errcode = statement->errcode; + error = statement->errcode; if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) { RETURN_FALSE; @@ -1642,23 +1649,23 @@ PHP_FUNCTION(oci_error) connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection); if (connection) { errh = connection->err; - errcode = connection->errcode; + error = connection->errcode; goto go_out; } connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection); if (connection) { errh = connection->err; - errcode = connection->errcode; + error = connection->errcode; goto go_out; } } else { errh = OCI_G(err); - errcode = OCI_G(errcode); + error = OCI_G(errcode); } go_out: - if (errcode == 0) { /* no error set in the handle */ + if (error == OCI_SUCCESS) { /* no error set in the handle */ RETURN_FALSE; } @@ -1737,12 +1744,7 @@ PHP_FUNCTION(oci_set_prefetch) PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - if (size < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0"); - return; - } - - if (php_oci_statement_set_prefetch(statement, (ub4)size TSRMLS_CC)) { + if (php_oci_statement_set_prefetch(statement, size TSRMLS_CC)) { RETURN_FALSE; } RETURN_TRUE; @@ -1757,7 +1759,6 @@ PHP_FUNCTION(oci_set_client_identifier) php_oci_connection *connection; char *client_id; int client_id_len; - sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) { return; @@ -1765,10 +1766,10 @@ PHP_FUNCTION(oci_set_client_identifier) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, connection->err)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); RETURN_FALSE; } @@ -1808,7 +1809,7 @@ PHP_FUNCTION(oci_set_edition) /* }}} */ /* {{{ proto bool oci_set_module_name(resource connection, string value) - Sets the module attribute on the connection for end-to-end tracing */ + Sets the module attribute on the connection */ PHP_FUNCTION(oci_set_module_name) { #if (OCI_MAJOR_VERSION >= 10) @@ -1816,7 +1817,6 @@ PHP_FUNCTION(oci_set_module_name) php_oci_connection *connection; char *module; int module_len; - sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) { return; @@ -1824,10 +1824,10 @@ PHP_FUNCTION(oci_set_module_name) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); RETURN_FALSE; } @@ -1840,7 +1840,7 @@ PHP_FUNCTION(oci_set_module_name) /* }}} */ /* {{{ proto bool oci_set_action(resource connection, string value) - Sets the action attribute on the connection for end-to-end tracing */ + Sets the action attribute on the connection */ PHP_FUNCTION(oci_set_action) { #if (OCI_MAJOR_VERSION >= 10) @@ -1848,7 +1848,6 @@ PHP_FUNCTION(oci_set_action) php_oci_connection *connection; char *action; int action_len; - sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) { return; @@ -1856,10 +1855,10 @@ PHP_FUNCTION(oci_set_action) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); RETURN_FALSE; } @@ -1872,7 +1871,7 @@ PHP_FUNCTION(oci_set_action) /* }}} */ /* {{{ proto bool oci_set_client_info(resource connection, string value) - Sets the client info attribute on the connection for end-to-end tracing */ + Sets the client info attribute on the connection */ PHP_FUNCTION(oci_set_client_info) { #if (OCI_MAJOR_VERSION >= 10) @@ -1880,7 +1879,6 @@ PHP_FUNCTION(oci_set_client_info) php_oci_connection *connection; char *client_info; int client_info_len; - sword errstatus; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) { return; @@ -1888,10 +1886,10 @@ PHP_FUNCTION(oci_set_client_info) PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, OCI_G(err))); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); RETURN_FALSE; } @@ -1959,7 +1957,7 @@ PHP_FUNCTION(oci_password_change) if (!connection) { RETURN_FALSE; } - RETURN_RESOURCE(connection->id); + RETURN_RESOURCE(connection->rsrc_id); } WRONG_PARAM_COUNT; } @@ -2397,32 +2395,6 @@ PHP_FUNCTION(oci_new_collection) } /* }}} */ -/* {{{ proto bool oci_get_implicit(resource stmt) - Get the next statement resource from an Oracle 12c PL/SQL Implicit Result Set */ -PHP_FUNCTION(oci_get_implicit_resultset) -{ - zval *z_statement; - php_oci_statement *statement; - php_oci_statement *imp_statement; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) { - return; - } - - PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement); - - imp_statement = php_oci_get_implicit_resultset(statement TSRMLS_CC); - - if (imp_statement) { - if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT TSRMLS_CC)) - RETURN_FALSE; - RETURN_RESOURCE(imp_statement->id); - } - RETURN_FALSE; -} - -/* }}} */ - #endif /* HAVE_OCI8 */ /* diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 8d14dc3f503a..d05e05391921 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -54,7 +54,6 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long type TSRMLS_DC) { php_oci_descriptor *descriptor; - sword errstatus; switch (type) { case OCI_DTYPE_FILE: @@ -71,17 +70,15 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ descriptor = ecalloc(1, sizeof(php_oci_descriptor)); descriptor->type = type; descriptor->connection = connection; - zend_list_addref(descriptor->connection->id); + zend_list_addref(descriptor->connection->rsrc_id); - PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); - if (errstatus != OCI_SUCCESS) { - OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC); + if (OCI_G(errcode) != OCI_SUCCESS) { + OCI_G(errcode) = php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, OCI_G(errcode)); efree(descriptor); return NULL; - } else { - OCI_G(errcode) = 0; /* retain backwards compat with OCI8 1.4 */ } PHP_OCI_REGISTER_RESOURCE(descriptor, le_descriptor); @@ -112,15 +109,13 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ } return descriptor; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_get_length() Get length of the LOB. The length is cached so we don't need to ask Oracle every time */ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; - sword errstatus; *length = 0; @@ -129,18 +124,18 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D return 0; } else { if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } - PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -148,20 +143,17 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D descriptor->lob_size = *length; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_callback() Append LOB portion to a memory buffer */ @@ -211,28 +203,25 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece) } /* }}} */ -/* {{{ php_oci_lob_calculate_buffer() - Work out the size for LOB buffering */ +/* {{{ php_oci_lob_calculate_buffer() */ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, long read_length TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; ub4 chunk_size; - sword errstatus; if (descriptor->type == OCI_DTYPE_FILE) { return read_length; } if (!descriptor->chunk_size) { - PHP_OCI_CALL_RETURN(errstatus, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return read_length; /* we have to return original length here */ } descriptor->chunk_size = chunk_size; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } if ((read_length % descriptor->chunk_size) != 0) { @@ -261,7 +250,6 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini #endif int is_clob = 0; sb4 bytes_per_char = 1; - sword errstatus; *data_len = 0; *data = NULL; @@ -298,20 +286,20 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini offset = initial_offset; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } else { ub2 charset_id = 0; - PHP_OCI_CALL_RETURN(errstatus, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -322,10 +310,10 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini } if (is_clob) { - PHP_OCI_CALL_RETURN(errstatus, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ)); + PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } @@ -349,7 +337,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */ bufp = (ub1 *) ecalloc(1, buffer_size); - PHP_OCI_CALL_RETURN(errstatus, OCILobRead2, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead2, ( connection->svc, connection->err, @@ -382,7 +370,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */ bufp = (ub1 *) ecalloc(1, buffer_size); - PHP_OCI_CALL_RETURN(errstatus, OCILobRead, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead, ( connection->svc, connection->err, @@ -403,8 +391,8 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini #endif - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); if (*data) { efree(*data); @@ -417,10 +405,10 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini descriptor->lob_current_position = (int)offset; if (descriptor->type == OCI_DTYPE_FILE) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); if (*data) { efree(*data); @@ -431,10 +419,8 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini } } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_write() Write data to the LOB */ @@ -443,7 +429,6 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor; php_oci_connection *connection = (php_oci_connection *) descriptor->connection; ub4 lob_length; - sword errstatus; *bytes_written = 0; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { @@ -462,7 +447,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i offset = descriptor->lob_current_position; } - PHP_OCI_CALL_RETURN(errstatus, OCILobWrite, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite, ( connection->svc, connection->err, @@ -479,8 +464,8 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i ) ); - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); *bytes_written = 0; return 1; @@ -497,17 +482,14 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i descriptor->buffering = PHP_OCI_LOB_BUFFER_USED; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_set_buffering() Turn buffering off/onn for this particular LOB */ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; - sword errstatus; if (!on_off && descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) { /* disabling when it's already off */ @@ -520,21 +502,19 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS } if (on_off) { - PHP_OCI_CALL_RETURN(errstatus, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor)); } else { - PHP_OCI_CALL_RETURN(errstatus, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor)); } - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->buffering = on_off ? PHP_OCI_LOB_BUFFER_ENABLED : PHP_OCI_LOB_BUFFER_DISABLED; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_get_buffering() Return current buffering state for the LOB */ @@ -545,8 +525,7 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor) } else { return 0; } -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_copy() Copy one LOB (or its part) to another one */ @@ -554,7 +533,6 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d { php_oci_connection *connection = descriptor_dest->connection; ub4 length_dest, length_from, copy_len; - sword errstatus; if (php_oci_lob_get_length(descriptor_dest, &length_dest TSRMLS_CC)) { return 1; @@ -575,7 +553,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCILobCopy, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobCopy, ( connection->svc, connection->err, @@ -587,33 +565,29 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_close() Close LOB */ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; - sword errstatus; - + if (descriptor->is_open) { - PHP_OCI_CALL_RETURN(errstatus, OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobClose, (connection->svc, connection->err, descriptor->descriptor)); + } - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); - return 1; - } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); + PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + return 1; } if (php_oci_temp_lob_close(descriptor TSRMLS_CC)) { @@ -621,8 +595,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) } return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_temp_lob_close() Close Temporary LOB */ @@ -630,29 +603,27 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC) { php_oci_connection *connection = descriptor->connection; int is_temporary; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } if (is_temporary) { - PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ + /* {{{ php_oci_lob_flush() Flush buffers for the LOB (only if they have been used) */ @@ -660,8 +631,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) { OCILobLocator *lob = descriptor->descriptor; php_oci_connection *connection = descriptor->connection; - sword errstatus; - + if (!lob) { return 1; } @@ -684,20 +654,18 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC) return 0; } - PHP_OCI_CALL_RETURN(errstatus, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } /* marking buffer as enabled and not used */ descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_free() Close LOB descriptor and free associated resources */ @@ -741,10 +709,9 @@ void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC) PHP_OCI_CALL(OCIDescriptorFree, (descriptor->descriptor, descriptor->type)); - zend_list_delete(descriptor->connection->id); + zend_list_delete(descriptor->connection->rsrc_id); efree(descriptor); -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_import() Import LOB contents from the given file */ @@ -756,7 +723,6 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC php_oci_connection *connection = descriptor->connection; char buf[8192]; ub4 offset = 1; - sword errstatus; #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5) /* Safe mode has been removed in PHP 5.4 */ @@ -773,7 +739,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC } while ((loblen = read(fp, &buf, sizeof(buf))) > 0) { - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobWrite, ( connection->svc, @@ -791,21 +757,18 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); close(fp); return 1; - } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } offset += loblen; } close(fp); return 0; -} - /* }}} */ +} /* }}} */ /* {{{ php_oci_lob_append() Append data to the end of the LOB */ @@ -815,7 +778,6 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor OCILobLocator *lob_dest = descriptor_dest->descriptor; OCILobLocator *lob_from = descriptor_from->descriptor; ub4 dest_len, from_len; - sword errstatus; if (php_oci_lob_get_length(descriptor_dest, &dest_len TSRMLS_CC)) { return 1; @@ -829,17 +791,15 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor return 0; } - PHP_OCI_CALL_RETURN(errstatus, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_truncate() Truncate LOB to the given length */ @@ -848,7 +808,6 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 lob_length; - sword errstatus; if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) { return 1; @@ -868,20 +827,17 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->lob_size = new_lob_length; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_erase() Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */ @@ -890,7 +846,6 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 lob_length; - sword errstatus; *bytes_erased = 0; @@ -906,19 +861,17 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, ub4 length, length = lob_length; } - PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } *bytes_erased = length; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_is_equal() Compare two LOB descriptors and figure out if they are pointing to the same LOB */ @@ -927,19 +880,16 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript php_oci_connection *connection = descriptor_first->connection; OCILobLocator *first_lob = descriptor_first->descriptor; OCILobLocator *second_lob = descriptor_second->descriptor; - sword errstatus; - PHP_OCI_CALL_RETURN(errstatus, OCILobIsEqual, (connection->env, first_lob, second_lob, result)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsEqual, (connection->env, first_lob, second_lob, result)); - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_lob_write_tmp() Create temporary LOB and write data to it */ @@ -948,7 +898,6 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data php_oci_connection *connection = descriptor->connection; OCILobLocator *lob = descriptor->descriptor; ub4 bytes_written = 0; - sword errstatus; switch (type) { case OCI_TEMP_BLOB: @@ -965,7 +914,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCILobCreateTemporary, + PHP_OCI_CALL_RETURN(connection->errcode, OCILobCreateTemporary, ( connection->svc, connection->err, @@ -978,26 +927,24 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, long type, char *data ) ); - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } - PHP_OCI_CALL_RETURN(errstatus, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); + PHP_OCI_CALL_RETURN(connection->errcode, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE)); - if (errstatus) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return 1; } descriptor->is_open = 1; - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC); -} -/* }}} */ +} /* }}} */ #endif /* HAVE_OCI8 */ diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 274c4e9e33b4..89facb070343 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -43,30 +43,21 @@ /* {{{ php_oci_statement_create() Create statemend handle and allocate necessary resources */ -php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC) +php_oci_statement *php_oci_statement_create (php_oci_connection *connection, char *query, int query_len TSRMLS_DC) { php_oci_statement *statement; - sword errstatus; - - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ - + statement = ecalloc(1,sizeof(php_oci_statement)); if (!query_len) { /* do not allocate stmt handle for refcursors, we'll get it from OCIStmtPrepare2() */ PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->stmt), OCI_HTYPE_STMT, 0, NULL)); - } else { -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_SQLTEXT_ENABLED()) { - DTRACE_OCI8_SQLTEXT(connection, query); - } -#endif /* HAVE_OCI8_DTRACE */ } PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(statement->err), OCI_HTYPE_ERROR, 0, NULL)); if (query_len > 0) { - PHP_OCI_CALL_RETURN(errstatus, OCIStmtPrepare2, + PHP_OCI_CALL_RETURN(connection->errcode, OCIStmtPrepare2, ( connection->svc, &(statement->stmt), @@ -79,13 +70,14 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char OCI_DEFAULT ) ); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); - PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE)); + PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT)); PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR)); - PHP_OCI_HANDLE_ERROR(connection, connection->errcode); + efree(statement); + PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } } @@ -103,15 +95,10 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char statement->has_data = 0; statement->has_descr = 0; statement->parent_stmtid = 0; - statement->impres_child_stmt = NULL; - statement->impres_count = 0; - statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */ - zend_list_addref(statement->connection->id); + zend_list_addref(statement->connection->rsrc_id); if (OCI_G(default_prefetch) >= 0) { - php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC); - } else { - php_oci_statement_set_prefetch(statement, (ub4)100 TSRMLS_CC); /* semi-arbitrary, "sensible default" */ + php_oci_statement_set_prefetch(statement, OCI_G(default_prefetch) TSRMLS_CC); } PHP_OCI_REGISTER_RESOURCE(statement, le_statement); @@ -122,85 +109,25 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char } /* }}} */ -/* {{{ php_oci_get_implicit_resultset() - Fetch implicit result set statement resource */ -php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC) -{ -#if (OCI_MAJOR_VERSION < 12) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Implicit results are available in Oracle Database 12c onwards"); - return NULL; -#else - void *result; - ub4 rtype; - php_oci_statement *statement2; /* implicit result set statement handle */ - sword errstatus; - - PHP_OCI_CALL_RETURN(errstatus, OCIStmtGetNextResult, (statement->stmt, statement->err, &result, &rtype, OCI_DEFAULT)); - if (errstatus == OCI_NO_DATA) { - return NULL; - } - - if (rtype != OCI_RESULT_TYPE_SELECT) { - /* Only OCI_RESULT_TYPE_SELECT is supported by Oracle DB 12cR1 */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected implicit result type returned from Oracle Database"); - return NULL; - } else { - statement2 = ecalloc(1,sizeof(php_oci_statement)); - - PHP_OCI_CALL(OCIHandleAlloc, (statement->connection->env, (dvoid **)&(statement2->err), OCI_HTYPE_ERROR, 0, NULL)); - statement2->stmt = (OCIStmt *)result; - statement2->parent_stmtid = statement->id; - statement2->impres_child_stmt = NULL; - statement2->impres_count = 0; - statement2->impres_flag = PHP_OCI_IMPRES_IS_CHILD; - statement2->connection = statement->connection; - statement2->errcode = 0; - statement2->last_query = NULL; - statement2->last_query_len = 0; - statement2->columns = NULL; - statement2->binds = NULL; - statement2->defines = NULL; - statement2->ncolumns = 0; - statement2->executed = 0; - statement2->has_data = 0; - statement2->has_descr = 0; - statement2->stmttype = 0; - - zend_list_addref(statement->id); - zend_list_addref(statement2->connection->id); - - php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC); - - PHP_OCI_REGISTER_RESOURCE(statement2, le_statement); - - OCI_G(num_statements)++; - - return statement2; - } -#endif /* OCI_MAJOR_VERSION < 12 */ -} -/* }}} */ - /* {{{ php_oci_statement_set_prefetch() - Set prefetch buffer size for the statement */ -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC) + Set prefetch buffer size for the statement (we're assuming that one row is ~1K sized) */ +int php_oci_statement_set_prefetch(php_oci_statement *statement, long size TSRMLS_DC) { - sword errstatus; + ub4 prefetch = size; - if (prefetch > 20000) { - prefetch = 20000; /* keep it somewhat sane */ + if (size < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0"); + return 1; } - - PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err)); + + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - statement->prefetch_count = 0; return 1; } - statement->prefetch_count = prefetch; - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + return 0; } /* }}} */ @@ -236,8 +163,8 @@ int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC) } return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ +} /* }}} */ + /* {{{ php_oci_statement_fetch() Fetch a row from the statement */ @@ -248,18 +175,16 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) ub4 typep, iterp, idxp; ub1 in_outp, piecep; zend_bool piecewisecols = 0; - php_oci_out_column *column; - sword errstatus; - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + php_oci_out_column *column; if (statement->has_descr && statement->columns) { zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch TSRMLS_CC); } - PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); - if (errstatus == OCI_NO_DATA || nrows == 0) { + if ( statement->errcode == OCI_NO_DATA || nrows == 0 ) { if (statement->last_query == NULL) { /* reset define-list for refcursors */ if (statement->columns) { @@ -271,6 +196,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) statement->executed = 0; } + statement->errcode = 0; /* OCI_NO_DATA is NO error for us!!! */ statement->has_data = 0; if (nrows == 0) { @@ -283,15 +209,15 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* reset length for all piecewise columns */ for (i = 0; i < statement->ncolumns; i++) { column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column && column->piecewise) { + if (column->piecewise) { column->retlen4 = 0; piecewisecols = 1; } } - while (errstatus == OCI_NEED_DATA) { + while (statement->errcode == OCI_NEED_DATA) { if (piecewisecols) { - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtGetPieceInfo, ( statement->stmt, @@ -308,7 +234,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) /* scan through our columns for a piecewise column with a matching handle */ for (i = 0; i < statement->ncolumns; i++) { column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC); - if (column && column->piecewise && handlepp == column->oci_define) { + if (column->piecewise && handlepp == column->oci_define) { if (!column->data) { column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1); } else { @@ -333,7 +259,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } } - PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT)); if (piecewisecols) { for (i = 0; i < statement->ncolumns; i++) { @@ -345,7 +271,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) } } - if (errstatus == OCI_SUCCESS_WITH_INFO || errstatus == OCI_SUCCESS) { + if (statement->errcode == OCI_SUCCESS_WITH_INFO || statement->errcode == OCI_SUCCESS) { statement->has_data = 1; /* do the stuff needed for OCIDefineByName */ @@ -366,7 +292,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC) return 0; } - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); statement->has_data = 0; @@ -406,7 +332,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, l } /* }}} */ -/* {{{ php_oci_define_callback() */ +/* php_oci_define_callback() {{{ */ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp) { php_oci_out_column *outcol = (php_oci_out_column *)ctx; @@ -489,18 +415,12 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ub4 colcount; ub2 dynamic; dvoid *buf; - sword errstatus; switch (mode) { case OCI_COMMIT_ON_SUCCESS: case OCI_DESCRIBE_ONLY: case OCI_DEFAULT: /* only these are allowed */ -#ifdef HAVE_OCI8_DTRACE - if (DTRACE_OCI8_EXECUTE_MODE_ENABLED()) { - DTRACE_OCI8_EXECUTE_MODE(statement->connection, mode); - } -#endif /* HAVE_OCI8_DTRACE */ break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode); @@ -510,14 +430,12 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) if (!statement->stmttype) { /* get statement type */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; - } else { - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } } @@ -527,7 +445,9 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) iters = 1; } - if (statement->last_query) { /* Don't execute REFCURSORS or Implicit Result Set handles */ + if (statement->last_query) { + /* if we execute refcursors we don't have a query and + we don't want to execute!!! */ if (statement->binds) { int result = 0; @@ -538,10 +458,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } /* execute statement */ - PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -551,20 +471,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } if (mode & OCI_COMMIT_ON_SUCCESS) { - /* No need to rollback on disconnect */ - statement->connection->rb_on_disconnect = 0; - } else if (statement->stmttype != OCI_STMT_SELECT) { - /* Assume some uncommitted DML occurred */ - statement->connection->rb_on_disconnect = 1; + statement->connection->needs_commit = 0; + } else { + statement->connection->needs_commit = 1; } - /* else for SELECT with OCI_NO_AUTO_COMMIT, leave - * "rb_on_disconnect" at its previous value. SELECT can't - * initiate uncommitted DML. (An AUTONOMOUS_TRANSACTION in - * invoked PL/SQL must explicitly rollback/commit else the - * SELECT fails). - */ - - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } if (statement->stmttype == OCI_STMT_SELECT && statement->executed == 0) { @@ -577,10 +487,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) counter = 1; /* get number of columns */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -597,50 +507,50 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } /* get column */ - PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)¶m, counter)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get column datatype */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_type, (ub4 *)0, OCI_ATTR_DATA_TYPE, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get character set form */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get character set id */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get size of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->data_size, (dvoid *)0, OCI_ATTR_DATA_SIZE, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -649,31 +559,31 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) outcol->retlen = outcol->data_size; /* get scale of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->scale, (dvoid *)0, OCI_ATTR_SCALE, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get precision of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->precision, (dvoid *)0, OCI_ATTR_PRECISION, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } /* get name of the column */ - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid **)&colname, (ub4 *)&outcol->name_len, (ub4)OCI_ATTR_NAME, statement->err)); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM)); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -681,7 +591,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) outcol->name = estrndup((char*) colname, outcol->name_len); - /* find a user-set define */ + /* find a user-setted define */ if (statement->defines) { if (zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define) == SUCCESS) { if (outcol->define->type) { @@ -769,7 +679,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } if (dynamic == OCI_DYNAMIC_FETCH) { - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIDefineByPos, ( statement->stmt, /* IN/OUT handle to the requested SQL query */ @@ -787,7 +697,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ); } else { - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIDefineByPos, ( statement->stmt, /* IN/OUT handle to the requested SQL query */ @@ -806,10 +716,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) } - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; + return 0; } /* additional OCIDefineDynamic() call */ @@ -819,7 +729,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) case SQLT_BLOB: case SQLT_CLOB: case SQLT_BFILE: - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIDefineDynamic, ( outcol->oci_define, @@ -829,15 +739,9 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) ) ); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); - PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); - return 1; - } break; } } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } return 0; @@ -848,9 +752,10 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC) Cancel statement */ int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC) { + return php_oci_statement_fetch(statement, 0 TSRMLS_CC); -} -/* }}} */ + +} /* }}} */ /* {{{ php_oci_statement_free() Destroy statement handle and free associated resources */ @@ -859,15 +764,15 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) if (statement->stmt) { if (statement->last_query_len) { /* FIXME: magical */ PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, statement->errcode ? OCI_STRLS_CACHE_DELETE : OCI_DEFAULT)); - } else if (statement->impres_flag != PHP_OCI_IMPRES_IS_CHILD) { /* Oracle doc says don't free Implicit Result Set handles */ + } else { PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT)); } - statement->stmt = NULL; + statement->stmt = 0; } if (statement->err) { PHP_OCI_CALL(OCIHandleFree, (statement->err, OCI_HTYPE_ERROR)); - statement->err = NULL; + statement->err = 0; } if (statement->last_query) { @@ -893,12 +798,11 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC) zend_list_delete(statement->parent_stmtid); } - zend_list_delete(statement->connection->id); + zend_list_delete(statement->connection->rsrc_id); efree(statement); OCI_G(num_statements)--; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_pre_exec() Helper function */ @@ -968,7 +872,6 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) { php_oci_bind *bind = (php_oci_bind *) data; php_oci_connection *connection = bind->parent_statement->connection; - sword errstatus; if (bind->indicator == -1) { /* NULL */ zval *val = bind->zval; @@ -1028,26 +931,24 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) memset((void*)buff,0,sizeof(buff)); if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); zval_dtor(*entry); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); ZVAL_NULL(*entry); } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1); } zend_hash_move_forward(hash); } else { - PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); - if (errstatus != OCI_SUCCESS) { - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff)); + if (connection->errcode != OCI_SUCCESS) { + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); add_next_index_null(bind->zval); } else { - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ add_next_index_stringl(bind->zval, (char *)buff, buff_len, 1); } } @@ -1081,7 +982,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC) /* {{{ php_oci_bind_by_name() Bind zval to the given placeholder */ -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC) +int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long maxlength, ub2 type TSRMLS_DC) { php_oci_collection *bind_collection = NULL; php_oci_descriptor *bind_descriptor = NULL; @@ -1093,7 +994,6 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, php_oci_bind bind, *old_bind, *bindp; int mode = OCI_DATA_AT_EXEC; sb4 value_sz = -1; - sword errstatus; switch (type) { case SQLT_NTY: @@ -1217,7 +1117,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, bindp->type = type; zval_add_ref(&var); - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIBindByName, ( statement->stmt, /* statement handle */ @@ -1237,14 +1137,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } if (mode == OCI_DATA_AT_EXEC) { - PHP_OCI_CALL_RETURN(errstatus, OCIBindDynamic, + PHP_OCI_CALL_RETURN(statement->errcode, OCIBindDynamic, ( bindp->bind, statement->err, @@ -1255,8 +1155,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } @@ -1264,7 +1164,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, if (type == SQLT_NTY) { /* Bind object */ - PHP_OCI_CALL_RETURN(errstatus, OCIBindObject, + PHP_OCI_CALL_RETURN(statement->errcode, OCIBindObject, ( bindp->bind, statement->err, @@ -1276,17 +1176,15 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, ) ); - if (errstatus) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_in_callback() Callback used when binding LOBs and VARCHARs */ @@ -1337,8 +1235,7 @@ sb4 php_oci_bind_in_callback( *piecep = OCI_ONE_PIECE; /* pass all data in one go */ return OCI_CONTINUE; -} -/* }}} */ +}/* }}} */ /* {{{ php_oci_bind_out_callback() Callback used when binding LOBs and VARCHARs */ @@ -1461,61 +1358,55 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME zval_dtor(&tmp); } return column; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_statement_get_type() Return type of the statement */ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC) { ub2 statement_type; - sword errstatus; *type = 0; - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + *type = statement_type; return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_statement_get_numrows() Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC) { ub4 statement_numrows; - sword errstatus; *numrows = 0; - PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); + PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err)); - if (errstatus != OCI_SUCCESS) { - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + if (statement->errcode != OCI_SUCCESS) { + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ + *numrows = statement_numrows; return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_array_by_name() Bind arrays to PL/SQL types */ -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC) +int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC) { php_oci_bind *bind, *bindp; - sword errstatus; convert_to_array(var); @@ -1579,7 +1470,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam zval_add_ref(&var); - PHP_OCI_CALL_RETURN(errstatus, + PHP_OCI_CALL_RETURN(statement->errcode, OCIBindByName, ( statement->stmt, @@ -1600,21 +1491,19 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam ); - if (errstatus != OCI_SUCCESS) { + if (statement->errcode != OCI_SUCCESS) { efree(bind); - statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC); + statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode); return 1; } - statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */ efree(bind); return 0; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_array_helper_string() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length, long maxlength TSRMLS_DC) { php_oci_bind *bind; ub4 i; @@ -1679,12 +1568,11 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, zend_hash_internal_pointer_reset(hash); return bind; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_array_helper_number() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length TSRMLS_DC) { php_oci_bind *bind; ub4 i; @@ -1718,12 +1606,11 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length zend_hash_internal_pointer_reset(hash); return bind; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_array_helper_double() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length TSRMLS_DC) { php_oci_bind *bind; ub4 i; @@ -1757,18 +1644,16 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length zend_hash_internal_pointer_reset(hash); return bind; -} -/* }}} */ +} /* }}} */ /* {{{ php_oci_bind_array_helper_date() Bind arrays to PL/SQL types */ -php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC) +php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, php_oci_connection *connection TSRMLS_DC) { php_oci_bind *bind; ub4 i; HashTable *hash; zval **entry; - sword errstatus; hash = HASH_OF(var); @@ -1790,14 +1675,14 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) { convert_to_string_ex(entry); - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } @@ -1805,27 +1690,25 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, p ((OCIDate *)bind->array.elements)[i] = oci_date; zend_hash_move_forward(hash); } else { - PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); + PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date)); - if (errstatus != OCI_SUCCESS) { + if (connection->errcode != OCI_SUCCESS) { /* failed to convert string to date */ efree(bind->array.element_lengths); efree(bind->array.elements); efree(bind); - connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC); + connection->errcode = php_oci_error(connection->err, connection->errcode TSRMLS_CC); PHP_OCI_HANDLE_ERROR(connection, connection->errcode); return NULL; } ((OCIDate *)bind->array.elements)[i] = oci_date; } - connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */ } zend_hash_internal_pointer_reset(hash); return bind; -} -/* }}} */ +} /* }}} */ #endif /* HAVE_OCI8 */ diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index fcab20cc4544..00566b1b6013 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -6,14 +6,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> oci8 pecl.php.net Extension for Oracle Database - - - This extension allows you to access Oracle Database. OCI8 2.0 can - be built with PHP 4.3.9 onwards. OCI8 can be linked with Oracle - Database 9.2, 10, 11, or 12.1 client libraries. Oracle's standard - cross-version connectivity applies. For example PHP linked with - Oracle Database 11.2 client libraries can connect to Oracle - Database 9.2 onwards. + This extension allows you to access Oracle databases. It can be built with PHP 4.3.9 to 5.x. It can be linked with Oracle 9.2, 10.2, 11.1, or 11.2 client libraries. Christopher Jones @@ -25,7 +18,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> Antony Dovgal tony2001 tony2001@php.net - no + yes Wez Furlong @@ -40,24 +33,21 @@ http://pear.php.net/dtd/package-2.0.xsd"> no - 2013-09-06 + 2012-10-21 - - 2.0.2 - 2.0.2 - - - devel - devel - - PHP - -Review and improve error handling code and data types. -Fix oci_set_*($connection, ...) error handling so oci_error($connection) works. -Add DTrace oci8-connection-close probe -Add the connection handle to several DTrace probes. - + + 1.4.9 + 1.4.9 + + + stable + stable + + PHP + + Re-fixed bug #60901 (Improve "tail" syntax for AIX installation) + @@ -104,7 +94,6 @@ Add the connection handle to several DTrace probes. - @@ -298,38 +287,6 @@ Add the connection handle to several DTrace probes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -378,7 +335,6 @@ Add the connection handle to several DTrace probes. - @@ -427,14 +383,13 @@ Add the connection handle to several DTrace probes. - + - @@ -442,7 +397,7 @@ Add the connection handle to several DTrace probes. 4.3.9 - 6.0.0 + 5.4.99 1.4.0b1 @@ -455,131 +410,6 @@ Add the connection handle to several DTrace probes. - - - 2.0.1 - 2.0.1 - - - devel - devel - - PHP - -Fixed --enable-maintainer-zts mode. -Allow Implicit Result Set statement resources to inherit the parent's current prefetch count. -Allow OCI8 to be DTrace-enabled independently from core PHP. -Require OCI8 to be configured 'shared' when enabling DTrace support. - - - - - - 2.0.0 - 2.0.0 - - - devel - devel - - PHP - -- NEW FUNCTIONALITY: - - - Added Implicit Result Set support for Oracle Database 12c. - Streaming of all IRS's returned from a PL/SQL block is available - via oci_fetch_array, oci_fetch_assoc, oci_fetch_object and - oci_fetch_row (but not oci_fetch or oci_fetch_all). - Alternatively individual IRS statement resources can be obtained - with the new function 'oci_get_implicit_resultset' and passed to - any oci_fetch_* function. - - - Added DTrace probes enabled with PHP's generic --enable-dtrace - -- IMPROVED FUNCTIONALITY: - - - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no - longer unnecessarily initiates an internal ROLLBACK during - connection close. This can improve overall scalability by - reducing "round trips" between PHP and the database. - -- CHANGED FUNCTIONALITY: - - - PHPINFO() CHANGES: - - - The oci8.event and oci8.connection_class values are now shown - only when the Oracle client libraries support the respective - functionality. - - - Connection statistics are now in a separate phpinfo() table. - - - Temporary LOB and Collection support status lines in - phpinfo() were removed. These features have always been - enabled since 2007. - - - OCI_INTERNAL_DEBUG() CHANGES: - - - The oci_internal_debug() function is now a no-op. Use PHP's - --enable-dtrace functionality with DTrace or SystemTap instead. - -- INTERNAL CHANGES: - - - Fixed a potential NULL pointer dereference flagged by Parfait - static code analysis. - - - Extended testing of existing OCI8 functionality. - - - Improved test output portability when using the PHP development - web server to run tests. - - - Removed no-longer necessary Unicode patterns from tests - (vestiges of PHP's previous PHP 6 project) - - - Improved build portability by removing compilation type cast - warnings with some compilers. - - - Fixed compilation warnings when building with Oracle 9.2 - client libraries. - - - Updated code to use internal macro PHP_OCI_REGISTER_RESOURCE. - - - Regularized code prototypes and fixed some in-line documentation - prototypes. - - - Fixed code folding. - - - - - - 1.4.10 - 1.4.10 - - - stable - stable - - PHP - - Bump PECL package info version check to allow PECL installs with PHP 5.5+ - - - - - - 1.4.9 - 1.4.9 - - - stable - stable - - PHP - - Re-fixed bug #60901 (Improve "tail" syntax for AIX installation) - - - 1.4.8 @@ -612,7 +442,7 @@ Require OCI8 to be configured 'shared' when enabling DTrace support. Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup) Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc) Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size - Improve internal initialization failure error messages + Improve internal initalization failure error messages @@ -627,7 +457,7 @@ Require OCI8 to be configured 'shared' when enabling DTrace support. PHP - Added oci_client_version() returning the run time Oracle client library version + Added oci_client_version() returning the runtime Oracle client library version Made OCI8 extension buildable with PHP 5.4-development code @@ -1001,7 +831,7 @@ Fixed bug #36820 (Privileged connection with an Oracle password file fails) 2006-03-16 PHP Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version < 10.2 -Fixed bug #36235 (ocicolumnname returns false before a successful fetch) +Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch) Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed) Fixed bug #36055 (possible OCI8 crash in multithreaded environment) Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters) diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 8c5fba9ab087..6632bc88ffc3 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -46,7 +46,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.0.2-dev" +#define PHP_OCI8_VERSION "1.4.9" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 6155a883b02e..155e57d2cd1a 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -31,7 +31,7 @@ # ifndef PHP_OCI8_INT_H # define PHP_OCI8_INT_H -/* {{{ misc defines */ +/* misc defines {{{ */ # if (defined(__osf__) && defined(__alpha)) # ifndef A_OSF # define A_OSF @@ -44,10 +44,6 @@ # endif # endif /* osf alpha */ -#ifdef HAVE_OCI8_DTRACE -#include "oci8_dtrace_gen.h" -#endif - #if defined(min) #undef min #endif @@ -70,7 +66,7 @@ extern int le_session; extern zend_class_entry *oci_lob_class_entry_ptr; extern zend_class_entry *oci_coll_class_entry_ptr; -/* {{{ constants */ +/* constants {{{ */ #define PHP_OCI_SEEK_SET 0 #define PHP_OCI_SEEK_CUR 1 #define PHP_OCI_SEEK_END 2 @@ -105,11 +101,6 @@ extern zend_class_entry *oci_coll_class_entry_ptr; #error Invalid value for PHP_OCI_CRED_EXT #endif -#define PHP_OCI_IMPRES_UNKNOWN 0 -#define PHP_OCI_IMPRES_NO_CHILDREN 1 -#define PHP_OCI_IMPRES_HAS_CHILDREN 2 -#define PHP_OCI_IMPRES_IS_CHILD 3 - /* * Name passed to Oracle for tracing. Note some DB views only show * the first nine characters of the driver name. @@ -118,21 +109,16 @@ extern zend_class_entry *oci_coll_class_entry_ptr; /* }}} */ -/* {{{ php_oci_spool */ -typedef struct { - int id; /* resource id */ - OCIEnv *env; /* env of this session pool */ +typedef struct { /* php_oci_spool {{{ */ + OCIEnv *env; /*env of this session pool */ OCIError *err; /* pool's error handle */ OCISPool *poolh; /* pool handle */ void *poolname; /* session pool name */ unsigned int poolname_len; /* length of session pool name */ char *spool_hash_key; /* Hash key for session pool in plist */ -} php_oci_spool; -/* }}} */ +} php_oci_spool; /* }}} */ -/* {{{ php_oci_connection */ -typedef struct { - int id; /* resource ID */ +typedef struct { /* php_oci_connection {{{ */ OCIEnv *env; /* private env handle */ ub2 charset; /* charset ID */ OCIServer *server; /* private server handle */ @@ -141,7 +127,7 @@ typedef struct { OCIAuthInfo *authinfo; /* Cached authinfo handle for OCISessionGet */ OCIError *err; /* private error handle */ php_oci_spool *private_spool; /* private session pool (for persistent) */ - sb4 errcode; /* last ORA- error number */ + sword errcode; /* last errcode */ HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ ulong descriptor_count; /* used to index the descriptors hash table. Not an accurate count */ @@ -149,18 +135,17 @@ typedef struct { unsigned is_attached:1; /* hels to determine if we should detach from the server when closing/freeing the connection */ unsigned is_persistent:1; /* self-descriptive */ unsigned used_this_request:1; /* helps to determine if we should reset connection's next ping time and check its timeout */ - unsigned rb_on_disconnect:1; /* helps to determine if we should rollback this connection on close/shutdown */ + unsigned needs_commit:1; /* helps to determine if we should rollback this connection on close/shutdown */ unsigned passwd_changed:1; /* helps determine if a persistent connection hash should be invalidated after a password change */ unsigned is_stub:1; /* flag to keep track whether the connection structure has a real OCI connection associated */ unsigned using_spool:1; /* Is this connection from session pool? */ + int rsrc_id; /* resource ID */ time_t idle_expiry; /* time when the connection will be considered as expired */ time_t *next_pingp; /* (pointer to) time of the next ping */ char *hash_key; /* hashed details of the connection */ -} php_oci_connection; -/* }}} */ +} php_oci_connection; /* }}} */ -/* {{{ php_oci_descriptor */ -typedef struct { +typedef struct { /* php_oci_descriptor {{{ */ int id; ulong index; /* descriptors hash table index */ php_oci_connection *connection; /* parent connection handle */ @@ -173,19 +158,15 @@ typedef struct { ub1 charset_form; /* charset form, required for NCLOBs */ ub2 charset_id; /* charset ID */ unsigned is_open:1; /* helps to determine if lob is open or not */ -} php_oci_descriptor; -/* }}} */ +} php_oci_descriptor; /* }}} */ -/* {{{ php_oci_lob_ctx */ -typedef struct { +typedef struct { /* php_oci_lob_ctx {{{ */ char **lob_data; /* address of pointer to LOB data */ ub4 *lob_len; /* address of LOB length variable (bytes) */ ub4 alloc_len; -} php_oci_lob_ctx; -/* }}} */ +} php_oci_lob_ctx; /* }}} */ -/* {{{ php_oci_collection */ -typedef struct { +typedef struct { /* php_oci_collection {{{ */ int id; php_oci_connection *connection; /* parent connection handle */ OCIType *tdo; /* collection's type handle */ @@ -194,30 +175,23 @@ typedef struct { OCIType *element_type; /* element's type handle */ OCITypeCode element_typecode; /* element's typecode handle */ OCIColl *collection; /* collection handle */ -} php_oci_collection; -/* }}} */ +} php_oci_collection; /* }}} */ -/* {{{ php_oci_define */ -typedef struct { +typedef struct { /* php_oci_define {{{ */ zval *zval; /* zval used in define */ text *name; /* placeholder's name */ ub4 name_len; /* placeholder's name length */ ub4 type; /* define type */ -} php_oci_define; -/* }}} */ +} php_oci_define; /* }}} */ -/* {{{ php_oci_statement */ -typedef struct { +typedef struct { /* php_oci_statement {{{ */ int id; int parent_stmtid; /* parent statement id */ - struct php_oci_statement *impres_child_stmt;/* child of current Implicit Result Set statement handle */ - ub4 impres_count; /* count of remaining Implicit Result children on parent statement handle */ php_oci_connection *connection; /* parent connection handle */ - sb4 errcode; /* last ORA- error number */ + sword errcode; /* last errcode*/ OCIError *err; /* private error handle */ OCIStmt *stmt; /* statement handle */ - char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor recieved from Oracle */ - char impres_flag; /* PHP_OCI_IMPRES_*_ */ + char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */ long last_query_len; /* last query length */ HashTable *columns; /* hash containing all the result columns */ HashTable *binds; /* binds hash */ @@ -227,12 +201,9 @@ typedef struct { unsigned has_data:1; /* statement has more data flag */ unsigned has_descr:1; /* statement has at least one descriptor or cursor column */ ub2 stmttype; /* statement type */ - ub4 prefetch_count; /* current prefetch count */ -} php_oci_statement; -/* }}} */ +} php_oci_statement; /* }}} */ -/* {{{ php_oci_bind */ -typedef struct { +typedef struct { /* php_oci_bind {{{ */ OCIBind *bind; /* bind handle */ zval *zval; /* value */ dvoid *descriptor; /* used for binding of LOBS etc */ @@ -251,11 +222,9 @@ typedef struct { sb2 indicator; /* -1 means NULL */ ub2 retcode; ub4 dummy_len; /* a dummy var to store alenpp value in bind OUT callback */ -} php_oci_bind; -/* }}} */ +} php_oci_bind; /* }}} */ -/* {{{ php_oci_out_column */ -typedef struct { +typedef struct { /* php_oci_out_column {{{ */ php_oci_statement *statement; /* statement handle. used when fetching REFCURSORS */ php_oci_statement *nested_statement; /* statement handle. used when fetching REFCURSORS */ OCIDefine *oci_define; /* define handle */ @@ -280,23 +249,28 @@ typedef struct { sb2 precision; /* column precision */ ub1 charset_form; /* charset form, required for NCLOBs */ ub2 charset_id; /* charset ID */ -} php_oci_out_column; -/* }}} */ +} php_oci_out_column; /* }}} */ /* {{{ macros */ -#define PHP_OCI_CALL(func, params) \ - do { \ - OCI_G(in_call) = 1; \ - func params; \ - OCI_G(in_call) = 0; \ +#define PHP_OCI_CALL(func, params) \ + do { \ + if (OCI_G(debug_mode)) { \ + php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \ + } \ + OCI_G(in_call) = 1; \ + func params; \ + OCI_G(in_call) = 0; \ } while (0) -#define PHP_OCI_CALL_RETURN(__retval, func, params) \ - do { \ - OCI_G(in_call) = 1; \ - __retval = func params; \ - OCI_G(in_call) = 0; \ +#define PHP_OCI_CALL_RETURN(__retval, func, params) \ + do { \ + if (OCI_G(debug_mode)) { \ + php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \ + } \ + OCI_G(in_call) = 1; \ + __retval = func params; \ + OCI_G(in_call) = 0; \ } while (0) /* Check for errors that indicate the connection to the DB is no @@ -310,7 +284,6 @@ typedef struct { */ #define PHP_OCI_HANDLE_ERROR(connection, errcode) \ do { \ - ub4 serverStatus = OCI_SERVER_NORMAL; \ switch (errcode) { \ case 1013: \ zend_bailout(); \ @@ -340,6 +313,7 @@ typedef struct { break; \ default: \ { \ + ub4 serverStatus = OCI_SERVER_NORMAL; \ PHP_OCI_CALL(OCIAttrGet, ((dvoid *)(connection)->server, OCI_HTYPE_SERVER, (dvoid *)&serverStatus, \ (ub4 *)0, OCI_ATTR_SERVER_STATUS, (connection)->err)); \ if (serverStatus != OCI_SERVER_NORMAL) { \ @@ -348,7 +322,6 @@ typedef struct { } \ break; \ } \ - php_oci_dtrace_check_connection(connection, errcode, serverStatus); \ } while (0) #define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \ @@ -392,110 +365,117 @@ typedef struct { /* PROTOS */ -/* {{{ main prototypes */ +/* main prototypes {{{ */ + +void php_oci_column_hash_dtor (void *data); +void php_oci_define_hash_dtor (void *data); +void php_oci_bind_hash_dtor (void *data); +void php_oci_descriptor_flush_hash_dtor (void *data); -void php_oci_column_hash_dtor(void *data); -void php_oci_define_hash_dtor(void *data); -void php_oci_bind_hash_dtor(void *data); -void php_oci_descriptor_flush_hash_dtor(void *data); void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_DC); -sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC); -sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC); -int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC); -void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive); + +sb4 php_oci_error (OCIError *, sword TSRMLS_DC); +sb4 php_oci_fetch_errmsg(OCIError *, text ** TSRMLS_DC); +int php_oci_fetch_sqltext_offset(php_oci_statement *, text **, ub2 * TSRMLS_DC); + +void php_oci_do_connect (INTERNAL_FUNCTION_PARAMETERS, int , int); php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC); -int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC); -int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC); + +int php_oci_connection_rollback(php_oci_connection * TSRMLS_DC); +int php_oci_connection_commit(php_oci_connection * TSRMLS_DC); int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC); -int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC); -void php_oci_client_get_version(char **version TSRMLS_DC); -int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC); -void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args); -int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC); -void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus); + +int php_oci_password_change(php_oci_connection *, char *, int, char *, int, char *, int TSRMLS_DC); +void php_oci_client_get_version(char ** TSRMLS_DC); +int php_oci_server_get_version(php_oci_connection *, char ** TSRMLS_DC); + +void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int, int); +int php_oci_column_to_zval(php_oci_out_column *, zval *, int TSRMLS_DC); /* }}} */ -/* {{{ lob related prototypes */ - -php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, long type TSRMLS_DC); -int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC); -int php_oci_lob_read(php_oci_descriptor *descriptor, long read_length, long inital_offset, char **data, ub4 *data_len TSRMLS_DC); -int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC); -int php_oci_lob_flush(php_oci_descriptor *descriptor, long flush_flag TSRMLS_DC); -int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off TSRMLS_DC); -int php_oci_lob_get_buffering(php_oci_descriptor *descriptor); -int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, long length TSRMLS_DC); -int php_oci_lob_close(php_oci_descriptor *descriptor TSRMLS_DC); -int php_oci_temp_lob_close(php_oci_descriptor *descriptor TSRMLS_DC); -int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, long type, char *data, int data_len TSRMLS_DC); -void php_oci_lob_free(php_oci_descriptor *descriptor TSRMLS_DC); -int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename TSRMLS_DC); -int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC); -int php_oci_lob_truncate(php_oci_descriptor *descriptor, long new_lob_length TSRMLS_DC); -int php_oci_lob_erase(php_oci_descriptor *descriptor, long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC); -int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC); +/* lob related prototypes {{{ */ + +php_oci_descriptor * php_oci_lob_create (php_oci_connection *, long TSRMLS_DC); +int php_oci_lob_get_length (php_oci_descriptor *, ub4 * TSRMLS_DC); +int php_oci_lob_read (php_oci_descriptor *, long, long, char **, ub4 * TSRMLS_DC); +int php_oci_lob_write (php_oci_descriptor *, ub4, char *, int, ub4 * TSRMLS_DC); +int php_oci_lob_flush (php_oci_descriptor *, long TSRMLS_DC); +int php_oci_lob_set_buffering (php_oci_descriptor *, int TSRMLS_DC); +int php_oci_lob_get_buffering (php_oci_descriptor *); +int php_oci_lob_copy (php_oci_descriptor *, php_oci_descriptor *, long TSRMLS_DC); +int php_oci_lob_close (php_oci_descriptor * TSRMLS_DC); +int php_oci_temp_lob_close (php_oci_descriptor * TSRMLS_DC); +int php_oci_lob_write_tmp (php_oci_descriptor *, long, char *, int TSRMLS_DC); +void php_oci_lob_free(php_oci_descriptor * TSRMLS_DC); +int php_oci_lob_import(php_oci_descriptor *descriptor, char * TSRMLS_DC); +int php_oci_lob_append (php_oci_descriptor *, php_oci_descriptor * TSRMLS_DC); +int php_oci_lob_truncate (php_oci_descriptor *, long TSRMLS_DC); +int php_oci_lob_erase (php_oci_descriptor *, long, ub4, ub4 * TSRMLS_DC); +int php_oci_lob_is_equal (php_oci_descriptor *, php_oci_descriptor *, boolean * TSRMLS_DC); #if defined(HAVE_OCI_LOB_READ2) -sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp); +sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp); #else -sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece); +sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece); #endif /* }}} */ -/* {{{ collection related prototypes */ - -php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC); -int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC); -int php_oci_collection_max(php_oci_collection *collection, long *max TSRMLS_DC); -int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRMLS_DC); -int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC); -int php_oci_collection_element_get(php_oci_collection *collection, long index, zval **result_element TSRMLS_DC); -int php_oci_collection_element_set(php_oci_collection *collection, long index, char *value, int value_len TSRMLS_DC); -int php_oci_collection_element_set_null(php_oci_collection *collection, long index TSRMLS_DC); -int php_oci_collection_element_set_date(php_oci_collection *collection, long index, char *date, int date_len TSRMLS_DC); -int php_oci_collection_element_set_number(php_oci_collection *collection, long index, char *number, int number_len TSRMLS_DC); -int php_oci_collection_element_set_string(php_oci_collection *collection, long index, char *element, int element_len TSRMLS_DC); -int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC); -void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC); -int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC); -int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC); -int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC); -int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC); +/* collection related prototypes {{{ */ + +php_oci_collection * php_oci_collection_create(php_oci_connection *, char *, int, char *, int TSRMLS_DC); +int php_oci_collection_size(php_oci_collection *, sb4 * TSRMLS_DC); +int php_oci_collection_max(php_oci_collection *, long * TSRMLS_DC); +int php_oci_collection_trim(php_oci_collection *, long TSRMLS_DC); +int php_oci_collection_append(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_element_get(php_oci_collection *, long, zval** TSRMLS_DC); +int php_oci_collection_element_set(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_element_set_null(php_oci_collection *, long TSRMLS_DC); +int php_oci_collection_element_set_date(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_element_set_number(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_element_set_string(php_oci_collection *, long, char *, int TSRMLS_DC); +int php_oci_collection_assign(php_oci_collection *, php_oci_collection * TSRMLS_DC); +void php_oci_collection_close(php_oci_collection * TSRMLS_DC); +int php_oci_collection_append_null(php_oci_collection * TSRMLS_DC); +int php_oci_collection_append_date(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append_number(php_oci_collection *, char *, int TSRMLS_DC); +int php_oci_collection_append_string(php_oci_collection *, char *, int TSRMLS_DC); /* }}} */ -/* {{{ statement related prototypes */ +/* statement related prototypes {{{ */ -php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC); -php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC); -int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC); -int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC); -php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC); -int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC); -int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC); -void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC); +php_oci_statement * php_oci_statement_create (php_oci_connection *, char *, int TSRMLS_DC); +int php_oci_statement_set_prefetch (php_oci_statement *, long TSRMLS_DC); +int php_oci_statement_fetch (php_oci_statement *, ub4 TSRMLS_DC); +php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long, char *, int TSRMLS_DC); +int php_oci_statement_execute (php_oci_statement *, ub4 TSRMLS_DC); +int php_oci_statement_cancel (php_oci_statement * TSRMLS_DC); +void php_oci_statement_free (php_oci_statement * TSRMLS_DC); int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC); int php_oci_bind_post_exec(void *data TSRMLS_DC); -int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long maxlength, ub2 type TSRMLS_DC); -sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp); -sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp); +int php_oci_bind_by_name(php_oci_statement *, char *, int, zval*, long, ub2 TSRMLS_DC); +sb4 php_oci_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); +sb4 php_oci_bind_out_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 **, ub1 *, dvoid **, ub2 **); php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data); int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC); -int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC); -int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC); -int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, long max_table_length, long maxlength, long type TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_number(zval *var, long max_table_length TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_double(zval *var, long max_table_length TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_string(zval *var, long max_table_length, long maxlength TSRMLS_DC); -php_oci_bind *php_oci_bind_array_helper_date(zval *var, long max_table_length, php_oci_connection *connection TSRMLS_DC); + +int php_oci_statement_get_type(php_oci_statement *, ub2 * TSRMLS_DC); +int php_oci_statement_get_numrows(php_oci_statement *, ub4 * TSRMLS_DC); +int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval* var, long max_table_length, long maxlength, long type TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length, long maxlength TSRMLS_DC); +php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, php_oci_connection *connection TSRMLS_DC); /* }}} */ -ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */ - sb4 errcode; /* global last ORA- error number. Used when connect fails, for example */ +ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ */ + sword errcode; /* global last error code (used when connect fails, for example) */ OCIError *err; /* global error handle */ + zend_bool debug_mode; /* debug mode flag */ + long max_persistent; /* maximum number of persistent connections per process */ long num_persistent; /* number of existing persistent connections */ long num_links; /* non-persistent + persistent connections */ diff --git a/ext/oci8/tests/bind_char_1.phpt b/ext/oci8/tests/bind_char_1.phpt index d68991a7f2ba..91fa4b75b76b 100644 --- a/ext/oci8/tests/bind_char_1.phpt +++ b/ext/oci8/tests/bind_char_1.phpt @@ -5,15 +5,12 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) { + die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); + } } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bind_char_1_11gR1.phpt b/ext/oci8/tests/bind_char_1_11gR1.phpt index 2a7c713aa7f1..a7feff9f6a87 100644 --- a/ext/oci8/tests/bind_char_1_11gR1.phpt +++ b/ext/oci8/tests/bind_char_1_11gR1.phpt @@ -5,12 +5,10 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); + } } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_2.phpt b/ext/oci8/tests/bind_char_2.phpt index 3695c8585490..43661a065da4 100644 --- a/ext/oci8/tests/bind_char_2.phpt +++ b/ext/oci8/tests/bind_char_2.phpt @@ -5,15 +5,12 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) { + die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); + } } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bind_char_2_11gR1.phpt b/ext/oci8/tests/bind_char_2_11gR1.phpt index b9afd6940bcc..edb2a12ff0a2 100644 --- a/ext/oci8/tests/bind_char_2_11gR1.phpt +++ b/ext/oci8/tests/bind_char_2_11gR1.phpt @@ -5,12 +5,10 @@ SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); + } } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_3.phpt b/ext/oci8/tests/bind_char_3.phpt index 009e60a542b6..25115836dfcb 100644 --- a/ext/oci8/tests/bind_char_3.phpt +++ b/ext/oci8/tests/bind_char_3.phpt @@ -5,15 +5,12 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) { + die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); + } } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bind_char_3_11gR1.phpt b/ext/oci8/tests/bind_char_3_11gR1.phpt index a894de00c075..fea77754d176 100644 --- a/ext/oci8/tests/bind_char_3_11gR1.phpt +++ b/ext/oci8/tests/bind_char_3_11gR1.phpt @@ -5,12 +5,10 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to CHAR parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); + } } ?> --ENV-- diff --git a/ext/oci8/tests/bind_char_4.phpt b/ext/oci8/tests/bind_char_4.phpt index 0ac60e503de8..36765f813744 100644 --- a/ext/oci8/tests/bind_char_4.phpt +++ b/ext/oci8/tests/bind_char_4.phpt @@ -5,15 +5,12 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 2) { + die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); + } } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bind_char_4_11gR1.phpt b/ext/oci8/tests/bind_char_4_11gR1.phpt index d5ce116afb65..2bc2f1424634 100644 --- a/ext/oci8/tests/bind_char_4_11gR1.phpt +++ b/ext/oci8/tests/bind_char_4_11gR1.phpt @@ -5,12 +5,10 @@ PL/SQL oci_bind_by_name with SQLT_AFC aka CHAR to VARCHAR2 parameter if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 11 && $matches[2] == 1) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); +if (preg_match('/Release 11\.1\./', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 11gR1 or 11.2.0.3 databases"); + } } ?> --ENV-- diff --git a/ext/oci8/tests/bind_unsupported_2.phpt b/ext/oci8/tests/bind_unsupported_2.phpt index a2bf9de5a6b6..d3e5375df6c4 100644 --- a/ext/oci8/tests/bind_unsupported_2.phpt +++ b/ext/oci8/tests/bind_unsupported_2.phpt @@ -3,8 +3,7 @@ Bind with various unsupported 10g+ bind types --SKIPIF-- diff --git a/ext/oci8/tests/bug27303_1.phpt b/ext/oci8/tests/bug27303_1.phpt index 0ef47f13ddee..40ab4ebed247 100644 --- a/ext/oci8/tests/bug27303_1.phpt +++ b/ext/oci8/tests/bug27303_1.phpt @@ -5,15 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] >= 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 && + preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); + // Other point releases may also work } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bug27303_1_11gR1.phpt b/ext/oci8/tests/bug27303_1_11gR1.phpt index 7b4c15856195..6de9b9937855 100644 --- a/ext/oci8/tests/bug27303_1_11gR1.phpt +++ b/ext/oci8/tests/bug27303_1_11gR1.phpt @@ -5,13 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using Oracle 10gR2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using specific Oracle database versions"); + } + } } ?> --FILE-- diff --git a/ext/oci8/tests/bug27303_2.phpt b/ext/oci8/tests/bug27303_2.phpt index 72d4e5a7ddbc..1fb2b3168271 100644 --- a/ext/oci8/tests/bug27303_2.phpt +++ b/ext/oci8/tests/bug27303_2.phpt @@ -5,15 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); +if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 && + preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); + // Other point releases may also work } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bug27303_2_11gR1.phpt b/ext/oci8/tests/bug27303_2_11gR1.phpt index 27d8a585bd45..1e3e3105ad66 100644 --- a/ext/oci8/tests/bug27303_2_11gR1.phpt +++ b/ext/oci8/tests/bug27303_2_11gR1.phpt @@ -5,13 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using specific Oracle database versions"); +if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using specific Oracle database versions"); + } + } } ?> --FILE-- diff --git a/ext/oci8/tests/bug27303_4.phpt b/ext/oci8/tests/bug27303_4.phpt index a24ae705aba5..3137db865919 100644 --- a/ext/oci8/tests/bug27303_4.phpt +++ b/ext/oci8/tests/bug27303_4.phpt @@ -5,16 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 2) - ))) { - die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); - // Other point releases may also work +if (preg_match('/Release 10\.2\.0\.2/', oci_server_version($c), $matches) !== 1 && + preg_match('/Release 11\.2\.0\.2/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using Oracle 10.2.0.2 or 11.2.0.2 databases"); + // Other point releases may also work } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 11) { +if (preg_match('/^11\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11g or greater version of client"); } ?> diff --git a/ext/oci8/tests/bug27303_4_11gR1.phpt b/ext/oci8/tests/bug27303_4_11gR1.phpt index 01db1dc5a0be..f9bc2da8a25a 100644 --- a/ext/oci8/tests/bug27303_4_11gR1.phpt +++ b/ext/oci8/tests/bug27303_4_11gR1.phpt @@ -5,13 +5,12 @@ Bug #27303 (OCIBindByName binds numeric PHP values as characters) if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && - (($matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) || - ($matches[1] == 11 && $matches[2] == 1 && $matches[3] == 0 && $matches[4] == 6) || - ($matches[1] == 11 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] == 3) - ))) { - die("skip expected output only valid when using specific Oracle database versions"); +if (preg_match('/Release 10\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.1\.0\.6/', oci_server_version($c), $matches) !== 1) { + if (preg_match('/Release 11\.2\.0\.3/', oci_server_version($c), $matches) !== 1) { + die("skip expected output only valid when using specific Oracle database versions"); + } + } } ?> --FILE-- diff --git a/ext/oci8/tests/bug36403.phpt b/ext/oci8/tests/bug36403.phpt index 4ac32c4b069a..53dae694ec8b 100644 --- a/ext/oci8/tests/bug36403.phpt +++ b/ext/oci8/tests/bug36403.phpt @@ -3,9 +3,8 @@ Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY) --SKIPIF-- --FILE-- diff --git a/ext/oci8/tests/bug43492_2.phpt b/ext/oci8/tests/bug43492_2.phpt index d735f6429947..61511cf6d2f4 100644 --- a/ext/oci8/tests/bug43492_2.phpt +++ b/ext/oci8/tests/bug43492_2.phpt @@ -8,7 +8,7 @@ require(dirname(__FILE__).'/skipif.inc'); --FILE-- true, 'timesten' => false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { - die("skip test expected to work only with Oracle 10g or greater version of client"); +if (preg_match('/^1[01]\./', oci_client_version()) != 1) { + die("skip expected output only valid with Oracle 10g or greater version of client"); } ?> --FILE-- diff --git a/ext/oci8/tests/bug47281.phpt b/ext/oci8/tests/bug47281.phpt index 0098ec5ebb77..d0e00235374c 100644 --- a/ext/oci8/tests/bug47281.phpt +++ b/ext/oci8/tests/bug47281.phpt @@ -6,12 +6,11 @@ $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on t require(dirname(__FILE__).'/skipif.inc'); // error3.phpt obsoletes this test for newer Oracle client versions // Assume runtime client version is >= compile time client version -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!isset($matches[0]) || - ($matches[0] > 11 || ($matches[0] == 11 && $matches[1] > 2) || ($matches[0] == 11 && $matches[1] == 2 && $matches[3] >= 3) - )) { +$cv = explode('.', oci_client_version()); +if ($cv[0] > 11 || ($cv[0] == 11 && $cv[1] > 2) || ($cv[0] == 11 && $cv[1] == 2 && $cv[3] >= 3)) { die("skip test works only with Oracle 11.2.0.2 or earlier Oracle client libraries"); } + ?> --ENV-- NLS_LANG=.AL32UTF8 diff --git a/ext/oci8/tests/commit_001.phpt b/ext/oci8/tests/commit_001.phpt index ef4018118e31..806fb193a0e7 100644 --- a/ext/oci8/tests/commit_001.phpt +++ b/ext/oci8/tests/commit_001.phpt @@ -81,48 +81,48 @@ echo "Done\n"; bool(true) int(0) array(5) { - ["ID"]=> + [%u|b%"ID"]=> array(0) { } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(0) { } - ["BLOB"]=> + [%u|b%"BLOB"]=> array(0) { } - ["CLOB"]=> + [%u|b%"CLOB"]=> array(0) { } - ["STRING"]=> + [%u|b%"STRING"]=> array(0) { } } bool(true) int(4) array(5) { - ["ID"]=> + [%u|b%"ID"]=> array(4) { [0]=> - string(1) "1" + %string|unicode%(1) "1" [1]=> - string(1) "1" + %string|unicode%(1) "1" [2]=> - string(1) "1" + %string|unicode%(1) "1" [3]=> - string(1) "1" + %string|unicode%(1) "1" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(4) { [0]=> - string(1) "1" + %string|unicode%(1) "1" [1]=> - string(1) "1" + %string|unicode%(1) "1" [2]=> - string(1) "1" + %string|unicode%(1) "1" [3]=> - string(1) "1" + %string|unicode%(1) "1" } - ["BLOB"]=> + [%u|b%"BLOB"]=> array(4) { [0]=> NULL @@ -133,7 +133,7 @@ array(5) { [3]=> NULL } - ["CLOB"]=> + [%u|b%"CLOB"]=> array(4) { [0]=> NULL @@ -144,7 +144,7 @@ array(5) { [3]=> NULL } - ["STRING"]=> + [%u|b%"STRING"]=> array(4) { [0]=> NULL diff --git a/ext/oci8/tests/conn_attr.inc b/ext/oci8/tests/conn_attr.inc index 2edc1c95528d..2c086b1892b4 100644 --- a/ext/oci8/tests/conn_attr.inc +++ b/ext/oci8/tests/conn_attr.inc @@ -2,28 +2,30 @@ require(dirname(__FILE__)."/connect.inc"); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if ((isset($matches[1]) && $matches[1] >= 11)) { +$sv = oci_server_version($c); +$sv = preg_match('/Release (11\.2|12)\./', $sv, $matches); +if ($sv == 1) { // Server is Oracle 11.2+ $stmtarray = array( - "drop user $testuser cascade", - "create user $testuser identified by $testpassword", // $testuser should be set by the file that includes conn_attr.inc - "grant connect,resource,dba to $testuser", - "alter user $testuser enable editions", - "drop edition myedition1 cascade", - "drop edition myedition cascade", - "grant create any edition to $testuser", + "drop user testuser cascade", + "create user testuser identified by testuser", + "grant connect,resource,dba to testuser", + "alter user testuser enable editions", + "drop edition myedition1", + "drop edition myedition", + "grant create any edition to testuser", "create edition myedition", "create edition myedition1 as child of myedition", - "grant use on edition myedition to $testuser", - "grant use on edition myedition1 to $testuser", + "grant use on edition myedition to testuser", + "grant use on edition myedition1 to testuser", ); -} else { +} +else { // Server is Pre 11.2 $stmtarray = array( - "drop user $testuser cascade", - "create user $testuser identified by $testpassword", - "grant connect,resource,dba to $testuser", + "drop user testuser cascade", + "create user testuser identified by testuser", + "grant connect,resource,dba to testuser", ); } @@ -66,8 +68,8 @@ function get_attr($conn,$attr) function get_conn($conn_type) { - $user = $GLOBALS['testuser']; - $password = $GLOBALS['testpassword']; + $user = 'testuser'; + $password = 'testuser'; $dbase = $GLOBALS['dbase']; switch($conn_type) { case 1: @@ -96,7 +98,7 @@ function set_attr($conn,$attr,$sufix) else if (!strcmp($attr,'CLIENT_IDENTIFIER')) $r = oci_set_client_identifier($conn,'ID00'.$sufix); else - echo "Pass one of the above four attributes!!!\n"; + echo "Pass one of the above four attibutes!!!\n"; if ($r) { echo "Value of $attr has been set successfully\n"; } @@ -137,9 +139,9 @@ function get_sys_attr($conn,$attr) function clean_up($c) { $stmtarray = array( - "drop edition myedition1 cascade", - "drop edition myedition cascade", - "drop user " . $GLOBALS['testuser'] . " cascade", + "drop user testuser cascade", + "drop edition myedition1", + "drop edition myedition", ); foreach ($stmtarray as $stmt) { diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt index 631bc19c1d41..ad508a2ed2a4 100644 --- a/ext/oci8/tests/conn_attr_1.phpt +++ b/ext/oci8/tests/conn_attr_1.phpt @@ -9,21 +9,15 @@ if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); if ($test_drcp) die("skip output might vary with DRCP"); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 10)) { +if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { +} else if (preg_match('/^1[01]\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 10g or greater version of client"); } + ?> --FILE-- = 10)) { +if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { +} else if (preg_match('/^1[01]\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 10g or greater version of client"); } + ?> --INI-- oci8.privileged_connect = On --FILE-- = 10)) { +if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { +} else if (preg_match('/^1[01]\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 10g or greater version of client"); } ?> --FILE-- = 2) || - ($matches[1] >= 12) - ))) { - // Bug fixed in 11.2 prevents client_info being reset +if (preg_match('/Release (11\.2|12)\./', oci_server_version($c), $matches) !== 1) { + // Bug fixed in 11.2 prevents client_info being rest die("skip expected output only valid when using Oracle 11gR2 or greater database server"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { +} else if (preg_match('/^1[01]\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 10g or greater version of client"); } ?> --FILE-- = 10)) { +if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) { die("skip expected output only valid when using Oracle 10g or greater database server"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (isset($matches[0]) && $matches[0] < 10) { +} else if (preg_match('/^1[01]\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 10g or greater version of client"); } ?> --FILE-- (10\.2)/', $phpinfo); +if ($iv != 1) { die ("skip tests a feature that works only with Oracle 10gR2"); } ?> diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt index 40dc5a98fc7e..1620803dbb73 100644 --- a/ext/oci8/tests/connect_without_oracle_home_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_11.phpt @@ -10,11 +10,7 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov != 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[0] == 11 && $matches[1] >= 2) || - ($matches[0] >= 12) - ))) { +if (preg_match('/^11\.2|12\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt index e04016f41a76..c7cfecf39611 100644 --- a/ext/oci8/tests/connect_without_oracle_home_old_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_old_11.phpt @@ -10,11 +10,7 @@ $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && - (($matches[0] == 11 && $matches[1] >= 2) || - ($matches[0] >= 12) - ))) { +if (preg_match('/^11\.2|12\./', oci_client_version()) != 1) { die("skip test expected to work only with Oracle 11gR2 or greater version of client"); } ?> diff --git a/ext/oci8/tests/cursors_old.phpt b/ext/oci8/tests/cursors_old.phpt index aa25937570e5..d60e2ff1ea43 100644 --- a/ext/oci8/tests/cursors_old.phpt +++ b/ext/oci8/tests/cursors_old.phpt @@ -52,19 +52,19 @@ echo "Done\n"; ?> --EXPECTF-- array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(1) "1" } bool(true) Warning: ocifetchinto():%sORA-01002: %s in %scursors_old.php on line %d array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(1) "1" } bool(true) Done diff --git a/ext/oci8/tests/debug.phpt b/ext/oci8/tests/debug.phpt index 66ab0f0d005f..fe96e6e87ec4 100644 --- a/ext/oci8/tests/debug.phpt +++ b/ext/oci8/tests/debug.phpt @@ -16,9 +16,10 @@ else { oci_connect($user, $password); } +echo "Done\n"; + oci_internal_debug(false); ?> -===DONE=== ---EXPECT-- -===DONE=== +--EXPECTREGEX-- +^OCI8 DEBUG: .*Done$ diff --git a/ext/oci8/tests/define.phpt b/ext/oci8/tests/define.phpt index b78f698e7c38..c6ce7bd9b304 100644 --- a/ext/oci8/tests/define.phpt +++ b/ext/oci8/tests/define.phpt @@ -44,5 +44,5 @@ echo "Done\n"; ?> --EXPECTF-- -string(%d) "some" +%unicode|string%(%d) "some" Done diff --git a/ext/oci8/tests/define1.phpt b/ext/oci8/tests/define1.phpt index be16271d5bb1..6e4b74e3bacb 100644 --- a/ext/oci8/tests/define1.phpt +++ b/ext/oci8/tests/define1.phpt @@ -55,5 +55,5 @@ bool(false) Warning: oci_define_by_name() expects at least 3 parameters, 2 given in %s on line %d NULL -string(4) "some" +%unicode|string%(4) "some" Done diff --git a/ext/oci8/tests/define4.phpt b/ext/oci8/tests/define4.phpt index 3114a7393769..266fd7edd70f 100644 --- a/ext/oci8/tests/define4.phpt +++ b/ext/oci8/tests/define4.phpt @@ -58,15 +58,15 @@ echo "Done\n"; Test 1 bool(true) Test 2 -string(4) "1234" -string(4) "some" -string(4) "some" -string(4) "some" -string(4) "1234" -string(4) "some" +%unicode|string%(4) "1234" +%unicode|string%(4) "some" +%unicode|string%(4) "some" +%unicode|string%(4) "some" +%unicode|string%(4) "1234" +%unicode|string%(4) "some" Test 3 bool(true) -string(4) "some" +%unicode|string%(4) "some" Warning: oci_result(): %d is not a valid oci8 statement resource in %s on line %d bool(false) diff --git a/ext/oci8/tests/define5.phpt b/ext/oci8/tests/define5.phpt index 978d66b26074..68fa01d09aa8 100644 --- a/ext/oci8/tests/define5.phpt +++ b/ext/oci8/tests/define5.phpt @@ -61,12 +61,12 @@ echo "Done\n"; Test 1 - must do define before execute bool(true) NULL -string(4) "some" +%unicode|string%(4) "some" Test 2 - normal define order bool(true) -string(4) "some" +%unicode|string%(4) "some" Test 3 - no new define done -string(4) "some" -string(5) "thing" +%unicode|string%(4) "some" +%unicode|string%(5) "thing" Done diff --git a/ext/oci8/tests/define_old.phpt b/ext/oci8/tests/define_old.phpt index cc07e2ea94fb..f65e6b80809b 100644 --- a/ext/oci8/tests/define_old.phpt +++ b/ext/oci8/tests/define_old.phpt @@ -44,5 +44,5 @@ echo "Done\n"; ?> --EXPECTF-- -string(4) "some" +%unicode|string%(4) "some" Done diff --git a/ext/oci8/tests/details.inc b/ext/oci8/tests/details.inc index e54ea84abdb4..9a86c4686847 100644 --- a/ext/oci8/tests/details.inc +++ b/ext/oci8/tests/details.inc @@ -52,7 +52,7 @@ if (!function_exists('oci8_test_sql_execute')) { $s = oci_parse($c, $stmt); if (!$s) { $m = oci_error($c); - echo "oci8_test_sql_execute() error:". PHP_EOL . $stmt . PHP_EOL . $m['message'] . PHP_EOL; + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; } else { $r = @oci_execute($s); @@ -66,7 +66,7 @@ if (!function_exists('oci8_test_sql_execute')) { , 4080 // trigger does not exist , 38802 // edition does not exist ))) { - echo "oci8_test_sql_execute() error:". PHP_EOL . $stmt . PHP_EOL . $m['message'] . PHP_EOL; + echo $stmt . PHP_EOL . $m['message'] . PHP_EOL; } } } diff --git a/ext/oci8/tests/edition_1.phpt b/ext/oci8/tests/edition_1.phpt index d8ca53cddf06..b9c8fd817ef8 100644 --- a/ext/oci8/tests/edition_1.phpt +++ b/ext/oci8/tests/edition_1.phpt @@ -24,9 +24,6 @@ if (preg_match('/Release (1[1]\.2|12)\./', oci_server_version($c), $matches) !== * already */ -$testuser = 'testuser_attr_1'; // Used in conn_attr.inc -$testpassword = 'testuser'; - require(dirname(__FILE__)."/conn_attr.inc"); function select_fn($conn) { @@ -42,7 +39,7 @@ function select_fn($conn) { select from both the editions and verify the contents. */ set_edit_attr('MYEDITION'); -$conn = oci_connect($testuser,$testpassword,$dbase); +$conn = oci_connect('testuser','testuser',$dbase); if ($conn === false) { $m = oci_error(); die("Error:" . $m['message']); @@ -64,7 +61,7 @@ select_fn($conn); // Create a different version of view_ed in MYEDITION1. set_edit_attr('MYEDITION1'); -$conn2 = oci_new_connect($testuser,$testpassword,$dbase); +$conn2 = oci_new_connect('testuser','testuser',$dbase); $stmt = "create or replace editioning view view_ed as select name,age,job,salary from edit_tab"; $s = oci_parse($conn2, $stmt); oci_execute($s); @@ -90,58 +87,58 @@ The value of edition has been successfully set The value of current EDITION is MYEDITION array(3) { [0]=> - string(%d) "mike" + %unicode|string%(%d) "mike" [1]=> - string(%d) "30" + %unicode|string%(%d) "30" [2]=> - string(%d) "Senior engineer" + %unicode|string%(%d) "Senior engineer" } array(3) { [0]=> - string(%d) "juan" + %unicode|string%(%d) "juan" [1]=> - string(%d) "25" + %unicode|string%(%d) "25" [2]=> - string(%d) "engineer" + %unicode|string%(%d) "engineer" } The value of edition has been successfully set The value of current EDITION is MYEDITION1 array(4) { [0]=> - string(%d) "mike" + %unicode|string%(%d) "mike" [1]=> - string(%d) "30" + %unicode|string%(%d) "30" [2]=> - string(%d) "Senior engineer" + %unicode|string%(%d) "Senior engineer" [3]=> - string(%d) "200" + %unicode|string%(%d) "200" } array(4) { [0]=> - string(%d) "juan" + %unicode|string%(%d) "juan" [1]=> - string(%d) "25" + %unicode|string%(%d) "25" [2]=> - string(%d) "engineer" + %unicode|string%(%d) "engineer" [3]=> - string(%d) "100" + %unicode|string%(%d) "100" } version of view_ed in MYEDITION The value of current EDITION is MYEDITION array(3) { [0]=> - string(%d) "mike" + %unicode|string%(%d) "mike" [1]=> - string(%d) "30" + %unicode|string%(%d) "30" [2]=> - string(%d) "Senior engineer" + %unicode|string%(%d) "Senior engineer" } array(3) { [0]=> - string(%d) "juan" + %unicode|string%(%d) "juan" [1]=> - string(%d) "25" + %unicode|string%(%d) "25" [2]=> - string(%d) "engineer" + %unicode|string%(%d) "engineer" } Done diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt index 0ffb62dc3263..030e6a673c85 100644 --- a/ext/oci8/tests/edition_2.phpt +++ b/ext/oci8/tests/edition_2.phpt @@ -24,11 +24,11 @@ if (preg_match('/Release (1[1]\.2|12)\./', oci_server_version($c), $matches) !== * already */ -$testuser = 'testuser_ed_2'; // Used in conn_attr.inc -$testpassword = 'testuser'; - require(dirname(__FILE__)."/conn_attr.inc"); +$user = 'testuser'; +$password = 'testuser'; + echo"**Test 1.1 - Default value for the attribute **************\n"; get_edit_attr($c); @@ -50,7 +50,7 @@ get_edit_attr($conn3); oci_close($conn1); // With a oci_pconnect with a different charset. -$pc1 = oci_pconnect($testuser,$testpassword,$dbase,"utf8"); +$pc1 = oci_pconnect($user,$password,$dbase,"utf8"); get_edit_attr($pc1); oci_close($pc1); @@ -145,7 +145,7 @@ function set_scope() { } function get_scope() { - $sc1 = oci_connect($GLOBALS['testuser'],$GLOBALS['testpassword'],$GLOBALS['dbase']); + $sc1 = oci_connect($GLOBALS['user'],$GLOBALS['password'],$GLOBALS['dbase']); if ($sc1 === false) { $m = oci_error(); die("Error:" . $m['message']); diff --git a/ext/oci8/tests/error_set.phpt b/ext/oci8/tests/error_set.phpt deleted file mode 100644 index ad56e8aefadb..000000000000 --- a/ext/oci8/tests/error_set.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Check oci_set_{action,client_identifier,module_name,client_info} error handling ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -bool(false) -24960 -bool(false) -24960 -bool(false) -24960 -bool(false) -24960 - -Test 2 -bool(true) -bool(true) -bool(true) -bool(true) -===DONE=== diff --git a/ext/oci8/tests/extauth_01.phpt b/ext/oci8/tests/extauth_01.phpt index 1194ae180dd2..37f8f3834d80 100644 --- a/ext/oci8/tests/extauth_01.phpt +++ b/ext/oci8/tests/extauth_01.phpt @@ -143,56 +143,56 @@ Test 7 Warning: oci_connect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 8 Warning: oci_connect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 9 Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 10 Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) ===DONE=== diff --git a/ext/oci8/tests/extauth_02.phpt b/ext/oci8/tests/extauth_02.phpt index 0a3227019ce4..f3b517f730af 100644 --- a/ext/oci8/tests/extauth_02.phpt +++ b/ext/oci8/tests/extauth_02.phpt @@ -142,56 +142,56 @@ Test 7 Warning: oci_new_connect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 8 Warning: oci_new_connect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 9 Warning: oci_new_connect(): ORA-%d: TNS:%s %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 10 Warning: oci_new_connect(): ORA-%d: TNS:%s %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) ===DONE=== diff --git a/ext/oci8/tests/extauth_03.phpt b/ext/oci8/tests/extauth_03.phpt index d7884ce6b48f..e6685eb1769b 100644 --- a/ext/oci8/tests/extauth_03.phpt +++ b/ext/oci8/tests/extauth_03.phpt @@ -142,56 +142,56 @@ Test 7 Warning: oci_pconnect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 8 Warning: oci_pconnect(): ORA-12154: %s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(12154) - ["message"]=> - string(%d) "ORA-12154: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-12154: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 9 Warning: oci_pconnect(): ORA-%d: TNS:%s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) Test 10 Warning: oci_pconnect(): ORA-%d: TNS:%s in %s on line %d array(4) { - ["code"]=> + [%u|b%"code"]=> int(%d) - ["message"]=> - string(%d) "ORA-%d: %s" - ["offset"]=> + [%u|b%"message"]=> + %unicode|string%(%d) "ORA-%d: %s" + [%u|b%"offset"]=> int(0) - ["sqltext"]=> - string(0) "" + [%u|b%"sqltext"]=> + %unicode|string%(0) "" } bool(false) ===DONE=== diff --git a/ext/oci8/tests/fetch.phpt b/ext/oci8/tests/fetch.phpt index b968ae4bf6ea..e48aeefd87b6 100644 --- a/ext/oci8/tests/fetch.phpt +++ b/ext/oci8/tests/fetch.phpt @@ -47,10 +47,10 @@ oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> --EXPECTF-- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" +%unicode|string%(1) "1" +%unicode|string%(1) "1" +%unicode|string%(1) "1" +%unicode|string%(1) "1" +%unicode|string%(1) "1" +%unicode|string%(1) "1" Done diff --git a/ext/oci8/tests/fetch_all.phpt b/ext/oci8/tests/fetch_all.phpt index b8155b170b0a..4fc41daad482 100644 --- a/ext/oci8/tests/fetch_all.phpt +++ b/ext/oci8/tests/fetch_all.phpt @@ -51,44 +51,44 @@ echo "Done\n"; --EXPECTF-- int(3) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } } int(3) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } } Done diff --git a/ext/oci8/tests/fetch_all1.phpt b/ext/oci8/tests/fetch_all1.phpt index b8155b170b0a..4fc41daad482 100644 --- a/ext/oci8/tests/fetch_all1.phpt +++ b/ext/oci8/tests/fetch_all1.phpt @@ -51,44 +51,44 @@ echo "Done\n"; --EXPECTF-- int(3) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } } int(3) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" [2]=> - string(1) "1" + %unicode|string%(1) "1" } } Done diff --git a/ext/oci8/tests/fetch_all3.phpt b/ext/oci8/tests/fetch_all3.phpt index 4c0be1cc079b..1748ea5658eb 100644 --- a/ext/oci8/tests/fetch_all3.phpt +++ b/ext/oci8/tests/fetch_all3.phpt @@ -129,105 +129,105 @@ echo "Done\n"; None int(4) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_ASSOC int(4) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_COLUMN int(4) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_COLUMN|OCI_ASSOC int(4) array(2) { - ["ID"]=> + [%u|b%"ID"]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } - ["VALUE"]=> + [%u|b%"VALUE"]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM @@ -236,24 +236,24 @@ array(2) { [0]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } [1]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM|OCI_ASSOC @@ -262,24 +262,24 @@ array(2) { [0]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } [1]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW @@ -287,31 +287,31 @@ int(4) array(4) { [0]=> array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-1" } [1]=> array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" + [%u|b%"ID"]=> + %unicode|string%(1) "2" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-2" } [2]=> array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" + [%u|b%"ID"]=> + %unicode|string%(1) "3" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-3" } [3]=> array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" + [%u|b%"ID"]=> + %unicode|string%(1) "4" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_ASSOC @@ -319,31 +319,31 @@ int(4) array(4) { [0]=> array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-1" } [1]=> array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" + [%u|b%"ID"]=> + %unicode|string%(1) "2" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-2" } [2]=> array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" + [%u|b%"ID"]=> + %unicode|string%(1) "3" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-3" } [3]=> array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" + [%u|b%"ID"]=> + %unicode|string%(1) "4" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN @@ -351,31 +351,31 @@ int(4) array(4) { [0]=> array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-1" } [1]=> array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" + [%u|b%"ID"]=> + %unicode|string%(1) "2" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-2" } [2]=> array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" + [%u|b%"ID"]=> + %unicode|string%(1) "3" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-3" } [3]=> array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" + [%u|b%"ID"]=> + %unicode|string%(1) "4" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_ASSOC @@ -383,31 +383,31 @@ int(4) array(4) { [0]=> array(2) { - ["ID"]=> - string(1) "1" - ["VALUE"]=> - string(2) "-1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-1" } [1]=> array(2) { - ["ID"]=> - string(1) "2" - ["VALUE"]=> - string(2) "-2" + [%u|b%"ID"]=> + %unicode|string%(1) "2" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-2" } [2]=> array(2) { - ["ID"]=> - string(1) "3" - ["VALUE"]=> - string(2) "-3" + [%u|b%"ID"]=> + %unicode|string%(1) "3" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-3" } [3]=> array(2) { - ["ID"]=> - string(1) "4" - ["VALUE"]=> - string(2) "-4" + [%u|b%"ID"]=> + %unicode|string%(1) "4" + [%u|b%"VALUE"]=> + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM @@ -416,30 +416,30 @@ array(4) { [0]=> array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(2) "-1" + %unicode|string%(2) "-1" } [1]=> array(2) { [0]=> - string(1) "2" + %unicode|string%(1) "2" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" } [2]=> array(2) { [0]=> - string(1) "3" + %unicode|string%(1) "3" [1]=> - string(2) "-3" + %unicode|string%(2) "-3" } [3]=> array(2) { [0]=> - string(1) "4" + %unicode|string%(1) "4" [1]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_FETCHSTATEMENT_BY_COLUMN|OCI_NUM|OCI_ASSOC @@ -448,30 +448,30 @@ array(4) { [0]=> array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(2) "-1" + %unicode|string%(2) "-1" } [1]=> array(2) { [0]=> - string(1) "2" + %unicode|string%(1) "2" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" } [2]=> array(2) { [0]=> - string(1) "3" + %unicode|string%(1) "3" [1]=> - string(2) "-3" + %unicode|string%(2) "-3" } [3]=> array(2) { [0]=> - string(1) "4" + %unicode|string%(1) "4" [1]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_NUM @@ -480,30 +480,30 @@ array(4) { [0]=> array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(2) "-1" + %unicode|string%(2) "-1" } [1]=> array(2) { [0]=> - string(1) "2" + %unicode|string%(1) "2" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" } [2]=> array(2) { [0]=> - string(1) "3" + %unicode|string%(1) "3" [1]=> - string(2) "-3" + %unicode|string%(2) "-3" } [3]=> array(2) { [0]=> - string(1) "4" + %unicode|string%(1) "4" [1]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_FETCHSTATEMENT_BY_ROW|OCI_NUM|OCI_ASSOC @@ -512,30 +512,30 @@ array(4) { [0]=> array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(2) "-1" + %unicode|string%(2) "-1" } [1]=> array(2) { [0]=> - string(1) "2" + %unicode|string%(1) "2" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" } [2]=> array(2) { [0]=> - string(1) "3" + %unicode|string%(1) "3" [1]=> - string(2) "-3" + %unicode|string%(2) "-3" } [3]=> array(2) { [0]=> - string(1) "4" + %unicode|string%(1) "4" [1]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_NUM @@ -544,24 +544,24 @@ array(2) { [0]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } [1]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } OCI_NUM|OCI_ASSOC @@ -570,24 +570,24 @@ array(2) { [0]=> array(4) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" [3]=> - string(1) "4" + %unicode|string%(1) "4" } [1]=> array(4) { [0]=> - string(2) "-1" + %unicode|string%(2) "-1" [1]=> - string(2) "-2" + %unicode|string%(2) "-2" [2]=> - string(2) "-3" + %unicode|string%(2) "-3" [3]=> - string(2) "-4" + %unicode|string%(2) "-4" } } Done diff --git a/ext/oci8/tests/fetch_all4.phpt b/ext/oci8/tests/fetch_all4.phpt index 1d4a8df7b7c1..1d3c9677ee9c 100644 --- a/ext/oci8/tests/fetch_all4.phpt +++ b/ext/oci8/tests/fetch_all4.phpt @@ -51,10 +51,10 @@ oci8_test_sql_execute($c, $stmtarray); Test 1 int(0) array(2) { - ["MYCOL1"]=> + [%u|b%"MYCOL1"]=> array(0) { } - ["MYCOL2"]=> + [%u|b%"MYCOL2"]=> array(0) { } } diff --git a/ext/oci8/tests/fetch_all5.phpt b/ext/oci8/tests/fetch_all5.phpt index d82fd30e41cd..a6bb3c3f18a0 100644 --- a/ext/oci8/tests/fetch_all5.phpt +++ b/ext/oci8/tests/fetch_all5.phpt @@ -62,45 +62,45 @@ oci_close($c); Test 1 int(3) array(2) { - ["MYCOL1"]=> + [%u|b%"MYCOL1"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" } - ["MYCOL2"]=> + [%u|b%"MYCOL2"]=> array(3) { [0]=> - string(3) "abc" + %unicode|string%(3) "abc" [1]=> - string(3) "def" + %unicode|string%(3) "def" [2]=> - string(3) "ghi" + %unicode|string%(3) "ghi" } } Test 1 int(3) array(2) { - ["MYCOL1"]=> + [%u|b%"MYCOL1"]=> array(3) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "2" + %unicode|string%(1) "2" [2]=> - string(1) "3" + %unicode|string%(1) "3" } - ["MYCOL2"]=> + [%u|b%"MYCOL2"]=> array(3) { [0]=> - string(3) "abc" + %unicode|string%(3) "abc" [1]=> - string(3) "def" + %unicode|string%(3) "def" [2]=> - string(3) "ghi" + %unicode|string%(3) "ghi" } } Test 3 diff --git a/ext/oci8/tests/fetch_into.phpt b/ext/oci8/tests/fetch_into.phpt index d90c4d95dcb2..45a6a8132ed1 100644 --- a/ext/oci8/tests/fetch_into.phpt +++ b/ext/oci8/tests/fetch_into.phpt @@ -53,19 +53,19 @@ echo "Done\n"; int(2) array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" } int(2) array(4) { [0]=> - string(1) "1" - ["ID"]=> - string(1) "1" + %unicode|string%(1) "1" + [%u|b%"ID"]=> + %unicode|string%(1) "1" [1]=> - string(1) "1" - ["VALUE"]=> - string(1) "1" + %unicode|string%(1) "1" + [%u|b%"VALUE"]=> + %unicode|string%(1) "1" } Done diff --git a/ext/oci8/tests/fetch_object.phpt b/ext/oci8/tests/fetch_object.phpt index 73711baa1884..1c290d5e953d 100644 --- a/ext/oci8/tests/fetch_object.phpt +++ b/ext/oci8/tests/fetch_object.phpt @@ -82,28 +82,28 @@ oci8_test_sql_execute($c, $stmtarray); --EXPECTF-- Test 1 object(stdClass)#1 (3) { - ["caseSensitive"]=> - string(3) "123" - ["SECONDCOL"]=> - string(19) "1st row col2 string" - ["ANOTHERCOL"]=> - string(15) "1 more text " + [%u|b%"caseSensitive"]=> + %unicode|string%(3) "123" + [%u|b%"SECONDCOL"]=> + %unicode|string%(19) "1st row col2 string" + [%u|b%"ANOTHERCOL"]=> + %unicode|string%(15) "1 more text " } object(stdClass)#2 (3) { - ["caseSensitive"]=> - string(3) "456" - ["SECONDCOL"]=> - string(19) "2nd row col2 string" - ["ANOTHERCOL"]=> - string(15) "2 more text " + [%u|b%"caseSensitive"]=> + %unicode|string%(3) "456" + [%u|b%"SECONDCOL"]=> + %unicode|string%(19) "2nd row col2 string" + [%u|b%"ANOTHERCOL"]=> + %unicode|string%(15) "2 more text " } object(stdClass)#1 (3) { - ["caseSensitive"]=> - string(3) "789" - ["SECONDCOL"]=> - string(19) "3rd row col2 string" - ["ANOTHERCOL"]=> - string(15) "3 more text " + [%u|b%"caseSensitive"]=> + %unicode|string%(3) "789" + [%u|b%"SECONDCOL"]=> + %unicode|string%(19) "3rd row col2 string" + [%u|b%"ANOTHERCOL"]=> + %unicode|string%(15) "3 more text " } Test 2 123 diff --git a/ext/oci8/tests/fetch_row.phpt b/ext/oci8/tests/fetch_row.phpt index 40bc4f893cad..2b28634ab3f0 100644 --- a/ext/oci8/tests/fetch_row.phpt +++ b/ext/oci8/tests/fetch_row.phpt @@ -46,20 +46,20 @@ echo "Done\n"; --EXPECTF-- array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" } array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" } array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" } Done diff --git a/ext/oci8/tests/field_funcs1.phpt b/ext/oci8/tests/field_funcs1.phpt index 41d8627ce46c..c14ee8957e70 100644 --- a/ext/oci8/tests/field_funcs1.phpt +++ b/ext/oci8/tests/field_funcs1.phpt @@ -85,9 +85,9 @@ echo "Done\n"; --EXPECTF-- array(2) { [0]=> - string(1) "1" + %unicode|string%(1) "1" [1]=> - string(1) "1" + %unicode|string%(1) "1" } Test 1 diff --git a/ext/oci8/tests/function_aliases.phpt b/ext/oci8/tests/function_aliases.phpt index 2c890d6403ca..4c6ce8375965 100644 --- a/ext/oci8/tests/function_aliases.phpt +++ b/ext/oci8/tests/function_aliases.phpt @@ -104,6 +104,8 @@ NULL Warning: ocifreestatement() expects exactly 1 parameter, 0 given in %s on line %d NULL + +Warning: ociinternaldebug() expects exactly 1 parameter, 0 given in %s on line %d NULL Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d diff --git a/ext/oci8/tests/imp_res_1.phpt b/ext/oci8/tests/imp_res_1.phpt deleted file mode 100644 index a36f89f4da00..000000000000 --- a/ext/oci8/tests/imp_res_1.phpt +++ /dev/null @@ -1,630 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: basic test ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - oci_fetch_assoc -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 2 - oci_fetch_object -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -object(stdClass)#%d (1) { - ["C3"]=> - string(1) "t" -} -object(stdClass)#%d (1) { - ["C3"]=> - string(1) "u" -} -object(stdClass)#%d (1) { - [99]=> - string(2) "99" -} -object(stdClass)#%d (2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 3 - oci_fetch_row -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(2) "99" -} -array(2) { - [0]=> - NULL - [1]=> - string(1) "Z" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} - -Test 4 - oci_fetch_array(OCI_ASSOC+OCI_RETURN_NULLS) -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(2) { - ["NULL"]=> - NULL - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 5 - oci_fetch_array(OCI_ASSOC) -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} -array(1) { - ["C3"]=> - string(1) "t" -} -array(1) { - ["C3"]=> - string(1) "u" -} -array(1) { - [99]=> - string(2) "99" -} -array(1) { - ["'Z'"]=> - string(1) "Z" -} -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(5) "abcde" -} -array(2) { - ["C1"]=> - string(1) "2" - ["C2"]=> - string(5) "fghij" -} -array(2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(5) "klmno" -} - -Test 6 - oci_fetch_array(OCI_NUM) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(2) "99" -} -array(1) { - [1]=> - string(1) "Z" -} -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} - -Test 7 - oci_fetch_array(OCI_BOTH) -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} -array(2) { - [0]=> - string(1) "t" - ["C3"]=> - string(1) "t" -} -array(2) { - [0]=> - string(1) "u" - ["C3"]=> - string(1) "u" -} -array(2) { - [0]=> - string(2) "99" - [99]=> - string(2) "99" -} -array(2) { - [1]=> - string(1) "Z" - ["'Z'"]=> - string(1) "Z" -} -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} - -Test 8 - oci_fetch_array(OCI_BOTH+OCI_RETURN_NULLS) -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} -array(2) { - [0]=> - string(1) "t" - ["C3"]=> - string(1) "t" -} -array(2) { - [0]=> - string(1) "u" - ["C3"]=> - string(1) "u" -} -array(2) { - [0]=> - string(2) "99" - [99]=> - string(2) "99" -} -array(4) { - [0]=> - NULL - ["NULL"]=> - NULL - [1]=> - string(1) "Z" - ["'Z'"]=> - string(1) "Z" -} -array(4) { - [0]=> - string(1) "1" - ["C1"]=> - string(1) "1" - [1]=> - string(5) "abcde" - ["C2"]=> - string(5) "abcde" -} -array(4) { - [0]=> - string(1) "2" - ["C1"]=> - string(1) "2" - [1]=> - string(5) "fghij" - ["C2"]=> - string(5) "fghij" -} -array(4) { - [0]=> - string(1) "3" - ["C1"]=> - string(1) "3" - [1]=> - string(5) "klmno" - ["C2"]=> - string(5) "klmno" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_2.phpt b/ext/oci8/tests/imp_res_2.phpt deleted file mode 100644 index 860a5fbb34e0..000000000000 --- a/ext/oci8/tests/imp_res_2.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: Zero Rows ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -Test 2 -array(1) { - [0]=> - string(1) "X" -} -Test 2 -array(1) { - [0]=> - string(1) "X" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_3.phpt b/ext/oci8/tests/imp_res_3.phpt deleted file mode 100644 index 0fc4815893d6..000000000000 --- a/ext/oci8/tests/imp_res_3.phpt +++ /dev/null @@ -1,1257 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: bigger data size ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X - 1 a 1 a 1 a 1 a 1 a - 1 a 1 a 1 a 1 a 2 f - 1 a 1 a 1 a 2 f 1 a - 1 a 1 a 1 a 2 f 2 f - 1 a 1 a 2 f 1 a 1 a - 1 a 1 a 2 f 1 a 2 f - 1 a 1 a 2 f 2 f 1 a - 1 a 1 a 2 f 2 f 2 f - 1 a 2 f 1 a 1 a 1 a - 1 a 2 f 1 a 1 a 2 f - 1 a 2 f 1 a 2 f 1 a - 1 a 2 f 1 a 2 f 2 f - 1 a 2 f 2 f 1 a 1 a - 1 a 2 f 2 f 1 a 2 f - 1 a 2 f 2 f 2 f 1 a - 1 a 2 f 2 f 2 f 2 f - 2 f 1 a 1 a 1 a 1 a - 2 f 1 a 1 a 1 a 2 f - 2 f 1 a 1 a 2 f 1 a - 2 f 1 a 1 a 2 f 2 f - 2 f 1 a 2 f 1 a 1 a - 2 f 1 a 2 f 1 a 2 f - 2 f 1 a 2 f 2 f 1 a - 2 f 1 a 2 f 2 f 2 f - 2 f 2 f 1 a 1 a 1 a - 2 f 2 f 1 a 1 a 2 f - 2 f 2 f 1 a 2 f 1 a - 2 f 2 f 1 a 2 f 2 f - 2 f 2 f 2 f 1 a 1 a - 2 f 2 f 2 f 1 a 2 f - 2 f 2 f 2 f 2 f 1 a - 2 f 2 f 2 f 2 f 2 f - a - f - t - u - v - w - X -===DONE=== diff --git a/ext/oci8/tests/imp_res_4.phpt b/ext/oci8/tests/imp_res_4.phpt deleted file mode 100644 index 762ae7722491..000000000000 --- a/ext/oci8/tests/imp_res_4.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_fetch ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - -Warning: oci_fetch(): ORA-24374: %s in %simp_res_4.php on line %d -bool(false) - -Test 2 -array(1) { - [0]=> - string(1) "1" -} - -Warning: oci_fetch(): ORA-24374: %s in %simp_res_4.php on line %d -bool(false) -array(1) { - [0]=> - string(1) "2" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_5.phpt b/ext/oci8/tests/imp_res_5.phpt deleted file mode 100644 index 564a7a37404e..000000000000 --- a/ext/oci8/tests/imp_res_5.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_fetch_all ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - -Warning: oci_fetch_all(): ORA-24374: %s in %simp_res_5.php on line %d -array(0) { -} - -Test 2 -array(1) { - [0]=> - string(1) "1" -} - -Warning: oci_fetch_all(): ORA-24374: %s in %simp_res_5.php on line %d -array(0) { -} -array(1) { - [0]=> - string(1) "2" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_6.phpt b/ext/oci8/tests/imp_res_6.phpt deleted file mode 100644 index f94efe70db92..000000000000 --- a/ext/oci8/tests/imp_res_6.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: alternating oci_fetch_* calls ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -array(2) { - ["C1"]=> - string(1) "1" - ["C2"]=> - string(1) "a" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(1) "b" -} -object(stdClass)#%d (2) { - ["C1"]=> - string(1) "3" - ["C2"]=> - string(1) "c" -} -array(4) { - [0]=> - string(1) "4" - ["C1"]=> - string(1) "4" - [1]=> - string(1) "d" - ["C2"]=> - string(1) "d" -} -array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "e" -} -array(2) { - ["C1"]=> - string(1) "6" - ["C2"]=> - string(1) "f" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_7.phpt b/ext/oci8/tests/imp_res_7.phpt deleted file mode 100644 index 05ae5e685794..000000000000 --- a/ext/oci8/tests/imp_res_7.phpt +++ /dev/null @@ -1,873 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: bigger data size ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - 193 - 194 - 195 - 196 - 197 - 198 - 199 - 200 - 201 - 202 - 203 - 204 - 205 - 206 - 207 - 208 - 209 - 210 - 211 - 212 - 213 - 214 - 215 - 216 - 217 - 218 - 219 - 220 - 221 - 222 - 223 - 224 - 225 - 226 - 227 - 228 - 229 - 230 - 231 - 232 - 233 - 234 - 235 - 236 - 237 - 238 - 239 - 240 - 241 - 242 - 243 - 244 - 245 - 246 - 247 - 248 - 249 - 250 - 251 - 252 - 253 - 254 - 255 - 256 - 257 - 258 - 259 - 260 - 261 - 262 - 263 - 264 - 265 - 266 - 267 - 268 - 269 - 270 - 271 - 272 - 273 - 274 - 275 -===DONE=== diff --git a/ext/oci8/tests/imp_res_call_error.phpt b/ext/oci8/tests/imp_res_call_error.phpt deleted file mode 100644 index 8b0fa78db91a..000000000000 --- a/ext/oci8/tests/imp_res_call_error.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: using SQL 'CALL' ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - -Warning: oci_execute(): ORA-29478: %s -ORA-06512: at "SYS.DBMS_SQL", line %d -ORA-06512: at "SYS.DBMS_SQL", line %d -ORA-06512: at "SYSTEM.IMP_RES_CALL_ERR_PROC", line %d in %simp_res_call_error.php on line %d -===DONE=== diff --git a/ext/oci8/tests/imp_res_cancel.phpt b/ext/oci8/tests/imp_res_cancel.phpt deleted file mode 100644 index 663d630dfbeb..000000000000 --- a/ext/oci8/tests/imp_res_cancel.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_cancel ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 -bool(true) - 2 -bool(true) - 3 -bool(true) -===DONE=== diff --git a/ext/oci8/tests/imp_res_close.phpt b/ext/oci8/tests/imp_res_close.phpt deleted file mode 100644 index 01ac2c75e001..000000000000 --- a/ext/oci8/tests/imp_res_close.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_free_statement #1 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 2 - -Warning: oci_fetch_array(): %d is not a valid oci8 statement resource in %simp_res_close.php on line %d -===DONE=== diff --git a/ext/oci8/tests/imp_res_cursor.phpt b/ext/oci8/tests/imp_res_cursor.phpt deleted file mode 100644 index cac0a5d1c0b7..000000000000 --- a/ext/oci8/tests/imp_res_cursor.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: nested cursor ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - X - 1 abcde - 2 fghij - 3 klmno - - t - u -===DONE=== diff --git a/ext/oci8/tests/imp_res_dbmsoutput.phpt b/ext/oci8/tests/imp_res_dbmsoutput.phpt deleted file mode 100644 index 8c9808d96c33..000000000000 --- a/ext/oci8/tests/imp_res_dbmsoutput.phpt +++ /dev/null @@ -1,136 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: interleaved with DBMS_OUTPUT ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -array(2) { - [0]=> - string(18) "dbms_output Line 1" - [1]=> - string(18) "dbms_output Line 2" -} - 1 abcde - 2 fghij - 3 klmno - t - u - v - -Test 2 - 1 abcde - 2 fghij - 3 klmno - t - u - v -array(2) { - [0]=> - string(18) "dbms_output Line 1" - [1]=> - string(18) "dbms_output Line 2" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_field.phpt b/ext/oci8/tests/imp_res_field.phpt deleted file mode 100644 index 54b8295cf928..000000000000 --- a/ext/oci8/tests/imp_res_field.phpt +++ /dev/null @@ -1,227 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: field tests ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - Result set ".++$i."\n"; - print_fields($s1); - while (($r = oci_fetch_row($s1)) !== false) { - var_dump($r); - } -} - -echo "\nTest 5 - get IRS fields when fetching rows\n"; -$s = oci_parse($c, "begin imp_res_field_proc(); end;"); -oci_execute($s); -$i = 0; -while (($s1 = oci_get_implicit_resultset($s))) { - echo "===> Result set ".++$i."\n"; - while (($r = oci_fetch_row($s1)) !== false) { - var_dump($r); - print_fields($s1); - } -} - -// Clean up - -$stmtarray = array( - "drop procedure imp_res_field_proc", - "drop table imp_res_field_tab_1", - "drop table imp_res_field_tab_2", - "drop table imp_res_field_tab_3" -); - -oci8_test_sql_execute($c, $stmtarray); - -?> -===DONE=== - ---EXPECTF-- -Test 1 - can't get IRS fields from parent -num fields : 0 - -Test 2 - can't get IRS fields from parent when fetching -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -num fields : 0 -array(1) { - [0]=> - string(4) "tttt" -} -num fields : 0 -array(1) { - [0]=> - string(2) "33" -} -num fields : 0 -array(1) { - [0]=> - NULL -} -num fields : 0 - -Test 3 - get IRS fields -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER - -Test 4 - get IRS fields before fetching rows -===> Result set 1 -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -===> Result set 2 -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -array(1) { - [0]=> - string(4) "tttt" -} -===> Result set 3 -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER -array(1) { - [0]=> - string(2) "33" -} -array(1) { - [0]=> - NULL -} - -Test 5 - get IRS fields when fetching rows -===> Result set 1 -array(2) { - [0]=> - string(4) "1111" - [1]=> - string(5) "abcde" -} -num fields : 2 -C1_NUMBER : is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER -C2_VARCHAR210 : is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2 -===> Result set 2 -array(1) { - [0]=> - string(4) "tttt" -} -num fields : 1 -C3_VARCHAR21 : is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2 -===> Result set 3 -array(1) { - [0]=> - string(2) "33" -} -num fields : 1 -C4_NUMBER52 : is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER -array(1) { - [0]=> - NULL -} -num fields : 1 -C4_NUMBER52 : is_null T, precision 5, scale 2, size 22, typeraw 2, type NUMBER -===DONE=== diff --git a/ext/oci8/tests/imp_res_func_error.phpt b/ext/oci8/tests/imp_res_func_error.phpt deleted file mode 100644 index 73c0557930cd..000000000000 --- a/ext/oci8/tests/imp_res_func_error.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: test with a PL/SQL function ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - -Warning: oci_execute(): ORA-29478: %s -ORA-06512: %s -ORA-06512: %s -ORA-06512: %s -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_1.phpt b/ext/oci8/tests/imp_res_get_1.phpt deleted file mode 100644 index 665f773b5734..000000000000 --- a/ext/oci8/tests/imp_res_get_1.phpt +++ /dev/null @@ -1,109 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X - -Test 2 - with execute - 1 abcde - 2 fghij - 3 klmno - t - u - X -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_2.phpt b/ext/oci8/tests/imp_res_get_2.phpt deleted file mode 100644 index b20b8dd3970e..000000000000 --- a/ext/oci8/tests/imp_res_get_2.phpt +++ /dev/null @@ -1,107 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: similar to imp_res_get_1 but with unrolled loop ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_3.phpt b/ext/oci8/tests/imp_res_get_3.phpt deleted file mode 100644 index 15b2efaef0d9..000000000000 --- a/ext/oci8/tests/imp_res_get_3.phpt +++ /dev/null @@ -1,267 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: basic test 3 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---INI-- -oci8.statement_cache_size = 0 ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X - 1 abcde - 2 fghij - 3 klmno - t - u - X -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_4.phpt b/ext/oci8/tests/imp_res_get_4.phpt deleted file mode 100644 index ea7fb8775a72..000000000000 --- a/ext/oci8/tests/imp_res_get_4.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved fetches ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 abcde - t - 2 fghij - u - 3 klmno - v -Test 2 - too many fetches - 1 abcde - t - 2 fghij - u - 3 klmno - v -Return is false -Return is false - -Warning: oci_fetch_array(): ORA-01002: %s in %simp_res_get_4.php on line %d -Return is false - -Warning: oci_fetch_array(): ORA-01002: %s in %simp_res_get_4.php on line %d -Return is false -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_5.phpt b/ext/oci8/tests/imp_res_get_5.phpt deleted file mode 100644 index 3cfa0967a211..000000000000 --- a/ext/oci8/tests/imp_res_get_5.phpt +++ /dev/null @@ -1,124 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: get from wrong statement ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 3 - 4 - 5 - 6 - -Test 2 - fetch first IRS explicitly - 1 - 2 - 3 - 4 - 5 - 6 - -Test 3 - fetch part of IRS explicitly - 1 - 2 - 3 - 5 - 6 - 4 - -Test 4 - skip IRSs - 5 - 6 -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_all.phpt b/ext/oci8/tests/imp_res_get_all.phpt deleted file mode 100644 index d2dcbea6c782..000000000000 --- a/ext/oci8/tests/imp_res_get_all.phpt +++ /dev/null @@ -1,120 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_fetch_all ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -array(1) { - [1]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - } -} -array(1) { - [3]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(1) "4" - } -} -array(1) { - [5]=> - array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "6" - } -} - -Test 2 -array(1) { - [1]=> - array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - } -} -array(1) { - [3]=> - array(2) { - [0]=> - string(1) "3" - [1]=> - string(1) "4" - } -} -array(1) { - [5]=> - array(2) { - [0]=> - string(1) "5" - [1]=> - string(1) "6" - } -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_cancel.phpt b/ext/oci8/tests/imp_res_get_cancel.phpt deleted file mode 100644 index 7dbcecbfe9db..000000000000 --- a/ext/oci8/tests/imp_res_get_cancel.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_cancel ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 3 -===DONE=== - diff --git a/ext/oci8/tests/imp_res_get_close_1.phpt b/ext/oci8/tests/imp_res_get_close_1.phpt deleted file mode 100644 index 2edc8bf604b8..000000000000 --- a/ext/oci8/tests/imp_res_get_close_1.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #1 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - -Warning: oci_fetch_array(): %d is not a valid oci8 statement resource in %s on line %d - 3 - -Warning: oci_fetch_array(): %d is not a valid oci8 statement resource in %s on line %d - 5 - -Warning: oci_fetch_array(): %d is not a valid oci8 statement resource in %s on line %d -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_close_2.phpt b/ext/oci8/tests/imp_res_get_close_2.phpt deleted file mode 100644 index b3153834babf..000000000000 --- a/ext/oci8/tests/imp_res_get_close_2.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #2 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 2 - -Warning: oci_fetch_array(): OCI_INVALID_HANDLE in %s on line %d - -Warning: oci_get_implicit_resultset(): %d is not a valid oci8 statement resource in %s on line %d -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_close_3.phpt b/ext/oci8/tests/imp_res_get_close_3.phpt deleted file mode 100644 index 4793a6c88207..000000000000 --- a/ext/oci8/tests/imp_res_get_close_3.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: oci_free_statement #3 ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 2 - 3 - 4 - 5 - 6 -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_cursor.phpt b/ext/oci8/tests/imp_res_get_cursor.phpt deleted file mode 100644 index ccdb6f549030..000000000000 --- a/ext/oci8/tests/imp_res_get_cursor.phpt +++ /dev/null @@ -1,101 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: nested cursor ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 abcde - 2 fghij - 3 klmno - - t - u - X -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt b/ext/oci8/tests/imp_res_get_dbmsoutput.phpt deleted file mode 100644 index cbc2389e4688..000000000000 --- a/ext/oci8/tests/imp_res_get_dbmsoutput.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: interleaved with DBMS_OUTPUT ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -array(3) { - [0]=> - string(6) "Line 1" - [1]=> - string(6) "Line 2" - [2]=> - string(6) "Line 3" -} - 1 abcde - 2 fghij - 3 klmno - t - u - v - X -Test 2 - 1 abcde - 2 fghij - 3 klmno - t - u - v - X -array(3) { - [0]=> - string(6) "Line 1" - [1]=> - string(6) "Line 2" - [2]=> - string(6) "Line 3" -} -===DONE=== - diff --git a/ext/oci8/tests/imp_res_get_exec.phpt b/ext/oci8/tests/imp_res_get_exec.phpt deleted file mode 100644 index dbd8f3ef3a20..000000000000 --- a/ext/oci8/tests/imp_res_get_exec.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: Execute twice ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - 1 - 2 -===DONE=== diff --git a/ext/oci8/tests/imp_res_get_none.phpt b/ext/oci8/tests/imp_res_get_none.phpt deleted file mode 100644 index 981f4945e245..000000000000 --- a/ext/oci8/tests/imp_res_get_none.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: no implicit results ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 -bool(false) -===DONE=== diff --git a/ext/oci8/tests/imp_res_insert.phpt b/ext/oci8/tests/imp_res_insert.phpt deleted file mode 100644 index d9c0705b5541..000000000000 --- a/ext/oci8/tests/imp_res_insert.phpt +++ /dev/null @@ -1,152 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: Commit modes ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - No commit in procedure, OCI_COMMIT_ON_SUCCESS mode -111 -array(1) { - [0]=> - string(3) "111" -} - -Test 2 - No commit in procedure, OCI_NO_AUTO_COMMIT mode -111 -222 -array(1) { - [0]=> - string(3) "111" -} - -Test 3 - Commit in procedure, OCI_COMMIT_ON_SUCCESS mode -111 -222 -333 -array(3) { - [0]=> - string(3) "111" - [1]=> - string(3) "222" - [2]=> - string(3) "333" -} - -Test 4 - Commit in procedure, OCI_NO_AUTO_COMMIT mode -111 -222 -333 -444 -array(4) { - [0]=> - string(3) "111" - [1]=> - string(3) "222" - [2]=> - string(3) "333" - [3]=> - string(3) "444" -} -===DONE=== diff --git a/ext/oci8/tests/imp_res_lob.phpt b/ext/oci8/tests/imp_res_lob.phpt deleted file mode 100644 index 247803581d21..000000000000 --- a/ext/oci8/tests/imp_res_lob.phpt +++ /dev/null @@ -1,101 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: LOBs ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- -load(); - } else { - echo " " . $item; - } - } - echo "\n"; -} - -echo "\nTest 2 - don't fetch all rows\n"; -$s = oci_parse($c, "begin imp_res_lob_proc(); end;"); -oci_execute($s); -$row = oci_fetch_row($s); -foreach ($row as $item) { - if (is_object($item)) { - echo " " . $item->load(); - } else { - echo " " . $item; - } -} -echo "\n"; - -// Clean up - -$stmtarray = array( - "drop procedure imp_res_lob_proc", - "drop table imp_res_lob_tab", -); - -oci8_test_sql_execute($c, $stmtarray); - -?> -===DONE=== - ---EXPECTF-- -Test 1 - 1 aaaaa a - 2 bbbbb b - 3 ccccc c - 4 ddddd d - X - aaaaa - bbbbb - ccccc - ddddd - -Test 2 - don't fetch all rows - 1 aaaaa a -===DONE=== diff --git a/ext/oci8/tests/imp_res_prefetch.phpt b/ext/oci8/tests/imp_res_prefetch.phpt deleted file mode 100644 index 5acdd518e584..000000000000 --- a/ext/oci8/tests/imp_res_prefetch.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Oracle Database 12c Implicit Result Sets: basic test ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); -if (!(isset($matches[0]) && $matches[1] >= 12)) { - die("skip expected output only valid when using Oracle Database 12c or greater"); -} -preg_match('/^[[:digit:]]+/', oci_client_version(), $matches); -if (!(isset($matches[0]) && $matches[0] >= 12)) { - die("skip works only with Oracle 12c or greater version of Oracle client libraries"); -} -?> ---FILE-- - -===DONE=== - ---EXPECTF-- -Test 1 - prefetch 0 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} - -Test 1 - prefetch 1 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} - -Test 1 - prefetch 2 -bool(true) -array(2) { - [0]=> - string(1) "1" - [1]=> - string(5) "abcde" -} -array(2) { - [0]=> - string(1) "2" - [1]=> - string(5) "fghij" -} -array(2) { - [0]=> - string(1) "3" - [1]=> - string(5) "klmno" -} -array(1) { - [0]=> - string(1) "t" -} -array(1) { - [0]=> - string(1) "u" -} -array(1) { - [0]=> - string(1) "v" -} -===DONE=== diff --git a/ext/oci8/tests/lob_015.phpt b/ext/oci8/tests/lob_015.phpt index 59e8fec42ae3..b4a19684a395 100644 --- a/ext/oci8/tests/lob_015.phpt +++ b/ext/oci8/tests/lob_015.phpt @@ -48,7 +48,7 @@ Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %s on line Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %s on line %d -Warning: oci_execute(): ORA-00932: %s on line %d +Warning: oci_execute(): ORA-00932: %s NUMBER %s BLOB in %s on line %d object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) diff --git a/ext/oci8/tests/lob_temp2.phpt b/ext/oci8/tests/lob_temp2.phpt deleted file mode 100644 index d774b4d7249e..000000000000 --- a/ext/oci8/tests/lob_temp2.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Writing temporary lob before binding ---SKIPIF-- - true, 'timesten' => false); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- -writeTemporary("test")); - -$statement = oci_parse($c, $ora_sql); -oci_bind_by_name($statement, ":v_clob", $clob, -1, OCI_B_CLOB); -oci_execute($statement, OCI_DEFAULT); - -$s = oci_parse($c, "select clob from ". $schema.$table_name); -oci_execute($s); -oci_fetch_all($s, $res); -var_dump($res); - -?> -===DONE=== ---EXPECTF-- -bool(true) -array(1) { - ["CLOB"]=> - array(1) { - [0]=> - string(4) "test" - } -} -===DONE=== diff --git a/ext/oci8/tests/minfo.phpt b/ext/oci8/tests/minfo.phpt index 34a19ca693ea..f6b95ff29616 100644 --- a/ext/oci8/tests/minfo.phpt +++ b/ext/oci8/tests/minfo.phpt @@ -8,12 +8,12 @@ Code coverage for PHP_MINFO_FUNCTION(oci) ob_start(); phpinfo(INFO_MODULES); $v = ob_get_clean(); -$r = preg_match('/OCI8 Support .* enabled/', $v); -if ($r !== 1) - var_dump($r); +$r = strpos($v, 'OCI8 Support => enabled'); +var_dump($r); echo "Done\n"; ?> --EXPECTF-- +int(%d) Done diff --git a/ext/oci8/tests/password.phpt b/ext/oci8/tests/password.phpt index 8ea81d3fc0e0..1738702cb662 100644 --- a/ext/oci8/tests/password.phpt +++ b/ext/oci8/tests/password.phpt @@ -14,28 +14,28 @@ if ($test_drcp) die("skip password change not supported in DRCP Mode"); require(dirname(__FILE__)."/connect.inc"); $stmtarray = array( - "drop user testuser_pw cascade", - "create user testuser_pw identified by testuserpwd", - "grant connect, create session to testuser_pw" + "drop user testuser cascade", + "create user testuser identified by testuserpwd", + "grant connect, create session to testuser" ); oci8_test_sql_execute($c, $stmtarray); // Connect and change the password -$c1 = oci_connect("testuser_pw", "testuserpwd", $dbase); +$c1 = oci_connect("testuser", "testuserpwd", $dbase); var_dump($c1); $rn1 = (int)$c1; -oci_password_change($c1, "testuser_pw", "testuserpwd", "testuserpwd2"); +oci_password_change($c1, "testuser", "testuserpwd", "testuserpwd2"); // Second connect should return a new resource because the hash string will be different from $c1 -$c2 = oci_connect("testuser_pw", "testuserpwd2", $dbase); +$c2 = oci_connect("testuser", "testuserpwd2", $dbase); var_dump($c2); $rn2 = (int)$c2; // Despite using the old password this connect should succeed and return the original resource -$c3 = oci_connect("testuser_pw", "testuserpwd", $dbase); +$c3 = oci_connect("testuser", "testuserpwd", $dbase); var_dump($c3); $rn3 = (int)$c3; @@ -67,7 +67,7 @@ echo "Done\n"; require(dirname(__FILE__)."/connect.inc"); $stmtarray = array( - "drop user testuser_pw cascade" + "drop user testuser cascade" ); oci8_test_sql_execute($c, $stmtarray); diff --git a/ext/oci8/tests/password_2.phpt b/ext/oci8/tests/password_2.phpt index 13da9ff7b269..ceba0bba80d9 100644 --- a/ext/oci8/tests/password_2.phpt +++ b/ext/oci8/tests/password_2.phpt @@ -14,27 +14,27 @@ if ($test_drcp) die("skip password change not supported in DRCP Mode"); require(dirname(__FILE__)."/connect.inc"); $stmtarray = array( - "drop user testuser_pw2 cascade", - "create user testuser_pw2 identified by testuserpwd", - "grant connect, create session to testuser_pw2" + "drop user testuser cascade", + "create user testuser identified by testuserpwd", + "grant connect, create session to testuser" ); oci8_test_sql_execute($c, $stmtarray); // Connect (persistent) and change the password -$c1 = oci_pconnect("testuser_pw2", "testuserpwd", $dbase); +$c1 = oci_pconnect("testuser", "testuserpwd", $dbase); var_dump($c1); $rn1 = (int)$c1; -oci_password_change($c1, "testuser_pw2", "testuserpwd", "testuserpwd2"); +oci_password_change($c1, "testuser", "testuserpwd", "testuserpwd2"); // Second connect should return a new resource because the hash string will be different from $c1 -$c2 = oci_pconnect("testuser_pw2", "testuserpwd2", $dbase); +$c2 = oci_pconnect("testuser", "testuserpwd2", $dbase); var_dump($c2); $rn2 = (int)$c2; // Despite using the old password this connect should succeed and return the original resource -$c3 = oci_pconnect("testuser_pw2", "testuserpwd", $dbase); +$c3 = oci_pconnect("testuser", "testuserpwd", $dbase); var_dump($c3); $rn3 = (int)$c3; @@ -66,7 +66,7 @@ echo "Done\n"; require(dirname(__FILE__)."/connect.inc"); $stmtarray = array( - "drop user testuser_pw2 cascade" + "drop user testuser cascade" ); oci8_test_sql_execute($c, $stmtarray); diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt index 2c66dd94ab7d..c218d904fa2d 100644 --- a/ext/oci8/tests/password_new.phpt +++ b/ext/oci8/tests/password_new.phpt @@ -3,27 +3,15 @@ oci_password_change() --SKIPIF-- true, 'timesten' => false); // test runs on thes -require(dirname(__FILE__).'/connect.inc'); +require(dirname(__FILE__).'/skipif.inc'); if (empty($dbase)) die ("skip requires database connection string be set"); if ($test_drcp) die("skip password change not supported in DRCP Mode"); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv); -if (isset($matches_sv[1]) && $matches_sv[1] >= 11) { - preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); - if (isset($matches[0]) && $matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] < 5) { - die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); - } -} - -// This test in Oracle 12c needs a non-CDB or the root container -if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { - $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); - $r = @oci_execute($s); - if (!$r) - die('skip could not identify container type'); - $r = oci_fetch_array($s); - if ($r['DBTYPE'] !== 'CDB$ROOT') - die('skip cannot run test using a PDB'); +// This test is known to fail with Oracle 10.2.0.4 client libraries +// connecting to Oracle Database 11 (Oracle bug 6277160, fixed 10.2.0.5) +if (preg_match('/Release (11|12)\./', oci_server_version($c), $matches) === 1 && + preg_match('/^10\.2\.0\.[1234]/', oci_client_version()) === 1) { + die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); } ?> --FILE-- diff --git a/ext/oci8/tests/password_old.phpt b/ext/oci8/tests/password_old.phpt index 2e186528e3d9..fdbb1f9e8923 100644 --- a/ext/oci8/tests/password_old.phpt +++ b/ext/oci8/tests/password_old.phpt @@ -3,28 +3,18 @@ ocipasswordchange() --SKIPIF-- true, 'timesten' => false); // test runs on thes -require(dirname(__FILE__).'/connect.inc'); +require(dirname(__FILE__).'/skipif.inc'); if (empty($dbase)) die ("skip requires database connection string be set"); if ($test_drcp) die("skip password change not supported in DRCP Mode"); -preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv); -if (isset($matches_sv[1]) && $matches_sv[1] >= 11) { - preg_match('/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); - if (isset($matches[0]) && $matches[1] == 10 && $matches[2] == 2 && $matches[3] == 0 && $matches[4] < 5) { - die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); - } +// This test is known to fail with Oracle 10.2.0.4 client libraries +// connecting to Oracle Database 11 (Oracle bug 6277160, fixed 10.2.0.5) +if (preg_match('/Release (11|12)\./', oci_server_version($c), $matches) === 1 && + preg_match('/^10\.2\.0\.[1234]/', oci_client_version()) === 1) { + die ("skip test known to fail using Oracle 10.2.0.4 client libs connecting to Oracle 11 (6277160)"); } -// This test in Oracle 12c needs a non-CDB or the root container -if (isset($matches_sv[1]) && $matches_sv[1] >= 12) { - $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); - $r = @oci_execute($s); - if (!$r) - die('skip could not identify container type'); - $r = oci_fetch_array($s); - if ($r['DBTYPE'] !== 'CDB$ROOT') - die('skip cannot run test using a PDB'); -} + ?> --FILE-- - string(%d) "test0" + %unicode|string%(%d) "test0" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test1" + %unicode|string%(%d) "test1" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test2" + %unicode|string%(%d) "test2" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test3" + %unicode|string%(%d) "test3" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test4" + %unicode|string%(%d) "test4" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test5" + %unicode|string%(%d) "test5" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test6" + %unicode|string%(%d) "test6" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test7" + %unicode|string%(%d) "test7" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test8" + %unicode|string%(%d) "test8" } Fetch Row using Nested cursor Query array(1) { [0]=> - string(%d) "test9" + %unicode|string%(%d) "test9" } Number of roundtrips made with prefetch count 5 for 10 rows is 3 Done diff --git a/ext/oci8/tests/reflection1.phpt b/ext/oci8/tests/reflection1.phpt index f76d7261aa78..5f2e73d80bde 100644 --- a/ext/oci8/tests/reflection1.phpt +++ b/ext/oci8/tests/reflection1.phpt @@ -126,7 +126,6 @@ reflection::export(new reflectionfunction('oci_set_module_name')); reflection::export(new reflectionfunction('oci_set_action')); reflection::export(new reflectionfunction('oci_set_client_info')); reflection::export(new reflectionfunction('oci_set_client_identifier')); -reflection::export(new reflectionfunction('oci_get_implicit_resultset')); ?> ===DONE=== @@ -1094,11 +1093,4 @@ Function [ function oci_set_client_identifier ] { } } -Function [ function oci_get_implicit_resultset ] { - - - Parameters [1] { - Parameter #0 [ $statement_resource ] - } -} - ===DONE=== diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index 7bc06715dd7b..5be3288f306b 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -101,7 +101,7 @@ dnl configure options dnl if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(adabas,, -[ --with-adabas[=DIR] Include Adabas D support [/usr/local]]) +[ --with-adabas[=DIR] Include Adabas D support [/usr/local]]) if test "$PHP_ADABAS" != "no"; then AC_MSG_CHECKING([for Adabas support]) @@ -128,7 +128,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(sapdb,, -[ --with-sapdb[=DIR] Include SAP DB support [/usr/local]]) +[ --with-sapdb[=DIR] Include SAP DB support [/usr/local]]) if test "$PHP_SAPDB" != "no"; then AC_MSG_CHECKING([for SAP DB support]) @@ -146,7 +146,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(solid,, -[ --with-solid[=DIR] Include Solid support [/usr/local/solid]]) +[ --with-solid[=DIR] Include Solid support [/usr/local/solid]]) if test "$PHP_SOLID" != "no"; then AC_MSG_CHECKING(for Solid support) @@ -171,7 +171,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(ibm-db2,, -[ --with-ibm-db2[=DIR] Include IBM DB2 support [/home/db2inst1/sqllib]]) +[ --with-ibm-db2[=DIR] Include IBM DB2 support [/home/db2inst1/sqllib]]) if test "$PHP_IBM_DB2" != "no"; then AC_MSG_CHECKING(for IBM DB2 support) @@ -208,7 +208,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(ODBCRouter,, -[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]]) +[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]]) if test "$PHP_ODBCROUTER" != "no"; then AC_MSG_CHECKING(for ODBCRouter.com support) @@ -228,7 +228,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(empress,, -[ --with-empress[=DIR] Include Empress support [\$EMPRESSPATH] +[ --with-empress[=DIR] Include Empress support [\$EMPRESSPATH] (Empress Version >= 8.60 required)]) if test "$PHP_EMPRESS" != "no"; then @@ -291,7 +291,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(birdstep,, -[ --with-birdstep[=DIR] Include Birdstep support [/usr/local/birdstep]]) +[ --with-birdstep[=DIR] Include Birdstep support [/usr/local/birdstep]]) if test "$PHP_BIRDSTEP" != "no"; then AC_MSG_CHECKING(for Birdstep support) @@ -338,14 +338,15 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(custom-odbc,, -[ --with-custom-odbc[=DIR] Include user defined ODBC support. DIR is ODBC install base +[ --with-custom-odbc[=DIR] + Include user defined ODBC support. DIR is ODBC install base directory [/usr/local]. Make sure to define CUSTOM_ODBC_LIBS and have some odbc.h in your include dirs. f.e. you should define following for Sybase SQL Anywhere 5.5.00 on QNX, prior to running this configure script: - CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\" - LDFLAGS=-lunix - CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"]) + CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\" + LDFLAGS=-lunix + CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"]) if test "$PHP_CUSTOM_ODBC" != "no"; then AC_MSG_CHECKING(for a custom ODBC support) @@ -359,49 +360,34 @@ PHP_ARG_WITH(custom-odbc,, ODBC_LIBS=$CUSTOM_ODBC_LIBS ODBC_TYPE=custom-odbc AC_DEFINE(HAVE_CODBC,1,[ ]) - AC_MSG_RESULT([$ext_output]) + AC_MSG_RESULT([$ext_ouput]) fi fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(iodbc,, -[ --with-iodbc[=DIR] Include iODBC support]) +[ --with-iodbc[=DIR] Include iODBC support [/usr/local]]) if test "$PHP_IODBC" != "no"; then AC_MSG_CHECKING(for iODBC support) - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then - PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) - ODBC_TYPE=iodbc - ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc` - ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc` - ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc` - PHP_EVAL_INCLINE($ODBC_INCLUDE) - AC_DEFINE(HAVE_IODBC,1,[ ]) - AC_DEFINE(HAVE_ODBC2,1,[ ]) - AC_MSG_RESULT([$ext_output]) - else - if test "$PHP_IODBC" = "yes"; then - PHP_IODBC=/usr/local - fi - PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) - PHP_ADD_INCLUDE($PHP_IODBC/include, 1) - ODBC_TYPE=iodbc - ODBC_INCLUDE=-I$PHP_IODBC/include - ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR - ODBC_LIBS=-liodbc - AC_DEFINE(HAVE_IODBC,1,[ ]) - AC_DEFINE(HAVE_ODBC2,1,[ ]) - AC_MSG_RESULT([$ext_output]) + if test "$PHP_IODBC" = "yes"; then + PHP_IODBC=/usr/local fi + PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR) + PHP_ADD_INCLUDE($PHP_IODBC/include, 1) + ODBC_TYPE=iodbc + ODBC_INCLUDE=-I$PHP_IODBC/include + ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR + ODBC_LIBS=-liodbc + AC_DEFINE(HAVE_IODBC,1,[ ]) + AC_DEFINE(HAVE_ODBC2,1,[ ]) + AC_MSG_RESULT([$ext_output]) fi fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(esoob,, -[ --with-esoob[=DIR] Include Easysoft OOB support [/usr/local/easysoft/oob/client]]) +[ --with-esoob[=DIR] Include Easysoft OOB support [/usr/local/easysoft/oob/client]]) if test "$PHP_ESOOB" != "no"; then AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support) @@ -421,7 +407,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(unixODBC,, -[ --with-unixODBC[=DIR] Include unixODBC support [/usr/local]]) +[ --with-unixODBC[=DIR] Include unixODBC support [/usr/local]]) if test "$PHP_UNIXODBC" != "no"; then AC_MSG_CHECKING(for unixODBC support) @@ -442,7 +428,7 @@ fi if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(dbmaker,, -[ --with-dbmaker[=DIR] Include DBMaker support]) +[ --with-dbmaker[=DIR] Include DBMaker support]) if test "$PHP_DBMAKER" != "no"; then AC_MSG_CHECKING(for DBMaker support) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index c84a4ecc6091..adb7272d4272 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1765,7 +1765,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (result_type & ODBC_NUM) { zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(zval *), NULL); } else { - if (!*(result->values[i].name) && Z_TYPE_P(tmp) == IS_STRING) { + if (!*(result->values[i].name)) { zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)+1, &tmp, sizeof(zval *), NULL); } else { zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+1, &tmp, sizeof(zval *), NULL); @@ -2704,7 +2704,7 @@ PHP_FUNCTION(odbc_num_rows) #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) /* {{{ proto bool odbc_next_result(resource result_id) - Checks if multiple results are available */ + Checks if multiple results are avaiable */ PHP_FUNCTION(odbc_next_result) { odbc_result *result; diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index ca237c0537bf..8251528e19c2 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -161,7 +161,7 @@ PHP_FUNCTION(solid_fetch_prev); #define UNIX /* * Extended Fetch in the Birdstep ODBC API is incapable of returning long varchar (memo) fields. - * So the following line has been commented-out to accommodate. - KNS + * So the following line has been commented-out to accomadate. - KNS * * #define HAVE_SQL_EXTENDED_FETCH 1 */ diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 43ae30419fee..b8c381406b38 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -558,51 +558,6 @@ static void zend_rebuild_access_path(zend_cfg *cfg, zend_op_array *op_array, int convert_to_string((v)); \ } -static void strip_nop(zend_code_block *block) -{ - zend_op *opline = block->start_opline; - zend_op *end, *new_end; - - /* remove leading NOPs */ - while (block->len > 0 && block->start_opline->opcode == ZEND_NOP) { - if (block->len == 1) { - /* this block is all NOPs, join with following block */ - if (block->follow_to) { - delete_code_block(block); - } - return; - } - block->start_opline++; - block->start_opline_no++; - block->len--; - } - - /* strip the inside NOPs */ - opline = new_end = block->start_opline; - end = opline + block->len; - - while (opline < end) { - zend_op *src; - int len = 0; - - while (opline < end && opline->opcode == ZEND_NOP) { - opline++; - } - src = opline; - - while (opline < end && opline->opcode != ZEND_NOP) { - opline++; - } - len = opline - src; - - /* move up non-NOP opcodes */ - memmove(new_end, src, len*sizeof(zend_op)); - - new_end += len; - } - block->len = new_end - block->start_opline; -} - static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, char *used_ext TSRMLS_DC) { zend_op *opline = block->start_opline; @@ -1213,7 +1168,45 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline++; } - strip_nop(block); + /* remove leading NOPs */ + while (block->len > 0 && block->start_opline->opcode == ZEND_NOP) { + if (block->len == 1) { + /* this block is all NOPs, join with following block */ + if (block->follow_to) { + delete_code_block(block); + } + if (op_array->T) { + efree(Tsource); + } + return; + } + block->start_opline++; + block->start_opline_no++; + block->len--; + } + + /* strip the inside NOPs */ + opline = block->start_opline; + end = opline + block->len; + while (opline < end) { + if (opline->opcode == ZEND_NOP) { + zend_op *nop = opline + 1; + int noplen; + while (nop < end && nop->opcode == ZEND_NOP) { + nop++; + } + noplen = nop-opline; + if (nop < end) { + /* move up non-NOP opcodes */ + memmove(opline, nop, (end-nop)*sizeof(zend_op)); + } else { + /* all NOPs up to the end, do nothing */ + } + block->len -= noplen; + end = block->start_opline + block->len; + } + opline++; + } if (op_array->T) { efree(Tsource); diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 9309d4b46209..ec5a78657737 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -438,74 +438,6 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { #endif collect_constants = 0; break; - -#if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO - case ZEND_FETCH_R: - case ZEND_FETCH_W: - case ZEND_FETCH_RW: - case ZEND_FETCH_FUNC_ARG: - case ZEND_FETCH_IS: - case ZEND_FETCH_UNSET: - if (opline != op_array->opcodes && - (opline-1)->opcode == ZEND_BEGIN_SILENCE && - (opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_LOCAL && - opline->op1_type == IS_CONST && - opline->op2_type == IS_UNUSED && - Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING && - (Z_STRLEN(ZEND_OP1_LITERAL(opline)) != sizeof("this")-1 || - memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), "this", sizeof("this")) != 0)) { - - int var = opline->result.var; - int level = 0; - zend_op *op = opline + 1; - zend_op *use = NULL; - - while (op < end) { - if (op->opcode == ZEND_BEGIN_SILENCE) { - level++; - } else if (op->opcode == ZEND_END_SILENCE) { - if (level == 0) { - break; - } else { - level--; - } - } - if (op->op1_type == IS_VAR && op->op1.var == var) { - if (use) { - /* used more than once */ - use = NULL; - break; - } - use = op; - } else if (op->op2_type == IS_VAR && op->op2.var == var) { - if (use) { - /* used more than once */ - use = NULL; - break; - } - use = op; - } - op++; - } - if (use) { - if (use->op1_type == IS_VAR && use->op1.var == var) { - use->op1_type = IS_CV; - use->op1.var = zend_optimizer_lookup_cv(op_array, - Z_STRVAL(ZEND_OP1_LITERAL(opline)), - Z_STRLEN(ZEND_OP1_LITERAL(opline))); - MAKE_NOP(opline); - } else if (use->op2_type == IS_VAR && use->op2.var == var) { - use->op2_type = IS_CV; - use->op2.var = zend_optimizer_lookup_cv(op_array, - Z_STRVAL(ZEND_OP1_LITERAL(opline)), - Z_STRLEN(ZEND_OP1_LITERAL(opline))); - MAKE_NOP(opline); - } - } - } - break; -#endif - } opline++; i++; diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index a058bd73cbb1..f3fbabcf81af 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -59,35 +59,6 @@ static int zend_optimizer_get_collected_constant(HashTable *constants, zval *nam return 0; } -#if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO -static int zend_optimizer_lookup_cv(zend_op_array *op_array, char* name, int name_len) -{ - int i = 0; - ulong hash_value = zend_inline_hash_func(name, name_len+1); - - while (i < op_array->last_var) { - if (op_array->vars[i].name == name || - (op_array->vars[i].hash_value == hash_value && - op_array->vars[i].name_len == name_len && - memcmp(op_array->vars[i].name, name, name_len) == 0)) { - return i; - } - i++; - } - i = op_array->last_var; - op_array->last_var++; - op_array->vars = erealloc(op_array->vars, op_array->last_var * sizeof(zend_compiled_variable)); - if (IS_INTERNED(name)) { - op_array->vars[i].name = name; - } else { - op_array->vars[i].name = estrndup(name, name_len); - } - op_array->vars[i].name_len = name_len; - op_array->vars[i].hash_value = hash_value; - return i; -} -#endif - #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO int zend_optimizer_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC) { diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h index 616bdf74f6e6..a9bad01be3bf 100644 --- a/ext/opcache/Optimizer/zend_optimizer_internal.h +++ b/ext/opcache/Optimizer/zend_optimizer_internal.h @@ -27,9 +27,6 @@ #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO # define VAR_NUM(v) ((zend_uint)(EX_TMP_VAR_NUM(0, 0) - EX_TMP_VAR(0, v))) # define NUM_VAR(v) ((zend_uint)(zend_uintptr_t)EX_TMP_VAR_NUM(0, v)) -#elif ZEND_EXTENSION_API_NO > PHP_5_2_X_API_NO -# define VAR_NUM(v) ((v)/ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable))) -# define NUM_VAR(v) ((v)*ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable))) #else # define VAR_NUM(v) ((v)/(sizeof(temp_variable))) # define NUM_VAR(v) ((v)*(sizeof(temp_variable))) diff --git a/ext/opcache/README b/ext/opcache/README index 6c3cc746e77c..311001224ada 100644 --- a/ext/opcache/README +++ b/ext/opcache/README @@ -199,10 +199,6 @@ opcache.protect_memory (default "0") Protect the shared memory from unexpected writing during script execution. Useful for internal debugging only. -opcache.restrict_api (default "") - Allows calling OPcache API functions only from PHP scripts which path is - started from specified string. The default "" means no restriction. - opcache.mmap_base Mapping base of shared memory segments (for Windows only). All the PHP processes have to map shared memory into the same address space. This diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 52e9e9844307..9a6c763ffaa1 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -138,7 +138,7 @@ static inline int is_stream_path(const char *filename) return ((*p == ':') && (p - filename > 1) && (p[1] == '/') && (p[2] == '/')); } -static inline int is_cacheable_stream_path(const char *filename) +static inline int is_cachable_stream_path(const char *filename) { return memcmp(filename, "file://", sizeof("file://") - 1) == 0 || memcmp(filename, "phar://", sizeof("phar://") - 1) == 0; @@ -1062,10 +1062,6 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC); #endif - if (!realpath) { - return FAILURE; - } - persistent_script = zend_accel_hash_find(&ZCSG(hash), realpath, strlen(realpath) + 1); if (persistent_script && !persistent_script->corrupted) { zend_file_handle file_handle; @@ -1134,10 +1130,6 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr return new_persistent_script; } - if (!compact_persistent_script(new_persistent_script)) { - return new_persistent_script; - } - /* exclusive lock */ zend_shared_alloc_lock(TSRMLS_C); @@ -1463,7 +1455,7 @@ static zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int CG(interactive) || (ZCSG(restart_in_progress) && accel_restart_is_active(TSRMLS_C)) || (is_stream_path(file_handle->filename) && - !is_cacheable_stream_path(file_handle->filename))) { + !is_cachable_stream_path(file_handle->filename))) { /* The Accelerator is disabled, act as if without the Accelerator */ return accelerator_orig_compile_file(file_handle, type TSRMLS_CC); } @@ -1625,12 +1617,10 @@ static zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int from_shared_memory = 0; persistent_script = compile_and_cache_file(file_handle, type, key, key_length, &op_array, &from_shared_memory TSRMLS_CC); - /* Caching is disabled, returning op_array; - * or something went wrong during compilation, returning NULL - */ + /* Something went wrong during compilation, returning NULL */ if (!persistent_script) { SHM_PROTECT(); - return op_array; + return op_array; /* Presently always NULL, but not necessary in the future */ } } else { @@ -2171,12 +2161,7 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr) case IS_CONSTANT_ARRAY: { TSRMLS_FETCH(); -#if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO - GC_REMOVE_ZVAL_FROM_BUFFER(zvalue); -#endif if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { - /* break possible cycles */ - Z_TYPE_P(zvalue) = IS_NULL; zvalue->value.ht->pDestructor = (dtor_func_t)accel_fast_zval_ptr_dtor; accel_fast_hash_destroy(zvalue->value.ht); } @@ -2186,9 +2171,6 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr) { TSRMLS_FETCH(); -#if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO - GC_REMOVE_ZVAL_FROM_BUFFER(zvalue); -#endif Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); } break; @@ -2391,7 +2373,6 @@ static inline int accel_find_sapi(TSRMLS_D) "isapi", "apache2filter", "apache2handler", - "litespeed", NULL }; const char **sapi_name; @@ -2516,7 +2497,7 @@ static int accel_startup(zend_extension *extension) strcmp(sapi_module.name, "cli") == 0) { zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb TSRMLS_CC); } else { - zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb TSRMLS_CC); + zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI SAPIs", NULL, accelerator_remove_cb TSRMLS_CC); } return SUCCESS; } @@ -2602,9 +2583,7 @@ static int accel_startup(zend_extension *extension) ZCG(include_path_key) = NULL; if (ZCG(include_path) && *ZCG(include_path)) { ZCG(include_path_len) = strlen(ZCG(include_path)); - ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len) + 1); - if (!ZCG(include_path_key) && - !zend_accel_hash_is_full(&ZCSG(include_paths))) { + if (!zend_accel_hash_is_full(&ZCSG(include_paths))) { char *key; zend_shared_alloc_lock(TSRMLS_C); @@ -2664,9 +2643,12 @@ static void accel_free_ts_resources() #endif } -void accel_shutdown(TSRMLS_D) +static void accel_shutdown(zend_extension *extension) { zend_ini_entry *ini_entry; + TSRMLS_FETCH(); + + (void)extension; /* keep the compiler happy */ zend_accel_blacklist_shutdown(&accel_blacklist); @@ -2684,11 +2666,6 @@ void accel_shutdown(TSRMLS_D) } #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO -# ifndef ZTS - zend_hash_clean(CG(function_table)); - zend_hash_clean(CG(class_table)); - zend_hash_clean(EG(zend_constants)); -# endif CG(interned_strings_start) = orig_interned_strings_start; CG(interned_strings_end) = orig_interned_strings_end; zend_new_interned_string = orig_new_interned_string; @@ -2765,7 +2742,7 @@ ZEND_EXT_API zend_extension zend_extension_entry = { "http://www.zend.com/", /* URL */ "Copyright (c) 1999-2013", /* copyright */ accel_startup, /* startup */ - NULL, /* shutdown */ + accel_shutdown, /* shutdown */ accel_activate, /* per-script activation */ accel_deactivate, /* per-script deactivation */ NULL, /* message handler */ diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 38f2e060f6e2..063c95102755 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -27,7 +27,7 @@ #endif #define ACCELERATOR_PRODUCT_NAME "Zend OPcache" -#define ACCELERATOR_VERSION "7.0.3-dev" +#define ACCELERATOR_VERSION "7.0.2-dev" /* 2 - added Profiler support, on 20010712 */ /* 3 - added support for Optimizer's encoded-only-files mode */ /* 4 - works with the new Optimizer, that supports the file format with licenses */ @@ -168,7 +168,7 @@ typedef time_t accel_time_t; typedef enum _zend_accel_restart_reason { ACCEL_RESTART_OOM, /* restart because of out of memory */ ACCEL_RESTART_HASH, /* restart because of hash overflow */ - ACCEL_RESTART_USER /* restart scheduled by opcache_reset() */ + ACCEL_RESTART_USER /* restart sheduled by opcache_reset() */ } zend_accel_restart_reason; typedef struct _zend_persistent_script { @@ -232,7 +232,6 @@ typedef struct _zend_accel_directives { #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO long interned_strings_buffer; #endif - char *restrict_api; } zend_accel_directives; typedef struct _zend_accel_globals { @@ -269,7 +268,7 @@ typedef struct _zend_accel_shared_globals { unsigned long blacklist_misses; unsigned long oom_restarts; /* number of restarts because of out of memory */ unsigned long hash_restarts; /* number of restarts because of hash overflow */ - unsigned long manual_restarts; /* number of restarts scheduled by opcache_reset() */ + unsigned long manual_restarts; /* number of restarts sheduled by opcache_reset() */ zend_accel_hash hash; /* hash table for cached scripts */ zend_accel_hash include_paths; /* used "include_path" values */ @@ -317,7 +316,6 @@ extern zend_accel_globals accel_globals; extern char *zps_api_failure_reason; -void accel_shutdown(TSRMLS_D); void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC); void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC); int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC); diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 index 1798fe13fa80..f9c38b1f795e 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_ENABLE(opcache, whether to enable Zend OPcache support, -[ --enable-opcache Enable Zend OPcache support], yes) +[ --enable-opcache Enable Zend OPcache support], yes) if test "$PHP_OPCACHE" != "no"; then @@ -357,9 +357,7 @@ extern int lock_file; # endif #endif int main() { return 0; } -], -[AC_MSG_RESULT([done])], -[AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])], []) +], [], [AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])], []) PHP_NEW_EXTENSION(opcache, ZendAccelerator.c \ diff --git a/ext/opcache/shared_alloc_shm.c b/ext/opcache/shared_alloc_shm.c index a88cc2e19673..d53236b3b028 100644 --- a/ext/opcache/shared_alloc_shm.c +++ b/ext/opcache/shared_alloc_shm.c @@ -54,7 +54,7 @@ typedef struct { static int create_segments(size_t requested_size, zend_shared_segment_shm ***shared_segments_p, int *shared_segments_count, char **error_in) { int i; - size_t allocate_size = 0, remaining_bytes = requested_size, seg_allocate_size; + unsigned int allocate_size = 0, remaining_bytes = requested_size, seg_allocate_size; int first_segment_id = -1; key_t first_segment_key = -1; struct shmid_ds sds; diff --git a/ext/opcache/tests/blacklist.inc b/ext/opcache/tests/blacklist.inc deleted file mode 100644 index a9db75141941..000000000000 --- a/ext/opcache/tests/blacklist.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/opcache/tests/blacklist.phpt b/ext/opcache/tests/blacklist.phpt index 57e4c306dd7f..f4a34723ada8 100644 --- a/ext/opcache/tests/blacklist.phpt +++ b/ext/opcache/tests/blacklist.phpt @@ -9,13 +9,7 @@ opcache.blacklist_filename={PWD}/opcache-*.blacklist --FILE-- --EXPECT-- Array @@ -23,10 +17,4 @@ Array [0] => /path/to/foo [1] => /path/to/foo2 [2] => /path/to/bar - [3] => __DIR__/blacklist.inc - [4] => __DIR__/current.php - [5] => /tmp/path/?nocache.inc - [6] => /tmp/path/*/somedir -) -ok -1 +) \ No newline at end of file diff --git a/ext/opcache/tests/bug65510.phpt b/ext/opcache/tests/bug65510.phpt deleted file mode 100644 index ba19d27d6ff2..000000000000 --- a/ext/opcache/tests/bug65510.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var) ---INI-- -allow_url_include=1 -opcache.enable=1 -opcache.enable_cli=1 ---SKIPIF-- - ---FILE-- - one [two] => 2 ) -function define: +funcion define: string(5) "dummy" string(11) "lambdadummy" string(1) "A" diff --git a/ext/opcache/tests/opcache-2.blacklist b/ext/opcache/tests/opcache-2.blacklist index 575d9fab304d..4f6580a773b1 100644 --- a/ext/opcache/tests/opcache-2.blacklist +++ b/ext/opcache/tests/opcache-2.blacklist @@ -1,6 +1 @@ /path/to/bar -; wildcard and relative entires -blacklist.inc -./current.php -/tmp/path/?nocache.inc -/tmp/path/*/somedir diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index da83cfd3119e..b09d0e54c3bf 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -30,10 +30,6 @@ # include "main/php_regex.h" #endif -#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO -# include "ext/standard/php_string.h" -#endif - #ifdef ZEND_WIN32 # define REGEX_MODE (REG_EXTENDED|REG_NOSUB|REG_ICASE) #else @@ -90,9 +86,9 @@ static void blacklist_report_regexp_error(regex_t *comp_regex, int reg_err) static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) { - int i, reg_err; + char *regexp; + int i, j, clen, reg_err, end = 0, rlen = 6; zend_regexp_list **regexp_list_it, *it; - char regexp[12*1024], *p, *end, *c, *backtrack = NULL; if (blacklist->pos == 0) { /* we have no blacklist to talk about */ @@ -100,91 +96,36 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) } regexp_list_it = &(blacklist->regexp_list); + for (i = 0; i < blacklist->pos; i++) { + rlen += blacklist->entries[i].path_length * 2 + 2; - regexp[0] = '^'; - regexp[1] = '('; - p = regexp + 2; - end = regexp + sizeof(regexp) - sizeof("[^\\\\]*)\0"); - - for (i = 0; i < blacklist->pos; ) { - c = blacklist->entries[i].path; - if (p + blacklist->entries[i].path_length < end) { - while (*c && p < end) { - switch (*c) { - case '?': - c++; -#ifdef ZEND_WIN32 - p[0] = '['; /* * => [^\\] on Win32 */ - p[1] = '^'; - p[2] = '\\'; - p[3] = '\\'; - p[4] = ']'; - p += 5; -#else - p[0] = '['; /* * => [^/] on *nix */ - p[1] = '^'; - p[2] = '/'; - p[3] = ']'; - p += 4; -#endif - break; - case '*': - c++; - if (*c == '*') { - c++; - p[0] = '.'; /* ** => .* */ - p[1] = '*'; - p += 2; - } else { -#ifdef ZEND_WIN32 - p[0] = '['; /* * => [^\\]* on Win32 */ - p[1] = '^'; - p[2] = '\\'; - p[3] = '\\'; - p[4] = ']'; - p[5] = '*'; - p += 6; -#else - p[0] = '['; /* * => [^/]* on *nix */ - p[1] = '^'; - p[2] = '/'; - p[3] = ']'; - p[4] = '*'; - p += 5; -#endif - } - break; - case '^': - case '.': - case '[': - case ']': - case '$': - case '(': - case ')': - case '|': - case '+': - case '{': - case '}': - case '\\': - *p++ = '\\'; - /* break missing intentionally */ - default: - *p++ = *c++; - } + /* don't create a regexp buffer bigger than 12K)*/ + if ((i + 1 == blacklist->pos) || ((rlen + blacklist->entries[i + 1].path_length * 2 + 2) > (12 * 1024))) { + regexp = (char *)malloc(rlen); + if (!regexp) { + zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n"); + return; } - } + regexp[0] = '^'; + regexp[1] = '('; + + clen = 2; + for (j = end; j <= i; j++) { - if (*c || i == blacklist->pos - 1) { - if (*c) { - if (!backtrack) { - zend_accel_error(ACCEL_LOG_ERROR, "Too long blacklist entry\n"); + int c; + if (j != end) { + regexp[clen++] = '|'; + } + /* copy mangled filename */ + for (c = 0; c < blacklist->entries[j].path_length; c++) { + if (strchr("^.[]$()|*+?{}\\", blacklist->entries[j].path[c])) { + regexp[clen++] = '\\'; + } + regexp[clen++] = blacklist->entries[j].path[c]; } - p = backtrack; - } else { - i++; } - *p++ = ')'; - *p++ = '\0'; + regexp[clen++] = ')'; + regexp[clen] = '\0'; it = (zend_regexp_list*)malloc(sizeof(zend_regexp_list)); if (!it) { @@ -197,13 +138,11 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) blacklist_report_regexp_error(&it->comp_regex, reg_err); } /* prepare for the next iteration */ - p = regexp + 2; + free(regexp); + end = i + 1; + rlen = 6; *regexp_list_it = it; regexp_list_it = &it->next; - } else { - backtrack = p; - *p++ = '|'; - i++; } } } @@ -243,9 +182,9 @@ static void zend_accel_blacklist_loadone(zend_blacklist *blacklist, char *filena void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) #endif { - char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL; + char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1]; FILE *fp; - int path_length, blacklist_path_length; + int path_length; TSRMLS_FETCH(); if ((fp = fopen(filename, "r")) == NULL) { @@ -255,15 +194,6 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) zend_accel_error(ACCEL_LOG_DEBUG,"Loading blacklist file: '%s'", filename); - if (VCWD_REALPATH(filename, buf)) { -#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO - blacklist_path_length = php_dirname(buf, strlen(buf)); -#else - blacklist_path_length = zend_dirname(buf, strlen(buf)); -#endif - blacklist_path = zend_strndup(buf, blacklist_path_length); - } - memset(buf, 0, sizeof(buf)); memset(real_path, 0, sizeof(real_path)); @@ -300,11 +230,7 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) } path_dup = zend_strndup(pbuf, path_length); - if (blacklist_path) { - expand_filepath_ex(path_dup, real_path, blacklist_path, blacklist_path_length TSRMLS_CC); - } else { - expand_filepath(path_dup, real_path TSRMLS_CC); - } + expand_filepath(path_dup, real_path TSRMLS_CC); path_length = strlen(real_path); free(path_dup); @@ -321,9 +247,6 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) blacklist->pos++; } fclose(fp); - if (blacklist_path) { - free(blacklist_path); - } zend_accel_blacklist_update_regexp(blacklist); } @@ -331,8 +254,7 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) { glob_t globbuf; - int ret; - unsigned int i; + int ret, i; memset(&globbuf, 0, sizeof(glob_t)); diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index f9ddaa98b8ba..fa4e3d85b78d 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -71,21 +71,6 @@ static zend_function_entry accel_functions[] = { { NULL, NULL, NULL, 0, 0 } }; -static int validate_api_restriction(TSRMLS_D) -{ - if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) { - int len = strlen(ZCG(accel_directives).restrict_api); - - if (!SG(request_info).path_translated || - strlen(SG(request_info).path_translated) < len || - memcmp(SG(request_info).path_translated, ZCG(accel_directives).restrict_api, len) != 0) { - zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " API is restricted by \"restrict_api\" configuration directive"); - return 0; - } - } - return 1; -} - static ZEND_INI_MH(OnUpdateMemoryConsumption) { long *p; @@ -266,7 +251,6 @@ ZEND_INI_BEGIN() STD_PHP_INI_BOOLEAN("opcache.enable_file_override" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_override_enabled, zend_accel_globals, accel_globals) STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals) - STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals) #ifdef ZEND_WIN32 STD_PHP_INI_ENTRY("opcache.mmap_base", NULL, PHP_INI_SYSTEM, OnUpdateString, accel_directives.mmap_base, zend_accel_globals, accel_globals) @@ -394,7 +378,6 @@ static ZEND_MSHUTDOWN_FUNCTION(zend_accelerator) (void)type; /* keep the compiler happy */ UNREGISTER_INI_ENTRIES(); - accel_shutdown(TSRMLS_C); return SUCCESS; } @@ -533,10 +516,6 @@ static ZEND_FUNCTION(opcache_get_status) return; } - if (!validate_api_restriction(TSRMLS_C)) { - RETURN_FALSE; - } - if (!accel_startup_ok) { RETURN_FALSE; } @@ -607,10 +586,6 @@ static ZEND_FUNCTION(opcache_get_configuration) } #endif - if (!validate_api_restriction(TSRMLS_C)) { - RETURN_FALSE; - } - array_init(return_value); /* directives */ @@ -675,10 +650,6 @@ static ZEND_FUNCTION(opcache_reset) } #endif - if (!validate_api_restriction(TSRMLS_C)) { - RETURN_FALSE; - } - if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) { RETURN_FALSE; } @@ -699,10 +670,6 @@ static ZEND_FUNCTION(opcache_invalidate) return; } - if (!validate_api_restriction(TSRMLS_C)) { - RETURN_FALSE; - } - if (zend_accel_invalidate(script_name, script_name_len, force TSRMLS_CC) == SUCCESS) { RETURN_TRUE; } else { diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 39b4c1fc2558..33ecf7f18309 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -86,53 +86,6 @@ zend_persistent_script* create_persistent_script(void) return persistent_script; } -static int compact_hash_table(HashTable *ht) -{ - uint i = 3; - uint nSize; - Bucket **t; - - if (!ht->nNumOfElements) { - /* Empty tables don't allocate space for Buckets */ - return 1; - } - - if (ht->nNumOfElements >= 0x80000000) { - /* prevent overflow */ - nSize = 0x80000000; - } else { - while ((1U << i) < ht->nNumOfElements) { - i++; - } - nSize = 1 << i; - } - - if (nSize >= ht->nTableSize) { - /* Keep the size */ - return 1; - } - - t = (Bucket **)pemalloc(nSize * sizeof(Bucket *), ht->persistent); - if (!t) { - return 0; - } - - pefree(ht->arBuckets, ht->persistent); - - ht->arBuckets = t; - ht->nTableSize = nSize; - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - - return 1; -} - -int compact_persistent_script(zend_persistent_script *persistent_script) -{ - return compact_hash_table(&persistent_script->function_table) && - compact_hash_table(&persistent_script->class_table); -} - void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements) { if (destroy_elements) { @@ -936,7 +889,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, zend_hash_destroy(&ZCG(bind_hash)); } /* we must first to copy all classes and then prepare functions, since functions may try to bind - classes - which depend on pre-bind class entries existent in the class table */ + classes - which depend on pre-bind class entries existant in the class table */ if (zend_hash_num_elements(&persistent_script->function_table) > 0) { zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, (unique_copy_ctor_func_t)zend_prepare_function_for_execution); } diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index ddaae86b2874..a926145c9865 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -28,7 +28,6 @@ void zend_accel_copy_internal_functions(TSRMLS_D); zend_persistent_script* create_persistent_script(void); -int compact_persistent_script(zend_persistent_script *script); void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements); void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 9f1940e06116..0bffae4d0e2f 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -52,10 +52,6 @@ typedef void (*zend_persist_func_t)(void * TSRMLS_DC); static void zend_persist_zval_ptr(zval **zp TSRMLS_DC); -#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO -static const Bucket *uninitialized_bucket = NULL; -#endif - static void zend_hash_persist(HashTable *ht, void (*pPersistElement)(void *pElement TSRMLS_DC), size_t el_size TSRMLS_DC) { Bucket *p = ht->pListHead; @@ -133,7 +129,7 @@ static void zend_hash_persist(HashTable *ht, void (*pPersistElement)(void *pElem zend_accel_store(ht->arBuckets, sizeof(Bucket*) * ht->nTableSize); #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO } else { - ht->arBuckets = (Bucket**)&uninitialized_bucket; + ht->arBuckets = NULL; } #endif } diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index cf4e0ff0f7c8..5405751ac3ad 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -99,9 +99,9 @@ void zend_shared_alloc_create_lock(void) } #endif -static void no_memory_bailout(size_t allocate_size, char *error) +static void no_memory_bailout(int allocate_size, char *error) { - zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %ld bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno ); + zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %d bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno ); } static void copy_shared_segments(void *to, void *from, int count, int size) @@ -119,7 +119,7 @@ static void copy_shared_segments(void *to, void *from, int count, int size) } } -static int zend_shared_alloc_try(const zend_shared_memory_handler_entry *he, size_t requested_size, zend_shared_segment ***shared_segments_p, int *shared_segments_count, char **error_in) +static int zend_shared_alloc_try(const zend_shared_memory_handler_entry *he, int requested_size, zend_shared_segment ***shared_segments_p, int *shared_segments_count, char **error_in) { int res; g_shared_alloc_handler = he->handler; @@ -148,7 +148,7 @@ static int zend_shared_alloc_try(const zend_shared_memory_handler_entry *he, siz return ALLOC_FAILURE; } -int zend_shared_alloc_startup(size_t requested_size) +int zend_shared_alloc_startup(int requested_size) { zend_shared_segment **tmp_shared_segments; size_t shared_segments_array_size; diff --git a/ext/opcache/zend_shared_alloc.h b/ext/opcache/zend_shared_alloc.h index e94ecab9b333..b7f36299bf54 100644 --- a/ext/opcache/zend_shared_alloc.h +++ b/ext/opcache/zend_shared_alloc.h @@ -117,7 +117,7 @@ extern zend_smm_shared_globals *smm_shared_globals; #define SHARED_ALLOC_REATTACHED (SUCCESS+1) -int zend_shared_alloc_startup(size_t requested_size); +int zend_shared_alloc_startup(int requested_size); void zend_shared_alloc_shutdown(void); /* allocate shared memory block */ diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index a97114f8085f..2c7f4fb691f4 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(openssl, for OpenSSL support, -[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)]) +[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)]) PHP_ARG_WITH(kerberos, for Kerberos support, [ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 4aac4e3137ca..c939c01b2b80 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -35,9 +35,6 @@ #include "ext/standard/php_fopen_wrappers.h" #include "ext/standard/md5.h" #include "ext/standard/base64.h" -#ifdef PHP_WIN32 -# include "win32/winutil.h" -#endif /* OpenSSL includes */ #include @@ -394,35 +391,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_random_pseudo_bytes, 0, 0, 1) ZEND_ARG_INFO(0, length) ZEND_ARG_INFO(1, result_is_strong) ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_spki_new, 0, 0, 2) - ZEND_ARG_INFO(0, privkey) - ZEND_ARG_INFO(0, challenge) - ZEND_ARG_INFO(0, algo) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_openssl_spki_verify, 0) - ZEND_ARG_INFO(0, spki) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_openssl_spki_export, 0) - ZEND_ARG_INFO(0, spki) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_openssl_spki_export_challenge, 0) - ZEND_ARG_INFO(0, spki) -ZEND_END_ARG_INFO() /* }}} */ /* {{{ openssl_functions[] */ const zend_function_entry openssl_functions[] = { -/* spki functions */ - PHP_FE(openssl_spki_new, arginfo_openssl_spki_new) - PHP_FE(openssl_spki_verify, arginfo_openssl_spki_verify) - PHP_FE(openssl_spki_export, arginfo_openssl_spki_export) - PHP_FE(openssl_spki_export_challenge, arginfo_openssl_spki_export_challenge) - /* public/private key functions */ PHP_FE(openssl_pkey_free, arginfo_openssl_pkey_free) PHP_FE(openssl_pkey_new, arginfo_openssl_pkey_new) @@ -598,9 +571,8 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */ { - zval **data; zval *subitem, *subentries; - int i; + int i, j = -1, last = -1, obj_cnt = 0; char *sname; int nid; X509_NAME_ENTRY * ne; @@ -616,12 +588,13 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s for (i = 0; i < X509_NAME_entry_count(name); i++) { unsigned char *to_add; - int to_add_len = 0; + int to_add_len; ne = X509_NAME_get_entry(name, i); obj = X509_NAME_ENTRY_get_object(ne); nid = OBJ_obj2nid(obj); + obj_cnt = 0; if (shortname) { sname = (char *) OBJ_nid2sn(nid); @@ -629,27 +602,39 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s sname = (char *) OBJ_nid2ln(nid); } - str = X509_NAME_ENTRY_get_data(ne); - if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { - to_add_len = ASN1_STRING_to_UTF8(&to_add, str); - } else { - to_add = ASN1_STRING_data(str); - to_add_len = ASN1_STRING_length(str); - } + MAKE_STD_ZVAL(subentries); + array_init(subentries); - if (to_add_len != -1) { - if (zend_hash_find(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, (void**)&data) == SUCCESS) { - if (Z_TYPE_PP(data) == IS_ARRAY) { - subentries = *data; - add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); - } else if (Z_TYPE_PP(data) == IS_STRING) { - MAKE_STD_ZVAL(subentries); - array_init(subentries); - add_next_index_stringl(subentries, Z_STRVAL_PP(data), Z_STRLEN_PP(data), 1); + last = -1; + for (;;) { + j = X509_NAME_get_index_by_OBJ(name, obj, last); + if (j < 0) { + if (last != -1) break; + } else { + obj_cnt++; + ne = X509_NAME_get_entry(name, j); + str = X509_NAME_ENTRY_get_data(ne); + if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { + to_add_len = ASN1_STRING_to_UTF8(&to_add, str); + if (to_add_len != -1) { + add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); + } + } else { + to_add = ASN1_STRING_data(str); + to_add_len = ASN1_STRING_length(str); add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); - zend_hash_update(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, &subentries, sizeof(zval*), NULL); } - } else { + } + last = j; + } + i = last; + + if (obj_cnt > 1) { + add_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries); + } else { + zval_dtor(subentries); + FREE_ZVAL(subentries); + if (obj_cnt && str && to_add_len > -1) { add_assoc_stringl(subitem, sname, (char *)to_add, to_add_len, 1); } } @@ -805,7 +790,6 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */ static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo); -int openssl_spki_cleanup(const char *src, char *dest); static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args TSRMLS_DC) /* {{{ */ { @@ -1350,279 +1334,6 @@ PHP_FUNCTION(openssl_x509_export_to_file) } /* }}} */ -/* {{{ proto string openssl_spki_new(mixed zpkey, string challenge [, mixed method]) - Creates new private key (or uses existing) and creates a new spki cert - outputting results to var */ -PHP_FUNCTION(openssl_spki_new) -{ - int challenge_len; - char * challenge = NULL, * spkstr = NULL, * s = NULL; - long keyresource = -1; - const char *spkac = "SPKAC="; - long algo = OPENSSL_ALGO_MD5; - - zval *method = NULL; - zval * zpkey = NULL; - EVP_PKEY * pkey = NULL; - NETSCAPE_SPKI *spki=NULL; - const EVP_MD *mdtype; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z", &zpkey, &challenge, &challenge_len, &method) == FAILURE) { - return; - } - RETVAL_FALSE; - - pkey = php_openssl_evp_from_zval(&zpkey, 0, challenge, 1, &keyresource TSRMLS_CC); - - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied private key"); - goto cleanup; - } - - if (method != NULL) { - if (Z_TYPE_P(method) == IS_LONG) { - algo = Z_LVAL_P(method); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Algorithm must be of supported type"); - goto cleanup; - } - } - mdtype = php_openssl_get_evp_md_from_algo(algo); - - if (!mdtype) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm"); - goto cleanup; - } - - if ((spki = NETSCAPE_SPKI_new()) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create new SPKAC"); - goto cleanup; - } - - if (challenge) { - ASN1_STRING_set(spki->spkac->challenge, challenge, challenge_len); - } - - if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to embed public key"); - goto cleanup; - } - - if (!NETSCAPE_SPKI_sign(spki, pkey, mdtype)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to sign with specified algorithm"); - goto cleanup; - } - - spkstr = NETSCAPE_SPKI_b64_encode(spki); - if (!spkstr){ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to encode SPKAC"); - goto cleanup; - } - - s = emalloc(strlen(spkac) + strlen(spkstr) + 1); - sprintf(s, "%s%s", spkac, spkstr); - - RETVAL_STRINGL(s, strlen(s), 0); - goto cleanup; - -cleanup: - - if (keyresource == -1 && spki != NULL) { - NETSCAPE_SPKI_free(spki); - } - if (keyresource == -1 && pkey != NULL) { - EVP_PKEY_free(pkey); - } - if (keyresource == -1 && spkstr != NULL) { - efree(spkstr); - } - - if (strlen(s) <= 0) { - RETVAL_FALSE; - } - - if (keyresource == -1 && s != NULL) { - efree(s); - } -} -/* }}} */ - -/* {{{ proto bool openssl_spki_verify(string spki) - Verifies spki returns boolean */ -PHP_FUNCTION(openssl_spki_verify) -{ - int spkstr_len, i = 0; - char *spkstr = NULL, * spkstr_cleaned = NULL; - - EVP_PKEY *pkey = NULL; - NETSCAPE_SPKI *spki = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) { - return; - } - RETVAL_FALSE; - - if (spkstr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - - spkstr_cleaned = emalloc(spkstr_len + 1); - openssl_spki_cleanup(spkstr, spkstr_cleaned); - - if (strlen(spkstr_cleaned)<=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SPKAC"); - goto cleanup; - } - - spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned)); - if (spki == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC"); - goto cleanup; - } - - pkey = X509_PUBKEY_get(spki->spkac->pubkey); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key"); - goto cleanup; - } - - i = NETSCAPE_SPKI_verify(spki, pkey); - goto cleanup; - -cleanup: - if (spki != NULL) { - NETSCAPE_SPKI_free(spki); - } - if (pkey != NULL) { - EVP_PKEY_free(pkey); - } - if (spkstr_cleaned != NULL) { - efree(spkstr_cleaned); - } - - if (i > 0) { - RETVAL_TRUE; - } -} -/* }}} */ - -/* {{{ proto string openssl_spki_export(string spki) - Exports public key from existing spki to var */ -PHP_FUNCTION(openssl_spki_export) -{ - int spkstr_len; - char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL; - - EVP_PKEY *pkey = NULL; - NETSCAPE_SPKI *spki = NULL; - BIO *out = BIO_new(BIO_s_mem()); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) { - return; - } - RETVAL_FALSE; - - if (spkstr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - - spkstr_cleaned = emalloc(spkstr_len + 1); - openssl_spki_cleanup(spkstr, spkstr_cleaned); - - spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned)); - if (spki == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC"); - goto cleanup; - } - - pkey = X509_PUBKEY_get(spki->spkac->pubkey); - if (pkey == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key"); - goto cleanup; - } - - out = BIO_new_fp(stdout, BIO_NOCLOSE); - PEM_write_bio_PUBKEY(out, pkey); - goto cleanup; - -cleanup: - - if (spki != NULL) { - NETSCAPE_SPKI_free(spki); - } - if (out != NULL) { - BIO_free_all(out); - } - if (pkey != NULL) { - EVP_PKEY_free(pkey); - } - if (spkstr_cleaned != NULL) { - efree(spkstr_cleaned); - } - if (s != NULL) { - efree(s); - } -} -/* }}} */ - -/* {{{ proto string openssl_spki_export_challenge(string spki) - Exports spkac challenge from existing spki to var */ -PHP_FUNCTION(openssl_spki_export_challenge) -{ - int spkstr_len; - char *spkstr = NULL, * spkstr_cleaned = NULL; - - NETSCAPE_SPKI *spki = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) { - return; - } - RETVAL_FALSE; - - if (spkstr == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - - spkstr_cleaned = emalloc(spkstr_len + 1); - openssl_spki_cleanup(spkstr, spkstr_cleaned); - - spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned)); - if (spki == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode SPKAC"); - goto cleanup; - } - - RETVAL_STRING(ASN1_STRING_data(spki->spkac->challenge), 1); - goto cleanup; - -cleanup: - if (spkstr_cleaned != NULL) { - efree(spkstr_cleaned); - } -} -/* }}} */ - -/* {{{ strip line endings from spkac */ -int openssl_spki_cleanup(const char *src, char *dest) -{ - int removed=0; - - while (*src) { - if (*src!='\n'&&*src!='\r') { - *dest++=*src; - } else { - ++removed; - } - ++src; - } - *dest=0; - return removed; -} -/* }}} */ - /* {{{ proto bool openssl_x509_export(mixed x509, string &out [, bool notext = true]) Exports a CERT to file or a var */ PHP_FUNCTION(openssl_x509_export) @@ -1697,74 +1408,6 @@ PHP_FUNCTION(openssl_x509_check_private_key) } /* }}} */ -/* Special handling of subjectAltName, see CVE-2013-4073 - * Christian Heimes - */ - -static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension) -{ - GENERAL_NAMES *names; - const X509V3_EXT_METHOD *method = NULL; - long i, length, num; - const unsigned char *p; - - method = X509V3_EXT_get(extension); - if (method == NULL) { - return -1; - } - - p = extension->value->data; - length = extension->value->length; - if (method->it) { - names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length, - ASN1_ITEM_ptr(method->it))); - } else { - names = (GENERAL_NAMES*)(method->d2i(NULL, &p, length)); - } - if (names == NULL) { - return -1; - } - - num = sk_GENERAL_NAME_num(names); - for (i = 0; i < num; i++) { - GENERAL_NAME *name; - ASN1_STRING *as; - name = sk_GENERAL_NAME_value(names, i); - switch (name->type) { - case GEN_EMAIL: - BIO_puts(bio, "email:"); - as = name->d.rfc822Name; - BIO_write(bio, ASN1_STRING_data(as), - ASN1_STRING_length(as)); - break; - case GEN_DNS: - BIO_puts(bio, "DNS:"); - as = name->d.dNSName; - BIO_write(bio, ASN1_STRING_data(as), - ASN1_STRING_length(as)); - break; - case GEN_URI: - BIO_puts(bio, "URI:"); - as = name->d.uniformResourceIdentifier; - BIO_write(bio, ASN1_STRING_data(as), - ASN1_STRING_length(as)); - break; - default: - /* use builtin print for GEN_OTHERNAME, GEN_X400, - * GEN_EDIPARTY, GEN_DIRNAME, GEN_IPADD and GEN_RID - */ - GENERAL_NAME_print(bio, name); - } - /* trailing ', ' except for last element */ - if (i < (num - 1)) { - BIO_puts(bio, ", "); - } - } - sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); - - return 0; -} - /* {{{ proto array openssl_x509_parse(mixed x509 [, bool shortnames=true]) Returns an array of the fields/values of the CERT */ PHP_FUNCTION(openssl_x509_parse) @@ -1861,30 +1504,15 @@ PHP_FUNCTION(openssl_x509_parse) for (i = 0; i < X509_get_ext_count(cert); i++) { - int nid; extension = X509_get_ext(cert, i); - nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension)); - if (nid != NID_undef) { + if (OBJ_obj2nid(X509_EXTENSION_get_object(extension)) != NID_undef) { extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension))); } else { OBJ_obj2txt(buf, sizeof(buf)-1, X509_EXTENSION_get_object(extension), 1); extname = buf; } bio_out = BIO_new(BIO_s_mem()); - if (nid == NID_subject_alt_name) { - if (openssl_x509v3_subjectAltName(bio_out, extension) == 0) { - BIO_get_mem_ptr(bio_out, &bio_buf); - add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1); - } else { - zval_dtor(return_value); - if (certresource == -1 && cert) { - X509_free(cert); - } - BIO_free(bio_out); - RETURN_FALSE; - } - } - else if (X509V3_EXT_print(bio_out, extension, 0, 0)) { + if (X509V3_EXT_print(bio_out, extension, 0, 0)) { BIO_get_mem_ptr(bio_out, &bio_buf); add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1); } else { diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 8483bbf7626d..e6b064a277e6 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -79,11 +79,6 @@ PHP_FUNCTION(openssl_csr_export_to_file); PHP_FUNCTION(openssl_csr_sign); PHP_FUNCTION(openssl_csr_get_subject); PHP_FUNCTION(openssl_csr_get_public_key); - -PHP_FUNCTION(openssl_spki_new); -PHP_FUNCTION(openssl_spki_verify); -PHP_FUNCTION(openssl_spki_export); -PHP_FUNCTION(openssl_spki_export_challenge); #else #define phpext_openssl_ptr NULL diff --git a/ext/openssl/tests/bug64802.pem b/ext/openssl/tests/bug64802.pem deleted file mode 100644 index 187cda31d7ad..000000000000 --- a/ext/openssl/tests/bug64802.pem +++ /dev/null @@ -1,37 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGfzCCBWegAwIBAgIQSVCinGH6MkvjJZjRyjK9nTANBgkqhkiG9w0BAQUFADCB -jjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNDAyBgNV -BAMTK0NPTU9ETyBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIgQ0Ew -HhcNMTIwMjI5MDAwMDAwWhcNMTQwMjI4MjM1OTU5WjCCAW8xEjAQBgNVBAMTCXd3 -dy5yZC5pbzERMA8GA1UEAxMIcmRpby5jb20xDjAMBgNVBAMTBXJkLmlvMRUwEwYD -VQQDEwxhcGkucmRpby5jb20xEjAQBgNVBAMTCWFwaS5yZC5pbzEQMA4GA1UEBRMH -NDU4NjAwNzETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECEwhE -ZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYT -AlVTMQ4wDAYDVQQREwU5NDEwMzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBG -cmFuY2lzY28xFzAVBgNVBAkTDjE1NTAgQnJ5YW50IHN0MRMwEQYDVQQKEwpSZGlv -LCBJbmMuMSMwIQYDVQQLExpDT01PRE8gRVYgTXVsdGktRG9tYWluIFNTTDEVMBMG -A1UEAxMMd3d3LnJkaW8uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAt0AgYOe8EBJNVBAuSJFLKHRKZn0/ObCLBFG4xVH/5fb1rfYHBT1XSjjOqR3t -iGC/A3esF8YC7TuHQcTLVephx0DtJv1ASxRg3zPM8ebBRsuul18N0W+sY1aNXpkd -36quxvjg5UdBrAweuekJ7OTSZcCe2Ry/SKBeZSWWtkWsI4krCLv7JaKUwxw2h+Hn -TAZSBLVxz/mixF0WYdepYwnq2Hm7XvvVEIQ7wxOQ9bA7iCevLojZOnb39BT2QII7 -cy8AB47RZdfYg7UwaO3bST2rauA4MKar7/Ozqc0aemNFpLatJfgv07cydiuj9fsd -5aE/c8is8C9M9+7MmSMkcNEgGwIDAQABo4IB8zCCAe8wHwYDVR0jBBgwFoAUiERR -/1AqaV4tiPQhutkM8s7L6nwwHQYDVR0OBBYEFCrYw8bfrYJ61NS2yYx6/CnhjzT4 -MA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUF -BwMBBggrBgEFBQcDAjBGBgNVHSAEPzA9MDsGDCsGAQQBsjEBAgEFATArMCkGCCsG -AQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21vZG8uY29tL0NQUzBTBgNVHR8ETDBK -MEigRqBEhkJodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9FeHRlbmRlZFZh -bGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYQGCCsGAQUFBwEBBHgwdjBOBggr -BgEFBQcwAoZCaHR0cDovL2NydC5jb21vZG9jYS5jb20vQ09NT0RPRXh0ZW5kZWRW -YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8v -b2NzcC5jb21vZG9jYS5jb20wTAYDVR0RBEUwQ4IMd3d3LnJkaW8uY29tgglhcGku -cmQuaW+CDGFwaS5yZGlvLmNvbYIFcmQuaW+CCHJkaW8uY29tggl3d3cucmQuaW8w -DQYJKoZIhvcNAQEFBQADggEBAKFd4bPVFRyrlqIKPtrtMuqGqid6685ohxf0cv52 -sjdRYwLVTjnZOrmkDdNaF3R2A1ZlVMRN+67rK+qfY5sTeijFcudV3/i0PDtOFRwP -6yYVD2uZmYkxfPiW309HPmDF+EzhxpVjWlTQEOwkfFLTmJmwl3Qu2Kffp8F1ENXW -OTVNvj5VtMghvzu68PpzKl1VjlOR4Ej9NCwh1dUjNKEoTPzvpehXsIZ7jHSpX/T1 -wSSt9ckiechDdpgZXTzHgbxHNibK0Uhh+QhkBgYMj5F8qj5BlBhWAWqQa/VnEdmr -Pfo7U+QmadoqQd7qt06hE2hG1nfZ0vPJDbWV3oVSwG2Yt7I= ------END CERTIFICATE----- diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt deleted file mode 100644 index 9a59701494ec..000000000000 --- a/ext/openssl/tests/bug64802.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #64802: openssl_x509_parse fails to parse subject properly in some cases ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(11) { - [0]=> - string(14) "1550 Bryant st" - [1]=> - string(5) "94103" - [2]=> - string(7) "4586007" - [3]=> - string(2) "CA" - [4]=> - string(26) "COMODO EV Multi-Domain SSL" - [5]=> - string(20) "Private Organization" - [6]=> - string(10) "Rdio, Inc." - [7]=> - string(13) "San Francisco" - [8]=> - string(2) "US" - [9]=> - array(2) { - [0]=> - string(2) "US" - [1]=> - string(8) "Delaware" - } - [10]=> - array(6) { - [0]=> - string(9) "www.rd.io" - [1]=> - string(8) "rdio.com" - [2]=> - string(5) "rd.io" - [3]=> - string(12) "api.rdio.com" - [4]=> - string(9) "api.rd.io" - [5]=> - string(12) "www.rdio.com" - } -} diff --git a/ext/openssl/tests/cve2013_4073.pem b/ext/openssl/tests/cve2013_4073.pem deleted file mode 100644 index 7ebb99492047..000000000000 --- a/ext/openssl/tests/cve2013_4073.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx -DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ -eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg -RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y -ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw -NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI -DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv -ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt -ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq -hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j -pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P -vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv -KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA -oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL -08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV -HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E -BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu -Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251 -bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA -AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9 -i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j -HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk -kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx -VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW -RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ= ------END CERTIFICATE----- diff --git a/ext/openssl/tests/cve2013_4073.phpt b/ext/openssl/tests/cve2013_4073.phpt deleted file mode 100644 index e676ddfb9999..000000000000 --- a/ext/openssl/tests/cve2013_4073.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -CVE 2013-4073: Null-byte certificate handling ---SKIPIF-- - 'CA:FALSE', - 'subjectKeyIdentifier' => '88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C', - 'keyUsage' => 'Digital Signature, Non Repudiation, Key Encipherment', - 'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:null@python.org' . "\0" . 'user@example.org, URI:http://null.python.org' . "\0" . 'http://example.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1 -', -) diff --git a/ext/openssl/tests/openssl.cnf b/ext/openssl/tests/openssl.cnf index 4ed40fdc8aa0..10e69076cff5 100644 --- a/ext/openssl/tests/openssl.cnf +++ b/ext/openssl/tests/openssl.cnf @@ -3,7 +3,7 @@ default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes -x509_extensions = v3_ca # The extensions to add to the self signed cert +x509_extensions = v3_ca # The extentions to add to the self signed cert string_mask = MASK:4294967295 diff --git a/ext/openssl/tests/openssl_spki_export.phpt b/ext/openssl/tests/openssl_spki_export.phpt deleted file mode 100644 index 59332f70a5ca..000000000000 --- a/ext/openssl/tests/openssl_spki_export.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Testing openssl_spki_export() -Creates SPKAC for all available key sizes & signature algorithms and exports public key ---SKIPIF-- - ---FILE-- -1024, - '2048'=>2048, - '4096'=>4096); - -/* array of available hashings to test */ -$algo = array('md4'=>OPENSSL_ALGO_MD4, - 'md5'=>OPENSSL_ALGO_MD5, - 'sha1'=>OPENSSL_ALGO_SHA1, - 'sha224'=>OPENSSL_ALGO_SHA224, - 'sha256'=>OPENSSL_ALGO_SHA256, - 'sha384'=>OPENSSL_ALGO_SHA384, - 'sha512'=>OPENSSL_ALGO_SHA512, - 'rmd160'=>OPENSSL_ALGO_RMD160); - -/* loop over key sizes for test */ -foreach($ksize as $k => $v) { - - /* generate new private key of specified size to use for tests */ - $pkey = openssl_pkey_new(array('digest_alg' => 'sha512', - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - 'private_key_bits' => $v)); - openssl_pkey_export($pkey, $pass); - - /* loop to create and verify results */ - foreach($algo as $key => $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spkac)); - } - openssl_free_key($pkey); -} - -/* generate a random challenge */ -function _uuid() -{ - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); -} - -?> ---EXPECTREGEX-- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- -\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-.*\-\-\-\-\-END PUBLIC KEY\-\-\-\-\- diff --git a/ext/openssl/tests/openssl_spki_export_challenge.phpt b/ext/openssl/tests/openssl_spki_export_challenge.phpt deleted file mode 100644 index 71ef62edd508..000000000000 --- a/ext/openssl/tests/openssl_spki_export_challenge.phpt +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -Testing openssl_spki_export_challenge() -Creates SPKAC for all available key sizes & signature algorithms and exports challenge ---INI-- -error_reporting=0 ---SKIPIF-- - ---FILE-- -1024, - '2048'=>2048, - '4096'=>4096); - -/* array of available hashings to test */ -$algo = array('md4'=>OPENSSL_ALGO_MD4, - 'md5'=>OPENSSL_ALGO_MD5, - 'sha1'=>OPENSSL_ALGO_SHA1, - 'sha224'=>OPENSSL_ALGO_SHA224, - 'sha256'=>OPENSSL_ALGO_SHA256, - 'sha384'=>OPENSSL_ALGO_SHA384, - 'sha512'=>OPENSSL_ALGO_SHA512, - 'rmd160'=>OPENSSL_ALGO_RMD160); - -/* loop over key sizes for test */ -foreach($ksize as $k => $v) { - - /* generate new private key of specified size to use for tests */ - $pkey = openssl_pkey_new(array('digest_alg' => 'sha512', - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - 'private_key_bits' => $v)); - openssl_pkey_export($pkey, $pass); - - /* loop to create and verify results */ - foreach($algo as $key => $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - var_dump(openssl_spki_export_challenge(preg_replace('/SPKAC=/', '', $spkac))); - var_dump(openssl_spki_export_challenge($spkac.'Make it fail')); - } - openssl_free_key($pkey); -} - -/* generate a random challenge */ -function _uuid() -{ - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); -} - -?> ---EXPECTREGEX-- -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) -string\(36\) \"[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}\" -bool\(false\) diff --git a/ext/openssl/tests/openssl_spki_new.phpt b/ext/openssl/tests/openssl_spki_new.phpt deleted file mode 100644 index e40f9bf28e25..000000000000 --- a/ext/openssl/tests/openssl_spki_new.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Testing openssl_spki_new() -Tests SPKAC for all available private key sizes & hashing algorithms ---SKIPIF-- - ---FILE-- -1024, - '2048'=>2048, - '4096'=>4096); - -/* array of available hashings to test */ -$algo = array('md4'=>OPENSSL_ALGO_MD4, - 'md5'=>OPENSSL_ALGO_MD5, - 'sha1'=>OPENSSL_ALGO_SHA1, - 'sha224'=>OPENSSL_ALGO_SHA224, - 'sha256'=>OPENSSL_ALGO_SHA256, - 'sha384'=>OPENSSL_ALGO_SHA384, - 'sha512'=>OPENSSL_ALGO_SHA512, - 'rmd160'=>OPENSSL_ALGO_RMD160); - -/* loop over key sizes for test */ -foreach($ksize as $k => $v) { - - /* generate new private key of specified size to use for tests */ - $pkey = openssl_pkey_new(array('digest_alg' => 'sha512', - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - 'private_key_bits' => $v)); - openssl_pkey_export($pkey, $pass); - - /* loop to create and verify results */ - foreach($algo as $key => $value) { - var_dump(openssl_spki_new($pkey, _uuid(), $value)); - } - openssl_free_key($pkey); -} - -/* generate a random challenge */ -function _uuid() -{ - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); -} - -?> ---EXPECTF-- -string(478) "%s" -string(478) "%s" -string(478) "%s" -string(478) "%s" -string(478) "%s" -string(478) "%s" -string(478) "%s" -string(474) "%s" -string(830) "%s" -string(830) "%s" -string(830) "%s" -string(830) "%s" -string(830) "%s" -string(830) "%s" -string(830) "%s" -string(826) "%s" -string(1510) "%s" -string(1510) "%s" -string(1510) "%s" -string(1510) "%s" -string(1510) "%s" -string(1510) "%s" -string(1510) "%s" -string(1506) "%s" diff --git a/ext/openssl/tests/openssl_spki_verify.phpt b/ext/openssl/tests/openssl_spki_verify.phpt deleted file mode 100644 index 1ee573fd3f05..000000000000 --- a/ext/openssl/tests/openssl_spki_verify.phpt +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -Testing openssl_spki_verify() -Creates SPKAC for all available key sizes & signature algorithms and tests for valid signature ---INI-- -error_reporting=0 ---SKIPIF-- - ---FILE-- -1024, - '2048'=>2048, - '4096'=>4096); - -/* array of available hashings to test */ -$algo = array('md4'=>OPENSSL_ALGO_MD4, - 'md5'=>OPENSSL_ALGO_MD5, - 'sha1'=>OPENSSL_ALGO_SHA1, - 'sha224'=>OPENSSL_ALGO_SHA224, - 'sha256'=>OPENSSL_ALGO_SHA256, - 'sha384'=>OPENSSL_ALGO_SHA384, - 'sha512'=>OPENSSL_ALGO_SHA512, - 'rmd160'=>OPENSSL_ALGO_RMD160); - -/* loop over key sizes for test */ -foreach($ksize as $k => $v) { - - /* generate new private key of specified size to use for tests */ - $pkey = openssl_pkey_new(array('digest_alg' => 'sha512', - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - 'private_key_bits' => $v)); - openssl_pkey_export($pkey, $pass); - - /* loop to create and verify results */ - foreach($algo as $key => $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - var_dump(openssl_spki_verify(preg_replace('/SPKAC=/', '', $spkac))); - var_dump(openssl_spki_verify($spkac.'Make it fail')); - } - openssl_free_key($pkey); -} - -/* generate a random challenge */ -function _uuid() -{ - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); -} - -?> ---EXPECT-- -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) \ No newline at end of file diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index d7ef42e0b1dd..ff8a22e14f9b 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -274,7 +274,7 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_ * Essentially, we are waiting for the socket to become writeable, which means * that all pending data has been sent. * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefinitely. + * but at the same time avoid hanging indefintely. * */ do { n = php_pollfd_for_ms(sslsock->s.socket, POLLOUT, 500); @@ -309,7 +309,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream, php_stream_xport_crypto_param *cparam TSRMLS_DC) { - const SSL_METHOD *method; + SSL_METHOD *method; long ssl_ctx_options = SSL_OP_ALL; if (sslsock->ssl_handle) { @@ -472,7 +472,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, do { struct timeval cur_time, - elapsed_time = {0}; + elapsed_time; if (sslsock->is_client) { n = SSL_connect(sslsock->ssl_handle); @@ -853,7 +853,7 @@ php_stream_ops php_openssl_socket_ops = { php_openssl_sockop_set_option, }; -static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC) { +static char * get_sni(php_stream_context *ctx, char *resourcename, long resourcenamelen, int is_persistent TSRMLS_DC) { php_url *url; @@ -900,8 +900,8 @@ static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t return NULL; } -php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen, - const char *resourcename, size_t resourcenamelen, +php_stream *php_openssl_ssl_socket_factory(const char *proto, long protolen, + char *resourcename, long resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC TSRMLS_DC) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b66f4722e810..abe6b64aca52 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -795,7 +795,7 @@ PHP_FUNCTION(pcntl_exec) snprintf(key, 100, "%ld", key_num); key_length = strlen(key); break; - case HASH_KEY_NON_EXISTENT: + case HASH_KEY_NON_EXISTANT: pair--; continue; } diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 574276b7ce2c..abdee832235c 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -23,7 +23,7 @@ #include "Zend/zend.h" #include "Zend/zend_signal.h" -/* php_signal using sigaction is derived from Advanced Programing +/* php_signal using sigaction is derrived from Advanced Programing * in the Unix Environment by W. Richard Stevens p 298. */ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) { diff --git a/ext/pcntl/tests/pcntl_exec.phpt b/ext/pcntl/tests/pcntl_exec.phpt index 9a2c96ea38a4..9d2ec1dcf5fa 100644 --- a/ext/pcntl/tests/pcntl_exec.phpt +++ b/ext/pcntl/tests/pcntl_exec.phpt @@ -8,7 +8,7 @@ if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE --FILE-- --EXPECT-- diff --git a/ext/pcntl/tests/pcntl_exec_2.phpt b/ext/pcntl/tests/pcntl_exec_2.phpt index e18527dba05c..02b5e22aa429 100644 --- a/ext/pcntl/tests/pcntl_exec_2.phpt +++ b/ext/pcntl/tests/pcntl_exec_2.phpt @@ -14,7 +14,7 @@ if (getenv("PCNTL_EXEC_TEST_IS_CHILD")) { exit; } echo "ok\n"; -pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array('-n', __FILE__), array( +pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array(__FILE__), array( b"PCNTL_EXEC_TEST_IS_CHILD" => b"1", b"FOO" => b"BAR", 1 => b"long") diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog index ed164fed0fc5..1b016ecee521 100644 --- a/ext/pcre/pcrelib/ChangeLog +++ b/ext/pcre/pcrelib/ChangeLog @@ -1751,7 +1751,7 @@ Version 7.7 07-May-08 containing () gave an internal compiling error instead of "reference to non-existent subpattern". Fortunately, when the pattern did exist, the compiled code was correct. (When scanning forwards to check for the - existence of the subpattern, it was treating the data ']' as terminating + existencd of the subpattern, it was treating the data ']' as terminating the class, so got the count wrong. When actually compiling, the reference was subsequently set up correctly.) diff --git a/ext/pcre/pcrelib/NEWS b/ext/pcre/pcrelib/NEWS index 082139f222e8..ebd9c5ec9d99 100644 --- a/ext/pcre/pcrelib/NEWS +++ b/ext/pcre/pcrelib/NEWS @@ -591,7 +591,7 @@ some of the new functionality in Perl 5.005. Another (I hope this is the last!) change has been made to the API for the pcre_compile() function. An additional argument has been added to make it possible to pass over a pointer to character tables built in the current -locale by pcre_maketables(). To use the default tables, this new argument +locale by pcre_maketables(). To use the default tables, this new arguement should be passed as NULL. IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 diff --git a/ext/pcre/pcrelib/pcre_compile.c b/ext/pcre/pcrelib/pcre_compile.c index 4997b3b1ecb4..5f0c8ed08734 100644 --- a/ext/pcre/pcrelib/pcre_compile.c +++ b/ext/pcre/pcrelib/pcre_compile.c @@ -8139,7 +8139,7 @@ if (code - codestart > length) errorcode = ERR23; #ifdef SUPPORT_VALGRIND /* If the estimated length exceeds the really used length, mark the extra -allocated memory as unaddressable, so that any out-of-bound reads can be +allocated memory as unadressable, so that any out-of-bound reads can be detected. */ VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar)); #endif diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index ae2eb128ba09..29dfc5af1e4f 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_grep reacts to being passed bad regexes */ echo "*** Testing preg_grep() : error conditions ***\n"; -$values = array('abcdef', //Regex without delimiter -'/[a-zA-Z]', //Regex without closing delimiter -'[a-zA-Z]/', //Regex without opening delimiter +$values = array('abcdef', //Regex without delimeter +'/[a-zA-Z]', //Regex without closing delimeter +'[a-zA-Z]/', //Regex without opening delimeter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt index 95ab905d7d4c..a3cb684044d3 100644 --- a/ext/pcre/tests/preg_match_all_error1.phpt +++ b/ext/pcre/tests/preg_match_all_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_match_all reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_match_all() : error conditions ***\n"; -$regex_array = array('abcdef', //Regex without delimiter -'/[a-zA-Z]', //Regex without closing delimiter -'[a-zA-Z]/', //Regex without opening delimiter +$regex_array = array('abcdef', //Regex without delimeter +'/[a-zA-Z]', //Regex without closing delimeter +'[a-zA-Z]/', //Regex without opening delimeter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index ec9cf8cec8cd..7630481517a1 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_match reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_match() : error conditions ***\n"; -$regex_array = array('abcdef', //Regex without delimiter -'/[a-zA-Z]', //Regex without closing delimiter -'[a-zA-Z]/', //Regex without opening delimiter +$regex_array = array('abcdef', //Regex without delimeter +'/[a-zA-Z]', //Regex without closing delimeter +'[a-zA-Z]/', //Regex without opening delimeter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_replace_basic.phpt b/ext/pcre/tests/preg_replace_basic.phpt index 6962bce255f4..33fb2d4a8a4e 100644 --- a/ext/pcre/tests/preg_replace_basic.phpt +++ b/ext/pcre/tests/preg_replace_basic.phpt @@ -11,7 +11,7 @@ var_dump($string); var_dump(preg_replace('<- This is a string$>', 'This shouldn\'t work', $string)); //tries to find '- This is a string' at the end of a string but can't so replaces nothing and prints the unchanged $string. var_dump(preg_replace('<[0-35-9]>', '4', $string)); //finds any number that's not 4 and replaces it with a 4 ('444444444') var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) -var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space +var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com') ?> diff --git a/ext/pcre/tests/preg_replace_edit_basic.phpt b/ext/pcre/tests/preg_replace_edit_basic.phpt index 556b48b8c1d7..97350e756e07 100644 --- a/ext/pcre/tests/preg_replace_edit_basic.phpt +++ b/ext/pcre/tests/preg_replace_edit_basic.phpt @@ -24,7 +24,7 @@ var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it) var_dump(preg_replace('<(\w)\s*-\s*(\w)>', - '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space + '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com') diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt index ec573c77bfa1..7ddfcfdef862 100644 --- a/ext/pcre/tests/preg_replace_error1.phpt +++ b/ext/pcre/tests/preg_replace_error1.phpt @@ -11,9 +11,9 @@ error_reporting(E_ALL&~E_NOTICE); * Testing how preg_replace reacts to being passed the wrong type of regex argument */ echo "*** Testing preg_replace() : error conditions***\n"; -$regex_array = array('abcdef', //Regex without delimiter -'/[a-zA-Z]', //Regex without closing delimiter -'[a-zA-Z]/', //Regex without opening delimiter +$regex_array = array('abcdef', //Regex without delimeter +'/[a-zA-Z]', //Regex without closing delimeter +'[a-zA-Z]/', //Regex without opening delimeter '/[a-zA-Z]/F', array('[a-z]', //Array of Regexes '[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string ); diff --git a/ext/pcre/tests/preg_split_basic.phpt b/ext/pcre/tests/preg_split_basic.phpt index 5d23ce6df131..e94a94f62e78 100644 --- a/ext/pcre/tests/preg_split_basic.phpt +++ b/ext/pcre/tests/preg_split_basic.phpt @@ -7,7 +7,7 @@ Test preg_split() function : basic functionality * Function is implemented in ext/pcre/php_pcre.c */ $string = 'this is a_list: value1, Test__, string; Hello, world!_(parentheses)'; -var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string separated by : , ; ( or ) are put into an array. +var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string seperated by : , ; ( or ) are put into an array. var_dump(preg_split('/:\s*(\w*,*\s*)+;/', $string)); //all text between : and ; is removed var_dump(preg_split('/(\(|\))/', $string, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY)); //all text before (parentheses) is put into first element, ( into second, "parentheses" into third and ) into fourth. var_dump(preg_split('/NAME/i', $string)); //tries to find NAME regardless of case in $string (can't split it so just returns how string as first element) diff --git a/ext/pdo/Makefile.frag b/ext/pdo/Makefile.frag index dc25c9f70b76..5ba5f80840ec 100644 --- a/ext/pdo/Makefile.frag +++ b/ext/pdo/Makefile.frag @@ -2,8 +2,7 @@ phpincludedir=$(prefix)/include/php PDO_HEADER_FILES= \ php_pdo.h \ - php_pdo_driver.h \ - php_pdo_error.h + php_pdo_driver.h $(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index aec388c03f5d..e6265f58075a 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -101,7 +101,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate } /* }}} */ -PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ +void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ { pdo_error_type *pdo_err = &dbh->error_code; const char *msg = "<>"; @@ -338,9 +338,6 @@ static PHP_METHOD(PDO, dbh_constructor) if (pdbh->std.properties) { zend_hash_destroy(dbh->std.properties); efree(dbh->std.properties); - if (dbh->std.properties_table) { - efree(dbh->std.properties_table); - } } else { pdbh->std.ce = dbh->std.ce; pdbh->def_stmt_ce = dbh->def_stmt_ce; @@ -899,7 +896,7 @@ static PHP_METHOD(PDO, getAttribute) PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; - /* handle generic PDO-level attributes */ + /* handle generic PDO-level atributes */ switch (attr) { case PDO_ATTR_PERSISTENT: RETURN_BOOL(dbh->is_persistent); @@ -997,7 +994,7 @@ static PHP_METHOD(PDO, lastInsertId) pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC); RETURN_FALSE; } else { - Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, (unsigned int *)&Z_STRLEN_P(return_value) TSRMLS_CC); + Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, &Z_STRLEN_P(return_value) TSRMLS_CC); if (!Z_STRVAL_P(return_value)) { PDO_HANDLE_DBH_ERR(); RETURN_FALSE; @@ -1578,7 +1575,6 @@ static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) } zend_object_std_dtor(&dbh->std TSRMLS_CC); dbh->std.properties = NULL; - dbh->std.properties_table = NULL; dbh_free(dbh TSRMLS_CC); } diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index aea362fdb26d..ec488e053f02 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -77,7 +77,7 @@ static int scan(Scanner *s) yy3: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych >= 0x01) goto yy43; + if (yych >= 0x01) goto yy41; yy4: #line 63 "ext/pdo/pdo_sql_parser.re" { SKIP_ONE(PDO_PARSER_TEXT); } @@ -86,7 +86,7 @@ static int scan(Scanner *s) yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x00) goto yy4; - goto yy38; + goto yy36; yy6: yych = *++YYCURSOR; switch (yych) { @@ -153,19 +153,21 @@ static int scan(Scanner *s) case 'x': case 'y': case 'z': goto yy32; - case ':': goto yy35; + case ':': + case '?': goto yy29; default: goto yy4; } yy7: ++YYCURSOR; switch ((yych = *YYCURSOR)) { + case ':': case '?': goto yy29; default: goto yy8; } yy8: #line 62 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_BIND_POS); } -#line 169 "ext/pdo/pdo_sql_parser.c" +#line 171 "ext/pdo/pdo_sql_parser.c" yy9: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -175,7 +177,7 @@ static int scan(Scanner *s) yy10: #line 65 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 179 "ext/pdo/pdo_sql_parser.c" +#line 181 "ext/pdo/pdo_sql_parser.c" yy11: yych = *++YYCURSOR; switch (yych) { @@ -212,7 +214,7 @@ static int scan(Scanner *s) yy16: #line 64 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 216 "ext/pdo/pdo_sql_parser.c" +#line 218 "ext/pdo/pdo_sql_parser.c" yy17: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -286,13 +288,14 @@ static int scan(Scanner *s) if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; switch (yych) { + case ':': case '?': goto yy29; default: goto yy31; } yy31: #line 60 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 296 "ext/pdo/pdo_sql_parser.c" +#line 299 "ext/pdo/pdo_sql_parser.c" yy32: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -366,59 +369,51 @@ static int scan(Scanner *s) yy34: #line 61 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_BIND); } -#line 370 "ext/pdo/pdo_sql_parser.c" +#line 373 "ext/pdo/pdo_sql_parser.c" yy35: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - switch (yych) { - case ':': goto yy35; - default: goto yy31; - } -yy37: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy38: +yy36: switch (yych) { case 0x00: goto yy2; - case '\'': goto yy40; - case '\\': goto yy39; - default: goto yy37; + case '\'': goto yy38; + case '\\': goto yy37; + default: goto yy35; } -yy39: +yy37: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x00) goto yy2; - goto yy37; -yy40: + goto yy35; +yy38: ++YYCURSOR; #line 59 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 400 "ext/pdo/pdo_sql_parser.c" -yy42: +#line 395 "ext/pdo/pdo_sql_parser.c" +yy40: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy43: +yy41: switch (yych) { case 0x00: goto yy2; - case '"': goto yy45; - case '\\': goto yy44; - default: goto yy42; + case '"': goto yy43; + case '\\': goto yy42; + default: goto yy40; } -yy44: +yy42: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x00) goto yy2; - goto yy42; -yy45: + goto yy40; +yy43: ++YYCURSOR; #line 58 "ext/pdo/pdo_sql_parser.re" { RET(PDO_PARSER_TEXT); } -#line 422 "ext/pdo/pdo_sql_parser.c" +#line 417 "ext/pdo/pdo_sql_parser.c" } #line 66 "ext/pdo/pdo_sql_parser.re" @@ -766,9 +761,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { if(param->parameter) { convert_to_string(param->parameter); - /* accommodate a string that needs to be fully quoted + /* accomodate a string that needs to be fully quoted bind placeholders are at least 2 characters, so - the accommodate their own "'s + the accomodate their own "'s */ newbuffer_len += padding * Z_STRLEN_P(param->parameter); } diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 1936a37340bb..d4272d679b58 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -50,14 +50,14 @@ static int scan(Scanner *s) QUESTION = [?]; COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*); SPECIALS = [:?"']; - MULTICHAR = ([:]{2,}|[?]{2,}); + MULTICHAR = [:?]; ANYNOEOF = [\001-\377]; */ /*!re2c (["](([\\]ANYNOEOF)|ANYNOEOF\["\\])*["]) { RET(PDO_PARSER_TEXT); } (['](([\\]ANYNOEOF)|ANYNOEOF\['\\])*[']) { RET(PDO_PARSER_TEXT); } - MULTICHAR { RET(PDO_PARSER_TEXT); } + MULTICHAR{2,} { RET(PDO_PARSER_TEXT); } BINDCHR { RET(PDO_PARSER_BIND); } QUESTION { RET(PDO_PARSER_BIND_POS); } SPECIALS { SKIP_ONE(PDO_PARSER_TEXT); } @@ -408,9 +408,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { if(param->parameter) { convert_to_string(param->parameter); - /* accommodate a string that needs to be fully quoted + /* accomodate a string that needs to be fully quoted bind placeholders are at least 2 characters, so - the accommodate their own "'s + the accomodate their own "'s */ newbuffer_len += padding * Z_STRLEN_P(param->parameter); } diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 04e71823b9de..1b0db91c3803 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1146,7 +1146,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, zval_ptr_dtor(&val); pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); return 0; - } else if (ce->unserialize(&return_value, ce, (unsigned char *)(Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : ""), Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) { + } else if (ce->unserialize(&return_value, ce, Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : "", Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) { zval_ptr_dtor(&val); pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC); zval_dtor(return_value); @@ -1876,7 +1876,7 @@ static PHP_METHOD(PDOStatement, getColumnMeta) int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip) { long mode = PDO_FETCH_BOTH; - int flags = 0, argc = ZEND_NUM_ARGS() - skip; + int flags, argc = ZEND_NUM_ARGS() - skip; zval ***args; zend_class_entry **cep; int retval; diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index ede2d6fb7644..f38e7b5ec917 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -72,12 +72,12 @@ enum pdo_param_type { /* get_col ptr should point to a zval* and the driver is responsible for adding correct type information to get_column_meta() */ - PDO_PARAM_ZVAL, - - /* magic flag to denote a parameter as being input/output */ - PDO_PARAM_INPUT_OUTPUT = 0x80000000 + PDO_PARAM_ZVAL }; +/* magic flag to denote a parameter as being input/output */ +#define PDO_PARAM_INPUT_OUTPUT 0x80000000 + #define PDO_PARAM_FLAGS 0xFFFF0000 #define PDO_PARAM_TYPE(x) ((x) & ~PDO_PARAM_FLAGS) @@ -469,7 +469,7 @@ struct _pdo_dbh_t { /* when set, convert int/floats to strings */ unsigned stringify:1; - /* the sum of the number of bits here and the bit fields preceding should + /* the sum of the number of bits here and the bit fields preceeding should * equal 32 */ unsigned _reserved_flags:21; diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h deleted file mode 100644 index 387436af8fd2..000000000000 --- a/ext/pdo/php_pdo_error.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_PDO_ERROR_H -#define PHP_PDO_ERROR_H - -#include "php_pdo_driver.h" - -PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC); - -#define PDO_DBH_CLEAR_ERR() do { \ - strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ - if (dbh->query_stmt) { \ - dbh->query_stmt = NULL; \ - zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \ - } \ -} while (0) -#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE) -#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); } -#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); } - -#endif /* PHP_PDO_ERROR_H */ -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 59dbaf9b0190..91d0bf0412f7 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -23,8 +23,6 @@ /* Stuff private to the PDO extension and not for consumption by PDO drivers * */ -#include "php_pdo_error.h" - extern HashTable pdo_driver_hash; extern zend_class_entry *pdo_exception_ce; PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC); @@ -57,6 +55,19 @@ zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object extern pdo_driver_t *pdo_find_driver(const char *name, int namelen); +extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC); + +#define PDO_DBH_CLEAR_ERR() do { \ + strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ + if (dbh->query_stmt) { \ + dbh->query_stmt = NULL; \ + zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \ + } \ +} while (0) +#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE) +#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); } +#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); } + int pdo_sqlstate_init_error_table(void); void pdo_sqlstate_fini_error_table(void); const char *pdo_sqlstate_state_to_description(char *state); diff --git a/ext/pdo/tests/bug61292.phpt b/ext/pdo/tests/bug61292.phpt index 05b2e9c011d6..2381fd1a238b 100644 --- a/ext/pdo/tests/bug61292.phpt +++ b/ext/pdo/tests/bug61292.phpt @@ -17,15 +17,8 @@ class Database_SQL extends PDO { function __construct() { - $dsn = getenv('PDOTEST_DSN'); - $user = getenv('PDOTEST_USER'); - $pass = getenv('PDOTEST_PASS'); - - if ($user === false) $user = NULL; - if ($pass === false) $pass = NULL; $options = array(PDO::ATTR_PERSISTENT => TRUE); - - parent::__construct($dsn, $user, $pass, $options); + parent::__construct(getenv("PDOTEST_DSN"), getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options); } var $bar = array(); diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index b49ad2691f64..ffc910177fdd 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -32,9 +32,6 @@ #include "php_pdo_dblib_int.h" #include "zend_exceptions.h" -/* Cache of the server supported datatypes, initialized in handle_factory */ -zval* pdo_dblib_datatypes; - static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) { pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; @@ -265,41 +262,17 @@ static struct pdo_dbh_methods dblib_methods = { static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) { pdo_dblib_db_handle *H; - int i, nvars, nvers, ret = 0; - int *val; - - const pdo_dblib_keyval tdsver[] = { - {"4.2",DBVERSION_42} - ,{"4.6",DBVERSION_46} - ,{"5.0",DBVERSION_70} /* FIXME: This does not work with Sybase, but environ will */ - ,{"6.0",DBVERSION_70} - ,{"7.0",DBVERSION_70} -#ifdef DBVERSION_71 - ,{"7.1",DBVERSION_71} -#endif -#ifdef DBVERSION_72 - ,{"7.2",DBVERSION_72} - ,{"8.0",DBVERSION_72} -#endif - ,{"10.0",DBVERSION_100} - ,{"auto",0} /* Only works with FreeTDS. Other drivers will bork */ - - }; - - nvers = sizeof(tdsver)/sizeof(tdsver[0]); - + int i, ret = 0; struct pdo_data_src_parser vars[] = { - { "charset", NULL, 0 } - ,{ "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 } - ,{ "host", "127.0.0.1", 0 } - ,{ "dbname", NULL, 0 } - ,{ "secure", NULL, 0 } /* DBSETLSECURE */ - ,{ "version", NULL, 0 } /* DBSETLVERSION */ + { "charset", NULL, 0 }, + { "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 }, + { "host", "127.0.0.1", 0 }, + { "dbname", NULL, 0 }, + { "secure", NULL, 0 }, /* DBSETLSECURE */ + /* TODO: DBSETLVERSION ? */ }; - - nvars = sizeof(vars)/sizeof(vars[0]); - - php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); + + php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5); H = pecalloc(1, sizeof(*H), dbh->is_persistent); H->login = dblogin(); @@ -309,37 +282,11 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ goto cleanup; } - DBERRHANDLE(H->login, (EHANDLEFUNC) error_handler); - DBMSGHANDLE(H->login, (MHANDLEFUNC) msg_handler); - - if(vars[5].optval) { - for(i=0;ilogin, tdsver[i].value)) { - pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string." TSRMLS_CC); - goto cleanup; - } - break; - } - } - - if (i==nvers) { - printf("Invalid version '%s'\n", vars[5].optval); - pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string." TSRMLS_CC); - goto cleanup; /* unknown version specified */ - } - } - if (dbh->username) { - if(FAIL == DBSETLUSER(H->login, dbh->username)) { - goto cleanup; - } + DBSETLUSER(H->login, dbh->username); } - if (dbh->password) { - if(FAIL == DBSETLPWD(H->login, dbh->password)) { - goto cleanup; - } + DBSETLPWD(H->login, dbh->password); } #if !PHP_DBLIB_IS_MSSQL @@ -350,15 +297,14 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ DBSETLAPP(H->login, vars[1].optval); -#ifdef DBSETLDBNAME - if (vars[3].optval) { - DBSETLDBNAME(H->login, vars[3].optval); - } +#if PHP_DBLIB_IS_MSSQL + dbprocerrhandle(H->login, (EHANDLEFUNC) error_handler); + dbprocmsghandle(H->login, (MHANDLEFUNC) msg_handler); #endif H->link = dbopen(H->login, vars[2].optval); - if (!H->link) { + if (H->link == NULL) { goto cleanup; } @@ -371,29 +317,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ /* allow double quoted indentifiers */ DBSETOPT(H->link, DBQUOTEDIDENT, NULL); + if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) { + goto cleanup; + } + ret = 1; dbh->max_escaped_char_length = 2; dbh->alloc_own_columns = 1; -#if 0 - /* Cache the supported data types from the servers systypes table */ - if(dbcmd(H->link, "select usertype, name from systypes order by usertype") != FAIL) { - if(dbsqlexec(H->link) != FAIL) { - dbresults(H->link); - while (dbnextrow(H->link) == SUCCESS) { - val = dbdata(H->link, 1); - add_index_string(pdo_dblib_datatypes, *val, dbdata(H->link, 2), 1); - } - } - /* Throw out any remaining resultsets */ - dbcancel(H-link); - } -#endif - - - cleanup: - for (i = 0; i < nvars; i++) { + for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { if (vars[i].freeme) { efree(vars[i].optval); } diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 51cebc48b02f..1a2fefd47a9b 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -36,51 +36,35 @@ /* {{{ pdo_dblib_get_field_name * - * Return the data type name for a given TDS number + * Updated for MSSQL 2008 SR2 extended types * */ static char *pdo_dblib_get_field_name(int type) { - /* - * I don't return dbprtype(type) because it does not fully describe the type - * (example: varchar is reported as char by dbprtype) - * - * FIX ME: Cache datatypes from server systypes table in pdo_dblib_handle_factory() - * to make this future proof. - */ - switch (type) { - case 31: return "nvarchar"; case 34: return "image"; case 35: return "text"; case 36: return "uniqueidentifier"; - case 37: return "varbinary"; /* & timestamp - Sybase AS12 */ - case 38: return "bigint"; /* & bigintn - Sybase AS12 */ - case 39: return "varchar"; /* & sysname & nvarchar - Sybase AS12 */ case 40: return "date"; case 41: return "time"; case 42: return "datetime2"; case 43: return "datetimeoffset"; - case 45: return "binary"; /* Sybase AS12 */ - case 47: return "char"; /* & nchar & uniqueidentifierstr Sybase AS12 */ case 48: return "tinyint"; - case 50: return "bit"; /* Sybase AS12 */ case 52: return "smallint"; - case 55: return "decimal"; /* Sybase AS12 */ case 56: return "int"; case 58: return "smalldatetime"; case 59: return "real"; case 60: return "money"; case 61: return "datetime"; case 62: return "float"; - case 63: return "numeric"; /* or uint, ubigint, usmallint Sybase AS12 */ case 98: return "sql_variant"; case 99: return "ntext"; case 104: return "bit"; - case 106: return "decimal"; /* decimal n on sybase */ - case 108: return "numeric"; /* numeric n on sybase */ + case 106: return "decimal"; + case 108: return "numeric"; case 122: return "smallmoney"; case 127: return "bigint"; + case 240: return "geometry"; case 165: return "varbinary"; case 167: return "varchar"; case 173: return "binary"; @@ -88,22 +72,23 @@ static char *pdo_dblib_get_field_name(int type) case 189: return "timestamp"; case 231: return "nvarchar"; case 239: return "nchar"; - case 240: return "geometry"; case 241: return "xml"; - default: return "unknown"; + default: + return "unknown"; + break; } } /* }}} */ -static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) +static int dblib_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; /* Cancel any pending results */ dbcancel(H->link); - - efree(stmt->columns); + + efree(stmt->columns); stmt->columns = NULL; return 1; @@ -113,8 +98,7 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - efree(stmt->columns); - stmt->columns = NULL; + dblib_dblib_stmt_cursor_closer(stmt TSRMLS_CC); efree(S); @@ -129,12 +113,7 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) ret = dbresults(H->link); - if (FAIL == ret) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC); - return 0; - } - - if(NO_MORE_RESULTS == ret) { + if (ret == FAIL || ret == NO_MORE_RESULTS) { return 0; } @@ -152,8 +131,6 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) dbsetuserdata(H->link, (BYTE*) &S->err); - pdo_dblib_stmt_cursor_closer(stmt TSRMLS_CC); - if (FAIL == dbcmd(H->link, stmt->active_query_string)) { return 0; } @@ -164,6 +141,10 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) ret = pdo_dblib_stmt_next_rowset(stmt TSRMLS_CC); + if (ret == 0) { + return 0; + } + stmt->row_count = DBCOUNT(H->link); stmt->column_count = dbnumcols(H->link); @@ -181,12 +162,7 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt, ret = dbnextrow(H->link); - if (FAIL == ret) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC); - return 0; - } - - if(NO_MORE_ROWS == ret) { + if (ret == FAIL || ret == NO_MORE_ROWS) { return 0; } @@ -198,10 +174,6 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; - if(colno >= stmt->column_count || colno < 0) { - return FAILURE; - } - struct pdo_column_data *col = &stmt->columns[colno]; col->name = (char*)dbcolname(H->link, colno+1); @@ -233,12 +205,11 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, } switch (coltype) { + case SQLCHAR: + case SQLTEXT: case SQLVARBINARY: case SQLBINARY: case SQLIMAGE: - case SQLTEXT: - /* FIXME: Above types should be returned as a stream as they can be VERY large */ - case SQLCHAR: case SQLVARCHAR: tmp_ptr = emalloc(*len + 1); memcpy(tmp_ptr, *ptr, *len); @@ -254,26 +225,34 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, *ptr = tmp_ptr; break; } +#ifdef SQLUNIQUE case SQLUNIQUE: { +#else + case 36: { /* FreeTDS hack, also used by ext/mssql */ +#endif *len = 36+1; tmp_ptr = emalloc(*len + 1); /* uniqueidentifier is a 16-byte binary number, convert to 32 char hex string */ +#ifdef SQLUNIQUE *len = dbconvert(NULL, SQLUNIQUE, *ptr, *len, SQLCHAR, tmp_ptr, *len); +#else + *len = dbconvert(NULL, 36, *ptr, *len, SQLCHAR, tmp_ptr, *len); +#endif php_strtoupper(tmp_ptr, *len); *ptr = tmp_ptr; break; } default: if (dbwillconvert(coltype, SQLCHAR)) { - tmp_len = 32 + (2 * (*len)); /* FIXME: We allocate more than we need here */ + tmp_len = 32 + (2 * (*len)); tmp_ptr = emalloc(tmp_len); *len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, -1); *ptr = tmp_ptr; - } else { - *len = 0; /* FIXME: Silently fails and returns null on conversion errors */ - *ptr = NULL; - } + } else { + *len = 0; + *ptr = NULL; + } } *caller_frees = 1; @@ -291,25 +270,17 @@ static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *re { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; pdo_dblib_db_handle *H = S->H; - DBTYPEINFO* dbtypeinfo; - - if(colno >= stmt->column_count || colno < 0) { - return FAILURE; - } - + array_init(return_value); + DBTYPEINFO* dbtypeinfo; dbtypeinfo = dbcoltypeinfo(H->link, colno+1); - - if(!dbtypeinfo) return FAILURE; add_assoc_long(return_value, "max_length", dbcollen(H->link, colno+1) ); add_assoc_long(return_value, "precision", (int) dbtypeinfo->precision ); add_assoc_long(return_value, "scale", (int) dbtypeinfo->scale ); add_assoc_string(return_value, "column_source", dbcolsource(H->link, colno+1), 1); add_assoc_string(return_value, "native_type", pdo_dblib_get_field_name(dbcoltype(H->link, colno+1)), 1); - add_assoc_long(return_value, "native_type_id", dbcoltype(H->link, colno+1)); - add_assoc_long(return_value, "native_usertype_id", dbcolutype(H->link, colno+1)); return 1; } @@ -326,6 +297,6 @@ struct pdo_stmt_methods dblib_stmt_methods = { NULL, /* get attr */ pdo_dblib_stmt_get_column_meta, /* meta */ pdo_dblib_stmt_next_rowset, /* nextrow */ - pdo_dblib_stmt_cursor_closer + dblib_dblib_stmt_cursor_closer }; diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index bc5d364ed338..ed79aea20d16 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -93,12 +93,8 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr, char *state = "HY000"; TSRMLS_FETCH(); - if(dbproc) { - einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); - if (!einfo) einfo = &DBLIB_G(err); - } else { - einfo = &DBLIB_G(err); - } + einfo = (pdo_dblib_err*)dbgetuserdata(dbproc); + if (!einfo) einfo = &DBLIB_G(err); einfo->severity = severity; einfo->oserr = oserr; diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index 2bdb83c3260d..dd06a1d94fb1 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -71,8 +71,6 @@ # define SQLVARBINARY SYBVARBINARY # ifdef SYBUNIQUE # define SQLUNIQUE SYBUNIQUE -#else -# define SQLUNIQUE 36 /* FreeTDS Hack */ # endif # define DBERRHANDLE(a, b) dberrhandle(b) @@ -120,12 +118,6 @@ typedef struct { pdo_dblib_err err; } pdo_dblib_stmt; -typedef struct { - const char* key; - int value; -} pdo_dblib_keyval; - - ZEND_BEGIN_MODULE_GLOBALS(dblib) pdo_dblib_err err; char sqlstate[6]; diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index a89ab2aea53a..7b6f669a5049 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -4,7 +4,7 @@ dnl PHP_ARG_WITH(pdo-firebird,for Firebird support for PDO, [ --with-pdo-firebird[=DIR] PDO: Firebird support. DIR is the Firebird base - install directory [/opt/firebird]]) + install directory [/opt/firebird]]) if test "$PHP_PDO_FIREBIRD" != "no"; then diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 2b57cd8ba6b0..5c3e435f7b7f 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -344,7 +344,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{ if (n >= 0) { *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -var->sqlscale, n % f); - } else if (n <= -f) { + } else if (n < -f) { *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -var->sqlscale, -n % f); } else { @@ -535,14 +535,12 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat int force_null; case IS_LONG: - /* keep the allow-NULL flag */ - var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); + var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG; var->sqldata = (void*)&Z_LVAL_P(param->parameter); var->sqllen = sizeof(long); break; case IS_DOUBLE: - /* keep the allow-NULL flag */ - var->sqltype = SQL_DOUBLE | (var->sqltype & 1); + var->sqltype = SQL_DOUBLE; var->sqldata = (void*)&Z_DVAL_P(param->parameter); var->sqllen = sizeof(double); break; @@ -562,8 +560,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat force_null = (Z_STRLEN_P(param->parameter) == 0); } if (!force_null) { - /* keep the allow-NULL flag */ - var->sqltype = SQL_TEXT | (var->sqltype & 1); + var->sqltype = SQL_TEXT; var->sqldata = Z_STRVAL_P(param->parameter); var->sqllen = Z_STRLEN_P(param->parameter); break; diff --git a/ext/pdo_firebird/tests/bug_62024.phpt b/ext/pdo_firebird/tests/bug_62024.phpt deleted file mode 100644 index e046879c22a9..000000000000 --- a/ext/pdo_firebird/tests/bug_62024.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Bug #62024 Cannot insert second row with null using parametrized query (Firebird PDO) ---SKIPIF-- - - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); -$value = '2'; -@$dbh->exec('DROP TABLE test_insert'); -$dbh->exec("CREATE TABLE test_insert (ID INTEGER NOT NULL, TEXT VARCHAR(10))"); - -$dbh->commit(); - -//start actual test - -$sql = "insert into test_insert (id, text) values (?, ?)"; -$sttmt = $dbh->prepare($sql); - -$args_ok = array(1, "test1"); -$args_err = array(2, null); - -$res = $sttmt->execute($args_ok); -var_dump($res); - -$res = $sttmt->execute($args_err); -var_dump($res); - -$dbh->commit(); - - -//teardown test data -$sttmt = $dbh->prepare('DELETE FROM test_insert'); -$sttmt->execute(); - -$dbh->commit(); - -$dbh->exec('DROP TABLE test_insert'); - -unset($sttmt); -unset($dbh); - -?> ---EXPECT-- -bool(true) -bool(true) - diff --git a/ext/pdo_firebird/tests/bug_64037.phpt b/ext/pdo_firebird/tests/bug_64037.phpt deleted file mode 100644 index f7b53e57a342..000000000000 --- a/ext/pdo_firebird/tests/bug_64037.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Bug #64037 Firebird return wrong value for numeric field ---SKIPIF-- - - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); -$value = '2'; -@$dbh->exec('DROP TABLE price'); -$dbh->exec("CREATE TABLE PRICE (ID INTEGER NOT NULL, TEXT VARCHAR(10), COST NUMERIC(15, 2))"); -$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (1, 'test', -1.0)"); -$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (2, 'test', -0.99)"); -$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (3, 'test', -1.01)"); - -$dbh->commit(); - -$query = "SELECT * from price order by ID"; -$stmt = $dbh->prepare($query); -$stmt->execute(); -$rows = $stmt->fetchAll(); -var_dump($rows[0]['COST']); -var_dump($rows[1]['COST']); -var_dump($rows[2]['COST']); - - -$stmt = $dbh->prepare('DELETE FROM price'); -$stmt->execute(); - -$dbh->commit(); - -$dbh->exec('DROP TABLE price'); - -unset($stmt); -unset($dbh); - -?> ---EXPECT-- -string(5) "-1.00" -string(5) "-0.99" -string(5) "-1.01" \ No newline at end of file diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index f237f413be8c..a2ba2fdbdd58 100755 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -4,12 +4,12 @@ dnl vim: se ts=2 sw=2 et: PHP_ARG_WITH(pdo-mysql, for MySQL support for PDO, [ --with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directory - If no value or mysqlnd is passed as DIR, the - MySQL native driver will be used]) + If no value or mysqlnd is passed as DIR, the + MySQL native driver will be used]) if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, - [ --with-zlib-dir[=DIR] PDO_MySQL: Set the path to libz install prefix], no, no) + [ --with-zlib-dir[=DIR] PDO_MySQL: Set the path to libz install prefix], no, no) fi if test "$PHP_PDO_MYSQL" != "no"; then diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index cd86503dd765..54c2e8dd8487 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -527,9 +527,9 @@ static struct pdo_dbh_methods mysql_methods = { /* }}} */ #ifdef PHP_WIN32 -# define PDO_DEFAULT_MYSQL_UNIX_ADDR NULL +# define MYSQL_UNIX_ADDR NULL #else -# define PDO_DEFAULT_MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) +# define MYSQL_UNIX_ADDR PDO_MYSQL_G(default_socket) #endif /* {{{ pdo_mysql_handle_factory */ @@ -545,7 +545,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ { "dbname", "", 0 }, { "host", "localhost", 0 }, { "port", "3306", 0 }, - { "unix_socket", PDO_DEFAULT_MYSQL_UNIX_ADDR, 0 }, + { "unix_socket", MYSQL_UNIX_ADDR, 0 }, }; int connect_opts = 0 #ifdef CLIENT_MULTI_RESULTS @@ -710,7 +710,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ } } -#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND) +#if MYSQL_VERSION_ID > 50605 || defined(MYSQLI_USE_MYSQLND) { char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL TSRMLS_CC); if (public_key) { diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 369c38946278..2ae559571d48 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -761,11 +761,8 @@ static char *type_to_name_native(int type) /* {{{ */ switch (type) { PDO_MYSQL_NATIVE_TYPE_NAME(STRING) PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING) -#ifdef FIELD_TYPE_TINY +#ifdef MYSQL_HAS_TINY PDO_MYSQL_NATIVE_TYPE_NAME(TINY) -#endif -#ifdef FIELD_TYPE_BIT - PDO_MYSQL_NATIVE_TYPE_NAME(BIT) #endif PDO_MYSQL_NATIVE_TYPE_NAME(SHORT) PDO_MYSQL_NATIVE_TYPE_NAME(LONG) @@ -781,7 +778,7 @@ static char *type_to_name_native(int type) /* {{{ */ PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY) #endif PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP) -#ifdef FIELD_TYPE_YEAR +#ifdef MYSQL_HAS_YEAR PDO_MYSQL_NATIVE_TYPE_NAME(YEAR) #endif PDO_MYSQL_NATIVE_TYPE_NAME(SET) diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 78c4ceefe916..ed51e947cd79 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -61,7 +61,7 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql) #include "ext/mysqlnd/mysqlnd_reverse_api.h" static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) { - if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) { + if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJCE_P(zv) == php_pdo_get_dbh_ce()) { pdo_dbh_t * dbh = zend_object_store_get_object(zv TSRMLS_CC); if (!dbh || dbh->driver != &pdo_mysql_driver) { @@ -118,7 +118,7 @@ static PHP_MINIT_FUNCTION(pdo_mysql) REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CA", (long)PDO_MYSQL_ATTR_SSL_CA); REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CAPATH", (long)PDO_MYSQL_ATTR_SSL_CAPATH); REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CIPHER", (long)PDO_MYSQL_ATTR_SSL_CIPHER); -#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND) +#if MYSQL_VERSION_ID > 50605 || defined(MYSQLI_USE_MYSQLND) REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SERVER_PUBLIC_KEY", (long)PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY); #endif diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index 24f7aa2182dc..42debf07e933 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -171,7 +171,7 @@ enum { PDO_MYSQL_ATTR_SSL_CA, PDO_MYSQL_ATTR_SSL_CAPATH, PDO_MYSQL_ATTR_SSL_CIPHER, -#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND) +#if MYSQL_VERSION_ID > 50605 || defined(MYSQLI_USE_MYSQLND) PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY #endif }; diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt deleted file mode 100644 index ee928c093de7..000000000000 --- a/ext/pdo_mysql/tests/bug63176.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) ---SKIPIF-- - ---FILE-- -db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); - } else { - $this->db = new PDO3(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); - } - $this->db->query('SELECT 1')->fetchAll(); - } -} - -$a = new ModelA(true); -$b = new ModelA(false); - -var_dump($a); -var_dump($b); ---EXPECTF-- -bool(true) -bool(false) -object(ModelA)#%d (1) { - ["db"]=> - object(PDO2)#%d (1) { - ["transLevel":protected]=> - NULL - } -} -object(ModelA)#%d (1) { - ["db"]=> - object(PDO2)#%d (1) { - ["transLevel":protected]=> - NULL - } -} diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt index cb9cafd9f59b..47457180a5b6 100644 --- a/ext/pdo_mysql/tests/bug_39858.phpt +++ b/ext/pdo_mysql/tests/bug_39858.phpt @@ -18,8 +18,6 @@ if ($version < 50000) die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", $matches[0], $matches[1], $matches[2], $version)); ?> ---XFAIL-- -nextRowset() problem with stored proc & emulation mode & mysqlnd --FILE-- exec('DROP TABLE IF EXISTS test'); ?> +--XFAIL-- +For some reason the exception gets thrown at the wrong place --EXPECTF-- Native Prepared Statements ... SELECT has returned 1 row... diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc index 7a97bb463075..115aeadc5a65 100644 --- a/ext/pdo_mysql/tests/mysql_pdo_test.inc +++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc @@ -162,8 +162,8 @@ class MySQLPDOTest extends PDOTest { phpinfo(); $tmp = ob_get_contents(); ob_end_clean(); - return (preg_match('/PDO Driver for MySQL.*enabled/', $tmp) && - preg_match('/Client API version.*mysqlnd/', $tmp)); + $tmp = stristr($tmp, "PDO Driver for MySQL => enabled"); + return (bool)preg_match('/Client API version.*mysqlnd/', $tmp); } static function dropTestTable($db = NULL) { @@ -174,4 +174,4 @@ class MySQLPDOTest extends PDOTest { } } -?> +?> \ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt index 0cabfe6aa39e..c3f12df7a964 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct.phpt @@ -49,8 +49,7 @@ MySQLPDOTest::skip(); // should fail $dsn = 'mysql:'; - // don't print the message since it can be different - tryandcatch(10, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); + print tryandcatch(10, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); $dsn = PDO_MYSQL_TEST_DSN; $user = PDO_MYSQL_TEST_USER; @@ -58,15 +57,14 @@ MySQLPDOTest::skip(); // should work... $db = new PDO($dsn, $user, $pass); - // Reaction on host not specified differs for different configs, so no printing $dsn = 'mysql:invalid=foo'; - tryandcatch(11, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); + print tryandcatch(11, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); $dsn = 'mysql:' . str_repeat('howmuch=canpdoeat;', 1000); - tryandcatch(12, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); + print tryandcatch(12, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); $dsn = 'mysql:' . str_repeat('abcdefghij', 1024 * 10) . '=somevalue'; - tryandcatch(13, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); + print tryandcatch(13, '$db = new PDO("' . $dsn . '", "' . $user . '", "' . $pass . '");'); if (PDO_MYSQL_TEST_HOST) { $host = PDO_MYSQL_TEST_HOST; @@ -297,5 +295,6 @@ MySQLPDOTest::skip(); [006] invalid data source name, [n/a] n/a [007] could not find driver, [n/a] n/a [009] SQLSTATE[%s] [1045] Access denied for user 'dont%s'@'%s' (using password: YES), [n/a] n/a +[010] SQLSTATE[%s] [1045] Access denied for user 'dont%s'@'%s' (using password: YES), [n/a] n/a [017] DSN=%s, SQLSTATE[%s] [%d] %s done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt index ebf22ef61bec..b550cb8da318 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt @@ -48,7 +48,6 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) } require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); - putenv('PDOTEST_ATTR='.serialize([PDO::MYSQL_ATTR_LOCAL_INFILE=>true])); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db)); diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt index 5990ab812e38..eb0fff13e63d 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt @@ -64,7 +64,7 @@ MySQLPDOTest::skip(); $tmp = $stmt->fetch(PDO::FETCH_ASSOC); $con1 = $tmp['_con1']; - @$db2 = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); + $db2 = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); $stmt = $db2->query('SELECT CONNECTION_ID() as _con2'); $tmp = $stmt->fetch(PDO::FETCH_ASSOC); $con2 = $tmp['_con2']; @@ -94,4 +94,4 @@ MySQLPDOTest::skip(); print "done!"; ?> --EXPECTF-- -done! +done! \ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt index 74b4a7358447..a570c1fd49b9 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt @@ -18,9 +18,10 @@ $db = MySQLPDOTest::factory(); ob_end_clean(); /* PDO Driver for MySQL, client library version => 6.0.3-alpha */ - $reg = 'Client API version.*' . preg_quote($db->getAttribute(PDO::ATTR_CLIENT_VERSION), '/'); + $expected = sprintf('Client API version => %s', + $db->getAttribute(PDO::ATTR_CLIENT_VERSION)); - if (!preg_match("/$reg/", $tmp)) { + if (false === stristr($tmp, $expected)) { printf("[001] Cannot find MySQL PDO driver line in phpinfo() output\n"); } diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt index d2097f1162cf..0fef33487846 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt @@ -148,9 +148,9 @@ try { $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $is_mysqlnd = MySQLPDOTest::isPDOMySQLnd(); - test_meta($db, 20, 'BIT(8)', 1, 'BIT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); - test_meta($db, 30, 'TINYINT', -127, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); - test_meta($db, 40, 'TINYINT UNSIGNED', 255, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 20, 'BIT(8)', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 30, 'TINYINT', -127, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 40, 'TINYINT UNSIGNED', 255, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 50, 'BOOLEAN', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 60, 'SMALLINT', -32768, 'SHORT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); @@ -194,7 +194,7 @@ try { test_meta($db, 340, 'TIME', '14:37:00', 'TIME', PDO::PARAM_STR); test_meta($db, 350, 'TIMESTAMP', time(), 'TIMESTAMP', PDO::PARAM_STR); test_meta($db, 360, 'DATETIME', '2008-03-23 14:38:00', 'DATETIME', PDO::PARAM_STR); - test_meta($db, 370, 'YEAR', '2008', 'YEAR', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); + test_meta($db, 370, 'YEAR', '2008', NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 380, 'CHAR(1)', 'a', 'STRING', PDO::PARAM_STR); test_meta($db, 390, 'CHAR(10)', '0123456789', 'STRING', PDO::PARAM_STR); @@ -311,4 +311,4 @@ print "done!"; ?> --EXPECTF-- Testing native PS... -done! +done! \ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt index 9165e70551f3..799624543141 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt @@ -1,7 +1,5 @@ --TEST-- MySQL PDOStatement->nextRowSet() ---XFAIL-- -nextRowset() problem with stored proc & emulation mode & mysqlnd --SKIPIF-- --EXPECTF-- -done! +done! \ No newline at end of file diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 index e3795db0ea81..309bde8a5fa7 100755 --- a/ext/pdo_oci/config.m4 +++ b/ext/pdo_oci/config.m4 @@ -2,7 +2,7 @@ dnl $Id$ dnl config.m4 for extension pdo_oci dnl vim:et:sw=2:ts=2: -SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped +SUPPORTED_LIB_VERS="9.0 10.1 11.1" # This caters for all Oracle 9.x, 10.x and 11.1 installs AC_DEFUN([AC_PDO_OCI_VERSION],[ AC_MSG_CHECKING([Oracle version]) for OCI_VER in $SUPPORTED_LIB_VERS; do @@ -42,11 +42,11 @@ AC_DEFUN([AC_PDO_OCI_CHECK_LIB_DIR],[ PHP_ARG_WITH(pdo-oci, Oracle OCI support for PDO, [ --with-pdo-oci[=DIR] PDO: Oracle OCI support. DIR defaults to \$ORACLE_HOME. - Use --with-pdo-oci=instantclient,prefix,version - for an Oracle Instant Client SDK. - For example on Linux with 11.2 RPMs use: + Use --with-pdo-oci=instantclient,prefix,version + for an Oracle Instant Client SDK. + For example on Linux with 11.2 RPMs use: --with-pdo-oci=instantclient,/usr,11.2 - With 10.2 RPMs use: + With 10.2 RPMs use: --with-pdo-oci=instantclient,/usr,10.2.0.4]) if test "$PHP_PDO_OCI" != "no"; then @@ -147,7 +147,7 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_ fi case $PDO_OCI_VERSION in - 9.0|10.1|10.2|11.1|11.2|12.1) + 9.0|10.1|10.2|11.1|11.2) PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD) ;; diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index fcdefa94b3ec..5497bebc6446 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -537,9 +537,7 @@ static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */ { pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data; sb4 error_code = 0; -#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))) char version[256]; -#endif /* TODO move attached check to PDO level */ if (H->attached == 0) { diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 6a74efa7ba19..dcb9557803d5 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -270,12 +270,6 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa P = (pdo_oci_bound_param*)param->driver_data; switch (event_type) { - case PDO_PARAM_EVT_FETCH_PRE: - case PDO_PARAM_EVT_FETCH_POST: - case PDO_PARAM_EVT_NORMALIZE: - /* Do nothing */ - break; - case PDO_PARAM_EVT_FREE: P = param->driver_data; if (P) { diff --git a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt index ab9b99fc6c91..81e9b74ff927 100644 --- a/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt +++ b/ext/pdo_oci/tests/pdo_oci_attr_autocommit_3.phpt @@ -1,5 +1,5 @@ --TEST-- -PDO_OCI: Attribute: closing a connection in non-autocommit mode commits data +PDO_OCI: Atrribute: closing a connection in non-autocommit mode commits data --SKIPIF-- getAttribute(PDO::ATTR_CLIENT_VERSION); var_dump($cv); $s = explode(".", $cv); -if (count($s) > 1 && (($s[0] == 10 && $s[1] >= 2) || $s[0] >= 11)) { +if ($s[0] >= 10 && count($s) > 1 && $s[1] >= 2) { if (count($s) != 5) { echo "Wrong number of values in array\nVersion was: "; var_dump($cv); diff --git a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4 index 74734c4d63d7..b70dc9d53961 100755 --- a/ext/pdo_odbc/config.m4 +++ b/ext/pdo_odbc/config.m4 @@ -3,25 +3,25 @@ dnl config.m4 for extension pdo_odbc dnl vim:et:sw=2:ts=2: define([PDO_ODBC_HELP_TEXT],[[ - include and lib dirs are looked for under 'dir'. - - 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic - If ',dir' part is omitted, default for the flavour - you have selected will be used. e.g.: - - --with-pdo-odbc=unixODBC - - will check for unixODBC under /usr/local. You may attempt - to use an otherwise unsupported driver using the \"generic\" - flavour. The syntax for generic ODBC support is: - - --with-pdo-odbc=generic,dir,libname,ldflags,cflags - - When built as 'shared' the extension filename is always pdo_odbc.so]]) + include and lib dirs are looked for under 'dir'. + + 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic + If ',dir' part is omitted, default for the flavour + you have selected will used. e.g.: + + --with-pdo-odbc=unixODBC + + will check for unixODBC under /usr/local. You may attempt + to use an otherwise unsupported driver using the \"generic\" + flavour. The syntax for generic ODBC support is: + + --with-pdo-odbc=generic,dir,libname,ldflags,cflags + + When build as shared the extension filename is always pdo_odbc.so]]) PHP_ARG_WITH(pdo-odbc, for ODBC v3 support for PDO, [ --with-pdo-odbc=flavour,dir - PDO: Support for 'flavour' ODBC driver.]PDO_ODBC_HELP_TEXT) + PDO: Support for 'flavour' ODBC driver.]PDO_ODBC_HELP_TEXT) AC_DEFUN([PDO_ODBC_CHECK_HEADER],[ diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index f7f3ef34ed32..33163688eb4e 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -263,7 +263,7 @@ static long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRML static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC) { - /* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */ + pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; /* TODO: figure it out */ return 0; } diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 0e3fd3cbb9f3..6ee2fcd6becb 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -286,12 +286,6 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p if (param->is_param) { switch (event_type) { - case PDO_PARAM_EVT_FETCH_PRE: - case PDO_PARAM_EVT_FETCH_POST: - case PDO_PARAM_EVT_NORMALIZE: - /* Do nothing */ - break; - case PDO_PARAM_EVT_FREE: P = param->driver_data; if (P) { @@ -549,6 +543,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) { pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; struct pdo_column_data *col = &stmt->columns[colno]; + zend_bool dyn = FALSE; RETCODE rc; SWORD colnamelen; SDWORD colsize, displaysize; @@ -619,6 +614,7 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l /* if it is a column containing "long" data, perform late binding now */ if (C->is_long) { + unsigned long alloced = 4096; unsigned long used = 0; char *buf; RETCODE rc; diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 index afe42e06a5be..f9254a8fd923 100644 --- a/ext/pdo_pgsql/config.m4 +++ b/ext/pdo_pgsql/config.m4 @@ -4,7 +4,7 @@ dnl vim:et:sw=2:ts=2: PHP_ARG_WITH(pdo-pgsql,for PostgreSQL support for PDO, [ --with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base - install directory or the path to pg_config]) + install directory or the path to pg_config]) if test "$PHP_PDO_PGSQL" != "no"; then diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index cb89809f023a..a54fccd0e633 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -27,10 +27,8 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" -#include "main/php_network.h" #include "pdo/php_pdo.h" #include "pdo/php_pdo_driver.h" -#include "pdo/php_pdo_error.h" #include "ext/standard/file.h" #undef PACKAGE_BUGREPORT @@ -62,7 +60,7 @@ static char * _pdo_pgsql_trim_message(const char *message, int persistent) return tmp; } -int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC) /* {{{ */ +int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC) /* {{{ */ { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; @@ -78,17 +76,14 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char * einfo->errmsg = NULL; } - if (sqlstate == NULL || strlen(sqlstate) >= sizeof(pdo_error_type)) { + if (sqlstate == NULL) { strcpy(*pdo_err, "HY000"); } else { strcpy(*pdo_err, sqlstate); } - if (msg) { - einfo->errmsg = estrdup(msg); - } - else if (errmsg) { + if (errmsg) { einfo->errmsg = _pdo_pgsql_trim_message(errmsg, dbh->is_persistent); } @@ -96,7 +91,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char * zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s", *pdo_err, einfo->errcode, einfo->errmsg); } - + return errcode; } /* }}} */ @@ -320,9 +315,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote case PDO_PARAM_LOB: /* escapedlen returned by PQescapeBytea() accounts for trailing 0 */ #ifdef HAVE_PQESCAPE_BYTEA_CONN - escaped = PQescapeByteaConn(H->server, (unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len); + escaped = PQescapeByteaConn(H->server, unquoted, unquotedlen, &tmp_len); #else - escaped = PQescapeBytea((unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len); + escaped = PQescapeBytea(unquoted, unquotedlen, &tmp_len); #endif *quotedlen = (int)tmp_len + 1; *quoted = emalloc(*quotedlen + 1); @@ -336,9 +331,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote *quoted = safe_emalloc(2, unquotedlen, 3); (*quoted)[0] = '\''; #ifndef HAVE_PQESCAPE_CONN - *quotedlen = PQescapeString(*quoted + 1, unquoted, (size_t)unquotedlen); + *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen); #else - *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, (size_t)unquotedlen, NULL); + *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL); #endif (*quoted)[*quotedlen + 1] = '\''; (*quoted)[*quotedlen + 2] = '\0'; @@ -540,13 +535,11 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); - /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { - spprintf(&query, 0, "COPY %s (%s) FROM STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s (%s) FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } else { - spprintf(&query, 0, "COPY %s FROM STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } /* Obtain db Handle */ @@ -590,8 +583,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray) query[query_len] = '\0'; if (PQputCopyData(H->server, query, query_len) != 1) { efree(query); - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "copy failed"); RETURN_FALSE; } zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos); @@ -601,25 +593,22 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray) } if (PQputCopyEnd(H->server, NULL) != 1) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "putcopyend failed"); RETURN_FALSE; } while ((pgsql_result = PQgetResult(H->server))) { if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); command_failed = 1; } PQclear(pgsql_result); } - PDO_HANDLE_DBH_ERR(); RETURN_BOOL(!command_failed); } else { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); PQclear(pgsql_result); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); RETURN_FALSE; } } @@ -648,20 +637,17 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile) /* Obtain db Handler */ dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); - stream = php_stream_open_wrapper_ex(filename, "rb", ENFORCE_SAFE_MODE, NULL, FG(default_context)); + stream = php_stream_open_wrapper_ex(filename, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, FG(default_context)); if (!stream) { - pdo_pgsql_error_msg(dbh, PGRES_FATAL_ERROR, "Unable to open the file"); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Unable to open the file"); RETURN_FALSE; } - /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { - spprintf(&query, 0, "COPY %s (%s) FROM STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s (%s) FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } else { - spprintf(&query, 0, "COPY %s FROM STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -688,9 +674,8 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile) while ((buf = php_stream_get_line(stream, NULL, 0, &line_len)) != NULL) { if (PQputCopyData(H->server, buf, line_len) != 1) { efree(buf); - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "copy failed"); php_stream_close(stream); - PDO_HANDLE_DBH_ERR(); RETURN_FALSE; } efree(buf); @@ -698,26 +683,23 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile) php_stream_close(stream); if (PQputCopyEnd(H->server, NULL) != 1) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "putcopyend failed"); RETURN_FALSE; } while ((pgsql_result = PQgetResult(H->server))) { if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); command_failed = 1; } PQclear(pgsql_result); } - PDO_HANDLE_DBH_ERR(); RETURN_BOOL(!command_failed); } else { - php_stream_close(stream); - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); PQclear(pgsql_result); - PDO_HANDLE_DBH_ERR(); + php_stream_close(stream); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); RETURN_FALSE; } } @@ -748,14 +730,12 @@ static PHP_METHOD(PDO, pgsqlCopyToFile) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); H = (pdo_pgsql_db_handle *)dbh->driver_data; - stream = php_stream_open_wrapper_ex(filename, "wb", ENFORCE_SAFE_MODE, NULL, FG(default_context)); + stream = php_stream_open_wrapper_ex(filename, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, FG(default_context)); if (!stream) { - pdo_pgsql_error_msg(dbh, PGRES_FATAL_ERROR, "Unable to open the file for writing"); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Unable to open the file for writing"); RETURN_FALSE; } @@ -763,11 +743,10 @@ static PHP_METHOD(PDO, pgsqlCopyToFile) PQclear(pgsql_result); } - /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { - spprintf(&query, 0, "COPY %s (%s) TO STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s (%s) TO STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } else { - spprintf(&query, 0, "COPY %s TO STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s TO STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } pgsql_result = PQexec(H->server, query); efree(query); @@ -788,18 +767,16 @@ static PHP_METHOD(PDO, pgsqlCopyToFile) break; /* done */ } else if (ret > 0) { if (php_stream_write(stream, csv, ret) != ret) { - pdo_pgsql_error_msg(dbh, PGRES_FATAL_ERROR, "Unable to write to file"); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Unable to write to file"); PQfreemem(csv); php_stream_close(stream); - PDO_HANDLE_DBH_ERR(); RETURN_FALSE; } else { PQfreemem(csv); } } else { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed: getline failed"); php_stream_close(stream); - PDO_HANDLE_DBH_ERR(); RETURN_FALSE; } } @@ -811,9 +788,8 @@ static PHP_METHOD(PDO, pgsqlCopyToFile) RETURN_TRUE; } else { php_stream_close(stream); - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); PQclear(pgsql_result); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); RETURN_FALSE; } } @@ -841,7 +817,6 @@ static PHP_METHOD(PDO, pgsqlCopyToArray) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -849,11 +824,10 @@ static PHP_METHOD(PDO, pgsqlCopyToArray) PQclear(pgsql_result); } - /* using pre-9.0 syntax as PDO_pgsql is 7.4+ compatible */ if (pg_fields) { - spprintf(&query, 0, "COPY %s (%s) TO STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s (%s) TO STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, pg_fields, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } else { - spprintf(&query, 0, "COPY %s TO STDIN WITH DELIMITER E'%c' NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); + spprintf(&query, 0, "COPY %s TO STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, (pg_delim_len ? *pg_delim : '\t'), (pg_null_as_len ? pg_null_as : "\\\\N")); } pgsql_result = PQexec(H->server, query); efree(query); @@ -877,8 +851,7 @@ static PHP_METHOD(PDO, pgsqlCopyToArray) add_next_index_stringl(return_value, csv, ret, 1); PQfreemem(csv); } else { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed: getline failed"); RETURN_FALSE; } } @@ -887,9 +860,8 @@ static PHP_METHOD(PDO, pgsqlCopyToArray) PQclear(pgsql_result); } } else { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, pdo_pgsql_sqlstate(pgsql_result)); PQclear(pgsql_result); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed"); RETURN_FALSE; } } @@ -906,7 +878,6 @@ static PHP_METHOD(PDO, pgsqlLOBCreate) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); H = (pdo_pgsql_db_handle *)dbh->driver_data; lfd = lo_creat(H->server, INV_READ|INV_WRITE); @@ -916,9 +887,8 @@ static PHP_METHOD(PDO, pgsqlLOBCreate) spprintf(&buf, 0, "%lu", (long) lfd); RETURN_STRING(buf, 0); } - - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "HY000"); RETURN_FALSE; } /* }}} */ @@ -954,7 +924,6 @@ static PHP_METHOD(PDO, pgsqlLOBOpen) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -967,10 +936,8 @@ static PHP_METHOD(PDO, pgsqlLOBOpen) return; } } else { - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "HY000"); } - - PDO_HANDLE_DBH_ERR(); RETURN_FALSE; } /* }}} */ @@ -997,98 +964,17 @@ static PHP_METHOD(PDO, pgsqlLOBUnlink) dbh = zend_object_store_get_object(getThis() TSRMLS_CC); PDO_CONSTRUCT_CHECK; - PDO_DBH_CLEAR_ERR(); H = (pdo_pgsql_db_handle *)dbh->driver_data; - + if (1 == lo_unlink(H->server, oid)) { RETURN_TRUE; } - - pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - PDO_HANDLE_DBH_ERR(); + pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "HY000"); RETURN_FALSE; } /* }}} */ -/* {{{ proto mixed PDO::pgsqlGetNotify([ int $result_type = PDO::FETCH_USE_DEFAULT] [, int $ms_timeout = 0 ]]) - Get asyncronous notification */ -static PHP_METHOD(PDO, pgsqlGetNotify) -{ - pdo_dbh_t *dbh; - pdo_pgsql_db_handle *H; - long result_type = PDO_FETCH_USE_DEFAULT; - long ms_timeout = 0; - PGnotify *pgsql_notify; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", - &result_type, &ms_timeout)) { - RETURN_FALSE; - } - - dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - PDO_CONSTRUCT_CHECK; - - if (result_type == PDO_FETCH_USE_DEFAULT) { - result_type = dbh->default_fetch_type; - } - - if (result_type != PDO_FETCH_BOTH && result_type != PDO_FETCH_ASSOC && result_type != PDO_FETCH_NUM) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); - RETURN_FALSE; - } - - if (ms_timeout < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid timeout"); - RETURN_FALSE; - } - - H = (pdo_pgsql_db_handle *)dbh->driver_data; - - PQconsumeInput(H->server); - pgsql_notify = PQnotifies(H->server); - - if (ms_timeout && !pgsql_notify) { - php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, ms_timeout); - - PQconsumeInput(H->server); - pgsql_notify = PQnotifies(H->server); - } - - if (!pgsql_notify) { - RETURN_FALSE; - } - - array_init(return_value); - if (result_type == PDO_FETCH_NUM || result_type == PDO_FETCH_BOTH) { - add_index_string(return_value, 0, pgsql_notify->relname, 1); - add_index_long(return_value, 1, pgsql_notify->be_pid); - } - if (result_type == PDO_FETCH_ASSOC || result_type == PDO_FETCH_BOTH) { - add_assoc_string(return_value, "message", pgsql_notify->relname, 1); - add_assoc_long(return_value, "pid", pgsql_notify->be_pid); - } - - PQfreemem(pgsql_notify); -} -/* }}} */ - -/* {{{ proto int PDO::pgsqlGetPid() - Get backend(server) pid */ -static PHP_METHOD(PDO, pgsqlGetPid) -{ - pdo_dbh_t *dbh; - pdo_pgsql_db_handle *H; - - dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - PDO_CONSTRUCT_CHECK; - - H = (pdo_pgsql_db_handle *)dbh->driver_data; - - RETURN_LONG(PQbackendPID(H->server)); -} -/* }}} */ - static const zend_function_entry dbh_methods[] = { PHP_ME(PDO, pgsqlLOBCreate, NULL, ZEND_ACC_PUBLIC) @@ -1098,8 +984,6 @@ static const zend_function_entry dbh_methods[] = { PHP_ME(PDO, pgsqlCopyFromFile, NULL, ZEND_ACC_PUBLIC) PHP_ME(PDO, pgsqlCopyToArray, NULL, ZEND_ACC_PUBLIC) PHP_ME(PDO, pgsqlCopyToFile, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, pgsqlGetNotify, NULL, ZEND_ACC_PUBLIC) - PHP_ME(PDO, pgsqlGetPid, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 792ad2707867..d58eebf8f439 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -536,7 +536,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned *len = 0; return 0; } else { - char *tmp_ptr = (char *)PQunescapeBytea((unsigned char *)*ptr, &tmp_len); + char *tmp_ptr = PQunescapeBytea(*ptr, &tmp_len); if (!tmp_ptr) { /* PQunescapeBytea returned an error */ *len = 0; @@ -587,7 +587,7 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type); /* Fetch metadata from Postgres system catalogue */ - spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type); + spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type); res = PQexec(S->H->server, q); efree(q); diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 5600a925411c..02a6717760cd 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -83,11 +83,9 @@ typedef struct { extern pdo_driver_t pdo_pgsql_driver; -extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC); -#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC) -#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC) +extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC); +#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, __FILE__, __LINE__ TSRMLS_CC) +#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, __FILE__, __LINE__ TSRMLS_CC) extern struct pdo_stmt_methods pgsql_stmt_methods; diff --git a/ext/pdo_pgsql/tests/bug46274.phpt b/ext/pdo_pgsql/tests/bug46274.phpt index 40706ecaa302..c34839ad430b 100644 --- a/ext/pdo_pgsql/tests/bug46274.phpt +++ b/ext/pdo_pgsql/tests/bug46274.phpt @@ -14,11 +14,6 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); -try { - @$db->query("SET bytea_output = 'escape'"); -} catch (Exception $e) { -} - $db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); $stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); diff --git a/ext/pdo_pgsql/tests/bug46274_2.phpt b/ext/pdo_pgsql/tests/bug46274_2.phpt index df60f34540ad..eb675afe9e5f 100644 --- a/ext/pdo_pgsql/tests/bug46274_2.phpt +++ b/ext/pdo_pgsql/tests/bug46274_2.phpt @@ -14,11 +14,6 @@ $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); -try { - @$db->query("SET bytea_output = 'escape'"); -} catch (Exception $e) { -} - $db->query('CREATE TABLE test_one_blob (id SERIAL NOT NULL, blob1 BYTEA)'); $stmt = $db->prepare("INSERT INTO test_one_blob (blob1) VALUES (:foo)"); diff --git a/ext/pdo_pgsql/tests/bug64953.phpt b/ext/pdo_pgsql/tests/bug64953.phpt deleted file mode 100644 index 6e72bcab68ff..000000000000 --- a/ext/pdo_pgsql/tests/bug64953.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -PDO PgSQL Bug #64953 (Postgres prepared statement positional parameter casting) ---SKIPIF-- - ---FILE-- -setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - -echo "Taken from the bug report:\n"; - -$st = $pdo->prepare('SELECT ?::char as i'); -$st->bindValue(1, '1'); -$st->execute(); -var_dump($st->fetch()); // return false - - -$st = $pdo->prepare('SELECT (?)::char as i'); -$st->bindValue(1, '1'); -$st->execute(); -var_dump($st->fetch()); // return array(1) { ["i"]=> string(1) "1" } - -echo "Something more nasty:\n"; - -$st = $pdo->prepare("SELECT :int::int as i"); -$st->execute(array(":int" => 123)); -var_dump($st->fetch()); - -$st = $pdo->prepare("SELECT '''?'''::text as \":text\""); -$st->execute(); -var_dump($st->fetch()); - -?> -Done ---EXPECT-- -Test -Taken from the bug report: -array(2) { - ["i"]=> - string(1) "1" - [0]=> - string(1) "1" -} -array(2) { - ["i"]=> - string(1) "1" - [0]=> - string(1) "1" -} -Something more nasty: -array(2) { - ["i"]=> - string(3) "123" - [0]=> - string(3) "123" -} -array(2) { - [":text"]=> - string(3) "'?'" - [0]=> - string(3) "'?'" -} -Done diff --git a/ext/pdo_pgsql/tests/bug_33876.phpt b/ext/pdo_pgsql/tests/bug_33876.phpt index 6a93905b439f..48618e13dba9 100644 --- a/ext/pdo_pgsql/tests/bug_33876.phpt +++ b/ext/pdo_pgsql/tests/bug_33876.phpt @@ -82,7 +82,7 @@ else # false -> "" as string, which pgsql doesn't like if (!$res->execute(array(false))) { $err = $res->errorInfo(); - // Strip additional lines outputted by recent PgSQL versions + // Strip additional lines ouputted by recent PgSQL versions $err[2] = trim(current(explode("\n", $err[2]))); print_r($err); } else { diff --git a/ext/pdo_pgsql/tests/bug_49985.phpt b/ext/pdo_pgsql/tests/bug_49985.phpt index e1d7df82a0a3..26dcfc617d24 100644 --- a/ext/pdo_pgsql/tests/bug_49985.phpt +++ b/ext/pdo_pgsql/tests/bug_49985.phpt @@ -30,6 +30,6 @@ for ($i = 0; $i < 3; $i++) { ?> --EXPECTF-- bool(true) -SQLSTATE[23505]: %stest_pkey%s -SQLSTATE[23505]: %stest_pkey%s +SQLSTATE[23505]: %s"test_pkey" +SQLSTATE[23505]: %s"test_pkey" diff --git a/ext/pdo_pgsql/tests/copy_from.phpt b/ext/pdo_pgsql/tests/copy_from.phpt index de1140dfea71..2858905d0cb1 100644 --- a/ext/pdo_pgsql/tests/copy_from.phpt +++ b/ext/pdo_pgsql/tests/copy_from.phpt @@ -16,6 +16,8 @@ $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $db->exec('CREATE TABLE test (a integer not null primary key, b text, c integer)'); +try { + echo "Preparing test file and array for CopyFrom tests\n"; $tableRows = array(); @@ -66,13 +68,10 @@ $db->rollback(); echo "Testing pgsqlCopyFromArray() with error\n"; $db->beginTransaction(); -try { - var_dump($db->pgsqlCopyFromArray('test_error',$tableRowsWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); -} catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; -} +var_dump($db->pgsqlCopyFromArray('test_error',$tableRowsWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); $db->rollback(); + echo "Testing pgsqlCopyFromFile() with default parameters\n"; $db->beginTransaction(); var_dump($db->pgsqlCopyFromFile('test',$filename)); @@ -103,25 +102,16 @@ $db->rollback(); echo "Testing pgsqlCopyFromFile() with error\n"; $db->beginTransaction(); -try { - var_dump($db->pgsqlCopyFromFile('test_error',$filenameWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); -} catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; -} +var_dump($db->pgsqlCopyFromFile('test_error',$filenameWithDifferentNullValuesAndSelectedFields,";","NULL",'a,c')); $db->rollback(); -echo "Testing pgsqlCopyFromFile() with non existing file\n"; -$db->beginTransaction(); -try { - var_dump($db->pgsqlCopyFromFile('test',"nonexisting/foo.csv",";","NULL",'a,c')); } catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; + /* catch exceptions so that we can show the relative error */ + echo "Exception! at line ", $e->getLine(), "\n"; + var_dump($e->getMessage()); } -$db->rollback(); - -// Clean up -foreach (array($filename, $filenameWithDifferentNullValues, $filenameWithDifferentNullValuesAndSelectedFields) as $f) { - @unlink($f); +if(isset($filename)) { + @unlink($filename); } ?> --EXPECT-- @@ -259,7 +249,7 @@ array(6) { NULL } Testing pgsqlCopyFromArray() with error -Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "test_error" does not exist +bool(false) Testing pgsqlCopyFromFile() with default parameters bool(true) array(6) { @@ -393,7 +383,4 @@ array(6) { NULL } Testing pgsqlCopyFromFile() with error -Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "test_error" does not exist -Testing pgsqlCopyFromFile() with non existing file -Exception: SQLSTATE[HY000]: General error: 7 Unable to open the file - +bool(false) \ No newline at end of file diff --git a/ext/pdo_pgsql/tests/copy_to.phpt b/ext/pdo_pgsql/tests/copy_to.phpt index 7bc46c6e0b6e..1dc7d1de33ed 100644 --- a/ext/pdo_pgsql/tests/copy_to.phpt +++ b/ext/pdo_pgsql/tests/copy_to.phpt @@ -17,6 +17,7 @@ $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $db->exec('CREATE TABLE test (a integer not null primary key, b text, c integer)'); $db->beginTransaction(); +try { echo "Preparing test table for CopyTo tests\n"; $stmt = $db->prepare("INSERT INTO test (a, b, c) values (?, ?, ?)"); @@ -41,11 +42,8 @@ echo "Testing pgsqlCopyToArray() with only selected fields\n"; var_dump($db->pgsqlCopyToArray('test',";","NULL",'a,c')); echo "Testing pgsqlCopyToArray() with error\n"; -try { - var_dump($db->pgsqlCopyToArray('test_error')); -} catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; -} +var_dump($db->pgsqlCopyToArray('test_error')); + echo "Testing pgsqlCopyToFile() with default parameters\n"; @@ -60,19 +58,14 @@ var_dump($db->pgsqlCopyToFile('test',$filename,";","NULL",'a,c')); echo file_get_contents($filename); echo "Testing pgsqlCopyToFile() with error\n"; -try { - var_dump($db->pgsqlCopyToFile('test_error',$filename)); -} catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; -} +var_dump($db->pgsqlCopyToFile('test_error',$filename)); + -echo "Testing pgsqlCopyToFile() to unwritable file\n"; -try { - var_dump($db->pgsqlCopyToFile('test', 'nonexistent/foo.csv')); } catch (Exception $e) { - echo "Exception: {$e->getMessage()}\n"; + /* catch exceptions so that we can show the relative error */ + echo "Exception! at line ", $e->getLine(), "\n"; + var_dump($e->getMessage()); } - if(isset($filename)) { @unlink($filename); } @@ -116,7 +109,7 @@ array(3) { " } Testing pgsqlCopyToArray() with error -Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "test_error" does not exist +bool(false) Testing pgsqlCopyToFile() with default parameters bool(true) 0 test insert 0 \N @@ -133,7 +126,4 @@ bool(true) 1;NULL 2;NULL Testing pgsqlCopyToFile() with error -Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "test_error" does not exist -Testing pgsqlCopyToFile() to unwritable file -Exception: SQLSTATE[HY000]: General error: 7 Unable to open the file for writing - +bool(false) \ No newline at end of file diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt deleted file mode 100644 index c093e0357a5d..000000000000 --- a/ext/pdo_pgsql/tests/getnotify.phpt +++ /dev/null @@ -1,109 +0,0 @@ ---TEST-- -PDO PgSQL LISTEN/NOTIFY support ---SKIPIF-- - ---FILE-- -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -// pgsqlGetPid should return something meaningful -$pid = $db->pgsqlGetPid(); -var_dump($pid > 0); - -// No listen, no notifies -var_dump($db->pgsqlGetNotify()); - -// Listen started, no notifies -$db->exec("LISTEN notifies_phpt"); -var_dump($db->pgsqlGetNotify()); - -// No parameters, use default PDO::FETCH_NUM -$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM); -$db->exec("NOTIFY notifies_phpt"); -$notify = $db->pgsqlGetNotify(); -var_dump(count($notify)); -var_dump($notify[0]); -var_dump($notify[1] == $pid); - -// No parameters, use default PDO::FETCH_ASSOC -$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); -$db->exec("NOTIFY notifies_phpt"); -$notify = $db->pgsqlGetNotify(); -var_dump(count($notify)); -var_dump($notify['message']); -var_dump($notify['pid'] == $pid); - -// Test PDO::FETCH_NUM as parameter -$db->exec("NOTIFY notifies_phpt"); -$notify = $db->pgsqlGetNotify(PDO::FETCH_NUM); -var_dump(count($notify)); -var_dump($notify[0]); -var_dump($notify[1] == $pid); - -// Test PDO::FETCH_ASSOC as parameter -$db->exec("NOTIFY notifies_phpt"); -$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC); -var_dump(count($notify)); -var_dump($notify['message']); -var_dump($notify['pid'] == $pid); - -// Test PDO::FETCH_BOTH as parameter -$db->exec("NOTIFY notifies_phpt"); -$notify = $db->pgsqlGetNotify(PDO::FETCH_BOTH); -var_dump(count($notify)); -var_dump($notify['message']); -var_dump($notify['pid'] == $pid); -var_dump($notify[0]); -var_dump($notify[1] == $pid); - -// Verify that there are no notifies queued -var_dump($db->pgsqlGetNotify()); - - -// Test second parameter, should wait 2 seconds because no notify is queued -$t = microtime(1); -$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000); -var_dump((microtime(1) - $t) >= 1); -var_dump($notify); - -// Test second parameter, should return immediately because a notify is queued -$db->exec("NOTIFY notifies_phpt"); -$t = microtime(1); -$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000); -var_dump((microtime(1) - $t) < 1); -var_dump(count($notify)); - -?> ---EXPECT-- -bool(true) -bool(false) -bool(false) -int(2) -string(13) "notifies_phpt" -bool(true) -int(2) -string(13) "notifies_phpt" -bool(true) -int(2) -string(13) "notifies_phpt" -bool(true) -int(2) -string(13) "notifies_phpt" -bool(true) -int(4) -string(13) "notifies_phpt" -bool(true) -string(13) "notifies_phpt" -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -int(2) diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 index 0a7d0fe82613..b2b70a503896 100644 --- a/ext/pdo_sqlite/config.m4 +++ b/ext/pdo_sqlite/config.m4 @@ -4,8 +4,8 @@ dnl vim:et:sw=2:ts=2: PHP_ARG_WITH(pdo-sqlite, for sqlite 3 support for PDO, [ --without-pdo-sqlite[=DIR] - PDO: sqlite 3 support. DIR is the sqlite base - install directory [BUNDLED]], $PHP_PDO) + PDO: sqlite 3 support. DIR is the sqlite base + install directory [BUNDLED]], $PHP_PDO) if test "$PHP_PDO_SQLITE" != "no"; then diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt deleted file mode 100644 index a1d890ac1b52..000000000000 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -PDO_sqlite: Testing sqliteCreateFunction() produces warning when -un-callable function passed ---CREDITS-- -Chris MacPherson chris@kombine.co.uk ---SKIPIF-- - ---FILE-- -sqliteCreateFunction('bar-alias', 'bar'); - -?> ---EXPECTF-- -Warning: PDO::sqliteCreateFunction(): function 'bar' is not callable in %s on line %d diff --git a/ext/pgsql/README b/ext/pgsql/README index 785b4f034b35..2b4c412338d4 100644 --- a/ext/pgsql/README +++ b/ext/pgsql/README @@ -35,7 +35,7 @@ names. Older names will become aliases of new functions for backward compatibility. -Manual will be updated when this change is committed to CVS source. +Manual will be updated when this change is commited to CVS source. ==== Configure Option Notes ==== You cannot specify PostgreSQL source directly to build PostgreSQL diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 13837bd832c7..bddb77a151e1 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(pgsql,for PostgreSQL support, -[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL +[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL base install directory or the path to pg_config]) if test "$PHP_PGSQL" != "no"; then diff --git a/ext/pgsql/mysql_users.php b/ext/pgsql/mysql_users.php index edfaa1cddcce..65a2c3396753 100644 --- a/ext/pgsql/mysql_users.php +++ b/ext/pgsql/mysql_users.php @@ -56,7 +56,7 @@ function pg_list_tables($db) /* * mysql_list_fields() * - * See also pg_meta_data(). It returns field definition as array. + * See also pg_meta_data(). It returns field defintion as array. */ function pg_list_fields($db, $table) { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 35eb09e58466..7ee838a9fa34 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -63,7 +63,6 @@ #define PGSQL_MAX_LENGTH_OF_LONG 30 #define PGSQL_MAX_LENGTH_OF_DOUBLE 60 -#if LONG_MAX < UINT_MAX #define PGSQL_RETURN_OID(oid) do { \ if (oid > LONG_MAX) { \ smart_str s = {0}; \ @@ -73,9 +72,7 @@ } \ RETURN_LONG((long)oid); \ } while(0) -#else -#define PGSQL_RETURN_OID(oid) (RETURN_LONG((long)oid)) -#endif + #if HAVE_PQSETNONBLOCKING #define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag) @@ -917,82 +914,6 @@ static void _free_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) } /* }}} */ - -static int _php_pgsql_detect_identifier_escape(const char *identifier, size_t len) -{ - size_t i; - - /* Handle edge case. Cannot be a escaped string */ - if (len <= 2) { - return FAILURE; - } - /* Detect double qoutes */ - if (identifier[0] == '"' && identifier[len-1] == '"') { - /* Detect wrong format of " inside of escaped string */ - for (i = 1; i < len-1; i++) { - if (identifier[i] == '"' && (identifier[++i] != '"' || i == len-1)) { - return FAILURE; - } - } - } else { - return FAILURE; - } - /* Escaped properly */ - return SUCCESS; -} - -#if !HAVE_PQESCAPELITERAL -/* {{{ _php_pgsql_escape_identifier - * Since PQescapeIdentifier() is unavailable (PostgreSQL 9.0 <), idenfifers - * should be escaped by pgsql module. - * Note: this function does not care for encoding. Therefore users should not - * use this with SJIS/BIG5 etc. (i.e. Encoding base injection may possible with - * before PostgreSQL 9.0) - */ -static char *_php_pgsql_escape_identifier(const char *field, size_t field_len) -{ - ulong field_escaped_len = field_len*2 + 3; - ulong i, j = 0; - char *field_escaped; - - field_escaped = (char *)malloc(field_escaped_len); - field_escaped[j++] = '"'; - for (i = 0; i < field_len; i++) { - if (field[i] == '"') { - field_escaped[j++] = '"'; - field_escaped[j++] = '"'; - } else { - field_escaped[j++] = field[i]; - } - } - field_escaped[j++] = '"'; - field_escaped[j] = '\0'; - return field_escaped; -} -/* }}} */ -#endif - -/* {{{ _php_pgsql_strndup, no strndup should be used */ -static char *_php_pgsql_strndup(const char *s, size_t len) -{ - char *new; - - if (NULL == s) { - return (char *)NULL; - } - - new = (char *) malloc(len + 1); - - if (NULL == new) { - return (char *)NULL; - } - - new[len] = '\0'; - - return memmove(new, s, len); -} -/* }}} */ - /* {{{ PHP_INI */ PHP_INI_BEGIN() @@ -4155,7 +4076,7 @@ PHP_FUNCTION(pg_escape_bytea) #ifdef HAVE_PQESCAPE_BYTEA_CONN if (pgsql_link != NULL || id != -1) { ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len); + to = (char *)PQescapeByteaConn(pgsql, from, (size_t)from_len, &to_len); } else #endif to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); @@ -4291,7 +4212,6 @@ PHP_FUNCTION(pg_unescape_bytea) to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len); #endif if (!to) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid parameter"); RETURN_FALSE; } RETVAL_STRINGL(to, to_len, 0); @@ -4350,9 +4270,10 @@ static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le #endif static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_literal) { - char *from = NULL, *to = NULL; + char *from = NULL, *to = NULL, *tmp = NULL; zval *pgsql_link = NULL; PGconn *pgsql; + int to_len; int from_len; int id = -1; @@ -4373,32 +4294,26 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l } if (pgsql_link == NULL && id == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link"); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (pgsql == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get pgsql link"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link"); RETURN_FALSE; } #ifdef HAVE_PQESCAPELITERAL - /* Use a block with a local var to avoid unused variable warnings */ - { - char *tmp; - - if (escape_literal) { - tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); - } else { - tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len); - } - if (!tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); - RETURN_FALSE; - } - to = estrdup(tmp); - PQfreemem(tmp); + if (escape_literal) { + tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); + } else { + tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len); + } + if (!tmp) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); + RETURN_FALSE; } + to = estrdup(tmp); + PQfreemem(tmp); #else to = php_pgsql_PQescapeInternal(pgsql, from, (size_t)from_len, escape_literal); if (!to) { @@ -4658,7 +4573,6 @@ PHP_FUNCTION(pg_send_query) PGconn *pgsql; PGresult *res; int leftover = 0; - int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) { @@ -4686,14 +4600,6 @@ PHP_FUNCTION(pg_send_query) RETURN_FALSE; } } - /* Wait to finish sending buffer */ - while ((ret = PQflush(pgsql))) { - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer"); - break; - } - usleep(10000); - } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4714,7 +4620,6 @@ PHP_FUNCTION(pg_send_query_params) PGconn *pgsql; PGresult *res; int leftover = 0; - int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) { return; @@ -4781,14 +4686,6 @@ PHP_FUNCTION(pg_send_query_params) } } _php_pgsql_free_params(params, num_params); - /* Wait to finish sending buffer */ - while ((ret = PQflush(pgsql))) { - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer"); - break; - } - usleep(10000); - } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4808,7 +4705,6 @@ PHP_FUNCTION(pg_send_prepare) PGconn *pgsql; PGresult *res; int leftover = 0; - int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) { return; @@ -4839,14 +4735,6 @@ PHP_FUNCTION(pg_send_prepare) RETURN_FALSE; } } - /* Wait to finish sending buffer */ - while ((ret = PQflush(pgsql))) { - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty postgres send buffer"); - break; - } - usleep(10000); - } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -4869,7 +4757,6 @@ PHP_FUNCTION(pg_send_execute) PGconn *pgsql; PGresult *res; int leftover = 0; - int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) { return; @@ -4936,14 +4823,6 @@ PHP_FUNCTION(pg_send_execute) } } _php_pgsql_free_params(params, num_params); - /* Wait to finish sending buffer */ - while ((ret = PQflush(pgsql))) { - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty postgres send buffer"); - break; - } - usleep(10000); - } if (PQ_SETNONBLOCKING(pgsql, 0)) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); } @@ -5099,9 +4978,8 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z { PGresult *pg_result; char *src, *tmp_name, *tmp_name2 = NULL; - char *escaped; smart_str querystr = {0}; - size_t new_len; + int new_len; int i, num_rows; zval *elem; @@ -5120,36 +4998,23 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z } smart_str_appends(&querystr, - "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.attndims, t.typtype = 'e' " + "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotNULL, a.atthasdef, a.attndims " "FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n " "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); - escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); -#if HAVE_PQESCAPE_CONN - new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); -#else - new_len = PQescapeString(escaped, tmp_name2, strlen(tmp_name2)); -#endif - if (new_len) { - smart_str_appends(&querystr, escaped); - } - efree(escaped); - + tmp_name2 = php_addslashes(tmp_name2, strlen(tmp_name2), &new_len, 0 TSRMLS_CC); + smart_str_appendl(&querystr, tmp_name2, new_len); + smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '"); - escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); -#if HAVE_PQESCAPE_CONN - new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); -#else - new_len = PQescapeString(escaped, tmp_name, strlen(tmp_name)); -#endif - if (new_len) { - smart_str_appends(&querystr, escaped); - } - efree(escaped); + tmp_name = php_addslashes(tmp_name, strlen(tmp_name), &new_len, 0 TSRMLS_CC); + smart_str_appendl(&querystr, tmp_name, new_len); smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;"); smart_str_0(&querystr); - efree(src); - + + efree(tmp_name2); + efree(tmp_name); + efree(src); + pg_result = PQexec(pg_link, querystr.c); if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name); @@ -5179,12 +5044,6 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z add_assoc_bool(elem, "has default", 0); } add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6))); - if (!strcmp(PQgetvalue(pg_result,i,7), "t")) { - add_assoc_bool(elem, "is enum", 1); - } - else { - add_assoc_bool(elem, "is enum", 0); - } name = PQgetvalue(pg_result,i,0); add_assoc_zval(meta, name, elem); } @@ -5218,18 +5077,7 @@ PHP_FUNCTION(pg_meta_data) zval_dtor(return_value); /* destroy array */ RETURN_FALSE; } - else { - HashPosition pos; - zval **val; - - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(return_value), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(return_value), (void **)&val, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(return_value), &pos)) { - /* delete newly added entry, in order to keep BC */ - zend_hash_del_key_or_index(Z_ARRVAL_PP(val), "is enum", sizeof("is enum"), 0, HASH_DEL_KEY); - } - } -} +} /* }}} */ /* {{{ php_pgsql_get_data_type @@ -5372,7 +5220,6 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) assert(Z_TYPE_P(src) == IS_STRING); assert(should_free == 1 || should_free == 0); - smart_str_appendc(&str, 'E'); smart_str_appendc(&str, '\''); smart_str_appendl(&str, Z_STRVAL_P(src), Z_STRLEN_P(src)); smart_str_appendc(&str, '\''); @@ -5412,9 +5259,8 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con char *field = NULL; uint field_len = -1; ulong num_idx = -1; - zval *meta, **def, **type, **not_null, **has_default, **is_enum, **val, *new_val; - int key_type, err = 0, skip_field; - php_pgsql_data_type data_type; + zval *meta, **def, **type, **not_null, **has_default, **val, *new_val; + int new_len, key_type, err = 0, skip_field; assert(pg_link != NULL); assert(Z_TYPE_P(values) == IS_ARRAY); @@ -5426,8 +5272,6 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } MAKE_STD_ZVAL(meta); array_init(meta); - -/* table_name is escaped by php_pgsql_meta_data */ if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) { zval_dtor(meta); FREE_ZVAL(meta); @@ -5439,7 +5283,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con skip_field = 0; new_val = NULL; - if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTENT) { + if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTANT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get array key type"); err = 1; } @@ -5447,7 +5291,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); err = 1; } - if (!err && key_type == HASH_KEY_NON_EXISTENT) { + if (!err && key_type == HASH_KEY_NON_EXISTANT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); err = 1; } @@ -5467,30 +5311,17 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'"); err = 1; } - if (!err && zend_hash_find(Z_ARRVAL_PP(def), "is enum", sizeof("is enum"), (void **)&is_enum) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'is enum'"); - err = 1; - } if (!err && (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT || Z_TYPE_PP(val) == IS_CONSTANT_ARRAY)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scalar values as field values"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values as field values"); err = 1; } if (err) { break; /* break out for() */ } ALLOC_INIT_ZVAL(new_val); - - if (Z_BVAL_PP(is_enum)) { - /* enums need to be treated like strings */ - data_type = PG_TEXT; - } - else { - data_type = php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type)); - } - - switch(data_type) + switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type))) { case PG_BOOL: switch (Z_TYPE_PP(val)) { @@ -5640,15 +5471,15 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { Z_TYPE_P(new_val) = IS_STRING; -#if HAVE_PQESCAPE_CONN +#if HAVE_PQESCAPE { char *tmp; - tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); - Z_STRLEN_P(new_val) = (int)PQescapeStringConn(pg_link, tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val), NULL); + tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); + Z_STRLEN_P(new_val) = (int)PQescapeString(tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); Z_STRVAL_P(new_val) = tmp; } #else - Z_STRVAL_P(new_val) = (int)PQescapeString(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); + Z_STRVAL_P(new_val) = php_addslashes(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); #endif php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); } @@ -5934,11 +5765,10 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con else { unsigned char *tmp; size_t to_len; - smart_str s = {0}; #ifdef HAVE_PQESCAPE_BYTEA_CONN - tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); + tmp = PQescapeByteaConn(pg_link, Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); #else - tmp = PQescapeBytea(Z_STRVAL_PP(val), (unsigned char *)Z_STRLEN_PP(val), &to_len); + tmp = PQescapeBytea(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len); #endif Z_TYPE_P(new_val) = IS_STRING; Z_STRLEN_P(new_val) = to_len-1; /* PQescapeBytea's to_len includes additional '\0' */ @@ -5946,11 +5776,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con memcpy(Z_STRVAL_P(new_val), tmp, to_len); PQfreemem(tmp); php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); - smart_str_appendl(&s, Z_STRVAL_P(new_val), Z_STRLEN_P(new_val)); - smart_str_0(&s); - efree(Z_STRVAL_P(new_val)); - Z_STRVAL_P(new_val) = s.c; - Z_STRLEN_P(new_val) = s.len; + } break; @@ -6035,22 +5861,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con FREE_ZVAL(new_val); break; /* break out for() */ } - /* If field is NULL and HAS DEFAULT, should be skipped */ if (!skip_field) { - char *escaped; - size_t field_len = strlen(field); - - if (_php_pgsql_detect_identifier_escape(field, field_len) == SUCCESS) { - escaped = _php_pgsql_strndup(field, field_len); - } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, field, field_len); -#else - escaped = _php_pgsql_escape_identifier(field, field_len); -#endif - } - add_assoc_zval(result, escaped, new_val); - free(escaped); + /* If field is NULL and HAS DEFAULT, should be skipped */ + field = php_addslashes(field, strlen(field), &new_len, 0 TSRMLS_CC); + add_assoc_zval(result, field, new_val); + efree(field); } } /* for */ zval_dtor(meta); @@ -6125,45 +5940,6 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt T return -1; } -static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const char *table) -{ - char *table_copy, *escaped, *token, *tmp; - size_t len; - - /* schame.table should be "schame"."table" */ - table_copy = estrdup(table); - token = php_strtok_r(table_copy, ".", &tmp); - len = strlen(token); - if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) { - escaped = _php_pgsql_strndup(token, len); - } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, token, len); -#else - escaped = _php_pgsql_escape_identifier(token, len); -#endif - } - smart_str_appends(querystr, escaped); - free(escaped); - if (tmp && *tmp) { - len = strlen(tmp); - /* "schema"."table" format */ - if (_php_pgsql_detect_identifier_escape(tmp, len) == SUCCESS) { - escaped = _php_pgsql_strndup(tmp, len); - } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, tmp, len); -#else - escaped = _php_pgsql_escape_identifier(tmp, len); -#endif - } - smart_str_appendc(querystr, '.'); - smart_str_appends(querystr, escaped); - free(escaped); - } - efree(table_copy); -} - /* {{{ php_pgsql_insert */ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, ulong opt, char **sql TSRMLS_DC) @@ -6183,7 +5959,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var if (zend_hash_num_elements(Z_ARRVAL_P(var_array)) == 0) { smart_str_appends(&querystr, "INSERT INTO "); - build_tablename(&querystr, pg_link, table); + smart_str_appends(&querystr, table); smart_str_appends(&querystr, " DEFAULT VALUES"); goto no_values; @@ -6198,14 +5974,14 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var } var_array = converted; } - + smart_str_appends(&querystr, "INSERT INTO "); - build_tablename(&querystr, pg_link, table); + smart_str_appends(&querystr, table); smart_str_appends(&querystr, " ("); - + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(var_array), &pos); while ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(var_array), &fld, - &fld_len, &num_idx, 0, &pos)) != HASH_KEY_NON_EXISTENT) { + &fld_len, &num_idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) { if (key_type == HASH_KEY_IS_LONG) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted"); goto cleanup; @@ -6389,7 +6165,7 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var } smart_str_appends(&querystr, "UPDATE "); - build_tablename(&querystr, pg_link, table); + smart_str_appends(&querystr, table); smart_str_appends(&querystr, " SET "); if (build_assignment_string(&querystr, Z_ARRVAL_P(var_array), 0, ",", 1 TSRMLS_CC)) @@ -6490,7 +6266,7 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids } smart_str_appends(&querystr, "DELETE FROM "); - build_tablename(&querystr, pg_link, table); + smart_str_appends(&querystr, table); smart_str_appends(&querystr, " WHERE "); if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1 TSRMLS_CC)) @@ -6626,7 +6402,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids } smart_str_appends(&querystr, "SELECT * FROM "); - build_tablename(&querystr, pg_link, table); + smart_str_appends(&querystr, table); smart_str_appends(&querystr, " WHERE "); if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1 TSRMLS_CC)) diff --git a/ext/pgsql/tests/00version.phpt b/ext/pgsql/tests/00version.phpt deleted file mode 100644 index d72d9e1f212b..000000000000 --- a/ext/pgsql/tests/00version.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -PostgreSQL version ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(3) { - ["client"]=> - string(%d) "%s" - ["protocol"]=> - int(%d) - ["server"]=> - string(%d) "%s" -} -string(%d) "%s" -OK diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt index 1bea35bf14d2..90b4ed8a9f5e 100644 --- a/ext/pgsql/tests/08escape.phpt +++ b/ext/pgsql/tests/08escape.phpt @@ -48,24 +48,15 @@ $sql = "INSERT INTO ".$table_name." (num, bin) VALUES (-9999, CAST ('".$escaped_ pg_query($db, $sql); // Retrieve binary from DB -for ($i = 0; $i < 2; $i++) { - $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; - $result = pg_query($db, $sql); - $row = pg_fetch_array($result, 0, PGSQL_ASSOC); +$sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; +$result = pg_query($db, $sql); +$row = pg_fetch_array($result, 0, PGSQL_ASSOC); - if ($data === pg_unescape_bytea($row['bin'])) { - echo "pg_escape_bytea() actually works with database\n"; - break; - } - elseif (!$i) { - // Force bytea escaping and retry - @pg_query($db, "SET bytea_output = 'escape'"); - } - else { - $result = pg_query($db, $sql); - echo "pg_escape_bytea() is broken\n"; - break; - } +if ($data === pg_unescape_bytea($row['bin'])) { + echo "pg_escape_bytea() actually works with database\n"; +} +else { + echo "pg_escape_bytea() is broken\n"; } // pg_escape_literal/pg_escape_identifier @@ -101,4 +92,4 @@ pg_escape_string() is Ok pg_escape_bytea() is Ok pg_escape_bytea() actually works with database pg_escape_literal() is Ok -pg_escape_identifier() is Ok +pg_escape_identifier() is Ok \ No newline at end of file diff --git a/ext/pgsql/tests/09notice.phpt b/ext/pgsql/tests/09notice.phpt index db671016e3b5..316706916917 100644 --- a/ext/pgsql/tests/09notice.phpt +++ b/ext/pgsql/tests/09notice.phpt @@ -10,7 +10,7 @@ _skip_lc_messages(); ?> --INI-- pgsql.log_notice=1 -pgsql.ignore_notice=0 +pgsql.ignore_notices=0 --FILE-- --EXPECTF-- -resource(%d) of type (pgsql result) - Notice: pg_query(): %s already a transaction in progress in %s on line %d %s already a transaction in progress pg_last_notice() is Ok diff --git a/ext/pgsql/tests/10pg_convert.phpt b/ext/pgsql/tests/10pg_convert.phpt index adc2756e25ce..73bf2b64e8b9 100644 --- a/ext/pgsql/tests/10pg_convert.phpt +++ b/ext/pgsql/tests/10pg_convert.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_convert() --SKIPIF-- ='); ?> --FILE-- --EXPECT-- array(3) { - [""num""]=> + ["num"]=> string(4) "1234" - [""str""]=> - string(6) "E'AAA'" - [""bin""]=> - string(6) "E'BBB'" -} \ No newline at end of file + ["str"]=> + string(5) "'AAA'" + ["bin"]=> + string(5) "'BBB'" +} diff --git a/ext/pgsql/tests/10pg_convert_9.phpt b/ext/pgsql/tests/10pg_convert_85.phpt similarity index 61% rename from ext/pgsql/tests/10pg_convert_9.phpt rename to ext/pgsql/tests/10pg_convert_85.phpt index 827c96250db8..4f1c92bf1ad9 100644 --- a/ext/pgsql/tests/10pg_convert_9.phpt +++ b/ext/pgsql/tests/10pg_convert_85.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_convert() (9.0+) +PostgreSQL pg_convert() (8.5+) --SKIPIF-- --FILE-- '1234', 'str'=>'AAA', 'bin'=>'BBB'); $converted = pg_convert($db, $table_name, $fields); @@ -21,10 +20,10 @@ var_dump($converted); ?> --EXPECT-- array(3) { - [""num""]=> + ["num"]=> string(4) "1234" - [""str""]=> - string(6) "E'AAA'" - [""bin""]=> - string(12) "E'\\x424242'" -} \ No newline at end of file + ["str"]=> + string(5) "'AAA'" + ["bin"]=> + string(11) "'\\x424242'" +} diff --git a/ext/pgsql/tests/12pg_insert.phpt b/ext/pgsql/tests/12pg_insert.phpt index 9fd0dd1e3b9b..f5cd868f81ca 100644 --- a/ext/pgsql/tests/12pg_insert.phpt +++ b/ext/pgsql/tests/12pg_insert.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_insert() --SKIPIF-- ='); ?> --FILE-- --EXPECT-- -INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'BBB'); -Ok \ No newline at end of file +INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','BBB'); +Ok diff --git a/ext/pgsql/tests/12pg_insert_9.phpt b/ext/pgsql/tests/12pg_insert_85.phpt similarity index 65% rename from ext/pgsql/tests/12pg_insert_9.phpt rename to ext/pgsql/tests/12pg_insert_85.phpt index 329364ad6450..a85dea0363d2 100644 --- a/ext/pgsql/tests/12pg_insert_9.phpt +++ b/ext/pgsql/tests/12pg_insert_85.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_insert() (9.0+) +PostgreSQL pg_insert() (8.5+) --SKIPIF-- --FILE-- '1234', 'str'=>'AAA', 'bin'=>'BBB'); pg_insert($db, $table_name, $fields) or print "Error in test 1\n"; @@ -22,5 +20,5 @@ echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'\\x424242'); -Ok \ No newline at end of file +INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','\\x424242'); +Ok diff --git a/ext/pgsql/tests/13pg_select.phpt b/ext/pgsql/tests/13pg_select.phpt index db2ca06bf869..f1504a8b1799 100644 --- a/ext/pgsql/tests/13pg_select.phpt +++ b/ext/pgsql/tests/13pg_select.phpt @@ -33,5 +33,5 @@ array(1) { string(3) "BBB" } } -SELECT * FROM "php_pgsql_test" WHERE "num"=1234; +SELECT * FROM php_pgsql_test WHERE num=1234; Ok diff --git a/ext/pgsql/tests/13pg_select_9.phpt b/ext/pgsql/tests/13pg_select_85.phpt similarity index 78% rename from ext/pgsql/tests/13pg_select_9.phpt rename to ext/pgsql/tests/13pg_select_85.phpt index 67adc9d21d3e..e6d86bd6f809 100644 --- a/ext/pgsql/tests/13pg_select_9.phpt +++ b/ext/pgsql/tests/13pg_select_85.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_select() (9.0+) +PostgreSQL pg_select() (8.5+) --SKIPIF-- --FILE-- '1234', 'str'=>'ABC', 'bin'=>'XYZ'); $ids = array('num'=>'1234'); @@ -35,5 +33,5 @@ array(1) { string(8) "\x424242" } } -SELECT * FROM "php_pgsql_test" WHERE "num"=1234; -Ok \ No newline at end of file +SELECT * FROM php_pgsql_test WHERE num=1234; +Ok diff --git a/ext/pgsql/tests/14pg_update.phpt b/ext/pgsql/tests/14pg_update.phpt index 347cac94470d..b41dd1af84c3 100644 --- a/ext/pgsql/tests/14pg_update.phpt +++ b/ext/pgsql/tests/14pg_update.phpt @@ -3,7 +3,7 @@ PostgreSQL pg_update() --SKIPIF-- ='); ?> --FILE-- --EXPECT-- -UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'XYZ' WHERE "num"=1234; -Ok \ No newline at end of file +UPDATE php_pgsql_test SET num=1234,str='ABC',bin='XYZ' WHERE num=1234; +Ok diff --git a/ext/pgsql/tests/14pg_update_9.phpt b/ext/pgsql/tests/14pg_update_85.phpt similarity index 67% rename from ext/pgsql/tests/14pg_update_9.phpt rename to ext/pgsql/tests/14pg_update_85.phpt index c33f1afbd6e4..f1c77eac1deb 100644 --- a/ext/pgsql/tests/14pg_update_9.phpt +++ b/ext/pgsql/tests/14pg_update_85.phpt @@ -1,9 +1,9 @@ --TEST-- -PostgreSQL pg_update() (9.0+) +PostgreSQL pg_update() (8.5+) --SKIPIF-- --FILE-- '1234', 'str'=>'ABC', 'bin'=>'XYZ'); $ids = array('num'=>'1234'); @@ -23,5 +21,5 @@ echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; echo "Ok\n"; ?> --EXPECT-- -UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'\\x58595a' WHERE "num"=1234; -Ok \ No newline at end of file +UPDATE php_pgsql_test SET num=1234,str='ABC',bin='\\x58595a' WHERE num=1234; +Ok diff --git a/ext/pgsql/tests/18pg_escape_bytea_esc.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt similarity index 84% rename from ext/pgsql/tests/18pg_escape_bytea_esc.phpt rename to ext/pgsql/tests/18pg_escape_bytea.phpt index 38e5777c3e0a..43f98c446725 100644 --- a/ext/pgsql/tests/18pg_escape_bytea_esc.phpt +++ b/ext/pgsql/tests/18pg_escape_bytea.phpt @@ -1,5 +1,5 @@ --TEST-- -PostgreSQL pg_escape_bytea() functions (escape format) +PostgreSQL pg_escape_bytea() functions --SKIPIF-- --FILE-- @@ -8,12 +8,10 @@ PostgreSQL pg_escape_bytea() functions (escape format) include('config.inc'); -$db = pg_connect($conn_str); -@pg_query($db, "SET bytea_output = 'escape'"); - $image = file_get_contents(dirname(__FILE__) . '/php.gif'); $esc_image = pg_escape_bytea($image); +$db = pg_connect($conn_str); pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');'); $result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876'); $rows = pg_fetch_all($result); diff --git a/ext/pgsql/tests/18pg_escape_bytea_before.phpt b/ext/pgsql/tests/18pg_escape_bytea_before.phpt deleted file mode 100644 index 492517733fb6..000000000000 --- a/ext/pgsql/tests/18pg_escape_bytea_before.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -PostgreSQL pg_escape_bytea() functions (before connection) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/pgsql/tests/18pg_escape_bytea_hex.phpt b/ext/pgsql/tests/18pg_escape_bytea_hex.phpt deleted file mode 100644 index 04630bbbf8f4..000000000000 --- a/ext/pgsql/tests/18pg_escape_bytea_hex.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -PostgreSQL pg_escape_bytea() functions (hex format) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/pgsql/tests/80_bug14383.phpt b/ext/pgsql/tests/80_bug14383.phpt index cb54aa8dfb3c..a736f34c900e 100644 --- a/ext/pgsql/tests/80_bug14383.phpt +++ b/ext/pgsql/tests/80_bug14383.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #14383 (8.0+) (using postgres with DBA causes DBA not to be able to find any keys) +Bug #14383 (using postgres with DBA causes DBA not to be able to find any keys) --SKIPIF-- ---INI-- -pgsql.ignore_notice=0 --FILE-- ===DONE=== --EXPECTF-- -resource(%d) of type (pgsql result) -resource(%d) of type (pgsql result) array(1) { [0]=> string(1) "f" diff --git a/ext/pgsql/tests/80_bug32223b.phpt b/ext/pgsql/tests/80_bug32223b.phpt index 418ccfc9aeba..aada3f01ba41 100644 --- a/ext/pgsql/tests/80_bug32223b.phpt +++ b/ext/pgsql/tests/80_bug32223b.phpt @@ -15,8 +15,6 @@ end; ' LANGUAGE plpgsql;"); if (!$res) die('skip PLPGSQL not available'); ?> ---INI-- -pgsql.ignore_notice=0 --FILE-- ===DONE=== --EXPECTF-- -resource(%d) of type (pgsql result) array(1) { [0]=> string(1) "f" diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt index e1b7fa1b5077..a95cea7110a5 100644 --- a/ext/pgsql/tests/80_bug36625.phpt +++ b/ext/pgsql/tests/80_bug36625.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #36625 (8.0+) (pg_trace() does not work) +Bug #36625 (pg_trace() does not work) --SKIPIF-- 0); var_dump(file_exists($tracefile)); -@unlink($tracefile); - ?> ===DONE=== --CLEAN-- diff --git a/ext/pgsql/tests/80_bug39971.phpt b/ext/pgsql/tests/80_bug39971.phpt index 49f370b88d27..45d26319d383 100644 --- a/ext/pgsql/tests/80_bug39971.phpt +++ b/ext/pgsql/tests/80_bug39971.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #39971 (8.0+) (pg_insert/pg_update do not allow now() to be used for timestamp fields) +Bug #39971 (pg_insert/pg_update do not allow now() to be used for timestamp fields) --SKIPIF-- ='); ?> --FILE-- --FILE-- array(2) { diff --git a/ext/pgsql/tests/bug64609.phpt b/ext/pgsql/tests/bug64609.phpt deleted file mode 100644 index 72fac7648efd..000000000000 --- a/ext/pgsql/tests/bug64609.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #64609 (pg_convert enum type support) ---SKIPIF-- - ---FILE-- - 'ok'); -$converted = pg_convert($db, 'test_enum', $fields); - -pg_query("ROLLBACK"); - -var_dump($converted); -?> ---EXPECT-- -array(1) { - [""a""]=> - string(5) "E'ok'" -} \ No newline at end of file diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index ffe31a875e32..2b5f05a71dab 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -2,10 +2,8 @@ // These vars are used to connect db and create test table. // values can be set to meet your environment -// "test" database must be existed. i.e. "createdb test" before testing -// PostgreSQL uses login name as username, user must have access to "test" database. -$conn_str = "host=localhost dbname=test port=5432"; // connection string -$table_name = "php_pgsql_test"; // test table that will be created +$conn_str = "host=localhost dbname=test"; // connection string +$table_name = "php_pgsql_test"; // test table that should be exist $num_test_record = 1000; // Number of records to create $table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table diff --git a/ext/pgsql/tests/pg_delete_001.phpt b/ext/pgsql/tests/pg_delete_001.phpt index a98c95dc4cb5..abb65be142f7 100644 --- a/ext/pgsql/tests/pg_delete_001.phpt +++ b/ext/pgsql/tests/pg_delete_001.phpt @@ -45,8 +45,8 @@ pg_query('DROP SCHEMA phptests'); ?> --EXPECTF-- -string(43) "DELETE FROM "foo" WHERE "id"=1 AND "id2"=2;" -string(54) "DELETE FROM "phptests"."foo" WHERE "id"=2 AND "id2"=3;" +string(37) "DELETE FROM foo WHERE id=1 AND id2=2;" +string(46) "DELETE FROM phptests.foo WHERE id=2 AND id2=3;" array(2) { [0]=> array(2) { diff --git a/ext/pgsql/tests/pg_insert_001.phpt b/ext/pgsql/tests/pg_insert_001.phpt index 626d4d0f82cf..7d27219187d2 100644 --- a/ext/pgsql/tests/pg_insert_001.phpt +++ b/ext/pgsql/tests/pg_insert_001.phpt @@ -28,7 +28,7 @@ pg_query('DROP SCHEMA phptests'); --EXPECTF-- Warning: pg_insert(): Table 'foo' doesn't exists in %s on line %d -string(55) "INSERT INTO "phptests"."foo" ("id","id2") VALUES (1,2);" +string(47) "INSERT INTO phptests.foo (id,id2) VALUES (1,2);" array(1) { [0]=> array(2) { diff --git a/ext/pgsql/tests/pg_update_001.phpt b/ext/pgsql/tests/pg_update_001.phpt index 60db35c157b3..95fa69256847 100644 --- a/ext/pgsql/tests/pg_update_001.phpt +++ b/ext/pgsql/tests/pg_update_001.phpt @@ -35,8 +35,8 @@ pg_query('DROP SCHEMA phptests'); ?> --EXPECT-- -string(38) "UPDATE "foo" SET "id"=10 WHERE "id"=1;" -string(51) "UPDATE "phptests"."foo" SET "id"=100 WHERE "id2"=2;" +string(32) "UPDATE foo SET id=10 WHERE id=1;" +string(43) "UPDATE phptests.foo SET id=100 WHERE id2=2;" array(2) { ["id"]=> string(2) "10" diff --git a/ext/pgsql/tests/skipif.inc b/ext/pgsql/tests/skipif.inc index 83904af4f332..7c5153e6f082 100644 --- a/ext/pgsql/tests/skipif.inc +++ b/ext/pgsql/tests/skipif.inc @@ -17,28 +17,15 @@ if (!is_resource($conn)) { die("skip could not connect\n"); } -function skip_server_version($version, $op = '<') -{ - $pg = pg_parameter_status('server_version'); - if (version_compare($pg, $version, $op)) { - die("skip Server version {$pg} is {$op} {$version}\n"); - } - return $pg; -} +function skip_server_version($version, $op = '<') { _skip_version('server', $version, $op); } +function skip_client_version($version, $op = '<') { _skip_version('client', $version, $op); } -function skip_bytea_not_hex() -{ - $out = pg_escape_bytea("\xFF"); - if (strpos($out, '377') !== false) { - die("skip libpq or backend < 9.0\n"); - } -} -function skip_bytea_not_escape() +function _skip_version($type, $version, $op) { - $out = pg_escape_bytea("\xFF"); - if (strpos($out, '377') === false) { - die("skip libpq or backend >= 9.0\n"); + $pg = pg_parameter_status($type.'_version'); + if (version_compare($pg, $version, $op)) { + die("skip {$type} version {$pg} is {$op} {$version}\n"); } } diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index faa9db0c706b..e2b016d846ff 100644 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -40,7 +40,3 @@ install-pharcmd: pharcmd $(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) -@rm -f $(INSTALL_ROOT)$(bindir)/phar $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1 - @$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1 - diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index d424060f2a24..2ac7f3dd8132 100644 --- a/ext/phar/config.m4 +++ b/ext/phar/config.m4 @@ -27,6 +27,4 @@ if test "$PHP_PHAR" != "no"; then PHP_ADD_EXTENSION_DEP(phar, hash, true) PHP_ADD_EXTENSION_DEP(phar, spl, true) PHP_ADD_MAKEFILE_FRAGMENT - - PHP_OUTPUT(ext/phar/phar.1 ext/phar/phar.phar.1) fi diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index b09057730675..277d058ea6ce 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -103,7 +103,7 @@ static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_D return 0; } - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(data, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(data, &key, &keylen, &unused, 0, NULL)) { return 0; } @@ -211,7 +211,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) zend_hash_internal_pointer_reset(manifest); while (FAILURE != zend_hash_has_more_elements(manifest)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) { break; } @@ -319,7 +319,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) /** * Open a directory handle within a phar archive */ -php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { php_url *resource = NULL; php_stream *ret; @@ -403,7 +403,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, /* search for directory */ zend_hash_internal_pointer_reset(&phar->manifest); while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) { - if (HASH_KEY_NON_EXISTENT != + if (HASH_KEY_NON_EXISTANT != zend_hash_get_current_key_ex( &phar->manifest, &key, &keylen, &unused, 0, NULL)) { PHAR_STR(key, str_key); @@ -432,7 +432,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, /** * Make a new directory within a phar archive */ -int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ +int phar_wrapper_mkdir(php_stream_wrapper *wrapper, char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ { phar_entry_info entry, *e; phar_archive_data *phar = NULL; @@ -564,7 +564,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo /** * Remove a directory within a phar archive */ -int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ +int phar_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ { phar_entry_info *entry; phar_archive_data *phar = NULL; @@ -637,7 +637,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options if (!entry->is_deleted) { for (zend_hash_internal_pointer_reset(&phar->manifest); - HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL); + HASH_KEY_NON_EXISTANT != zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL); zend_hash_move_forward(&phar->manifest)) { PHAR_STR(key, str_key); @@ -658,7 +658,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options } for (zend_hash_internal_pointer_reset(&phar->virtual_dirs); - HASH_KEY_NON_EXISTENT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL); + HASH_KEY_NON_EXISTANT != zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL); zend_hash_move_forward(&phar->virtual_dirs)) { PHAR_STR(key, str_key); diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h index 030fe6536e91..9b07c9d79908 100644 --- a/ext/phar/dirstream.h +++ b/ext/phar/dirstream.h @@ -20,11 +20,11 @@ /* $Id$ */ BEGIN_EXTERN_C() -int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC); -int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); +int phar_wrapper_mkdir(php_stream_wrapper *wrapper, char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC); +int phar_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); #ifdef PHAR_DIRSTREAM -php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC); +php_url* phar_parse_url(php_stream_wrapper *wrapper, char *filename, char *mode, int options TSRMLS_DC); /* directory handlers */ static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC); @@ -33,7 +33,7 @@ static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC); static int phar_dir_flush(php_stream *stream TSRMLS_DC); static int phar_dir_seek( php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC); #else -php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); #endif END_EXTERN_C() diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 00cb92ff1336..65193726def9 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -733,7 +733,7 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i PHAR_G(cwd_len) = save_len; efree(entry); efree(arch); - /* Error Occurred */ + /* Error Occured */ if (!IS_EXISTS_CHECK(type)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); } diff --git a/ext/phar/phar.1.in b/ext/phar/phar.1.in deleted file mode 100644 index 259a2bae86c9..000000000000 --- a/ext/phar/phar.1.in +++ /dev/null @@ -1,523 +0,0 @@ -.TH PHAR 1 "2013" "The PHP Group" "User Commands" -.SH NAME -phar, phar.phar \- PHAR (PHP archive) command line tool -.SH SYNOPSIS -.B phar - [options] ... -.LP -.SH DESCRIPTION -The \fBPHAR\fP file format provides a way to put entire PHP applications into a single -file called a "phar" (PHP Archive) for easy distribution and installation. -.P -With the \fBphar\fP command you can create, update or extract PHP archives. -.P -Commands: -add compress delete extract help help-list info list meta-del -meta-get meta-set pack sign stub-get stub-set tree version - -.SH add command -Add entries to a PHAR package. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.TP -.PD -.B ... -Any number of input files and directories. If -i is in -use then ONLY files and matching the given regular -expression are being packed. If -x is given then files -matching that regular expression are NOT being packed. -.P -Optional arguments: -.TP 15 -.PD -.B \-a \fIalias\fP -Provide an \fIalias\fP name for the phar file. -.TP -.PD -.B \-c \fIalgo\fP -Compression algorithm (see -.SM -.B COMPRESSION -) -.TP -.PD -.B \-i \fIregex\fP -Specifies a regular expression for input files. -.TP -.PD -.B \-l \fIlevel\fP -Number of preceding subdirectories to strip from file entries -.TP -.PD -.B \-x \fIregex\fP -Regular expression for input files to exclude. - -.SH compress command -Compress or uncompress all files or a selected entry. -.P -Required arguments: -.TP 15 -.PD -.B \-c \fIalgo\fP -Compression algorithm (see -.SM -.B COMPRESSION -) -.TP -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -e \fIentry\fP -Name of \fIentry\fP to work on (must include PHAR internal -directory name if any). - -.SH delete command -Delete entry from a PHAR archive -.P -Required arguments: -.TP 15 -.PD -.B \-e \fIentry\fP -Name of \fIentry\fP to work on (must include PHAR internal -directory name if any). -.TP -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. - -.SH extract command -Extract a PHAR package to a directory. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -i \fIregex\fP -Specifies a regular expression for input files. -.TP -.PD -.B -x \fIregex\fP -Regular expression for input files to exclude. -.TP -.PD -.B ... -Directory to extract to (defaults to '.'). - - -.SH help command -This help or help for a selected command. -.P -Optional arguments: -.TP 15 -.PD -.B ... -Optional command to retrieve help for. - -.SH help-list command -Lists available commands. - -.SH info command -Get information about a PHAR package. -.P -By using -k it is possible to return a single value. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -k \fIindex\fP -Subscription \fIindex\fP to work on. - -.SH list command -List contents of a PHAR archive. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -i \fIregex\fP -Specifies a regular expression for input files. -.TP -.PD -.B -x \fIregex\fP -Regular expression for input files to exclude. - - -.SH meta-del command -Delete meta information of a PHAR entry or a PHAR package. -.P -If -k is given then the metadata is expected to be an array and the -given index is being deleted. -.P -If something was deleted the return value is 0 otherwise it is 1. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -e \fIentry\fP -Name of \fIentry\fP to work on (must include PHAR internal -directory name if any). -.TP -.PD -.B -k \fIindex\fP -Subscription \fIindex\fP to work on. - -.SH meta-get command -Get meta information of a PHAR entry or a PHAR package in serialized from. If -no output file is specified for meta data then stdout is being used. -You can also specify a particular index using -k. In that case the -metadata is expected to be an array and the value of the given index -is returned using echo rather than using serialize. If that index does -not exist or no meta data is present then the return value is 1. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B -e \fIentry\fP -Name of \fIentry\fP to work on (must include PHAR internal -directory name if any). -.TP -.PD -.B -k \fIindex\fP -Subscription \fIindex\fP to work on. - -.SH meta-set command -Set meta data of a PHAR entry or a PHAR package using serialized input. If no -input file is specified for meta data then stdin is being used. You can -also specify a particular index using -k. In that case the metadata is -expected to be an array and the value of the given index is being set. -If the metadata is not present or empty a new array will be created. -If the metadata is present and a flat value then the return value is -1. Also using -k the input is been taken directly rather then being -serialized. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.TP -.PD -.B -m \fImeta\fP -Meta data to store with entry (serialized php data). -.P -Optional arguments: -.TP 15 -.PD -.B -e \fIentry\fP -Name of \fIentry\fP to work on (must include PHAR internal -directory name if any). -.TP -.PD -.B -k \fIindex\fP -Subscription \fIindex\fP to work on. - -.SH pack command -Pack files into a PHAR archive. -.P -When using -s , then the stub file is being excluded from the -list of input files/dirs.To create an archive that contains PEAR class -PHP_Archive then point -p argument to PHP/Archive.php. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.TP -.PD -.B ... -Any number of input files and directories. If -i is in -use then ONLY files and matching the given regular -expression are being packed. If -x is given then files -matching that regular expression are NOT being packed. -.P -Optional arguments: -.TP 15 -.PD -.B \-a \fIalias\fP -Provide an \fIalias\fP name for the phar file. -.TP -.PD -.B \-b \fIbang\fP -Hash-bang line to start the archive (e.g. #!/usr/bin/php). -The hash mark itself '#!' and the newline character are optional. -.TP -.PD -.B \-c \fIalgo\fP -Compression algorithm (see -.SM -.B COMPRESSION -) -.TP -.PD -.B \-h \fIhash\fP -Selects the \fIhash\fP algorithm (see -.SM -.B HASH -) -.TP -.PD -.B \-i \fIregex\fP -Specifies a regular expression for input files. -.TP -.PD -.B \-l \fIlevel\fP -Number of preceding subdirectories to strip from file entries -.TP -.PD -.B \-p \fIloader\fP -Location of PHP_Archive class file (pear list-files -PHP_Archive).You can use '0' or '1' to locate it -automatically using the mentioned pear command. When -using '0' the command does not error out when the class -file cannot be located. This switch also adds some code -around the stub so that class PHP_Archive gets -registered as phar:// stream wrapper if necessary. And -finally this switch will add the file phar.inc from -this package and load it to ensure class Phar is -present. -.TP -.PD -.B \-s \fIstub\fP -Select the \fIstub\fP file. -.TP -.PD -.B \-x \fIregex\fP -Regular expression for input files to exclude. -.TP -.PD -.B \-y \fIkey\fP -Private \fIkey\fP for OpenSSL signing. - -.SH sign command -Set signature hash algorithm. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.TP -.PD -.B \-h \fIhash\fP -Selects the \fIhash\fP algorithm (see -.SM -.B HASH -) -.P -Optional arguments: -.TP 15 -.PD -.B \-y \fIkey\fP -Private \fIkey\fP for OpenSSL signing. - -.SH stub-get command -Get the stub of a PHAR file. If no output file is specified as stub then stdout -is being used. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B \-s \fIstub\fP -Select the \fIstub\fP file. - -.SH stub-set command -Set the stub of a PHAR file. If no input file is specified as stub then stdin -is being used. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B \-b \fIbang\fP -Hash-bang line to start the archive (e.g. #!/usr/bin/php). -The hash mark itself '#!' and the newline character are optional. -.TP -.PD -.B \-p \fIloader\fP -Location of PHP_Archive class file (pear list-files -PHP_Archive).You can use '0' or '1' to locate it -automatically using the mentioned pear command. When -using '0' the command does not error out when the class -file cannot be located. This switch also adds some code -around the stub so that class PHP_Archive gets -registered as phar:// stream wrapper if necessary. And -finally this switch will add the file phar.inc from -this package and load it to ensure class Phar is -present. -.TP -.PD -.B \-s \fIstub\fP -Select the \fIstub\fP file. - - -.SH tree command -Get a directory tree for a PHAR archive. -.P -Required arguments: -.TP 15 -.PD -.B -f \fIfile\fP -Specifies the phar \fIfile\fP to work on. -.P -Optional arguments: -.TP 15 -.PD -.B \-i \fIregex\fP -Specifies a regular expression for input files. -.TP -.PD -.B \-x \fIregex\fP -Regular expression for input files to exclude. - -.SH version command -Get information about the PHAR environment and the tool version. - - -.SH COMPRESSION -Algorithms: -.TP 15 -.PD -.B 0 -No compression -.TP -.PD -.B none -No compression -.TP -.PD -.B auto -Automatically select compression algorithm -.TP -.PD -.B gz -GZip compression -.TP -.PD -.B gzip -GZip compression -.TP -.PD -.B bz2 -BZip2 compression -.TP -.PD -.B bzip2 -BZip2 compression - -.SH HASH -Algorithms: -.TP 15 -.PD -.TP -.PD -.B md5 -MD5 -.TP -.PD -.B sha1 -SHA1 -.TP -.PD -.B sha256 -SHA256 -.TP -.PD -.B sha512 -SHA512 -.TP -.PD -.B openssl -OpenSSL - -.SH SEE ALSO -For a more or less complete description of PHAR look here: -.PD 0 -.P -.B http://php.net/phar -.PD 1 -.P -.SH BUGS -You can view the list of known bugs or report any new bug you -found at: -.PD 0 -.P -.B http://bugs.php.net -.PD 1 -.SH AUTHORS -The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. -.P -Work for the PHP archive was done by Gregory Beaver, Marcus Boerger. -.P -A List of active developers can be found here: -.PD 0 -.P -.B http://www.php.net/credits.php -.PD 1 -.P -And last but not least PHP was developed with the help of a huge amount of -contributors all around the world. -.SH VERSION INFORMATION -This manpage describes \fBphar\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2013 The PHP Group -.LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B http://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. diff --git a/ext/phar/phar.c b/ext/phar/phar.c index e8d1139cfa86..c5042cc34ace 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1964,7 +1964,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha zend_hash_internal_pointer_reset(&(PHAR_GLOBALS->phar_fname_map)); while (FAILURE != zend_hash_has_more_elements(&(PHAR_GLOBALS->phar_fname_map))) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&(PHAR_GLOBALS->phar_fname_map), &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(&(PHAR_GLOBALS->phar_fname_map), &key, &keylen, &unused, 0, NULL)) { break; } @@ -1994,7 +1994,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha zend_hash_internal_pointer_reset(&cached_phars); while (FAILURE != zend_hash_has_more_elements(&cached_phars)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&cached_phars, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(&cached_phars, &key, &keylen, &unused, 0, NULL)) { break; } @@ -2251,13 +2251,13 @@ char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{ * * This is used by phar_parse_url() */ -int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC) /* {{{ */ +int phar_split_fname(char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC) /* {{{ */ { const char *ext_str; #ifdef PHP_WIN32 char *save; #endif - int ext_len; + int ext_len, free_filename = 0; if (!strncasecmp(filename, "phar://", 7)) { filename += 7; @@ -2266,6 +2266,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a ext_len = 0; #ifdef PHP_WIN32 + free_filename = 1; save = filename; filename = estrndup(filename, filename_len); phar_unixify_path_separators(filename, filename_len); @@ -2281,9 +2282,10 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a #endif } -#ifdef PHP_WIN32 - efree(filename); -#endif + if (free_filename) { + efree(filename); + } + return FAILURE; } @@ -2306,9 +2308,9 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a *entry = estrndup("/", 1); } -#ifdef PHP_WIN32 - efree(filename); -#endif + if (free_filename) { + efree(filename); + } return SUCCESS; } @@ -2577,7 +2579,6 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, php_serialize_data_t metadata_hash; smart_str main_metadata_str = {0}; int free_user_stub, free_fp = 1, free_ufp = 1; - int manifest_hack = 0; if (phar->is_persistent) { if (error) { @@ -2929,12 +2930,6 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, manifest_len = offset + phar->alias_len + sizeof(manifest) + main_metadata_str.len; phar_set_32(manifest, manifest_len); - /* Hack - see bug #65028, add padding byte to the end of the manifest */ - if(manifest[0] == '\r' || manifest[0] == '\n') { - manifest_len++; - phar_set_32(manifest, manifest_len); - manifest_hack = 1; - } phar_set_32(manifest+4, new_manifest_count); if (has_dirs) { *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF); @@ -3059,22 +3054,6 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert, return EOF; } } - /* Hack - see bug #65028, add padding byte to the end of the manifest */ - if(manifest_hack) { - if(1 != php_stream_write(newfile, manifest, 1)) { - if (closeoldfile) { - php_stream_close(oldfile); - } - - php_stream_close(newfile); - - if (error) { - spprintf(error, 0, "unable to write manifest padding byte"); - } - - return EOF; - } - } /* now copy the actual file data to the new phar */ offset = php_stream_tell(newfile); diff --git a/ext/phar/phar.phar.1.in b/ext/phar/phar.phar.1.in deleted file mode 100644 index b5eecbfeba0e..000000000000 --- a/ext/phar/phar.phar.1.in +++ /dev/null @@ -1 +0,0 @@ -.so man1/phar.1 diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index e0a9faf38fb2..daa85f1b70f8 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -63,6 +63,9 @@ #include "ext/spl/spl_iterators.h" #endif #include "php_phar.h" +#ifdef HAVE_STDINT_H +#include +#endif #ifdef PHAR_HASH_OK #include "ext/hash/php_hash.h" #include "ext/hash/php_hash_sha.h" @@ -687,11 +690,11 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC); phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC); phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC); -phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC); -int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC); +phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC); +int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC); int phar_flush(phar_archive_data *archive, char *user_stub, long len, int convert, char **error TSRMLS_DC); int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete TSRMLS_DC); -int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC); +int phar_split_fname(char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC); typedef enum { pcr_use_query, diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index dcb67fe9fa6e..94ffd3744be8 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1877,10 +1877,6 @@ PHP_METHOD(Phar, buildFromDirectory) pass.count = 0; pass.ret = return_value; pass.fp = php_stream_fopen_tmpfile(); - if (pass.fp == NULL) { - zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" unable to create temporary file", phar_obj->arc.archive->fname); - return; - } if (phar_obj->arc.archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->arc.archive) TSRMLS_CC)) { zval_ptr_dtor(&iteriter); @@ -1961,10 +1957,6 @@ PHP_METHOD(Phar, buildFromIterator) pass.ret = return_value; pass.count = 0; pass.fp = php_stream_fopen_tmpfile(); - if (pass.fp == NULL) { - zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\": unable to create temporary file", phar_obj->arc.archive->fname); - return; - } if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) { phar_obj->arc.archive->ufp = pass.fp; @@ -2297,10 +2289,6 @@ static zval *phar_convert_to_other(phar_archive_data *source, int convert, char zend_get_hash_value, NULL, 0); phar->fp = php_stream_fopen_tmpfile(); - if (phar->fp == NULL) { - zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file"); - return NULL; - } phar->fname = source->fname; phar->fname_len = source->fname_len; phar->is_temporary_alias = source->is_temporary_alias; diff --git a/ext/phar/stream.c b/ext/phar/stream.c index d3d4cd655b33..924138d8faaa 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -56,7 +56,7 @@ php_stream_wrapper php_stream_phar_wrapper = { /** * Open a phar file for streams API */ -php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC) /* {{{ */ +php_url* phar_parse_url(php_stream_wrapper *wrapper, char *filename, char *mode, int options TSRMLS_DC) /* {{{ */ { php_url *resource; char *arch = NULL, *entry = NULL, *error; @@ -155,7 +155,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const /** * used for fopen('phar://...') and company */ -static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_data *idata; @@ -563,7 +563,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D /** * Stream wrapper stat implementation of stat() */ -static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, +static int phar_wrapper_stat(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) /* {{{ */ { php_url *resource = NULL; @@ -635,7 +635,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f zend_hash_internal_pointer_reset_ex(&phar->mounted_dirs, &pos); while (FAILURE != zend_hash_has_more_elements_ex(&phar->mounted_dirs, &pos)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, &pos)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, &pos)) { break; } PHAR_STR(key, str_key); @@ -686,7 +686,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f /** * Unlink a file within a phar archive */ -static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ +static int phar_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ { php_url *resource; char *internal_file, *error; @@ -762,7 +762,7 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int } /* }}} */ -static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ +static int phar_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) /* {{{ */ { php_url *resource_from, *resource_to; char *error; @@ -918,7 +918,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from uint to_len = strlen(resource_to->path+1); for (zend_hash_internal_pointer_reset(&phar->manifest); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL)) && + HASH_KEY_NON_EXISTANT != (key_type = zend_hash_get_current_key_ex(&phar->manifest, &key, &key_len, &unused, 0, NULL)) && SUCCESS == zend_hash_get_current_data(&phar->manifest, (void **) &entry); zend_hash_move_forward(&phar->manifest)) { @@ -952,7 +952,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from } for (zend_hash_internal_pointer_reset(&phar->virtual_dirs); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL)); + HASH_KEY_NON_EXISTANT != (key_type = zend_hash_get_current_key_ex(&phar->virtual_dirs, &key, &key_len, &unused, 0, NULL)); zend_hash_move_forward(&phar->virtual_dirs)) { PHAR_STR(key, str_key); @@ -979,7 +979,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from } for (zend_hash_internal_pointer_reset(&phar->mounted_dirs); - HASH_KEY_NON_EXISTENT != (key_type = zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &key_len, &unused, 0, NULL)) && + HASH_KEY_NON_EXISTANT != (key_type = zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &key_len, &unused, 0, NULL)) && SUCCESS == zend_hash_get_current_data(&phar->mounted_dirs, (void **) &entry); zend_hash_move_forward(&phar->mounted_dirs)) { diff --git a/ext/phar/stream.h b/ext/phar/stream.h index 0155759d1298..b22b67ab0174 100644 --- a/ext/phar/stream.h +++ b/ext/phar/stream.h @@ -21,13 +21,13 @@ BEGIN_EXTERN_C() -php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC); +php_url* phar_parse_url(php_stream_wrapper *wrapper, char *filename, char *mode, int options TSRMLS_DC); void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC); -static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC); -static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); -static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); +static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +static int phar_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); +static int phar_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); +static int phar_wrapper_stat(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); /* file/stream handlers */ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC); diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 0e60e3db134b..f170335437f0 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -847,10 +847,7 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS entry->is_modified = 1; entry->fp = php_stream_fopen_tmpfile(); entry->offset = entry->offset_abs = 0; - if (entry->fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return -1; - } + if (entry->metadata_str.len != php_stream_write(entry->fp, entry->metadata_str.c, entry->metadata_str.len)) { spprintf(error, 0, "phar tar error: unable to write metadata to magic metadata file \"%s\"", entry->filename); zend_hash_del(&(entry->phar->manifest), entry->filename, entry->filename_len); @@ -952,10 +949,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1); entry.filename_len = sizeof(".phar/alias.txt")-1; entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return -1; - } + if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { if (error) { spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname); @@ -1020,10 +1014,6 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau len = pos - user_stub + 18; entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } entry.uncompressed_filesize = len + 5; if ((size_t)len != php_stream_write(entry.fp, user_stub, len) @@ -1048,10 +1038,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau } else { /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } + if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); if (error) { @@ -1100,6 +1087,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau } newfile = php_stream_fopen_tmpfile(); + if (!newfile) { if (error) { spprintf(error, 0, "unable to create temporary file"); @@ -1186,10 +1174,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau entry.filename = ".phar/signature.bin"; entry.filename_len = sizeof(".phar/signature.bin")-1; entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } + #ifdef WORDS_BIGENDIAN # define PHAR_SET_32(var, buffer) \ *(php_uint32 *)(var) = (((((unsigned char*)&(buffer))[3]) << 24) \ diff --git a/ext/phar/tests/bug65028.phpt b/ext/phar/tests/bug65028.phpt deleted file mode 100644 index 74273b850b0e..000000000000 --- a/ext/phar/tests/bug65028.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Phar - test specific manifest length ---INI-- -phar.readonly=0 ---SKIPIF-- - ---FILE-- -addFromString($file, ""); -} - -// Copy phar -copy(__DIR__ . "/bug65028.phar", __DIR__ . "/bug65028-copy.phar"); - -// Open phar -try -{ - $phar = new Phar(__DIR__ . "/bug65028-copy.phar"); - echo "No exception thrown.\n"; -} -catch(UnexpectedValueException $ex) -{ - echo "Exception thrown: " . $ex->getMessage() . "\n"; -} -?> ---CLEAN-- - ---EXPECT-- -No exception thrown. - diff --git a/ext/phar/tests/files/openssl.cnf b/ext/phar/tests/files/openssl.cnf index 4ed40fdc8aa0..10e69076cff5 100644 --- a/ext/phar/tests/files/openssl.cnf +++ b/ext/phar/tests/files/openssl.cnf @@ -3,7 +3,7 @@ default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes -x509_extensions = v3_ca # The extensions to add to the self signed cert +x509_extensions = v3_ca # The extentions to add to the self signed cert string_mask = MASK:4294967295 diff --git a/ext/phar/tests/phpinfo_004.phpt b/ext/phar/tests/phpinfo_004.phpt index c57e850d82f9..24263f07bee6 100644 --- a/ext/phar/tests/phpinfo_004.phpt +++ b/ext/phar/tests/phpinfo_004.phpt @@ -23,9 +23,9 @@ phpinfo(INFO_MODULES); ?> ===DONE=== --EXPECTF-- -%a +%a

Phar

- +
@@ -36,20 +36,20 @@ phpinfo(INFO_MODULES); -
Phar: PHP Archive supportenabled
Phar EXT version %s
Phar API version 1.1.1
gzip compression enabled
bzip2 compression enabled
OpenSSL support disabled (install ext/openssl)
- +

+ -
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.
- +

+ -
DirectiveLocal ValueMaster Value
phar.cache_listno valueno value
phar.readonlyOffOff
phar.require_hashOffOff
-%a +
+%a

Phar

- +
@@ -60,16 +60,16 @@ Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar full -
Phar: PHP Archive supportenabled
Phar EXT version %s
Phar API version 1.1.1
gzip compression enabled
bzip2 compression enabled
OpenSSL support disabled (install ext/openssl)
- +

+ -
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.
- +

+ -
DirectiveLocal ValueMaster Value
phar.cache_listno valueno value
phar.readonlyOnOff
phar.require_hashOnOff
-%a +
+%a
===DONE=== diff --git a/ext/phar/util.c b/ext/phar/util.c index 38aa549f00d5..05c90cd45800 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -572,7 +572,7 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d * appended, truncated, or read. For read, if the entry is marked unmodified, it is * assumed that the file pointer, if present, is opened for reading */ -int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */ +int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry; @@ -733,7 +733,7 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char /** * Create a new dummy file slot within a writeable phar for a newly created file */ -phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */ +phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry, etemp; @@ -889,10 +889,6 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er dest->offset = 0; dest->is_modified = 1; dest->fp = php_stream_fopen_tmpfile(); - if (dest->fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(source TSRMLS_CC); @@ -1133,10 +1129,6 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{ } fp = php_stream_fopen_tmpfile(); - if (fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return FAILURE; - } phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(entry TSRMLS_CC); @@ -1554,7 +1546,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in zend_hash_internal_pointer_reset(&phar->mounted_dirs); while (FAILURE != zend_hash_has_more_elements(&phar->mounted_dirs)) { - if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, NULL)) { + if (HASH_KEY_NON_EXISTANT == zend_hash_get_current_key_ex(&phar->mounted_dirs, &key, &keylen, &unused, 0, NULL)) { break; } diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 6ba745e9cbf7..33732fbd63fa 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -937,11 +937,10 @@ static int phar_zip_changed_apply(void *data, void *arg TSRMLS_DC) /* {{{ */ PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize); PHAR_SET_32(central.compsize, entry->compressed_filesize); PHAR_SET_32(local.compsize, entry->compressed_filesize); - if (p->old) { - if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { - spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname); - return ZEND_HASH_APPLY_STOP; - } + + if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) { + spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname); + return ZEND_HASH_APPLY_STOP; } } not_compressed: @@ -1096,10 +1095,6 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas off_t tell, st; newfile = php_stream_fopen_tmpfile(); - if (newfile == NULL) { - spprintf(pass->error, 0, "phar error: unable to create temporary file for the signature file"); - return FAILURE; - } st = tell = php_stream_tell(pass->filefp); /* copy the local files, central directory, and the zip comment to generate the hash */ php_stream_seek(pass->filefp, 0, SEEK_SET); @@ -1127,10 +1122,6 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas entry.fp = php_stream_fopen_tmpfile(); entry.fp_type = PHAR_MOD; entry.is_modified = 1; - if (entry.fp == NULL) { - spprintf(pass->error, 0, "phar error: unable to create temporary file for signature"); - return FAILURE; - } PHAR_SET_32(sigbuf, phar->sig_flags); PHAR_SET_32(sigbuf + 4, signature_length); @@ -1201,10 +1192,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau /* set alias */ if (!phar->is_temporary_alias && phar->alias_len) { entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } + if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { if (error) { spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname); @@ -1279,10 +1267,6 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau len = pos - user_stub + 18; entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } entry.uncompressed_filesize = len + 5; if ((size_t)len != php_stream_write(entry.fp, user_stub, len) @@ -1316,10 +1300,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau } else { /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ entry.fp = php_stream_fopen_tmpfile(); - if (entry.fp == NULL) { - spprintf(error, 0, "phar error: unable to create temporary file"); - return EOF; - } + if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { php_stream_close(entry.fp); if (error) { diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index 82b80ce972c9..83ead2e46a97 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -45,6 +45,6 @@ int main(int argc, char *argv[]) ]) ]) if test "$ac_cv_have_utsname_domainname" = yes; then - AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Whether struct utsname has domainname]) + AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname]) fi fi diff --git a/ext/posix/tests/posix_ctermid.phpt b/ext/posix/tests/posix_ctermid.phpt index 551ed7304e21..f77da00aabfa 100644 --- a/ext/posix/tests/posix_ctermid.phpt +++ b/ext/posix/tests/posix_ctermid.phpt @@ -13,7 +13,7 @@ PHP Testfest Berlin 2009-05-10 } // needed because of #ifdef HAVE_CTERMID in posix.c if (!function_exists('posix_ctermid')) { - die('SKIP - Function posix_ctermid() not available'); + die('SKIP - Fuction posix_ctermid() not available'); } ?> --FILE-- diff --git a/ext/pspell/config.m4 b/ext/pspell/config.m4 index 481a9ae8918d..67e5b2760526 100644 --- a/ext/pspell/config.m4 +++ b/ext/pspell/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(pspell,for PSPELL support, -[ --with-pspell[=DIR] Include PSPELL support. +[ --with-pspell[=DIR] Include PSPELL support. GNU Aspell version 0.50.0 or higher required]) if test "$PHP_PSPELL" != "no"; then diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 index 0a00370fce57..b1cb0b67e823 100644 --- a/ext/readline/config.m4 +++ b/ext/readline/config.m4 @@ -3,11 +3,11 @@ dnl $Id$ dnl PHP_ARG_WITH(libedit,for libedit readline replacement, -[ --with-libedit[=DIR] Include libedit readline replacement (CLI/CGI only)]) +[ --with-libedit[=DIR] Include libedit readline replacement (CLI/CGI only)]) if test "$PHP_LIBEDIT" = "no"; then PHP_ARG_WITH(readline,for readline support, - [ --with-readline[=DIR] Include readline support (CLI/CGI only)]) + [ --with-readline[=DIR] Include readline support (CLI/CGI only)]) else dnl "register" the --with-readline option to preven invalid "unknown configure option" warning php_with_readline=no diff --git a/ext/readline/readline.c b/ext/readline/readline.c index bd460696bd70..3148f80db016 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -259,7 +259,6 @@ PHP_FUNCTION(readline_info) #endif add_assoc_string(return_value,"library_version",(char *)SAFE_STRING(rl_library_version),1); add_assoc_string(return_value,"readline_name",(char *)SAFE_STRING(rl_readline_name),1); - add_assoc_long(return_value,"attempted_completion_over",rl_attempted_completion_over); } else { if (!strcasecmp(what,"line_buffer")) { oldstr = rl_line_buffer; @@ -314,14 +313,7 @@ PHP_FUNCTION(readline_info) rl_readline_name = strdup(Z_STRVAL_PP(value));; } RETVAL_STRING(SAFE_STRING(oldstr),1); - } else if (!strcasecmp(what, "attempted_completion_over")) { - oldval = rl_attempted_completion_over; - if (value) { - convert_to_long_ex(value); - rl_attempted_completion_over = Z_LVAL_PP(value); - } - RETVAL_LONG(oldval); - } + } } } diff --git a/ext/readline/tests/readline_callback_handler_install_001.phpt b/ext/readline/tests/readline_callback_handler_install_001.phpt index c88a4e86f187..8bf1d61e43c1 100644 --- a/ext/readline/tests/readline_callback_handler_install_001.phpt +++ b/ext/readline/tests/readline_callback_handler_install_001.phpt @@ -15,7 +15,7 @@ var_dump(readline_callback_handler_install('testing: ')); ?> --EXPECTF-- -%Atesting: bool(true) +testing: bool(true) Warning: readline_callback_handler_install(): foobar! is not callable in %s on line %d bool(false) diff --git a/ext/readline/tests/readline_callback_handler_remove_001.phpt b/ext/readline/tests/readline_callback_handler_remove_001.phpt index 83b592e0558f..768041a4cf48 100644 --- a/ext/readline/tests/readline_callback_handler_remove_001.phpt +++ b/ext/readline/tests/readline_callback_handler_remove_001.phpt @@ -13,8 +13,8 @@ var_dump(readline_callback_handler_install('testing: ', 'foo')); var_dump(readline_callback_handler_remove()); ?> ---EXPECTF-- +--EXPECT-- bool(false) -%Atesting: bool(true) +testing: bool(true) testing: bool(true) bool(true) diff --git a/ext/readline/tests/readline_info_001.phpt b/ext/readline/tests/readline_info_001.phpt index ebab3bf68b81..c7bc92a4df6e 100644 --- a/ext/readline/tests/readline_info_001.phpt +++ b/ext/readline/tests/readline_info_001.phpt @@ -12,12 +12,10 @@ var_dump(readline_info('line_buffer')); var_dump(readline_info('readline_name')); var_dump(readline_info('readline_name', 1)); var_dump(readline_info('readline_name')); -var_dump(readline_info('attempted_completion_over',1)); -var_dump(readline_info('attempted_completion_over')); ?> --EXPECTF-- -array(11) { +array(10) { ["line_buffer"]=> string(0) "" ["point"]=> @@ -38,8 +36,6 @@ array(11) { string(%d) "%s" ["readline_name"]=> string(5) "other" - ["attempted_completion_over"]=> - int(0) } NULL NULL @@ -47,5 +43,3 @@ string(0) "" string(5) "other" string(5) "other" string(1) "1" -int(0) -int(1) diff --git a/ext/recode/config.m4 b/ext/recode/config.m4 index 7f394d0465d2..8df4cfc41a0f 100644 --- a/ext/recode/config.m4 +++ b/ext/recode/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(recode,for recode support, -[ --with-recode[=DIR] Include recode support]) +[ --with-recode[=DIR] Include recode support]) if test "$PHP_RECODE" != "no"; then RECODE_LIST="$PHP_RECODE /usr/local /usr /opt" diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b1f7484f243c..b65ccaa26d91 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5259,7 +5259,7 @@ ZEND_METHOD(reflection_extension, getVersion) /* }}} */ /* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions() - Returns an array of this extension's functions */ + Returns an array of this extension's fuctions */ ZEND_METHOD(reflection_extension, getFunctions) { reflection_object *intern; diff --git a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt index dfec951f7990..465e868cfa5f 100644 --- a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt +++ b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionExtension::getClassNames() method on an extension which actually returns some information +ReflectionExtension::getClassNames() method on an extension which acually returns some information --CREDITS-- Felix De Vliegher --FILE-- diff --git a/ext/reflection/tests/bug64936.inc b/ext/reflection/tests/bug64936.inc deleted file mode 100644 index 8ba8c896686e..000000000000 --- a/ext/reflection/tests/bug64936.inc +++ /dev/null @@ -1,5 +0,0 @@ - ---FILE-- -getDocComment())); - -token_get_all("getDocComment())); - -?> -===DONE=== ---EXPECT-- -bool(false) -bool(false) -===DONE=== diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 004d9d463796..053c617dec23 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -61,9 +61,40 @@ typedef struct { } ps_files; ps_module ps_mod_files = { - PS_MOD_SID(files) + PS_MOD(files) }; +/* If you change the logic here, please also update the error message in + * ps_files_open() appropriately */ +static int ps_files_valid_key(const char *key) +{ + size_t len; + const char *p; + char c; + int ret = 1; + + for (p = key; (c = *p); p++) { + /* valid characters are a..z,A..Z,0..9 */ + if (!((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == ',' + || c == '-')) { + ret = 0; + break; + } + } + + len = p - key; + + /* Somewhat arbitrary length limit here, but should be way more than + anyone needs and avoids file-level warnings later on if we exceed MAX_PATH */ + if (len == 0 || len > 128) { + ret = 0; + } + + return ret; +} static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const char *key) { @@ -124,11 +155,11 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC) ps_files_close(data); - if (php_session_valid_key(key) == FAILURE) { + if (!ps_files_valid_key(key)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'"); + PS(invalid_session_id) = 1; return; } - if (!ps_files_path_create(buf, sizeof(buf), data, key)) { return; } @@ -222,21 +253,6 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC) return (nrdels); } -static int ps_files_key_exists(ps_files *data, const char *key TSRMLS_DC) -{ - char buf[MAXPATHLEN]; - struct stat sbuf; - - if (!key || !ps_files_path_create(buf, sizeof(buf), data, key)) { - return FAILURE; - } - if (VCWD_STAT(buf, &sbuf)) { - return FAILURE; - } - return SUCCESS; -} - - #define PS_FILES_DATA ps_files *data = PS_GET_MOD_DATA() PS_OPEN_FUNC(files) @@ -326,25 +342,7 @@ PS_READ_FUNC(files) struct stat sbuf; PS_FILES_DATA; - /* If strict mode, check session id existence */ - if (PS(use_strict_mode) && - ps_files_key_exists(data, key TSRMLS_CC) == FAILURE) { - /* key points to PS(id), but cannot change here. */ - if (key) { - efree(PS(id)); - PS(id) = NULL; - } - PS(id) = PS(mod)->s_create_sid((void **)&data, NULL TSRMLS_CC); - if (!PS(id)) { - return FAILURE; - } - if (PS(use_cookies)) { - PS(send_cookie) = 1; - } - php_session_reset_id(TSRMLS_C); - } - - ps_files_open(data, PS(id) TSRMLS_CC); + ps_files_open(data, key TSRMLS_CC); if (data->fd < 0) { return FAILURE; } @@ -456,30 +454,6 @@ PS_GC_FUNC(files) return SUCCESS; } -PS_CREATE_SID_FUNC(files) -{ - char *sid; - int maxfail = 3; - PS_FILES_DATA; - - do { - sid = php_session_create_id((void **)&data, newlen TSRMLS_CC); - /* Check collision */ - if (data && ps_files_key_exists(data, sid TSRMLS_CC) == SUCCESS) { - if (sid) { - efree(sid); - sid = NULL; - } - if (!(maxfail--)) { - return NULL; - } - } - } while(!sid); - - return sid; -} - - /* * Local variables: * tab-width: 4 diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h index 94cbd6d025de..c97d168b1ee1 100644 --- a/ext/session/mod_files.h +++ b/ext/session/mod_files.h @@ -24,6 +24,6 @@ extern ps_module ps_mod_files; #define ps_files_ptr &ps_mod_files -PS_FUNCS_SID(files); +PS_FUNCS(files); #endif diff --git a/ext/session/mod_files.sh b/ext/session/mod_files.sh index 4fc4f20f7f12..1d2672847c6e 100644 --- a/ext/session/mod_files.sh +++ b/ext/session/mod_files.sh @@ -1,65 +1,24 @@ #! /bin/sh -if [[ "$2" = "" ]] || [[ "$3" = "" ]]; then - echo "Usage: $0 BASE_DIRECTORY DEPTH HASH_BITS" - echo "BASE_DIRECTORY will be created if it doesn't exist" - echo "DEPTH must be an integer number >0" - echo "HASH_BITS(session.hash_bits_per_charactor) should be one of 4, 5, or 6" - exit 1 +if test "$2" = ""; then + echo "usage: $0 basedir depth" + exit 1 fi -if [[ "$2" = "0" ]] && [[ ! "$4" = "recurse" ]]; then - echo "Can't create a directory tree with depth of 0, exiting." +if test "$2" = "0"; then + exit 0 fi -if [[ "$2" = "0" ]]; then - exit 0 -fi - -directory="$1" -depth="$2" -hashbits="$3" - hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f" - -if [[ "$hashbits" -ge "5" ]]; then - hash_chars="$hash_chars g h i j k l m n o p q r s t u v" +if test "$3" -a "$3" -ge "5"; then + hash_chars="$hash_chars g h i j k l m n o p q r s t u v" + if test "$3" -eq "6"; then + hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ," + fi fi -if [[ "$hashbits" -ge "6" ]]; then - hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ," -fi - -while [[ -d $directory ]] && [[ $( ls $directory ) ]]; do - echo "Directory $directory is not empty! What would you like to do?" - - options="\"Delete directory contents\" \"Choose another directory\" \"Quit\"" - eval set $options - select opt in "$@"; do - - if [[ $opt = "Delete directory contents" ]]; then - echo "Deleting $directory contents... " - rm -rf $directory/* - elif [[ $opt = "Choose another directory" ]]; then - echo "Which directory would you like to choose?" - read directory - elif [[ $opt = "Quit" ]]; then - exit 0 - fi - - break; - done -done - -if [[ ! -d $directory ]]; then - mkdir -p $directory -fi - - -echo "Creating session path in $directory with a depth of $depth for session.hash_bits_per_character = $hashbits" - for i in $hash_chars; do - newpath="$directory/$i" - mkdir $newpath || exit 1 - sh $0 $newpath `expr $depth - 1` $hashbits recurse + newpath="$1/$i" + mkdir $newpath || exit 1 + sh $0 $newpath `expr $2 - 1` $3 done diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index 3d37b981bcf7..e5406d0bcb8e 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -124,7 +124,7 @@ static ps_sd *ps_sd_new(ps_mm *data, const char *key) if (!sd) { TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %ld, err %s", mm_available(data->mm), mm_error()); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error()); return NULL; } @@ -208,22 +208,8 @@ static ps_sd *ps_sd_lookup(ps_mm *data, const char *key, int rw) return ret; } -static int ps_mm_key_exists(ps_mm *data, const char *key TSRMLS_DC) -{ - ps_sd *sd; - - if (!key) { - return FAILURE; - } - sd = ps_sd_lookup(data, key, 0); - if (sd) { - return SUCCESS; - } - return FAILURE; -} - ps_module ps_mod_mm = { - PS_MOD_SID(mm) + PS_MOD(mm) }; #define PS_MM_DATA ps_mm *data = PS_GET_MOD_DATA() @@ -285,8 +271,6 @@ PHP_MINIT_FUNCTION(ps_mm) } if (!(euid_len = slprintf(euid, sizeof(euid), "%d", geteuid()))) { - free(ps_mm_instance); - ps_mm_instance = NULL; return FAILURE; } @@ -355,25 +339,7 @@ PS_READ_FUNC(mm) mm_lock(data->mm, MM_LOCK_RD); - /* If there is an ID and strict mode, verify existence */ - if (PS(use_strict_mode) - && ps_mm_key_exists(data, key TSRMLS_CC) == FAILURE) { - /* key points to PS(id), but cannot change here. */ - if (key) { - efree(PS(id)); - PS(id) = NULL; - } - PS(id) = PS(mod)->s_create_sid((void **)&data, NULL TSRMLS_CC); - if (!PS(id)) { - return FAILURE; - } - if (PS(use_cookies)) { - PS(send_cookie) = 1; - } - php_session_reset_id(TSRMLS_C); - } - - sd = ps_sd_lookup(data, PS(id), 0); + sd = ps_sd_lookup(data, key, 0); if (sd) { *vallen = sd->datalen; *val = emalloc(sd->datalen + 1); @@ -476,29 +442,6 @@ PS_GC_FUNC(mm) return SUCCESS; } -PS_CREATE_SID_FUNC(mm) -{ - char *sid; - int maxfail = 3; - PS_MM_DATA; - - do { - sid = php_session_create_id((void **)&data, newlen TSRMLS_CC); - /* Check collision */ - if (ps_mm_key_exists(data, sid TSRMLS_CC) == SUCCESS) { - if (sid) { - efree(sid); - sid = NULL; - } - if (!(maxfail--)) { - return NULL; - } - } - } while(!sid); - - return sid; -} - #endif /* diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 1b606b9a3363..57d7bd0edcdf 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -23,7 +23,7 @@ #include "mod_user.h" ps_module ps_mod_user = { - PS_MOD_SID(user) + PS_MOD(user) }; #define SESS_ZVAL_LONG(val, a) \ @@ -183,38 +183,6 @@ PS_GC_FUNC(user) FINISH; } -PS_CREATE_SID_FUNC(user) -{ - /* maintain backwards compatibility */ - if (PSF(create_sid) != NULL) { - char *id = NULL; - zval *retval = NULL; - - retval = ps_call_handler(PSF(create_sid), 0, NULL TSRMLS_CC); - - if (retval) { - if (Z_TYPE_P(retval) == IS_STRING) { - id = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - } - zval_ptr_dtor(&retval); - } - else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "No session id returned by function"); - return NULL; - } - - if (!id) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Session id must be a string"); - return NULL; - } - - return id; - } - - /* function as defined by PS_MOD */ - return php_session_create_id(mod_data, newlen TSRMLS_CC); -} - /* * Local variables: * tab-width: 4 diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h index 6b2998c42640..fd149ccff44f 100644 --- a/ext/session/mod_user.h +++ b/ext/session/mod_user.h @@ -24,6 +24,6 @@ extern ps_module ps_mod_user; #define ps_user_ptr &ps_mod_user -PS_FUNCS_SID(user); +PS_FUNCS(user); #endif diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index ea53af9ebe15..1ed1e7bbd50a 100644 --- a/ext/session/mod_user_class.c +++ b/ext/session/mod_user_class.c @@ -141,19 +141,3 @@ PHP_METHOD(SessionHandler, gc) RETVAL_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC)); } /* }}} */ - -/* {{{ proto char SessionHandler::create_sid() - Wraps the old create_sid handler */ -PHP_METHOD(SessionHandler, create_sid) -{ - char *id; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - id = PS(default_mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); - - RETURN_STRING(id, 0); -} -/* }}} */ diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 4307e6afc5c1..adc5e70402c2 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -29,9 +29,6 @@ #define PHP_SESSION_API 20020330 -/* To check php_session_valid_key()/php_session_reset_id() */ -#define PHP_SESSION_STRICT 1 - #define PS_OPEN_ARGS void **mod_data, const char *save_path, const char *session_name TSRMLS_DC #define PS_CLOSE_ARGS void **mod_data TSRMLS_DC #define PS_READ_ARGS void **mod_data, const char *key, char **val, int *vallen TSRMLS_DC @@ -78,7 +75,7 @@ typedef struct ps_module_struct { #x, ps_open_##x, ps_close_##x, ps_read_##x, ps_write_##x, \ ps_delete_##x, ps_gc_##x, php_session_create_id -/* SID creation enabled module handler definitions */ +/* SID enabled module handler definitions */ #define PS_FUNCS_SID(x) \ PS_OPEN_FUNC(x); \ PS_CLOSE_FUNC(x); \ @@ -141,7 +138,7 @@ typedef struct _php_ps_globals { int module_number; long cache_expire; union { - zval *names[7]; + zval *names[6]; struct { zval *ps_open; zval *ps_close; @@ -149,7 +146,6 @@ typedef struct _php_ps_globals { zval *ps_write; zval *ps_destroy; zval *ps_gc; - zval *ps_create_sid; } name; } mod_user_names; int mod_user_implemented; @@ -178,9 +174,6 @@ typedef struct _php_ps_globals { smart_str rfc1867_name; /* session.upload_progress.name */ long rfc1867_freq; /* session.upload_progress.freq */ double rfc1867_min_freq; /* session.upload_progress.min_freq */ - - zend_bool use_strict_mode; /* whether or not PHP accepts unknown session ids */ - unsigned char session_data_hash[16]; /* binary MD5 hash length */ } php_ps_globals; typedef php_ps_globals zend_ps_globals; @@ -236,9 +229,6 @@ PHPAPI void php_session_start(TSRMLS_D); PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC); PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC); -PHPAPI int php_session_valid_key(const char *key); -PHPAPI void php_session_reset_id(TSRMLS_D); - #define PS_ADD_VARL(name,namelen) do { \ php_add_session_var(name, namelen TSRMLS_CC); \ } while (0) @@ -263,7 +253,7 @@ PHPAPI void php_session_reset_id(TSRMLS_D); int key_type; \ \ for (zend_hash_internal_pointer_reset(_ht); \ - (key_type = zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTENT; \ + (key_type = zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; \ zend_hash_move_forward(_ht)) { \ if (key_type == HASH_KEY_IS_LONG) { \ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Skipping numeric key %ld", num_key); \ @@ -287,15 +277,11 @@ extern zend_class_entry *php_session_class_entry; #define PS_IFACE_NAME "SessionHandlerInterface" extern zend_class_entry *php_session_iface_entry; -#define PS_SID_IFACE_NAME "SessionIdInterface" -extern zend_class_entry *php_session_id_iface_entry; - extern PHP_METHOD(SessionHandler, open); extern PHP_METHOD(SessionHandler, close); extern PHP_METHOD(SessionHandler, read); extern PHP_METHOD(SessionHandler, write); extern PHP_METHOD(SessionHandler, destroy); extern PHP_METHOD(SessionHandler, gc); -extern PHP_METHOD(SessionHandler, create_sid); #endif diff --git a/ext/session/session.c b/ext/session/session.c index 5b4820a65cfa..54bc6436adec 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -70,9 +70,6 @@ zend_class_entry *php_session_class_entry; /* SessionHandlerInterface */ zend_class_entry *php_session_iface_entry; -/* SessionIdInterface */ -zend_class_entry *php_session_id_iface_entry; - /* *********** * Helpers * *********** */ @@ -86,8 +83,6 @@ zend_class_entry *php_session_id_iface_entry; return FAILURE; \ } -static void php_session_send_cookie(TSRMLS_D); - /* Dispatched by RINIT and by php_session_destroy */ static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */ { @@ -128,7 +123,7 @@ static int php_session_destroy(TSRMLS_D) /* {{{ */ return FAILURE; } - if (PS(id) && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { + if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { retval = FAILURE; php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed"); } @@ -286,7 +281,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ PHP_MD5_CTX md5_context; PHP_SHA1_CTX sha1_context; #if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH) - void *hash_context = NULL; + void *hash_context; #endif unsigned char *digest; int digest_len; @@ -346,7 +341,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ unsigned char rbuf[2048]; size_t toread = PS(entropy_length); - if (php_win32_get_random_bytes(rbuf, MIN(toread, sizeof(rbuf))) == SUCCESS){ + if (php_win32_get_random_bytes(rbuf, (size_t) toread) == SUCCESS){ switch (PS(hash_func)) { case PS_HASH_FUNC_MD5: @@ -430,45 +425,17 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ } /* }}} */ -/* Default session id char validation function allowed by ps_modules. - * If you change the logic here, please also update the error message in - * ps_modules appropriately */ -PHPAPI int php_session_valid_key(const char *key) /* {{{ */ -{ - size_t len; - const char *p; - char c; - int ret = SUCCESS; - - for (p = key; (c = *p); p++) { - /* valid characters are a..z,A..Z,0..9 */ - if (!((c >= 'a' && c <= 'z') - || (c >= 'A' && c <= 'Z') - || (c >= '0' && c <= '9') - || c == ',' - || c == '-')) { - ret = FAILURE; - break; - } - } - - len = p - key; - - /* Somewhat arbitrary length limit here, but should be way more than - anyone needs and avoids file-level warnings later on if we exceed MAX_PATH */ - if (len == 0 || len > 128) { - ret = FAILURE; - } - - return ret; -} -/* }}} */ - static void php_session_initialize(TSRMLS_D) /* {{{ */ { - char *val = NULL; + char *val; int vallen; + /* check session name for invalid characters */ + if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) { + efree(PS(id)); + PS(id) = NULL; + } + if (!PS(mod)) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "No storage module chosen - failed to initialize session"); return; @@ -482,47 +449,28 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */ /* If there is no ID, use session module to create one */ if (!PS(id)) { +new_session: PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); - if (!PS(id)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path)); - return; - } if (PS(use_cookies)) { PS(send_cookie) = 1; } } - php_session_reset_id(TSRMLS_C); - PS(session_status) = php_session_active; - /* Read data */ + /* Question: if you create a SID here, should you also try to read data? + * I'm not sure, but while not doing so will remove one session operation + * it could prove usefull for those sites which wish to have "default" + * session information. */ php_session_track_init(TSRMLS_C); - if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == FAILURE) { - /* Some broken save handler implementation returns FAILURE for non-existent session ID */ - /* It's better to rase error for this, but disabled error for better compatibility */ - /* - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path)); - */ - } - if (val) { - PHP_MD5_CTX context; - - /* Store read data's MD5 hash */ - PHP_MD5Init(&context); - PHP_MD5Update(&context, val, vallen); - PHP_MD5Final(PS(session_data_hash), &context); - + PS(invalid_session_id) = 0; + if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { php_session_decode(val, vallen TSRMLS_CC); efree(val); - } else { - memset(PS(session_data_hash),'\0', 16); - } - - if (!PS(use_cookies) && PS(send_cookie)) { - if (PS(use_trans_sid) && !PS(use_only_cookies)) { - PS(apply_trans_sid) = 1; - } - PS(send_cookie) = 0; + } else if (PS(invalid_session_id)) { /* address instances where the session read fails due to an invalid id */ + PS(invalid_session_id) = 0; + efree(PS(id)); + PS(id) = NULL; + goto new_session; } } /* }}} */ @@ -538,19 +486,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */ val = php_session_encode(&vallen TSRMLS_CC); if (val) { - PHP_MD5_CTX context; - unsigned char digest[16]; - - /* Generate data's MD5 hash */ - PHP_MD5Init(&context); - PHP_MD5Update(&context, val, vallen); - PHP_MD5Final(digest, &context); - /* Write only when save is required */ - if (memcmp(digest, PS(session_data_hash), 16)) { - ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); - } else { - ret = SUCCESS; - } + ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); efree(val); } else { ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); @@ -679,31 +615,6 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */ } /* }}} */ -static PHP_INI_MH(OnUpdateName) /* {{{ */ -{ - /* Numeric session.name won't work at all */ - if (PG(modules_activated) && - (!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { - int err_type; - - if (stage == ZEND_INI_STAGE_RUNTIME) { - err_type = E_WARNING; - } else { - err_type = E_ERROR; - } - - /* Do not output error when restoring ini options. */ - if (stage != ZEND_INI_STAGE_DEACTIVATE) { - php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value); - } - return FAILURE; - } - - OnUpdateStringUnempty(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */ { long val; @@ -748,7 +659,6 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */ } #endif /* HAVE_HASH_EXT }}} */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value); return FAILURE; } /* }}} */ @@ -796,9 +706,9 @@ static ZEND_INI_MH(OnUpdateSmartStr) /* {{{ */ */ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateName, session_name, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals) PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler) - STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_PERDIR, OnUpdateBool, auto_start, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateLong, gc_probability, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_divisor", "100", PHP_INI_ALL, OnUpdateLong, gc_divisor, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateLong, gc_maxlifetime, php_ps_globals, ps_globals) @@ -810,7 +720,6 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("session.cookie_httponly", "", PHP_INI_ALL, OnUpdateBool, cookie_httponly, php_ps_globals, ps_globals) STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_cookies, php_ps_globals, ps_globals) STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_only_cookies, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.use_strict_mode", "0", PHP_INI_ALL, OnUpdateBool, use_strict_mode, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateString, extern_referer_chk, php_ps_globals, ps_globals) #if HAVE_DEV_URANDOM STD_PHP_INI_ENTRY("session.entropy_file", "/dev/urandom", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals) @@ -849,44 +758,6 @@ PHP_INI_END() /* *************** * Serializers * *************** */ -PS_SERIALIZER_ENCODE_FUNC(php_serialize) /* {{{ */ -{ - smart_str buf = {0}; - php_serialize_data_t var_hash; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, &PS(http_session_vars), &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - if (newlen) { - *newlen = buf.len; - } - smart_str_0(&buf); - *newstr = buf.c; - return SUCCESS; -} -/* }}} */ - -PS_SERIALIZER_DECODE_FUNC(php_serialize) /* {{{ */ -{ - const char *endptr = val + vallen; - zval *session_vars; - php_unserialize_data_t var_hash; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - ALLOC_INIT_ZVAL(session_vars); - php_var_unserialize(&session_vars, &val, endptr, &var_hash TSRMLS_CC); - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - if (PS(http_session_vars)) { - zval_ptr_dtor(&PS(http_session_vars)); - } - if (Z_TYPE_P(session_vars) == IS_NULL) { - array_init(session_vars); - } - PS(http_session_vars) = session_vars; - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); - return SUCCESS; -} -/* }}} */ #define PS_BIN_NR_OF_BITS 8 #define PS_BIN_UNDEF (1<<(PS_BIN_NR_OF_BITS-1)) @@ -1068,11 +939,10 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */ } /* }}} */ -#define MAX_SERIALIZERS 32 -#define PREDEFINED_SERIALIZERS 3 +#define MAX_SERIALIZERS 10 +#define PREDEFINED_SERIALIZERS 2 static ps_serializer ps_serializers[MAX_SERIALIZERS + 1] = { - PS_SERIALIZER_ENTRY(php_serialize), PS_SERIALIZER_ENTRY(php), PS_SERIALIZER_ENTRY(php_binary) }; @@ -1157,7 +1027,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */ res = php_gmtime_r(when, &tm); if (!res) { - ubuf[0] = '\0'; + buf[0] = '\0'; return; } @@ -1399,15 +1269,10 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{ convert_to_string((*ppid)); \ PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid)) -PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */ +static void php_session_reset_id(TSRMLS_D) /* {{{ */ { int module_number = PS(module_number); - if (!PS(id)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set session ID - session ID is not initialized"); - return; - } - if (PS(use_cookies) && PS(send_cookie)) { php_session_send_cookie(TSRMLS_C); PS(send_cookie) = 0; @@ -1554,14 +1419,19 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ } } - /* Finally check session id for dangarous characters - * Security note: session id may be embedded in HTML pages.*/ - if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) { - efree(PS(id)); - PS(id) = NULL; + php_session_initialize(TSRMLS_C); + + if (!PS(use_cookies) && PS(send_cookie)) { + if (PS(use_trans_sid) && !PS(use_only_cookies)) { + PS(apply_trans_sid) = 1; + } + PS(send_cookie) = 0; } - php_session_initialize(TSRMLS_C); + php_session_reset_id(TSRMLS_C); + + PS(session_status) = php_session_active; + php_session_cache_limiter(TSRMLS_C); if ((PS(mod_data) || PS(mod_user_implemented)) && PS(gc_probability) > 0) { @@ -1589,26 +1459,6 @@ static void php_session_flush(TSRMLS_D) /* {{{ */ } /* }}} */ -static void php_session_abort(TSRMLS_D) /* {{{ */ -{ - if (PS(session_status) == php_session_active) { - PS(session_status) = php_session_none; - if (PS(mod_data) || PS(mod_user_implemented)) { - PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); - } - } -} -/* }}} */ - -static void php_session_reset(TSRMLS_D) /* {{{ */ -{ - if (PS(session_status) == php_session_active) { - php_session_initialize(TSRMLS_C); - } -} -/* }}} */ - - PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) /* {{{ */ { if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) { @@ -1727,32 +1577,7 @@ static PHP_FUNCTION(session_module_name) } /* }}} */ -/* {{{ proto mixed session_serializer_name([string newname]) - Return the current serializer name used for encode/decode session data. If newname is given, the serialzer name is replaced with newname and return bool */ -static PHP_FUNCTION(session_serializer_name) -{ - char *name = NULL; - int name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { - return; - } - - /* Return serializer name */ - if (!name) { - RETURN_STRING(zend_ini_string("session.serialize_handler", sizeof("session.serialize_handler"), 0), 1); - } - - /* Set serializer name */ - if (zend_alter_ini_entry("session.serialize_handler", sizeof("session.serialize_handler"), name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc, string create_sid) +/* {{{ proto void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc) Sets user-level functions */ static PHP_FUNCTION(session_set_save_handler) { @@ -1764,7 +1589,11 @@ static PHP_FUNCTION(session_set_save_handler) RETURN_FALSE; } - if (argc > 0 && argc <= 2) { + if (argc != 1 && argc != 2 && argc != 6) { + WRONG_PARAM_COUNT; + } + + if (argc <= 2) { zval *obj = NULL, *callback = NULL; zend_uint func_name_len; char *func_name; @@ -1778,11 +1607,11 @@ static PHP_FUNCTION(session_set_save_handler) RETURN_FALSE; } - /* Find implemented methods - SessionHandlerInterface */ - zend_hash_internal_pointer_reset_ex(&php_session_iface_entry->function_table, &pos); + /* Find implemented methods */ + zend_hash_internal_pointer_reset_ex(&php_session_class_entry->function_table, &pos); i = 0; - while (zend_hash_get_current_data_ex(&php_session_iface_entry->function_table, (void **) &default_mptr, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(&php_session_iface_entry->function_table, &func_name, &func_name_len, &func_index, 0, &pos); + while (zend_hash_get_current_data_ex(&php_session_class_entry->function_table, (void **) &default_mptr, &pos) == SUCCESS) { + zend_hash_get_current_key_ex(&php_session_class_entry->function_table, &func_name, &func_name_len, &func_index, 0, &pos); if (zend_hash_find(&Z_OBJCE_P(obj)->function_table, func_name, func_name_len, (void **)¤t_mptr) == SUCCESS) { if (PS(mod_user_names).names[i] != NULL) { @@ -1800,29 +1629,7 @@ static PHP_FUNCTION(session_set_save_handler) RETURN_FALSE; } - zend_hash_move_forward_ex(&php_session_iface_entry->function_table, &pos); - ++i; - } - - /* Find implemented methods - SessionIdInterface (optional) */ - zend_hash_internal_pointer_reset_ex(&php_session_id_iface_entry->function_table, &pos); - while (zend_hash_get_current_data_ex(&php_session_id_iface_entry->function_table, (void **) &default_mptr, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(&php_session_id_iface_entry->function_table, &func_name, &func_name_len, &func_index, 0, &pos); - - if (zend_hash_find(&Z_OBJCE_P(obj)->function_table, func_name, func_name_len, (void **)¤t_mptr) == SUCCESS) { - if (PS(mod_user_names).names[i] != NULL) { - zval_ptr_dtor(&PS(mod_user_names).names[i]); - } - - MAKE_STD_ZVAL(callback); - array_init_size(callback, 2); - Z_ADDREF_P(obj); - add_next_index_zval(callback, obj); - add_next_index_stringl(callback, func_name, func_name_len - 1, 1); - PS(mod_user_names).names[i] = callback; - } - - zend_hash_move_forward_ex(&php_session_id_iface_entry->function_table, &pos); + zend_hash_move_forward_ex(&php_session_class_entry->function_table, &pos); ++i; } @@ -1854,10 +1661,6 @@ static PHP_FUNCTION(session_set_save_handler) RETURN_TRUE; } - if (argc != 6 && argc != 7) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters(argc TSRMLS_CC, "+", &args, &num_args) == FAILURE) { return; } @@ -1865,8 +1668,7 @@ static PHP_FUNCTION(session_set_save_handler) /* remove shutdown function */ remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") TSRMLS_CC); - /* at this point argc can only be 6 or 7 */ - for (i = 0; i < argc; i++) { + for (i = 0; i < 6; i++) { if (!zend_is_callable(*args[i], 0, &name TSRMLS_CC)) { efree(args); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1); @@ -1880,7 +1682,7 @@ static PHP_FUNCTION(session_set_save_handler) zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), "user", sizeof("user")-1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); } - for (i = 0; i < argc; i++) { + for (i = 0; i < 6; i++) { if (PS(mod_user_names).names[i] != NULL) { zval_ptr_dtor(&PS(mod_user_names).names[i]); } @@ -1922,9 +1724,9 @@ static PHP_FUNCTION(session_save_path) static PHP_FUNCTION(session_id) { char *name = NULL; - int name_len, argc = ZEND_NUM_ARGS(); + int name_len; - if (zend_parse_parameters(argc TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { return; } @@ -1969,13 +1771,11 @@ static PHP_FUNCTION(session_regenerate_id) } PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); - if (PS(id)) { - PS(send_cookie) = 1; - php_session_reset_id(TSRMLS_C); - RETURN_TRUE; - } else { - PS(id) = STR_EMPTY_ALLOC(); - } + + PS(send_cookie) = 1; + php_session_reset_id(TSRMLS_C); + + RETURN_TRUE; } RETURN_FALSE; } @@ -2115,22 +1915,6 @@ static PHP_FUNCTION(session_write_close) } /* }}} */ -/* {{{ proto void session_abort(void) - Abort session and end session. Session data will not be written */ -static PHP_FUNCTION(session_abort) -{ - php_session_abort(TSRMLS_C); -} -/* }}} */ - -/* {{{ proto void session_reset(void) - Reset session data from saved session data */ -static PHP_FUNCTION(session_reset) -{ - php_session_reset(TSRMLS_C); -} -/* }}} */ - /* {{{ proto int session_status(void) Returns the current session status */ static PHP_FUNCTION(session_status) @@ -2143,39 +1927,6 @@ static PHP_FUNCTION(session_status) } /* }}} */ -/* {{{ proto int session_gc([int maxlifetime]) - Execute garbage collection returns number of deleted data */ -static PHP_FUNCTION(session_gc) -{ - int nrdels = -1; - long maxlifetime = PS(gc_maxlifetime); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &maxlifetime) == FAILURE) { - return; - } - - /* Session must be active to have PS(mod) */ - if (PS(session_status) != php_session_active) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to garbage collect without active session"); - RETURN_FALSE; - } - - if (!PS(mod) || !PS(mod)->s_gc) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session save handler does not have gc()"); - RETURN_FALSE; - } - PS(mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC); - - if (nrdels < 0) { - /* Files save handler return -1 if there is not a permission to remove. - Save handlder should return negative nrdels when something wrong. */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session gc failed. Check permission or session storage"); - RETURN_FALSE; - } - RETURN_LONG((long)nrdels); -} -/* }}} */ - /* {{{ proto void session_register_shutdown(void) Registers session_write_close() as a shutdown function */ static PHP_FUNCTION(session_register_shutdown) @@ -2222,10 +1973,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_session_module_name, 0, 0, 0) ZEND_ARG_INFO(0, module) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_session_serializer_name, 0, 0, 0) - ZEND_ARG_INFO(0, module) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_session_save_path, 0, 0, 0) ZEND_ARG_INFO(0, path) ZEND_END_ARG_INFO() @@ -2245,14 +1992,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_session_void, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_session_set_save_handler, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_session_set_save_handler, 0, 0, 6) ZEND_ARG_INFO(0, open) ZEND_ARG_INFO(0, close) ZEND_ARG_INFO(0, read) ZEND_ARG_INFO(0, write) ZEND_ARG_INFO(0, destroy) ZEND_ARG_INFO(0, gc) - ZEND_ARG_INFO(0, create_sid) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_session_cache_limiter, 0, 0, 0) @@ -2271,10 +2017,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_session_set_cookie_params, 0, 0, 1) ZEND_ARG_INFO(0, httponly) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_session_gc, 0) - ZEND_ARG_INFO(0, maxlifetime) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO(arginfo_session_class_open, 0) ZEND_ARG_INFO(0, save_path) ZEND_ARG_INFO(0, session_name) @@ -2299,9 +2041,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_session_class_gc, 0) ZEND_ARG_INFO(0, maxlifetime) ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_session_class_create_sid, 0) -ZEND_END_ARG_INFO() /* }}} */ /* {{{ session_functions[] @@ -2309,7 +2048,6 @@ ZEND_END_ARG_INFO() static const zend_function_entry session_functions[] = { PHP_FE(session_name, arginfo_session_name) PHP_FE(session_module_name, arginfo_session_module_name) - PHP_FE(session_serializer_name, arginfo_session_serializer_name) PHP_FE(session_save_path, arginfo_session_save_path) PHP_FE(session_id, arginfo_session_id) PHP_FE(session_regenerate_id, arginfo_session_regenerate_id) @@ -2324,10 +2062,7 @@ static const zend_function_entry session_functions[] = { PHP_FE(session_set_cookie_params, arginfo_session_set_cookie_params) PHP_FE(session_get_cookie_params, arginfo_session_void) PHP_FE(session_write_close, arginfo_session_void) - PHP_FE(session_abort, arginfo_session_void) - PHP_FE(session_reset, arginfo_session_void) PHP_FE(session_status, arginfo_session_void) - PHP_FE(session_gc, arginfo_session_gc) PHP_FE(session_register_shutdown, arginfo_session_void) PHP_FALIAS(session_commit, session_write_close, arginfo_session_void) PHP_FE_END @@ -2347,14 +2082,6 @@ static const zend_function_entry php_session_iface_functions[] = { }; /* }}} */ -/* {{{ SessionIdInterface functions[] -*/ -static const zend_function_entry php_session_id_iface_functions[] = { - PHP_ABSTRACT_ME(SessionIdInterface, create_sid, arginfo_session_class_create_sid) - { NULL, NULL, NULL } -}; -/* }}} */ - /* {{{ SessionHandler functions[] */ static const zend_function_entry php_session_class_functions[] = { @@ -2364,7 +2091,6 @@ static const zend_function_entry php_session_class_functions[] = { PHP_ME(SessionHandler, write, arginfo_session_class_write, ZEND_ACC_PUBLIC) PHP_ME(SessionHandler, destroy, arginfo_session_class_destroy, ZEND_ACC_PUBLIC) PHP_ME(SessionHandler, gc, arginfo_session_class_gc, ZEND_ACC_PUBLIC) - PHP_ME(SessionHandler, create_sid, arginfo_session_class_create_sid, ZEND_ACC_PUBLIC) { NULL, NULL, NULL } }; /* }}} */ @@ -2424,7 +2150,7 @@ static PHP_RSHUTDOWN_FUNCTION(session) /* {{{ */ php_rshutdown_session_globals(TSRMLS_C); /* this should NOT be done in php_rshutdown_session_globals() */ - for (i = 0; i < 7; i++) { + for (i = 0; i < 6; i++) { if (PS(mod_user_names).names[i] != NULL) { zval_ptr_dtor(&PS(mod_user_names).names[i]); PS(mod_user_names).names[i] = NULL; @@ -2449,7 +2175,7 @@ static PHP_GINIT_FUNCTION(ps) /* {{{ */ ps_globals->default_mod = NULL; ps_globals->mod_user_implemented = 0; ps_globals->mod_user_is_open = 0; - for (i = 0; i < 7; i++) { + for (i = 0; i < 6; i++) { ps_globals->mod_user_names.names[i] = NULL; } ps_globals->http_session_vars = NULL; @@ -2473,20 +2199,15 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */ php_session_rfc1867_orig_callback = php_rfc1867_callback; php_rfc1867_callback = php_session_rfc1867_callback; - /* Register interfaces */ + /* Register interface */ INIT_CLASS_ENTRY(ce, PS_IFACE_NAME, php_session_iface_functions); php_session_iface_entry = zend_register_internal_class(&ce TSRMLS_CC); php_session_iface_entry->ce_flags |= ZEND_ACC_INTERFACE; - INIT_CLASS_ENTRY(ce, PS_SID_IFACE_NAME, php_session_id_iface_functions); - php_session_id_iface_entry = zend_register_internal_class(&ce TSRMLS_CC); - php_session_id_iface_entry->ce_flags |= ZEND_ACC_INTERFACE; - /* Register base class */ INIT_CLASS_ENTRY(ce, PS_CLASS_NAME, php_session_class_functions); php_session_class_entry = zend_register_internal_class(&ce TSRMLS_CC); zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_iface_entry); - zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_id_iface_entry); REGISTER_LONG_CONSTANT("PHP_SESSION_DISABLED", php_session_disabled, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_SESSION_NONE", php_session_none, CONST_CS | CONST_PERSISTENT); @@ -2504,12 +2225,6 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */ PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif - /* reset rfc1867 callbacks */ - php_session_rfc1867_orig_callback = NULL; - if (php_rfc1867_callback == php_session_rfc1867_callback) { - php_rfc1867_callback = NULL; - } - ps_serializers[PREDEFINED_SERIALIZERS].name = NULL; memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *)); @@ -2652,7 +2367,7 @@ static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, i php_session_initialize(TSRMLS_C); PS(session_status) = php_session_active; IF_SESSION_VARS() { - progress->cancel_upload |= php_check_cancel_upload(progress TSRMLS_CC); + progress->cancel_upload = php_check_cancel_upload(progress TSRMLS_CC); ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), progress->key.c, progress->key.len+1, progress->data, 2, 0); } php_session_flush(TSRMLS_C); diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt index 8725f06a69f3..03c3b957667d 100644 --- a/ext/session/tests/003.phpt +++ b/ext/session/tests/003.phpt @@ -4,7 +4,6 @@ session object deserialization --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt index 4547c6557491..aeb2c8b36307 100644 --- a/ext/session/tests/004.phpt +++ b/ext/session/tests/004.phpt @@ -4,7 +4,6 @@ session_set_save_handler test --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.name=PHPSESSID session.serialize_handler=php diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt index 796d9c377eac..a970e6b71d1a 100644 --- a/ext/session/tests/005.phpt +++ b/ext/session/tests/005.phpt @@ -4,7 +4,6 @@ custom save handler, multiple session_start()s, complex data structure test. --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.name=PHPSESSID session.serialize_handler=php diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt index dba6894c7eef..03fca103811f 100644 --- a/ext/session/tests/006.phpt +++ b/ext/session/tests/006.phpt @@ -4,7 +4,6 @@ correct instantiation of references between variables in sessions --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt index 6d8d11c331a6..d73bc238c9cf 100644 --- a/ext/session/tests/009.phpt +++ b/ext/session/tests/009.phpt @@ -4,7 +4,6 @@ unset($_SESSION["name"]); test --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/012.phpt b/ext/session/tests/012.phpt index c555d2ca1e8b..87080112736a 100644 --- a/ext/session/tests/012.phpt +++ b/ext/session/tests/012.phpt @@ -4,7 +4,6 @@ registering $_SESSION should not segfault --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/013.phpt b/ext/session/tests/013.phpt index 32909eb58c6f..8d0f284b173e 100644 --- a/ext/session/tests/013.phpt +++ b/ext/session/tests/013.phpt @@ -4,7 +4,6 @@ redefining SID should not cause warnings --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt index cbf22b142d61..73bc28ea66ca 100644 --- a/ext/session/tests/014.phpt +++ b/ext/session/tests/014.phpt @@ -5,7 +5,6 @@ a script should not be able to modify session.use_trans_sid --INI-- session.use_trans_sid=0 session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.name=PHPSESSID session.serialize_handler=php diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt index 527b86bc1d1b..7d7b737340d1 100644 --- a/ext/session/tests/015.phpt +++ b/ext/session/tests/015.phpt @@ -6,7 +6,6 @@ use_trans_sid should not affect SID session.use_trans_sid=1 session.use_cookies=0 session.use_only_cookies=0 -session.use_strict_mode=0 session.cache_limiter= arg_separator.output=& session.name=PHPSESSID diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt index 0e368e2f828b..83703294a3dd 100644 --- a/ext/session/tests/016.phpt +++ b/ext/session/tests/016.phpt @@ -16,11 +16,10 @@ session.serialize_handler=php ---EXPECTF-- -Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (123;:/really\completely:::/invalid;;,23123;213) in %s on line %d +--EXPECT-- I live diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt index 5ec132b34f09..def1f419ce17 100644 --- a/ext/session/tests/018.phpt +++ b/ext/session/tests/018.phpt @@ -5,7 +5,6 @@ rewriter correctly handles attribute names which contain dashes --INI-- session.use_cookies=0 session.use_only_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.use_trans_sid=1 session.name=PHPSESSID diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt index 0f06add5a115..3ee8ccd42082 100644 --- a/ext/session/tests/019.phpt +++ b/ext/session/tests/019.phpt @@ -4,7 +4,6 @@ serializing references test case using globals --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt index 267e52191cf2..f43bac5d1fd0 100644 --- a/ext/session/tests/020.phpt +++ b/ext/session/tests/020.phpt @@ -1,11 +1,10 @@ --TEST-- -rewriter uses arg_separator.output for modifying URLs +rewriter uses arg_seperator.output for modifying URLs --SKIPIF-- --INI-- session.use_cookies=0 session.use_only_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.use_trans_sid=1 arg_separator.output="&" diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt index e19997289944..1ad3c5d5f7b1 100644 --- a/ext/session/tests/021.phpt +++ b/ext/session/tests/021.phpt @@ -5,7 +5,6 @@ rewriter handles form and fieldset tags correctly --INI-- session.use_cookies=0 session.use_only_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.use_trans_sid=1 url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset=" diff --git a/ext/session/tests/023.phpt b/ext/session/tests/023.phpt index 592b4a8c3b8a..42b1e5b1beb7 100644 --- a/ext/session/tests/023.phpt +++ b/ext/session/tests/023.phpt @@ -4,7 +4,6 @@ session object deserialization --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/024.phpt b/ext/session/tests/024.phpt index 2b273e2b2ef1..2ad26067a505 100644 --- a/ext/session/tests/024.phpt +++ b/ext/session/tests/024.phpt @@ -4,7 +4,6 @@ session_set_save_handler test --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.name=PHPSESSID session.serialize_handler=php diff --git a/ext/session/tests/025.phpt b/ext/session/tests/025.phpt index a9ad8fb64916..4fd095f817a3 100644 --- a/ext/session/tests/025.phpt +++ b/ext/session/tests/025.phpt @@ -4,7 +4,6 @@ custom save handler, multiple session_start()s, complex data structure test. --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.name=PHPSESSID session.serialize_handler=php diff --git a/ext/session/tests/026.phpt b/ext/session/tests/026.phpt index 44f0ae0ec018..06c135d04681 100644 --- a/ext/session/tests/026.phpt +++ b/ext/session/tests/026.phpt @@ -4,7 +4,6 @@ correct instantiation of references between variables in sessions --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/027.phpt b/ext/session/tests/027.phpt index 63828522fb5b..600a992f7f9e 100644 --- a/ext/session/tests/027.phpt +++ b/ext/session/tests/027.phpt @@ -4,7 +4,6 @@ unset($_SESSION["name"]); should work --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/030.phpt b/ext/session/tests/030.phpt index 32909eb58c6f..8d0f284b173e 100644 --- a/ext/session/tests/030.phpt +++ b/ext/session/tests/030.phpt @@ -4,7 +4,6 @@ redefining SID should not cause warnings --INI-- session.use_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.serialize_handler=php session.save_handler=files diff --git a/ext/session/tests/bug41600.phpt b/ext/session/tests/bug41600.phpt index 79d5e128419f..690347ac8d32 100644 --- a/ext/session/tests/bug41600.phpt +++ b/ext/session/tests/bug41600.phpt @@ -5,7 +5,6 @@ Bug #41600 (url rewriter tags doesn't work with namespaced tags) --INI-- session.use_cookies=0 session.use_only_cookies=0 -session.use_strict_mode=0 session.cache_limiter= session.use_trans_sid=1 arg_separator.output="&" diff --git a/ext/session/tests/bug50308.phpt b/ext/session/tests/bug50308.phpt deleted file mode 100644 index 110277ce3c85..000000000000 --- a/ext/session/tests/bug50308.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #50308 (session id not appended properly for empty anchor tags) ---SKIPIF-- - ---INI-- -session.name=PHPSESSID -session.save_handler=files -session.use_trans_sid=1 -session.use_only_cookies=0 ---FILE-- - - - - - - - - - ---EXPECTF-- - - - - - - - - diff --git a/ext/session/tests/bug60634.phpt b/ext/session/tests/bug60634.phpt index e2dfd15b37a8..2ec0c26c13c5 100644 --- a/ext/session/tests/bug60634.phpt +++ b/ext/session/tests/bug60634.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) +--XFAIL-- +Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -42,4 +44,3 @@ echo "um, hi\n"; ?> --EXPECTF-- write: goodbye cruel world -close: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_1.phpt b/ext/session/tests/bug60634_error_1.phpt index e41592f18dd0..3b6e394eed59 100644 --- a/ext/session/tests/bug60634_error_1.phpt +++ b/ext/session/tests/bug60634_error_1.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write during exec +--XFAIL-- +Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -45,4 +47,3 @@ echo "um, hi\n"; write: goodbye cruel world Fatal error: Call to undefined function undefined_function() in %s on line %d -close: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_2.phpt b/ext/session/tests/bug60634_error_2.phpt index 7c50948ba837..265fb303f78d 100644 --- a/ext/session/tests/bug60634_error_2.phpt +++ b/ext/session/tests/bug60634_error_2.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec +--XFAIL-- +Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -45,8 +47,3 @@ echo "um, hi\n"; write: goodbye cruel world Fatal error: Uncaught exception 'Exception' in %s -Stack trace: -#0 [internal function]: write('%s', '') -#1 %s(%d): session_write_close() -#2 {main} - thrown in %s on line %d diff --git a/ext/session/tests/bug60634_error_3.phpt b/ext/session/tests/bug60634_error_3.phpt index 4a508a4d8fe0..b2004d68bcb9 100644 --- a/ext/session/tests/bug60634_error_3.phpt +++ b/ext/session/tests/bug60634_error_3.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec +--XFAIL-- +Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -44,4 +46,3 @@ session_start(); write: goodbye cruel world Fatal error: Call to undefined function undefined_function() in %s on line %d -close: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_4.phpt b/ext/session/tests/bug60634_error_4.phpt index f21d077b54f1..60bc0dcf5459 100644 --- a/ext/session/tests/bug60634_error_4.phpt +++ b/ext/session/tests/bug60634_error_4.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec +--XFAIL-- +Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -44,8 +46,3 @@ session_start(); write: goodbye cruel world Fatal error: Uncaught exception 'Exception' in %s -Stack trace: -#0 [internal function]: write('%s', '') -#1 {main} - thrown in %s on line %d -close: goodbye cruel world diff --git a/ext/session/tests/bug65475.phpt b/ext/session/tests/bug65475.phpt deleted file mode 100644 index 7dc546387958..000000000000 --- a/ext/session/tests/bug65475.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #65475: Session ID is not initialized when session.usr_strict_mode=1 ---INI-- -session.save_handler=files -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- - --EXPECTF-- Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 - -Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 - -Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0 - -Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 - -Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 - -Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0 string(%d) "%s" bool(true) array(2) { diff --git a/ext/session/tests/rfc1867_sid_only_cookie.phpt b/ext/session/tests/rfc1867_sid_only_cookie.phpt index 41f6761fb978..9a0105668fb7 100644 --- a/ext/session/tests/rfc1867_sid_only_cookie.phpt +++ b/ext/session/tests/rfc1867_sid_only_cookie.phpt @@ -7,7 +7,6 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID -session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=1 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt index 107957f8dbcf..7c1eb2de5de4 100644 --- a/ext/session/tests/rfc1867_sid_post.phpt +++ b/ext/session/tests/rfc1867_sid_post.phpt @@ -7,7 +7,6 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID -session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/session_abort_basic.phpt b/ext/session/tests/session_abort_basic.phpt deleted file mode 100644 index 4a6702f0dc66..000000000000 --- a/ext/session/tests/session_abort_basic.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test session_abort() function : basic functionality ---SKIPIF-- - ---INI-- -session.save_path= -session.name=PHPSESSID ---FILE-- - ---EXPECTF-- -*** Testing session_abort() : basic functionality *** -array(2) { - ["foo"]=> - int(123) - ["bar"]=> - int(456) -} -array(1) { - ["foo"]=> - int(123) -} -Done diff --git a/ext/session/tests/session_commit_variation4.phpt b/ext/session/tests/session_commit_variation4.phpt index 69854a6cf99e..57f42539d29f 100644 --- a/ext/session/tests/session_commit_variation4.phpt +++ b/ext/session/tests/session_commit_variation4.phpt @@ -2,8 +2,6 @@ Test session_commit() function : variation --SKIPIF-- ---INI-- -session.use_strict_mode=0 --FILE-- ---FILE-- - ---EXPECTF-- -*** Testing session_decode() : basic functionality *** -bool(true) - --- Iteration 1 -- -bool(true) -array(1) { - ["data"]=> - int(0) -} - --- Iteration 2 -- -bool(true) -array(1) { - ["data"]=> - int(1) -} - --- Iteration 3 -- -bool(true) -array(1) { - ["data"]=> - int(12345) -} - --- Iteration 4 -- -bool(true) -array(1) { - ["data"]=> - int(-2345) -} - --- Iteration 5 -- -bool(true) -array(1) { - ["data"]=> - float(10.5) -} - --- Iteration 6 -- -bool(true) -array(1) { - ["data"]=> - float(-10.5) -} - --- Iteration 7 -- -bool(true) -array(1) { - ["data"]=> - float(123456789000) -} - --- Iteration 8 -- -bool(true) -array(1) { - ["data"]=> - float(1.23456789E-9) -} - --- Iteration 9 -- -bool(true) -array(1) { - ["data"]=> - float(0.5) -} - --- Iteration 10 -- -bool(true) -array(1) { - ["data"]=> - NULL -} - --- Iteration 11 -- -bool(true) -array(1) { - ["data"]=> - NULL -} - --- Iteration 12 -- -bool(true) -array(1) { - ["data"]=> - bool(true) -} - --- Iteration 13 -- -bool(true) -array(1) { - ["data"]=> - bool(false) -} - --- Iteration 14 -- -bool(true) -array(1) { - ["data"]=> - bool(true) -} - --- Iteration 15 -- -bool(true) -array(1) { - ["data"]=> - bool(false) -} - --- Iteration 16 -- -bool(true) -array(1) { - ["data"]=> - string(0) "" -} - --- Iteration 17 -- -bool(true) -array(1) { - ["data"]=> - string(0) "" -} - --- Iteration 18 -- -bool(true) -array(1) { - ["data"]=> - string(7) "Nothing" -} - --- Iteration 19 -- -bool(true) -array(1) { - ["data"]=> - string(7) "Nothing" -} - --- Iteration 20 -- -bool(true) -array(1) { - ["data"]=> - string(12) "Hello World!" -} - --- Iteration 21 -- -bool(true) -array(1) { - ["data"]=> - object(classA)#2 (0) { - } -} - --- Iteration 22 -- -bool(true) -array(1) { - ["data"]=> - NULL -} - --- Iteration 23 -- -bool(true) -array(1) { - ["data"]=> - NULL -} - --- Iteration 24 -- -bool(true) -array(1) { - ["data"]=> - int(0) -} -bool(true) -Done - diff --git a/ext/session/tests/session_encode_serialize.phpt b/ext/session/tests/session_encode_serialize.phpt deleted file mode 100644 index 41c79c3e512b..000000000000 --- a/ext/session/tests/session_encode_serialize.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test session_encode() function : Numeric key raise error. bug65359 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -string(51) "a:3:{i:-3;s:3:"foo";i:3;s:3:"bar";s:3:"var";i:123;}" -Done - diff --git a/ext/session/tests/session_gc_basic.phpt b/ext/session/tests/session_gc_basic.phpt deleted file mode 100644 index f0726ce93bbb..000000000000 --- a/ext/session/tests/session_gc_basic.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Test session_gc() function : basic functionality ---SKIPIF-- - ---INI-- -session.serialize_handler=php -session.save_handler=files -session.maxlifetime=782000 ---FILE-- -= 3); - -echo "Done".PHP_EOL; - -?> ---EXPECTF-- -*** Testing session_gc() : basic functionality *** - -Warning: session_gc(): Trying to garbage collect without active session in %s on line 15 -bool(false) -int(%d) -int(0) -bool(true) -Done diff --git a/ext/session/tests/session_hash_function_basic.phpt b/ext/session/tests/session_hash_function_basic.phpt deleted file mode 100644 index 663852d9d1a1..000000000000 --- a/ext/session/tests/session_hash_function_basic.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test session.hash_function ini setting : basic functionality ---SKIPIF-- - ---INI-- -session.hash_bits_per_character=4 ---FILE-- - ---EXPECTF-- -*** Testing session.hash_function : basic functionality *** -string(1) "0" -bool(true) -bool(true) -string(32) "%s" -bool(true) -string(3) "md5" -bool(true) -bool(true) -string(40) "%s" -bool(true) - -Warning: ini_set(): session.configuration 'session.hash_function' must be existing hash function. none does not exist. in %s/session_hash_function_basic.php on line 17 -bool(false) -bool(true) -bool(true) -string(40) "%s" -bool(true) -Done diff --git a/ext/session/tests/session_id_basic.phpt b/ext/session/tests/session_id_basic.phpt index 852d2f9578ee..5cb13c25eaf1 100644 --- a/ext/session/tests/session_id_basic.phpt +++ b/ext/session/tests/session_id_basic.phpt @@ -20,8 +20,6 @@ var_dump(session_id("test")); var_dump(session_id()); var_dump(session_id("1234567890")); var_dump(session_id()); -// Turn off strice mode, since it does not allow uninitialized session ID -ini_set('session.use_strict_mode',false); var_dump(session_start()); var_dump(session_id()); var_dump(session_destroy()); diff --git a/ext/session/tests/session_name_error.phpt b/ext/session/tests/session_name_error.phpt index 1b99d4ea3558..2ed10d92a2bf 100644 --- a/ext/session/tests/session_name_error.phpt +++ b/ext/session/tests/session_name_error.phpt @@ -86,7 +86,7 @@ $inputs = array( $iterator = 1; foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; - var_dump($input, session_name($input)); + var_dump(session_name($input)); $iterator++; }; @@ -98,139 +98,77 @@ ob_end_flush(); *** Testing session_name() : error functionality *** -- Iteration 1 -- - -Warning: session_name(): session.name cannot be a numeric or empty '0' in %s on line %d -int(0) string(9) "PHPSESSID" -- Iteration 2 -- - -Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d -int(1) -string(9) "PHPSESSID" +string(1) "0" -- Iteration 3 -- - -Warning: session_name(): session.name cannot be a numeric or empty '12345' in %s on line %d -int(12345) -string(9) "PHPSESSID" +string(1) "1" -- Iteration 4 -- - -Warning: session_name(): session.name cannot be a numeric or empty '-2345' in %s on line %d -int(-2345) -string(9) "PHPSESSID" +string(5) "12345" -- Iteration 5 -- - -Warning: session_name(): session.name cannot be a numeric or empty '10.5' in %s on line %d -float(10.5) -string(9) "PHPSESSID" +string(5) "-2345" -- Iteration 6 -- - -Warning: session_name(): session.name cannot be a numeric or empty '-10.5' in %s on line %d -float(-10.5) -string(9) "PHPSESSID" +string(4) "10.5" -- Iteration 7 -- - -Warning: session_name(): session.name cannot be a numeric or empty '123456789000' in %s on line %d -float(123456789000) -string(9) "PHPSESSID" +string(5) "-10.5" -- Iteration 8 -- - -Warning: session_name(): session.name cannot be a numeric or empty '1.23456789E-9' in %s on line %d -float(1.23456789E-9) -string(9) "PHPSESSID" +string(12) "123456789000" -- Iteration 9 -- - -Warning: session_name(): session.name cannot be a numeric or empty '0.5' in %s on line %d -float(0.5) -string(9) "PHPSESSID" +string(13) "1.23456789E-9" -- Iteration 10 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -NULL -string(9) "PHPSESSID" +string(3) "0.5" -- Iteration 11 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -NULL -string(9) "PHPSESSID" +string(0) "" -- Iteration 12 -- - -Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d -bool(true) -string(9) "PHPSESSID" +string(0) "" -- Iteration 13 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -bool(false) -string(9) "PHPSESSID" +string(1) "1" -- Iteration 14 -- - -Warning: session_name(): session.name cannot be a numeric or empty '1' in %s on line %d -bool(true) -string(9) "PHPSESSID" +string(0) "" -- Iteration 15 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -bool(false) -string(9) "PHPSESSID" +string(1) "1" -- Iteration 16 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(0) "" -string(9) "PHPSESSID" -- Iteration 17 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(0) "" -string(9) "PHPSESSID" -- Iteration 18 -- -string(7) "Nothing" -string(9) "PHPSESSID" +string(0) "" -- Iteration 19 -- string(7) "Nothing" -string(7) "Nothing" -- Iteration 20 -- -string(12) "Hello World!" string(7) "Nothing" -- Iteration 21 -- -object(classA)#1 (0) { -} string(12) "Hello World!" -- Iteration 22 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -NULL string(12) "Hello World!" -- Iteration 23 -- - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d -NULL -string(12) "Hello World!" +string(0) "" -- Iteration 24 -- Warning: session_name() expects parameter 1 to be string, resource given in %s on line %d -resource(5) of type (stream) NULL -Done \ No newline at end of file +Done + diff --git a/ext/session/tests/session_name_variation1.phpt b/ext/session/tests/session_name_variation1.phpt index b0de3ee361a7..16d6ad462c86 100644 --- a/ext/session/tests/session_name_variation1.phpt +++ b/ext/session/tests/session_name_variation1.phpt @@ -43,20 +43,18 @@ ob_end_flush(); *** Testing session_name() : variation *** string(9) "PHPSESSID" bool(true) -string(9) "PHPSESSID" +string(0) "" bool(true) -string(9) "PHPSESSID" -string(9) "PHPSESSID" +string(0) "" +string(0) "" bool(true) string(1) " " bool(true) string(1) " " - -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d string(1) " " bool(true) -string(1) " " +string(0) "" bool(true) -string(1) " " +string(0) "" Done diff --git a/ext/session/tests/session_reset_basic.phpt b/ext/session/tests/session_reset_basic.phpt deleted file mode 100644 index 75c6a0411910..000000000000 --- a/ext/session/tests/session_reset_basic.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test session_reset() function : basic functionality ---SKIPIF-- - ---INI-- -session.save_path= -session.name=PHPSESSID ---FILE-- - ---EXPECTF-- -*** Testing session_abort() : basic functionality *** -array(2) { - ["foo"]=> - int(123) - ["bar"]=> - int(456) -} -array(1) { - ["foo"]=> - int(123) -} -Done diff --git a/ext/session/tests/session_save_path_variation2.phpt b/ext/session/tests/session_save_path_variation2.phpt index dff070100c5f..6b0848031226 100644 --- a/ext/session/tests/session_save_path_variation2.phpt +++ b/ext/session/tests/session_save_path_variation2.phpt @@ -32,7 +32,7 @@ ob_end_flush(); *** Testing session_save_path() : variation *** string(5) "/blah" -Warning: session_start(): open(/blah/%s, O_RDWR) failed: No such file or directory (2) in %s on line %d +Warning: session_start(): open(%s, O_RDWR) failed: No such file or directory (2) in %s on line %d bool(true) string(5) "/blah" bool(true) diff --git a/ext/session/tests/session_save_path_variation5.phpt b/ext/session/tests/session_save_path_variation5.phpt index c015dcc95c47..5407b5e15a69 100644 --- a/ext/session/tests/session_save_path_variation5.phpt +++ b/ext/session/tests/session_save_path_variation5.phpt @@ -9,6 +9,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") session.save_handler=files session.save_path= session.name=PHPSESSID +open_basedir=. --FILE-- ---FILE-- - ---EXPECTF-- -*** Testing session_serializer_name() : basic functionality *** -string(3) "php" -bool(true) -bool(true) - -Warning: session_serializer_name(): Cannot find serialization handler 'none' in %s/session_serializer_name_basic.php on line 16 -bool(false) -string(10) "php_binary" -Done - diff --git a/ext/session/tests/session_set_save_handler_basic.phpt b/ext/session/tests/session_set_save_handler_basic.phpt index e8496e8afb72..3897ba9a9275 100644 --- a/ext/session/tests/session_set_save_handler_basic.phpt +++ b/ext/session/tests/session_set_save_handler_basic.phpt @@ -43,7 +43,6 @@ session_id($session_id); session_set_save_handler("open", "close", "read", "write", "destroy", "gc"); session_start(); var_dump($_SESSION); -$_SESSION['Bar'] = 'Foo'; session_write_close(); ob_end_flush(); @@ -92,5 +91,5 @@ array(3) { ["Guff"]=> int(1234567890) } -Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";] +Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;] Close [%s,PHPSESSID] diff --git a/ext/session/tests/session_set_save_handler_class_003.phpt b/ext/session/tests/session_set_save_handler_class_003.phpt index 29b384685126..e9a3cc2febab 100644 --- a/ext/session/tests/session_set_save_handler_class_003.phpt +++ b/ext/session/tests/session_set_save_handler_class_003.phpt @@ -58,7 +58,6 @@ session_set_save_handler($handler); session_start(); -$_SESSION['bar'] = 'hello'; session_write_close(); session_unset(); @@ -72,10 +71,8 @@ array(1) { } int(4) string(%d) "%s" -array(2) { +array(1) { ["foo"]=> string(5) "hello" - ["bar"]=> - string(5) "hello" } string(3) "hai" diff --git a/ext/session/tests/session_set_save_handler_class_007.phpt b/ext/session/tests/session_set_save_handler_class_007.phpt index 55f722515ea6..7344ae1ef30b 100644 --- a/ext/session/tests/session_set_save_handler_class_007.phpt +++ b/ext/session/tests/session_set_save_handler_class_007.phpt @@ -56,7 +56,6 @@ $handler = new MySession(2); session_set_save_handler($handler); session_start(); -$_SESSION['abc'] = 'xyz'; // implicit close (called by shutdown function) echo "done\n"; ob_end_flush(); @@ -70,6 +69,6 @@ ob_end_flush(); (#2) constructor called (#1) destructor called done -(#2) writing %s = foo|s:3:"bar";abc|s:3:"xyz"; +(#2) writing %s = foo|s:3:"bar"; (#2) closing %s (#2) destructor called diff --git a/ext/session/tests/session_set_save_handler_class_016.phpt b/ext/session/tests/session_set_save_handler_class_016.phpt deleted file mode 100644 index 2de03c0682e5..000000000000 --- a/ext/session/tests/session_set_save_handler_class_016.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -Test session_set_save_handler() function: class with create_sid ---INI-- -session.save_handler=files -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- -path = $path . '/u_sess_' . $name; - return true; - } - - public function close() { - return true; - } - - public function read($id) { - return @file_get_contents($this->path . $id); - } - - public function write($id, $data) { - return file_put_contents($this->path . $id, $data); - } - - public function destroy($id) { - @unlink($this->path . $id); - } - - public function gc($maxlifetime) { - foreach (glob($this->path . '*') as $filename) { - if (filemtime($filename) + $maxlifetime < time()) { - @unlink($filename); - } - } - return true; - } - - public function create_sid() { - return parent::create_sid(); - } -} - -$handler = new MySession2; -session_set_save_handler($handler); -session_start(); - -$_SESSION['foo'] = "hello"; - -var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); - -session_write_close(); -session_unset(); - -session_start(); -var_dump($_SESSION); - -session_write_close(); -session_unset(); - ---EXPECTF-- -*** Testing session_set_save_handler() function: class with create_sid *** -string(%d) "%s" -string(4) "user" -array(1) { - ["foo"]=> - string(5) "hello" -} -array(1) { - ["foo"]=> - string(5) "hello" -} diff --git a/ext/session/tests/session_set_save_handler_class_017.phpt b/ext/session/tests/session_set_save_handler_class_017.phpt deleted file mode 100644 index 756dc55d0304..000000000000 --- a/ext/session/tests/session_set_save_handler_class_017.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -Test session_set_save_handler() function: class with create_sid ---INI-- -session.save_handler=files -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- -path = $path . '/u_sess_' . $name; - return true; - } - - public function close() { - return true; - } - - public function read($id) { - return @file_get_contents($this->path . $id); - } - - public function write($id, $data) { - return file_put_contents($this->path . $id, $data); - } - - public function destroy($id) { - @unlink($this->path . $id); - } - - public function gc($maxlifetime) { - foreach (glob($this->path . '*') as $filename) { - if (filemtime($filename) + $maxlifetime < time()) { - @unlink($filename); - } - } - return true; - } - - public function create_sid() { - return 'my_sid'; - } -} - -$handler = new MySession2; -session_set_save_handler($handler); -session_start(); - -$_SESSION['foo'] = "hello"; - -var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); - -session_write_close(); -session_unset(); - -session_start(); -var_dump($_SESSION); - -session_write_close(); -session_unset(); - ---EXPECTF-- -*** Testing session_set_save_handler() function: class with create_sid *** -string(%d) "my_sid" -string(4) "user" -array(1) { - ["foo"]=> - string(5) "hello" -} -array(1) { - ["foo"]=> - string(5) "hello" -} diff --git a/ext/session/tests/session_set_save_handler_closures.phpt b/ext/session/tests/session_set_save_handler_closures.phpt index 1251886b011f..21b2c6873709 100644 --- a/ext/session/tests/session_set_save_handler_closures.phpt +++ b/ext/session/tests/session_set_save_handler_closures.phpt @@ -42,7 +42,6 @@ echo "Starting session again..!\n"; session_id($session_id); session_set_save_handler($open_closure, $close_closure, $read_closure, $write_closure, $destroy_closure, $gc_closure); session_start(); -$_SESSION['Bar'] = 'Foo'; var_dump($_SESSION); session_write_close(); @@ -84,15 +83,13 @@ array(3) { Starting session again..! Open [%s,PHPSESSID] Read [%s,%s] -array(4) { +array(3) { ["Blah"]=> string(12) "Hello World!" ["Foo"]=> bool(false) ["Guff"]=> int(1234567890) - ["Bar"]=> - string(3) "Foo" } -Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";] +Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;] Close [%s,PHPSESSID] diff --git a/ext/session/tests/session_set_save_handler_error2.phpt b/ext/session/tests/session_set_save_handler_error2.phpt index 1f2a8b9e6a0a..03ba3b04d0fb 100644 --- a/ext/session/tests/session_set_save_handler_error2.phpt +++ b/ext/session/tests/session_set_save_handler_error2.phpt @@ -2,8 +2,6 @@ Test session_set_save_handler() function : error functionality --SKIPIF-- ---INI-- -error_reporting=0 --FILE-- ---FILE-- -path = $path . '/u_sess_' . $name; - return true; - } - - public function close() { - return true; - } - - public function read($id) { - return @file_get_contents($this->path . $id); - } - - public function write($id, $data) { - return file_put_contents($this->path . $id, $data); - } - - public function destroy($id) { - @unlink($this->path . $id); - } - - public function gc($maxlifetime) { - foreach (glob($this->path . '*') as $filename) { - if (filemtime($filename) + $maxlifetime < time()) { - @unlink($filename); - } - } - return true; - } - - public function create_sid() { - return 'my_sid'; - } -} - -$handler = new MySession2; -session_set_save_handler($handler); -session_start(); - -$_SESSION['foo'] = "hello"; - -var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); - -session_write_close(); -session_unset(); - -session_start(); -var_dump($_SESSION); - -session_write_close(); -session_unset(); - ---EXPECTF-- -*** Testing session_set_save_handler() function: id interface *** -string(%d) "my_sid" -string(4) "user" -array(1) { - ["foo"]=> - string(5) "hello" -} -array(1) { - ["foo"]=> - string(5) "hello" -} diff --git a/ext/session/tests/session_set_save_handler_sid_001.phpt b/ext/session/tests/session_set_save_handler_sid_001.phpt deleted file mode 100644 index 0dc4fc11cf0c..000000000000 --- a/ext/session/tests/session_set_save_handler_sid_001.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test session_set_save_handler() function: create_sid ---INI-- -session.save_handler=files -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- -path = $path . '/u_sess_' . $name; - return true; - } - - public function close() { - return true; - } - - public function read($id) { - return @file_get_contents($this->path . $id); - } - - public function write($id, $data) { - return file_put_contents($this->path . $id, $data); - } - - public function destroy($id) { - @unlink($this->path . $id); - } - - public function gc($maxlifetime) { - foreach (glob($this->path . '*') as $filename) { - if (filemtime($filename) + $maxlifetime < time()) { - @unlink($filename); - } - } - return true; - } - - public function create_sid() { - return 'my_sid'; - } -} - -$handler = new MySession2; -session_set_save_handler(array($handler, 'open'), array($handler, 'close'), - array($handler, 'read'), array($handler, 'write'), array($handler, 'destroy'), array($handler, 'gc'), array($handler, 'create_sid')); -session_start(); - -$_SESSION['foo'] = "hello"; - -var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); - -session_write_close(); -session_unset(); - -session_start(); -var_dump($_SESSION); - -session_write_close(); -session_unset(); - ---EXPECTF-- -*** Testing session_set_save_handler() function: create_sid *** -string(%d) "my_sid" -string(4) "user" -array(1) { - ["foo"]=> - string(5) "hello" -} -array(1) { - ["foo"]=> - string(5) "hello" -} diff --git a/ext/session/tests/session_set_save_handler_sid_002.phpt b/ext/session/tests/session_set_save_handler_sid_002.phpt deleted file mode 100644 index f9a72aebcaf8..000000000000 --- a/ext/session/tests/session_set_save_handler_sid_002.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Test session_set_save_handler() function: create_sid ---INI-- -session.save_handler=files -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- -path = $path . '/u_sess_' . $name; - return true; - } - - public function close() { - return true; - } - - public function read($id) { - return @file_get_contents($this->path . $id); - } - - public function write($id, $data) { - return file_put_contents($this->path . $id, $data); - } - - public function destroy($id) { - @unlink($this->path . $id); - } - - public function gc($maxlifetime) { - foreach (glob($this->path . '*') as $filename) { - if (filemtime($filename) + $maxlifetime < time()) { - @unlink($filename); - } - } - return true; - } - - public function create_sid() { - return null; - } -} - -$handler = new MySession2; -session_set_save_handler(array($handler, 'open'), array($handler, 'close'), - array($handler, 'read'), array($handler, 'write'), array($handler, 'destroy'), array($handler, 'gc'), array($handler, 'create_sid')); -session_start(); - -$_SESSION['foo'] = "hello"; - -var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); - -session_write_close(); -session_unset(); - -session_start(); -var_dump($_SESSION); - -session_write_close(); -session_unset(); - ---EXPECTF-- -*** Testing session_set_save_handler() function: create_sid *** - -Fatal error: session_start(): Session id must be a string in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt b/ext/session/tests/session_set_save_handler_write_short_circuit.phpt deleted file mode 100644 index 02ca182ec6b5..000000000000 --- a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test session_set_save_handler() function : test write short circuit ---INI-- -session.save_path= -session.name=PHPSESSID ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing session_set_save_handler() : test write short circuit *** - -Open [%s,PHPSESSID] -Read [%s,%s] -array(3) { - ["Blah"]=> - string(12) "Hello World!" - ["Foo"]=> - bool(false) - ["Guff"]=> - int(1234567890) -} -Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;] -Close [%s,PHPSESSID] -array(3) { - ["Blah"]=> - string(12) "Hello World!" - ["Foo"]=> - bool(false) - ["Guff"]=> - int(1234567890) -} -Starting session again..! -Open [%s,PHPSESSID] -Read [%s,%s] -array(3) { - ["Blah"]=> - string(12) "Hello World!" - ["Foo"]=> - bool(false) - ["Guff"]=> - int(1234567890) -} -Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";] -Close [%s,PHPSESSID] -Starting session again..! -Open [%s,PHPSESSID] -Read [%s,%s] -array(4) { - ["Blah"]=> - string(12) "Hello World!" - ["Foo"]=> - bool(false) - ["Guff"]=> - int(1234567890) - ["Bar"]=> - string(3) "Foo" -} -Close [%s,PHPSESSID] \ No newline at end of file diff --git a/ext/session/tests/session_status_disabled.phpt b/ext/session/tests/session_status_disabled.phpt index c4d1f2192db1..24e0ecd7bf76 100644 --- a/ext/session/tests/session_status_disabled.phpt +++ b/ext/session/tests/session_status_disabled.phpt @@ -3,7 +3,7 @@ Test session_status() function : disabled --SKIPIF-- --INI-- -session.save_handler=non-existent +session.save_handler=non-existant --FILE-- ---INI-- -session.use_strict_mode=0 --FILE-- , - unfortunately this extension was designed with PHP only in mind and + extention (sysvshm) written by Christian Cartus , + unfortunatly this extention was designed with PHP only in mind and offers high level features which are extremly bothersome for basic SHM we had in mind. After spending a day trying to reverse engineer and figure out the format of sysvshm we decided that it would be much easier to - add our own extension to php for simple SHM operations, we were right :)). + add our own extention to php for simple SHM operations, we were right :)). the functions are: diff --git a/ext/simplexml/config.m4 b/ext/simplexml/config.m4 index b06f5b00f049..2145e23d8875 100644 --- a/ext/simplexml/config.m4 +++ b/ext/simplexml/config.m4 @@ -6,7 +6,7 @@ PHP_ARG_ENABLE(simplexml, whether to enable SimpleXML support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR SimpleXML: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR SimpleXML: libxml2 install prefix], no, no) fi if test "$PHP_SIMPLEXML" != "no"; then @@ -18,7 +18,6 @@ if test "$PHP_SIMPLEXML" != "no"; then PHP_SETUP_LIBXML(SIMPLEXML_SHARED_LIBADD, [ AC_DEFINE(HAVE_SIMPLEXML,1,[ ]) PHP_NEW_EXTENSION(simplexml, simplexml.c sxe.c, $ext_shared) - PHP_INSTALL_HEADERS([ext/simplexml/php_simplexml.h ext/simplexml/php_simplexml_exports.h]) PHP_SUBST(SIMPLEXML_SHARED_LIBADD) ], [ AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) diff --git a/ext/simplexml/config.w32 b/ext/simplexml/config.w32 index a02f3dded3a1..2d2ed285ebda 100644 --- a/ext/simplexml/config.w32 +++ b/ext/simplexml/config.w32 @@ -16,7 +16,6 @@ if (PHP_SIMPLEXML == "yes") { MESSAGE("\tSPL support in simplexml disabled"); } ADD_FLAG("CFLAGS_SIMPLEXML", "/D PHP_SIMPLEXML_EXPORTS "); - PHP_INSTALL_HEADERS("ext/simplexml/", "php_simplexml.h php_simplexml_exports.h"); } else { PHP_SIMPLEXML = "no"; WARNING("simplexml not enabled; libraries and headers not found"); diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index eba46b909103..e7c2f298447e 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1070,7 +1070,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{ int namelen; int test; char use_iter; - zval *iter_data = NULL; + zval *iter_data; use_iter = 0; diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h index 86836c03e287..495907bbd16e 100644 --- a/ext/skeleton/php_skeleton.h +++ b/ext/skeleton/php_skeleton.h @@ -18,6 +18,15 @@ extern zend_module_entry extname_module_entry; #include "TSRM.h" #endif +PHP_MINIT_FUNCTION(extname); +PHP_MSHUTDOWN_FUNCTION(extname); +PHP_RINIT_FUNCTION(extname); +PHP_RSHUTDOWN_FUNCTION(extname); +PHP_MINFO_FUNCTION(extname); + +PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ +/* __function_declarations_here__ */ + /* Declare any global variables you may need between the BEGIN and END macros here: diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c index b9a918806c81..ee4ea74e1686 100644 --- a/ext/skeleton/skeleton.c +++ b/ext/skeleton/skeleton.c @@ -16,6 +16,41 @@ ZEND_DECLARE_MODULE_GLOBALS(extname) /* True global resources - no need for thread safety here */ static int le_extname; +/* {{{ extname_functions[] + * + * Every user visible function must have an entry in extname_functions[]. + */ +const zend_function_entry extname_functions[] = { + PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ + /* __function_entries_here__ */ + PHP_FE_END /* Must be the last line in extname_functions[] */ +}; +/* }}} */ + +/* {{{ extname_module_entry + */ +zend_module_entry extname_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 + STANDARD_MODULE_HEADER, +#endif + "extname", + extname_functions, + PHP_MINIT(extname), + PHP_MSHUTDOWN(extname), + PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */ + PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */ + PHP_MINFO(extname), +#if ZEND_MODULE_API_NO >= 20010901 + "0.1", /* Replace with version number for your extension */ +#endif + STANDARD_MODULE_PROPERTIES +}; +/* }}} */ + +#ifdef COMPILE_DL_EXTNAME +ZEND_GET_MODULE(extname) +#endif + /* {{{ PHP_INI */ /* Remove comments and fill if you need to have entries in php.ini @@ -26,35 +61,6 @@ PHP_INI_END() */ /* }}} */ -/* Remove the following function when you have successfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - -/* Every user-visible function in PHP should document itself in the source */ -/* {{{ proto string confirm_extname_compiled(string arg) - Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_extname_compiled) -{ - char *arg = NULL; - int arg_len, len; - char *strg; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) { - return; - } - - len = spprintf(&strg, 0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg); - RETURN_STRINGL(strg, len, 0); -} -/* }}} */ -/* The previous line is meant for vim and emacs, so it can correctly fold and - unfold functions in source code. See the corresponding marks just before - function definition, where the functions purpose is also documented. Please - follow this convention for the convenience of others editing your code. -*/ - -/* __function_stubs_here__ */ - /* {{{ php_extname_init_globals */ /* Uncomment this function if you have INI entries @@ -120,36 +126,35 @@ PHP_MINFO_FUNCTION(extname) } /* }}} */ -/* {{{ extname_functions[] - * - * Every user visible function must have an entry in extname_functions[]. - */ -const zend_function_entry extname_functions[] = { - PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ - /* __function_entries_here__ */ - PHP_FE_END /* Must be the last line in extname_functions[] */ -}; -/* }}} */ -/* {{{ extname_module_entry - */ -zend_module_entry extname_module_entry = { - STANDARD_MODULE_HEADER, - "extname", - extname_functions, - PHP_MINIT(extname), - PHP_MSHUTDOWN(extname), - PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(extname), - "0.1", /* Replace with version number for your extension */ - STANDARD_MODULE_PROPERTIES -}; +/* Remove the following function when you have successfully modified config.m4 + so that your module can be compiled into PHP, it exists only for testing + purposes. */ + +/* Every user-visible function in PHP should document itself in the source */ +/* {{{ proto string confirm_extname_compiled(string arg) + Return a string to confirm that the module is compiled in */ +PHP_FUNCTION(confirm_extname_compiled) +{ + char *arg = NULL; + int arg_len, len; + char *strg; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) { + return; + } + + len = spprintf(&strg, 0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg); + RETURN_STRINGL(strg, len, 0); +} /* }}} */ +/* The previous line is meant for vim and emacs, so it can correctly fold and + unfold functions in source code. See the corresponding marks just before + function definition, where the functions purpose is also documented. Please + follow this convention for the convenience of others editing your code. +*/ -#ifdef COMPILE_DL_EXTNAME -ZEND_GET_MODULE(extname) -#endif +/* __function_stubs_here__ */ /* * Local variables: diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4 index dd7a3bf68d17..9c0b82f77860 100644 --- a/ext/snmp/config.m4 +++ b/ext/snmp/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(snmp,for SNMP support, -[ --with-snmp[=DIR] Include SNMP support]) +[ --with-snmp[=DIR] Include SNMP support]) PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP, [ --with-openssl-dir[=DIR] SNMP: openssl install prefix], no, no) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 4e2510afc8da..47e2d43f5aef 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -514,7 +514,7 @@ static zend_object_value php_snmp_object_new(zend_class_entry *class_type TSRMLS static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...) { va_list args; - php_snmp_object *snmp_object = NULL; + php_snmp_object *snmp_object; if (object) { snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC); @@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, zval *snmpval = NULL; int snmp_errno; - /* we start with retval=FALSE. If any actual data is acquired, retval will be set to appropriate type */ + /* we start with retval=FALSE. If any actual data is aquired, retval will be set to appropriate type */ RETVAL_FALSE; /* reset errno and errstr */ @@ -1871,7 +1871,7 @@ PHP_METHOD(snmp, close) /* }}} */ /* {{{ proto mixed SNMP::get(mixed object_id [, bool preserve_keys]) - Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */ + Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */ PHP_METHOD(snmp, get) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, (-1)); @@ -1879,7 +1879,7 @@ PHP_METHOD(snmp, get) /* }}} */ /* {{{ proto mixed SNMP::getnext(mixed object_id) - Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */ + Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */ PHP_METHOD(snmp, getnext) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, (-1)); diff --git a/ext/snmp/tests/bug64159.phpt b/ext/snmp/tests/bug64159.phpt index 52e53c957f7f..51b159952967 100644 --- a/ext/snmp/tests/bug64159.phpt +++ b/ext/snmp/tests/bug64159.phpt @@ -15,7 +15,7 @@ require_once(dirname(__FILE__).'/snmp_include.inc'); snmp_set_quick_print(false); snmp_set_valueretrieval(SNMP_VALUE_LIBRARY); -var_dump(("ab8283f948419b2d24d22f44a80b17d3" === md5(snmpget($hostname, $community, '.1.3.6.1.4.1.2021.8.1.101.1')))); +var_dump(("ab8283f948419b2d24d22f44a80b17d3" === md5(snmpget($hostname, $community, '.1.3.6.1.4.1.2021.8.1.101.2')))); ?> --EXPECTF-- diff --git a/ext/soap/TODO b/ext/soap/TODO index 9e6784f6f437..ad0b11c94833 100644 --- a/ext/soap/TODO +++ b/ext/soap/TODO @@ -41,7 +41,7 @@ Encoding ? support for "nillable" and "nil" ? default values of ? provide schema 1999/2001 support??? -? make internal references for soap encoding (use serialization logic)??? +? make internal refrences for soap encoding (use seralization logic)??? ? provide user space overriding of serialization certin objects and types??? WSDL diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old index b219c61f8a33..59deb4b9dc09 100644 --- a/ext/soap/TODO.old +++ b/ext/soap/TODO.old @@ -2,13 +2,13 @@ TODO: make sure soap 1.1 and 1.2 is supported fully Better WSDL support Client and server (how much validation is needed here?) UDDI?? -make internal references for soap encoding (use serialization logic) +make internal refrences for soap encoding (use seralization logic) add ini option for always soap_error_handler provide user space overriding of serialization certin objects and types serialization in general needs to be polished/finished... all xsd types look to see if php-soap will work with out always_populate_raw_post_data on see if client will work with ssl.. should be eaiser with php_streams -work on soap serializer (php serialization) +work on soap seralizer (php serialization) -work on a soap-service 'regiestry' and 'proxy' (apache soap style) -convert all string mainpulation to use smart_str make the 'soap' packet abstract.. maybe incorperate xml-rpc diff --git a/ext/soap/config.m4 b/ext/soap/config.m4 index 7fa8c6f0ec39..8acad8dee371 100644 --- a/ext/soap/config.m4 +++ b/ext/soap/config.m4 @@ -6,7 +6,7 @@ PHP_ARG_ENABLE(soap, whether to enable SOAP support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR SOAP: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR SOAP: libxml2 install prefix], no, no) fi if test "$PHP_SOAP" != "no"; then diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index b8ee893d8dae..5b978734e8ea 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -300,7 +300,7 @@ function _saveResults($endpoint_id, &$soap_test) { /** * decodeSoapval - * decodes a soap value to php type, used for test result comparisons + * decodes a soap value to php type, used for test result comparisions * * @param SOAP_Value soapval * @return mixed result @@ -398,7 +398,7 @@ function doEndpointMethod(&$endpoint_info, &$soap_test) { $namespace = $soapaction = 'http://soapinterop.org/'; // hack to make tests work with MS SoapToolkit // it's the only one that uses this soapaction, and breaks if - // it isn't right. Can't wait for soapaction to be fully deprecated + // it isn't right. Can't wait for soapaction to be fully depricated if ($this->currentTest == 'base' && strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) { $soapaction = 'urn:soapinterop'; diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php index e0b2c0e82da5..f0987a170278 100644 --- a/ext/soap/interop/client_round2_params.php +++ b/ext/soap/interop/client_round2_params.php @@ -486,7 +486,7 @@ function SOAPStruct($s, $i, $f) { $soap_tests['GroupC'][] = $test; // echoMeStringRequest with endpoint header destination, must understand, -// invalid namespace, should receive a fault +// invalid namespace, should recieve a fault $test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL); $test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT); $test->headers_expect = array(); diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php index fc12bc8cb724..1ae25d92f02e 100644 --- a/ext/soap/interop/index.php +++ b/ext/soap/interop/index.php @@ -35,7 +35,7 @@ classes to define what the type of the value is.

Client Test Interface

The client interface allows you to run the PHP SOAP -Client against a chosen interop server. Each run updates the results database below.

+Client against a choosen interop server. Each run updates the results database below.

Interop Client Test Results

This is a database of the current test results using PHP SOAP Clients against interop servers.

diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 86ab03d9c80c..7a109c196622 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -194,7 +194,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph if (use_ssl && !*use_proxy) { if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_ssl_method", sizeof("_ssl_method"), (void **) &tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_LONG) { - /* uses constants declared in soap.c to determine ssl uri protocol */ + /* uses contants declared in soap.c to determine ssl uri protocol */ switch (Z_LVAL_PP(tmp)) { case SOAP_SSL_METHOD_TLS: protocol = "tls"; @@ -1222,7 +1222,7 @@ int make_http_soap_request(zval *this_ptr, zval *err; MAKE_STD_ZVAL(err); ZVAL_STRINGL(err, http_body, http_body_size, 1); - add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC); + add_soap_fault(this_ptr, "HTTP", "Didn't recieve an xml document", NULL, err TSRMLS_CC); efree(content_type); efree(http_headers); efree(http_body); diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 25bb17727365..7d2e129746ef 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1081,14 +1081,6 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns)); if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); - } else { - xmlAttrPtr ns = get_attribute(groupType->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - if (ns) { - smart_str_appends(&key, (char*)ns->children->content); - } } smart_str_appendc(&key, ':'); smart_str_appends(&key, type); @@ -1517,14 +1509,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp if (nsptr != NULL) { smart_str_appends(&nscat, (char*)nsptr->href); newType->namens = estrdup((char*)nsptr->href); - } else { - xmlAttrPtr ns = get_attribute(attrs, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - if (ns) { - smart_str_appends(&nscat, (char*)ns->children->content); - } } smart_str_appendc(&nscat, ':'); smart_str_appends(&nscat, type); @@ -1751,14 +1735,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl if (nsptr != NULL) { smart_str_appends(&key, (char*)nsptr->href); newAttr->namens = estrdup((char*)nsptr->href); - } else { - xmlAttrPtr ns = get_attribute(attrType->properties, "targetNamespace"); - if (ns == NULL) { - ns = tns; - } - if (ns) { - smart_str_appends(&key, (char*)ns->children->content); - } } smart_str_appendc(&key, ':'); smart_str_appends(&key, attr_name); @@ -2060,31 +2036,13 @@ static void copy_extra_attribute(void *attribute) } } -static void* schema_find_by_ref(HashTable *ht, char *ref) -{ - void **tmp; - - if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) { - return tmp; - } else { - ref = strrchr(ref, ':'); - if (ref) { - if (zend_hash_find(ht, ref, strlen(ref)+1, (void**)&tmp) == SUCCESS) { - return tmp; - } - } - } - return NULL; -} - static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) { sdlAttributePtr *tmp; if (attr->ref != NULL) { if (ctx->attributes != NULL) { - tmp = (sdlAttributePtr*)schema_find_by_ref(ctx->attributes, attr->ref); - if (tmp) { + if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { schema_attribute_fixup(ctx, *tmp); if ((*tmp)->name != NULL && attr->name == NULL) { attr->name = estrdup((*tmp)->name); @@ -2134,8 +2092,7 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT if (attr->ref != NULL) { if (ctx->attributeGroups != NULL) { - tmp = (sdlTypePtr*)schema_find_by_ref(ctx->attributeGroups, attr->ref); - if (tmp) { + if (zend_hash_find(ctx->attributeGroups, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) { if ((*tmp)->attributes) { zend_hash_internal_pointer_reset((*tmp)->attributes); while (zend_hash_get_current_data((*tmp)->attributes,(void**)&tmp_attr) == SUCCESS) { @@ -2192,7 +2149,7 @@ static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model) model->kind = XSD_CONTENT_GROUP; model->u.group = (*tmp); } else { - soap_error1(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); + soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute"); } break; } @@ -2236,8 +2193,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) if (type->ref != NULL) { if (ctx->sdl->elements != NULL) { - tmp = (sdlTypePtr*)schema_find_by_ref(ctx->sdl->elements, type->ref); - if (tmp) { + if (zend_hash_find(ctx->sdl->elements, type->ref, strlen(type->ref)+1, (void**)&tmp) == SUCCESS) { type->kind = (*tmp)->kind; type->encode = (*tmp)->encode; if ((*tmp)->nillable) { @@ -2253,7 +2209,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) } else if (strcmp(type->ref, SCHEMA_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { - soap_error1(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); + soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute"); } } efree(type->ref); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 0ac4c2ed7a9b..33e137cbbb70 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -40,8 +40,8 @@ static void delete_binding(void *binding); static void delete_binding_persistent(void *binding); static void delete_function(void *function); static void delete_function_persistent(void *function); -static void delete_parameter(void *parameter); -static void delete_parameter_persistent(void *parameter); +static void delete_parameter(void *paramater); +static void delete_parameter_persistent(void *paramater); static void delete_header(void *header); static void delete_header_persistent(void *header); static void delete_document(void *doc_ptr); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 00e80efbcbca..cabe5c068b08 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1290,7 +1290,7 @@ PHP_METHOD(SoapServer, setClass) } } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existent class (%s)", classname); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existant class (%s)", classname); return; } @@ -1421,7 +1421,7 @@ PHP_METHOD(SoapServer, addFunction) zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_PP(tmp_function)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function)); return; } @@ -1443,7 +1443,7 @@ PHP_METHOD(SoapServer, addFunction) zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name)); return; } if (service->soap_functions.ft == NULL) { @@ -1675,7 +1675,7 @@ PHP_METHOD(SoapServer, handle) } } #endif - /* If new session or something weird happned */ + /* If new session or something wierd happned */ if (soap_obj == NULL) { zval *tmp_soap; @@ -3669,44 +3669,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c return function; } -static void set_soap_header_attributes(xmlNodePtr h, HashTable *ht, int version) -{ - zval **tmp; - - if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { - if (version == SOAP_1_1) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); - } else { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); - } - } - if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { - if (Z_TYPE_PP(tmp) == IS_STRING) { - if (version == SOAP_1_1) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); - } else { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); - } - } else if (Z_TYPE_PP(tmp) == IS_LONG) { - if (version == SOAP_1_1) { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); - } - } else { - if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); - } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { - xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); - } - } - } - } -} - -static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node TSRMLS_DC) +static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main TSRMLS_DC) { xmlNodePtr method = NULL, param; sdlParamPtr parameter = NULL; @@ -3806,9 +3769,6 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) { xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE)); } - if (node) { - *node = method; - } return use; } @@ -3890,7 +3850,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function } if (headers->function) { - if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL TSRMLS_CC) == SOAP_ENCODED) { + if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } } else { @@ -3960,7 +3920,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function if (version == SOAP_1_1) { if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - size_t new_len; + int new_len; xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode")); char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); xmlAddChild(param, node); @@ -3970,7 +3930,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNodeSetContent(node, code); xmlFree(code); } else { - xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len); + xmlNodeSetContentLen(node, BAD_CAST(str), new_len); } efree(str); } @@ -3985,7 +3945,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function detail_name = "detail"; } else { if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) { - size_t new_len; + int new_len; xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL); char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC); node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL); @@ -3995,7 +3955,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNodeSetContent(node, code); xmlFree(code); } else { - xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len); + xmlNodeSetContentLen(node, BAD_CAST(str), new_len); } efree(str); } @@ -4076,15 +4036,15 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function zval *hdr_ret = &h->retval; char *hdr_ns = h->hdr?h->hdr->ns:NULL; char *hdr_name = Z_STRVAL(h->function_name); - HashTable *ht = NULL; + if (Z_TYPE(h->retval) == IS_OBJECT && instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) { + HashTable* ht = Z_OBJPROP(h->retval); zval **tmp; sdlSoapBindingFunctionHeaderPtr *hdr; smart_str key = {0}; - ht = Z_OBJPROP(h->retval); if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); @@ -4115,14 +4075,9 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function } if (h->function) { - xmlNodePtr xmlHdr = NULL; - - if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr TSRMLS_CC) == SOAP_ENCODED) { + if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } - if (ht) { - set_soap_header_attributes(xmlHdr, ht, version); - } } else { xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC); if (hdr_name) { @@ -4132,9 +4087,6 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); xmlSetNs(xmlHdr, nsptr); } - if (ht) { - set_soap_header_attributes(xmlHdr, ht, version); - } } } h = h->next; @@ -4148,7 +4100,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL); - if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL TSRMLS_CC) == SOAP_ENCODED) { + if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) { use = SOAP_ENCODED; } @@ -4340,7 +4292,38 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function } nsptr = encode_add_ns(h, Z_STRVAL_PP(ns)); xmlSetNs(h, nsptr); - set_soap_header_attributes(h, ht, version); + + if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { + if (version == SOAP_1_1) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); + } else { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); + } + } + if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { + if (Z_TYPE_PP(tmp) == IS_STRING) { + if (version == SOAP_1_1) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); + } else { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); + } + } else if (Z_TYPE_PP(tmp) == IS_LONG) { + if (version == SOAP_1_1) { + if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { + xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); + } + } else { + if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); + } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); + } else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { + xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); + } + } + } + } } zend_hash_move_forward(soap_headers); } diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl index 7f1514acbf37..f38d91185233 100644 --- a/ext/soap/tests/bugs/bug27742.wsdl +++ b/ext/soap/tests/bugs/bug27742.wsdl @@ -5,7 +5,7 @@ - ISO 8601 pattern used to denote program durations. Year, month and day are not relevant in our context and are omitted. + ISO 8601 pattern used to denote program durations. Year, month and day are not relevent in our context and are omitted. @@ -484,7 +484,7 @@ - Date until which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight. + Date untill which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight. diff --git a/ext/soap/tests/bugs/bug28985.phpt b/ext/soap/tests/bugs/bug28985.phpt index 73ff899c395b..59d96e2c77ce 100644 --- a/ext/soap/tests/bugs/bug28985.phpt +++ b/ext/soap/tests/bugs/bug28985.phpt @@ -44,10 +44,10 @@ array(42) { string iUserPassword; }" [8]=> - string(87) "struct MGCodeLibelle { + string(86) "struct MGCodeLibelle { string Code; string Libelle; - boolean Default; + boolean Defaut; anyType Tag; }" [9]=> @@ -203,4 +203,4 @@ array(42) { string(76) "struct GetEnvironnementResponse { MGEnvironnement GetEnvironnementResult; }" -} +} \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug28985.wsdl b/ext/soap/tests/bugs/bug28985.wsdl index 50c2fcda849e..ee528818bbe2 100644 --- a/ext/soap/tests/bugs/bug28985.wsdl +++ b/ext/soap/tests/bugs/bug28985.wsdl @@ -67,7 +67,7 @@ type="s:string" /> type="s:string" /> - diff --git a/ext/soap/tests/bugs/bug65018.phpt b/ext/soap/tests/bugs/bug65018.phpt deleted file mode 100644 index bbb9b5e42d36..000000000000 --- a/ext/soap/tests/bugs/bug65018.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #65018 (SoapHeader problems with SoapServer) ---SKIPIF-- - ---FILE-- -'.PHP_EOL. - ''. - 'abc'. - ''; - - $soap = new SoapServer(null, array('uri' => '127.0.0.1')); - $soap->setClass('Tool'); - $soap->handle($input); -?> ---EXPECT-- - -abc diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index ed55ed52fa75..e3ff271f8462 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -37,7 +37,7 @@ struct _WSAMSG { DWORD dwFlags; //int msg_flags } struct __WSABUF { - u_long len; //size_t iov_len (2nd member) + u_long len; //size_t iov_len (2nd member) char FAR *buf; //void *iov_base (1st member) } struct _WSACMSGHDR { @@ -98,8 +98,8 @@ typedef struct { } field_descriptor; #define KEY_FILL_SOCKADDR "fill_sockaddr" -#define KEY_RECVMSG_RET "recvmsg_ret" -#define KEY_CMSG_LEN "cmsg_len" +#define KEY_RECVMSG_RET "recvmsg_ret" +#define KEY_CMSG_LEN "cmsg_len" const struct key_value empty_key_value_list[] = {{0}}; @@ -223,7 +223,6 @@ static unsigned from_array_iterate(const zval *arr, char buf[sizeof("element #4294967295")]; char *bufp = buf; - /* Note i starts at 1, not 0! */ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos), i = 1; !ctx->err.has_error && zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&elem, &pos) == SUCCESS; @@ -594,7 +593,6 @@ static void to_zval_read_sockaddr_in(const char *data, zval *zv, res_context *ct { to_zval_read_aggregation(data, zv, descriptors_sockaddr_in, ctx); } -#if HAVE_IPV6 static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_context *ctx) { int res; @@ -654,7 +652,6 @@ static void to_zval_read_sockaddr_in6(const char *data, zval *zv, res_context *c { to_zval_read_aggregation(data, zv, descriptors_sockaddr_in6, ctx); } -#endif /* HAVE_IPV6 */ static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_context *ctx) { zval lzval = zval_used_for_init; @@ -667,13 +664,6 @@ static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_ path = &lzval; } - /* code in this file relies on the path being nul terminated, even though - * this is not required, at least on linux for abstract paths. It also - * assumes that the path is not empty */ - if (Z_STRLEN_P(path) == 0) { - do_from_zval_err(ctx, "%s", "the path is cannot be empty"); - return; - } if (Z_STRLEN_P(path) >= sizeof(saddr->sun_path)) { do_from_zval_err(ctx, "the path is too long, the maximum permitted " "length is %ld", sizeof(saddr->sun_path) - 1); @@ -752,7 +742,6 @@ static void from_zval_write_sockaddr_aux(const zval *container, } break; -#if HAVE_IPV6 case AF_INET6: if (ctx->sock->type != AF_INET6) { do_from_zval_err(ctx, "the specified family (AF_INET6) is not " @@ -766,7 +755,6 @@ static void from_zval_write_sockaddr_aux(const zval *container, (*sockaddr_ptr)->sa_family = AF_INET6; } break; -#endif /* HAVE_IPV6 */ case AF_UNIX: if (ctx->sock->type != AF_UNIX) { @@ -775,22 +763,10 @@ static void from_zval_write_sockaddr_aux(const zval *container, return; } *sockaddr_ptr = accounted_ecalloc(1, sizeof(struct sockaddr_un), ctx); + *sockaddr_len = sizeof(struct sockaddr_un); if (fill_sockaddr) { - struct sockaddr_un *sock_un = (struct sockaddr_un*)*sockaddr_ptr; - from_zval_write_sockaddr_un(container, (char*)*sockaddr_ptr, ctx); (*sockaddr_ptr)->sa_family = AF_UNIX; - - /* calculating length is more complicated here. Giving the size of - * struct sockaddr_un here and relying on the nul termination of - * sun_path does not work for paths in the abstract namespace. Note - * that we always assume the path is not empty and nul terminated */ - *sockaddr_len = offsetof(struct sockaddr_un, sun_path) + - (sock_un->sun_path[0] == '\0' - ? (1 + strlen(&sock_un->sun_path[1])) - : strlen(sock_un->sun_path)); - } else { - *sockaddr_len = sizeof(struct sockaddr_un); } break; @@ -816,11 +792,9 @@ static void to_zval_read_sockaddr_aux(const char *sockaddr_c, zval *zv, res_cont to_zval_read_sockaddr_in(sockaddr_c, zv, ctx); break; -#if HAVE_IPV6 case AF_INET6: to_zval_read_sockaddr_in6(sockaddr_c, zv, ctx); break; -#endif /* HAVE_IPV6 */ case AF_UNIX: to_zval_read_sockaddr_un(sockaddr_c, zv, ctx); @@ -889,14 +863,7 @@ static void from_zval_write_control(const zval *arr, } if (entry->calc_space) { - zval **data_elem; - /* arr must be an array at this point */ - if (zend_hash_find(Z_ARRVAL_P(arr), "data", sizeof("data"), - (void**)&data_elem) == FAILURE) { - do_from_zval_err(ctx, "cmsghdr should have a 'data' element here"); - return; - } - data_len = entry->calc_space(*data_elem, ctx); + data_len = entry->calc_space(arr, ctx); if (ctx->err.has_error) { return; } @@ -1316,7 +1283,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context } /* CONVERSIONS for struct in6_pktinfo */ -#if defined(IPV6_PKTINFO) && HAVE_IPV6 +#ifdef IPV6_PKTINFO static const field_descriptor descriptors_in6_pktinfo[] = { {"addr", sizeof("addr"), 1, offsetof(struct in6_pktinfo, ipi6_addr), from_zval_write_sin6_addr, to_zval_read_sin6_addr}, {"ifindex", sizeof("ifindex"), 1, offsetof(struct in6_pktinfo, ipi6_ifindex), from_zval_write_ifindex, to_zval_read_unsigned}, @@ -1397,7 +1364,7 @@ static void from_zval_write_fd_array_aux(zval **elem, unsigned i, void **args, s return; } - if (php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&iarr[i - 1], + if (php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&iarr[i], REPORT_ERRORS) == FAILURE) { do_from_zval_err(ctx, "cast stream to file descriptor failed"); return; diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index d9a819073654..50b43ec38a51 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -43,7 +43,7 @@ inline ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) { DWORD recvd = 0, bytesReturned; - + if (WSARecvMsg == NULL) { int res = WSAIoctl((SOCKET) sockfd, SIO_GET_EXTENSION_FUNCTION_POINTER, &WSARecvMsg_GUID, sizeof(WSARecvMsg_GUID), @@ -105,17 +105,17 @@ static void init_ancillary_registry(void) zend_hash_update(&ancillary_registry.ht, (char*)&key, sizeof(key), \ (void*)&entry, sizeof(entry), NULL) -#if defined(IPV6_PKTINFO) && HAVE_IPV6 +#ifdef IPV6_PKTINFO PUT_ENTRY(sizeof(struct in6_pktinfo), 0, 0, from_zval_write_in6_pktinfo, to_zval_read_in6_pktinfo, IPPROTO_IPV6, IPV6_PKTINFO); #endif -#if defined(IPV6_HOPLIMIT) && HAVE_IPV6 +#ifdef IPV6_HOPLIMIT PUT_ENTRY(sizeof(int), 0, 0, from_zval_write_int, to_zval_read_int, IPPROTO_IPV6, IPV6_HOPLIMIT); #endif -#if defined(IPV6_TCLASS) && HAVE_IPV6 +#ifdef IPV6_TCLASS PUT_ENTRY(sizeof(int), 0, 0, from_zval_write_int, to_zval_read_int, IPPROTO_IPV6, IPV6_TCLASS); #endif @@ -310,7 +310,6 @@ PHP_FUNCTION(socket_cmsg_space) RETURN_LONG((long)CMSG_SPACE(entry->size + n * entry->var_el_size)); } -#if HAVE_IPV6 int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval **arg4 TSRMLS_DC) { struct err_s err = {0}; @@ -402,16 +401,15 @@ int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, return res == 0 ? SUCCESS : FAILURE; } -#endif /* HAVE_IPV6 */ void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS) { /* IPv6 ancillary data */ -#if defined(IPV6_RECVPKTINFO) && HAVE_IPV6 +#ifdef IPV6_RECVPKTINFO REGISTER_LONG_CONSTANT("IPV6_RECVPKTINFO", IPV6_RECVPKTINFO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IPV6_PKTINFO", IPV6_PKTINFO, CONST_CS | CONST_PERSISTENT); #endif -#if defined(IPV6_RECVHOPLIMIT) && HAVE_IPV6 +#ifdef IPV6_RECVHOPLIMIT REGISTER_LONG_CONSTANT("IPV6_RECVHOPLIMIT", IPV6_RECVHOPLIMIT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IPV6_HOPLIMIT", IPV6_HOPLIMIT, CONST_CS | CONST_PERSISTENT); #endif @@ -420,7 +418,7 @@ void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS) REGISTER_LONG_CONSTANT("IPV6_RECVHOPOPTS", IPV6_RECVHOPOPTS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IPV6_RECVDSTOPTS", IPV6_RECVDSTOPTS, CONST_CS | CONST_PERSISTENT); */ -#if defined(IPV6_RECVTCLASS) && HAVE_IPV6 +#ifdef IPV6_RECVTCLASS REGISTER_LONG_CONSTANT("IPV6_RECVTCLASS", IPV6_RECVTCLASS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IPV6_TCLASS", IPV6_TCLASS, CONST_CS | CONST_PERSISTENT); #endif diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 4a2a41b5fd83..f305fa07d8e2 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -64,8 +64,6 @@ # endif #endif -#include - #include "sockaddr_conv.h" #include "multicast.h" #include "sendrecvmsg.h" @@ -346,7 +344,7 @@ const zend_function_entry sockets_functions[] = { PHP_FE(socket_recvmsg, arginfo_socket_recvmsg) PHP_FE(socket_cmsg_space, arginfo_socket_cmsg_space) - /* for downwards compatibility */ + /* for downwards compatability */ PHP_FALIAS(socket_getopt, socket_get_option, arginfo_socket_get_option) PHP_FALIAS(socket_setopt, socket_set_option, arginfo_socket_set_option) @@ -681,9 +679,6 @@ static PHP_MINIT_FUNCTION(sockets) REGISTER_LONG_CONSTANT("SO_FAMILY", SO_FAMILY, CONST_CS | CONST_PERSISTENT); #endif REGISTER_LONG_CONSTANT("SO_ERROR", SO_ERROR, CONST_CS | CONST_PERSISTENT); -#ifdef SO_BINDTODEVICE - REGISTER_LONG_CONSTANT("SO_BINDTODEVICE", SO_BINDTODEVICE, CONST_CS | CONST_PERSISTENT); -#endif REGISTER_LONG_CONSTANT("SOL_SOCKET", SOL_SOCKET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOMAXCONN", SOMAXCONN, CONST_CS | CONST_PERSISTENT); #ifdef TCP_NODELAY @@ -1481,7 +1476,7 @@ PHP_FUNCTION(socket_strerror) PHP_FUNCTION(socket_bind) { zval *arg1; - php_sockaddr_storage sa_storage = {0}; + php_sockaddr_storage sa_storage; struct sockaddr *sock_type = (struct sockaddr*) &sa_storage; php_socket *php_sock; char *addr; @@ -1499,19 +1494,10 @@ PHP_FUNCTION(socket_bind) case AF_UNIX: { struct sockaddr_un *sa = (struct sockaddr_un *) sock_type; - + memset(sa, 0, sizeof(sa_storage)); sa->sun_family = AF_UNIX; - - if (addr_len >= sizeof(sa->sun_path)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Invalid path: too long (maximum size is %d)", - (int)sizeof(sa->sun_path) - 1); - RETURN_FALSE; - } - memcpy(&sa->sun_path, addr, addr_len); - - retval = bind(php_sock->bsd_socket, (struct sockaddr *) sa, - offsetof(struct sockaddr_un, sun_path) + addr_len); + snprintf(sa->sun_path, 108, "%s", addr); + retval = bind(php_sock->bsd_socket, (struct sockaddr *) sa, SUN_LEN(sa)); break; } @@ -1519,6 +1505,8 @@ PHP_FUNCTION(socket_bind) { struct sockaddr_in *sa = (struct sockaddr_in *) sock_type; + memset(sa, 0, sizeof(sa_storage)); /* Apparently, Mac OSX needs this */ + sa->sin_family = AF_INET; sa->sin_port = htons((unsigned short) port); @@ -1534,6 +1522,8 @@ PHP_FUNCTION(socket_bind) { struct sockaddr_in6 *sa = (struct sockaddr_in6 *) sock_type; + memset(sa, 0, sizeof(sa_storage)); /* Apparently, Mac OSX needs this */ + sa->sin6_family = AF_INET6; sa->sin6_port = htons((unsigned short) port); @@ -1673,8 +1663,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&s_un, (socklen_t *)&slen); if (retval < 0) { - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); efree(recv_buf); + PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); RETURN_FALSE; } @@ -1698,8 +1688,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen); if (retval < 0) { - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); efree(recv_buf); + PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); RETURN_FALSE; } @@ -1727,8 +1717,8 @@ PHP_FUNCTION(socket_recvfrom) retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen); if (retval < 0) { - PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); efree(recv_buf); + PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno); RETURN_FALSE; } @@ -1868,9 +1858,7 @@ PHP_FUNCTION(socket_get_option) } } } - } -#if HAVE_IPV6 - else if (level == IPPROTO_IPV6) { + } else if (level == IPPROTO_IPV6) { int ret = php_do_getsockopt_ipv6_rfc3542(php_sock, level, optname, return_value TSRMLS_CC); if (ret == SUCCESS) { return; @@ -1878,7 +1866,6 @@ PHP_FUNCTION(socket_get_option) RETURN_FALSE; } /* else continue */ } -#endif /* sol_socket options and general case */ switch(optname) { @@ -2048,18 +2035,6 @@ PHP_FUNCTION(socket_set_option) #endif break; } -#ifdef SO_BINDTODEVICE - case SO_BINDTODEVICE: { - if (Z_TYPE_PP(arg4) == IS_STRING) { - opt_ptr = Z_STRVAL_PP(arg4); - optlen = Z_STRLEN_PP(arg4); - } else { - opt_ptr = ""; - optlen = 0; - } - break; - } -#endif default: default_case: diff --git a/ext/sockets/tests/socket_abstract_path.phpt b/ext/sockets/tests/socket_abstract_path.phpt deleted file mode 100644 index 816e5c11bb48..000000000000 --- a/ext/sockets/tests/socket_abstract_path.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Support for paths in the abstract namespace (bind, connect) ---SKIPIF-- - ---FILE-- - [ "addr" => $path, ], - "iov" => ["test ", "thing", "\n"], -], 0); -var_dump($r); -checktimeout($conns, 500); - -if (!socket_recv($conns, $buf, 20, 0)) die("recv"); -print_r($buf); -?> ---EXPECTF-- -creating server socket -creating client socket -int(11) -test thing diff --git a/ext/sockets/tests/socket_abstract_path_sendmsg.phpt b/ext/sockets/tests/socket_abstract_path_sendmsg.phpt deleted file mode 100644 index 5a9275a26b12..000000000000 --- a/ext/sockets/tests/socket_abstract_path_sendmsg.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Support for paths in the abstract namespace (bind, sendmsg, recvmsg) ---SKIPIF-- - ---FILE-- - [ "path" => $path], - "iov" => ["test ", "thing", "\n"], -], 0); -var_dump($r); -checktimeout($s, 500); - -if (!socket_recv($s, $buf, 20, 0)) die("recv"); -print_r($buf); -?> ---EXPECTF-- -creating send socket -creating receive socket -int(11) -test thing diff --git a/ext/sockets/tests/socket_cmsg_rights.phpt b/ext/sockets/tests/socket_cmsg_rights.phpt index 8c1734a56802..8290f03880c4 100644 --- a/ext/sockets/tests/socket_cmsg_rights.phpt +++ b/ext/sockets/tests/socket_cmsg_rights.phpt @@ -84,7 +84,6 @@ Array [0] => Resource id #%d [1] => Resource id #%d [2] => Resource id #%d - [3] => Resource id #%d ) ) diff --git a/ext/sockets/tests/socket_set_option_bindtodevice.phpt b/ext/sockets/tests/socket_set_option_bindtodevice.phpt deleted file mode 100644 index 05d718ce63fe..000000000000 --- a/ext/sockets/tests/socket_set_option_bindtodevice.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test if socket_set_option() works, option:SO_BINDTODEVICE ---DESCRIPTION-- --Bind to loopback 'lo' device (should exist) --Bind to unexisting device ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -bool(true) - -Warning: socket_set_option(): unable to set socket option [19]: No such device in %s on line %d -bool(false) ---CREDITS-- -Damjan Cvetko, foreach.org diff --git a/ext/spl/internal/cachingiterator.inc b/ext/spl/internal/cachingiterator.inc index 4d4bf8dbff87..33258ab954b6 100644 --- a/ext/spl/internal/cachingiterator.inc +++ b/ext/spl/internal/cachingiterator.inc @@ -23,7 +23,7 @@ * flag CALL_TOSTRING to do the conversion when the actual element * is being fetched. Otherwise the conversion would happen with the * already changed iterator. If you do not need this then it you should - * omit this flag because it costs unnecessary work and time. + * omit this flag because it costs unneccessary work and time. */ class CachingIterator implements OuterIterator { diff --git a/ext/spl/internal/iteratoriterator.inc b/ext/spl/internal/iteratoriterator.inc index 451d05da3201..37676e0537c1 100644 --- a/ext/spl/internal/iteratoriterator.inc +++ b/ext/spl/internal/iteratoriterator.inc @@ -17,7 +17,7 @@ * an Iterator. It is very important to understand that most classes that do * not implement Iterator have their reasone to. Most likely they do not allow * the full Iterator feature set. If so you need to provide techniques to - * prevent missuse. If you do not you must expect exceptions or fatal errors. + * prevent missuse. If you do not you must expect exceptions or fatal erros. * * It is also possible to derive the class and implement IteratorAggregate by * downcasting the instances returned in getIterator. See the following diff --git a/ext/spl/internal/multipleiterator.inc b/ext/spl/internal/multipleiterator.inc index 12df011ecc8b..2ed71d53a7e1 100644 --- a/ext/spl/internal/multipleiterator.inc +++ b/ext/spl/internal/multipleiterator.inc @@ -163,7 +163,7 @@ class MultipleIterator implements Iterator $retval = array(); foreach($this->iterators as $iter) { - if ($iter->valid()) + if ($it->valid()) { if ($this->flags & self::MIT_KEYS_ASSOC) { @@ -205,7 +205,7 @@ class MultipleIterator implements Iterator $retval = array(); foreach($this->iterators as $iter) { - if ($iter->valid()) + if ($it->valid()) { $retval[] = $iter->key(); } diff --git a/ext/spl/internal/splobjectstorage.inc b/ext/spl/internal/splobjectstorage.inc index ffc6c994889d..fa164066c70f 100644 --- a/ext/spl/internal/splobjectstorage.inc +++ b/ext/spl/internal/splobjectstorage.inc @@ -16,7 +16,7 @@ * @since PHP 5.1.2 * * This container allows to store objects uniquly without the need to compare - * them one by one. This is only possible internally. The code representation + * them one by one. This is only possible internally. The code represenation * here therefore has a complexity of O(n) while the actual implementation has * complexity O(1). */ diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 716990d80f02..35f4e5056bb4 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -743,17 +743,8 @@ PHP_FUNCTION(spl_autoload_functions) } add_next_index_string(tmp, alfi->func_ptr->common.function_name, 1); add_next_index_zval(return_value, tmp); - } else { - if (strncmp(alfi->func_ptr->common.function_name, "__lambda_func", sizeof("__lambda_func") - 1)) { - add_next_index_string(return_value, alfi->func_ptr->common.function_name, 1); - } else { - char *key; - uint len; - long dummy; - zend_hash_get_current_key_ex(SPL_G(autoload_functions), &key, &len, &dummy, 0, &function_pos); - add_next_index_stringl(return_value, key, len - 1, 1); - } - } + } else + add_next_index_string(return_value, alfi->func_ptr->common.function_name, 1); zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos); } @@ -800,7 +791,7 @@ PHPAPI void php_spl_object_hash(zval *obj, char *result TSRMLS_DC) /* {{{*/ hash_handle = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj); hash_handlers = SPL_G(hash_mask_handlers)^(intptr_t)Z_OBJ_HT_P(obj); - spprintf(&hex, 32, "%016lx%016lx", hash_handle, hash_handlers); + spprintf(&hex, 32, "%016x%016x", hash_handle, hash_handlers); strlcpy(result, hex, 33); efree(hex); diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index 28aa19def3af..4794f12443ea 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -20,6 +20,11 @@ #define PHP_SPL_H #include "php.h" +#if defined(PHP_WIN32) +# include "win32/php_stdint.h" +#elif defined(HAVE_STDINT_H) +# include +#endif #include #if 0 diff --git a/ext/spl/spl.php b/ext/spl/spl.php index 3638a5a2b778..fdffda36875b 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -260,7 +260,7 @@ class Exception /** The exception message */ protected $message; - /** The string representations as generated during construction */ + /** The string represenations as generated during construction */ private $string; /** The code passed to the constructor */ @@ -336,7 +336,7 @@ final public function getTraceAsString() { } - /** @return string representation of exception + /** @return string represenation of exception */ public function __toString() { diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index ca8076a95713..edeade375565 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -166,7 +166,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, /* {{{ spl_array_object_new_ex */ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig, int clone_orig TSRMLS_DC) { - zend_object_value retval = {0}; + zend_object_value retval; spl_array_object *intern; zval *tmp; zend_class_entry * parent = class_type; @@ -1646,7 +1646,7 @@ SPL_METHOD(Array, getChildren) return; } if (instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) { - RETURN_ZVAL(*entry, 1, 0); + RETURN_ZVAL(*entry, 0, 0); } } @@ -1766,7 +1766,7 @@ SPL_METHOD(Array, unserialize) ++p; if (*p!='m') { - if (*p!='a' && *p!='O' && *p!='C' && *p!='r') { + if (*p!='a' && *p!='O' && *p!='C') { goto outexcept; } intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1a417d0f5850..cf653f6899b7 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -710,12 +710,6 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, long ctor_fla } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (intern->_path) { - /* object is alreay initialized */ - zend_restore_error_handling(&error_handling TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized"); - return; - } intern->flags = flags; #ifdef HAVE_GLOB if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) { @@ -1510,7 +1504,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) Returns an iterator for the current entry if it is a directory */ SPL_METHOD(RecursiveDirectoryIterator, getChildren) { - zval *zpath, *zflags; + zval zpath, zflags; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_filesystem_object *subdir; char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; @@ -1524,13 +1518,11 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) if (SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { RETURN_STRINGL(intern->file_name, intern->file_name_len, 1); } else { - MAKE_STD_ZVAL(zflags); - MAKE_STD_ZVAL(zpath); - ZVAL_LONG(zflags, intern->flags); - ZVAL_STRINGL(zpath, intern->file_name, intern->file_name_len, 1); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, zpath, zflags TSRMLS_CC); - zval_ptr_dtor(&zpath); - zval_ptr_dtor(&zflags); + INIT_PZVAL(&zflags); + INIT_PZVAL(&zpath); + ZVAL_LONG(&zflags, intern->flags); + ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len, 0); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, &zpath, &zflags TSRMLS_CC); subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC); if (subdir) { diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 273bc7506aa7..aa462dfd7646 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -368,7 +368,7 @@ zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object static zend_object_value spl_dllist_object_new_ex(zend_class_entry *class_type, spl_dllist_object **obj, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */ { - zend_object_value retval = {0}; + zend_object_value retval; spl_dllist_object *intern; zend_class_entry *parent = class_type; int inherited = 0; diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 30532756cb6d..fcb4d20a6396 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -117,7 +117,6 @@ typedef struct _spl_recursive_it_object { zend_function *nextElement; zend_class_entry *ce; smart_str prefix[6]; - smart_str postfix[1]; } spl_recursive_it_object; typedef struct _spl_recursive_it_iterator { @@ -887,8 +886,6 @@ static void spl_RecursiveIteratorIterator_free_storage(void *_object TSRMLS_DC) smart_str_free(&object->prefix[4]); smart_str_free(&object->prefix[5]); - smart_str_free(&object->postfix[0]); - efree(object); } /* }}} */ @@ -909,8 +906,6 @@ static zend_object_value spl_RecursiveIteratorIterator_new_ex(zend_class_entry * smart_str_appendl(&intern->prefix[3], "|-", 2); smart_str_appendl(&intern->prefix[4], "\\-", 2); smart_str_appendl(&intern->prefix[5], "", 0); - - smart_str_appendl(&intern->postfix[0], "", 0); } zend_object_std_init(&intern->std, class_type TSRMLS_CC); @@ -1018,19 +1013,19 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object * obje zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); if (data && *data) { RETVAL_ZVAL(*data, 1, 0); - if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); - ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1); - } else { - convert_to_string(return_value); - } + } + if (Z_TYPE_P(return_value) == IS_ARRAY) { + zval_dtor(return_value); + ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1); + } else { + convert_to_string(return_value); } zend_restore_error_handling(&error_handling TSRMLS_CC); } static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object * object, zval * return_value TSRMLS_DC) { - RETVAL_STRINGL(object->postfix[0].c, object->postfix[0].len, 1); + RETVAL_STRINGL("", 0, 1); } /* {{{ proto void RecursiveTreeIterator::__construct(RecursiveIterator|IteratorAggregate it [, int flags = RTIT_BYPASS_KEY [, int cit_flags = CIT_CATCH_GET_CHILD [, mode = RIT_SELF_FIRST ]]]) throws InvalidArgumentException @@ -1073,22 +1068,6 @@ SPL_METHOD(RecursiveTreeIterator, getPrefix) spl_recursive_tree_iterator_get_prefix(object, return_value TSRMLS_CC); } /* }}} */ -/* {{{ proto void RecursiveTreeIterator::setPostfix(string prefix) - Sets postfix as used in getPostfix() */ -SPL_METHOD(RecursiveTreeIterator, setPostfix) -{ - spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char* postfix; - int postfix_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &postfix, &postfix_len) == FAILURE) { - return; - } - - smart_str_free(&object->postfix[0]); - smart_str_appendl(&object->postfix[0], postfix, postfix_len); -} /* }}} */ - /* {{{ proto string RecursiveTreeIterator::getEntry() Returns the string presentation built for current element */ SPL_METHOD(RecursiveTreeIterator, getEntry) @@ -1140,15 +1119,8 @@ SPL_METHOD(RecursiveTreeIterator, current) } } - INIT_ZVAL(prefix); - INIT_ZVAL(entry); spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC); spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC); - if (Z_TYPE(entry) != IS_STRING) { - zval_dtor(&prefix); - zval_dtor(&entry); - RETURN_NULL(); - } spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC); str_len = Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix); @@ -1256,7 +1228,6 @@ static const zend_function_entry spl_funcs_RecursiveTreeIterator[] = { SPL_ME(RecursiveTreeIterator, getPrefix, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveTreeIterator, setPrefixPart, arginfo_recursive_tree_it_setPrefixPart, ZEND_ACC_PUBLIC) SPL_ME(RecursiveTreeIterator, getEntry, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveTreeIterator, setPostfix, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveTreeIterator, getPostfix, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/spl/tests/SplFileInfo_getInode_basic.phpt b/ext/spl/tests/SplFileInfo_getInode_basic.phpt index 380b865cd2aa..902cbb31c6ff 100644 --- a/ext/spl/tests/SplFileInfo_getInode_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getInode_basic.phpt @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms getInode() == $result); ?> --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt index 53591f341775..e9b7beaa97fa 100644 --- a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt @@ -16,15 +16,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms getPerms() == 0100557); ?> --CLEAN-- --EXPECTF-- bool(true) diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt index 4402d6ca4c32..32705f0919b7 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_basic.phpt @@ -1,5 +1,5 @@ --TEST-- -SplFileObject::fgetcsv with alternative delimiter +SplFileObject::fgetcsv with alternative delimeter --FILE-- rewind( "invalid" ); -?> ---CLEAN-- - --EXPECTF-- Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/bug61697.phpt b/ext/spl/tests/bug61697.phpt index 064aaa2e2bf1..d95caef97859 100644 --- a/ext/spl/tests/bug61697.phpt +++ b/ext/spl/tests/bug61697.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #61697 (spl_autoload_functions returns lambda functions incorrectly) +--XFAIL-- +Bug #61697 not fixed yet --FILE-- __construct('/tmp'); -echo "Okey"; -?> ---EXPECTF-- -Warning: DirectoryIterator::__construct(): Directory object is already initialized in %sbug61828.php on line 3 -Okey diff --git a/ext/spl/tests/bug62672.phpt b/ext/spl/tests/bug62672.phpt deleted file mode 100644 index d0d6a62451a0..000000000000 --- a/ext/spl/tests/bug62672.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #62672 (Error on serialize of ArrayObject) ---FILE-- -_varA = $source; - } -} - -class ObjB extends ObjA -{ - private $_varB; - - public function __construct(ArrayObject $keys) - { - $this->_varB = $keys; - parent::__construct($keys->getIterator()); - } -} - -$obj = new ObjB(new ArrayObject()); - -var_dump($obj == unserialize(serialize($obj))); ---EXPECTF-- -bool(true) diff --git a/ext/spl/tests/bug63680.phpt b/ext/spl/tests/bug63680.phpt index 0b5c35dc746e..3a20c4bb1701 100644 --- a/ext/spl/tests/bug63680.phpt +++ b/ext/spl/tests/bug63680.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #63680 (Memleak in splfixedarray with cycle reference) ---INI-- -zend.enable_gc=1 --FILE-- head = $head ? : new Node('HEAD'); - } - - /** - * @return Node - */ - public function getHead() - { - return $this->head; - } - - /** - * @param mixed $uid - * @return Node|bool - */ - public function find($uid) - { - $iterator = $this->getIterator(); - - /** @var Node $node */ - foreach($iterator as $node) { - if($node->getUid() === $uid) { - return $node; - } - } - - return false; - } - - /** - * @param mixed $uid - * @return \SplStack - */ - public function & findAll($uid) - { - $result = new \SplStack(); - - /** @var Node $node */ - foreach($this->getIterator() as $node) { - if($node->getUid() == $uid) { - $result->push($node); - } - } - - return $result; - } - - /** - * @return \RecursiveIteratorIterator - */ - public function getIterator() - { - return new \RecursiveIteratorIterator( - $this->head->getChildren(), - \RecursiveIteratorIterator::SELF_FIRST - ); - } -} - -class Node extends \RecursiveArrayIterator implements \Countable -{ - /** - * @var array - */ - protected $children = []; - - /** - * @var Node - */ - protected $parent; - - /** - * @var mixed - */ - protected $data; - - /** - * @var mixed - */ - protected $uid; - - /** - * @var int - */ - protected $index = 0; - - /** - * @var bool - */ - protected $assureUnique; - - /** - * @param mixed $data - * @param mixed $uid - * @param Node $parent - * @param bool $assureUnique - */ - public function __construct($data, $uid = null, Node $parent = null, $assureUnique = false) - { - if(null !== $parent) { - $this->parent = $parent; - } - - $this->data = $data; - $this->uid = $uid ? : uniqid(sha1(serialize($data)), true); - $this->assureUnique = $assureUnique; - } - - /** - * @param mixed $uid - */ - public function setUid($uid) - { - $this->uid = $uid; - } - - /** - * @return mixed - */ - public function getUid() - { - return $this->uid; - } - - /** - * @param Node $child - */ - public function addChild(Node $child) - { - $child->setParent($this); - $this->children[] = $child; - } - - /** - * @param array $children - */ - public function setChildren(array $children) - { - $this->children = $children; - } - - /** - * @return array - */ - public function getChildrenArray() - { - return $this->children; - } - - /** - * @param mixed $data - */ - public function setData($data) - { - $this->data = $data; - } - - /** - * @return mixed - */ - public function getData() - { - return $this->data; - } - - /** - * @param Node $parent - * @throws \RuntimeException - */ - public function setParent(Node $parent) - { - if(true === $this->assureUnique && !self::checkUnique($parent, $this->uid)) { - throw new \RuntimeException("Node uid is not unique in assigned node tree"); - } - - $this->parent = $parent; - } - - /** - * @param Node $node - * @param mixed $uid - * @return bool - */ - protected static function checkUnique(Node $node, $uid) - { - $headNode = $node; - do { - $headNode = $node; - } while($node = $node->getParent()); - - $tree = new Tree($headNode); - - return !$tree->find($uid); - } - - /** - * @return \IJsonRPC\Helpers\Tree\Node - */ - public function getParent() - { - return $this->parent; - } - - /** - * @return Node - */ - public function current() - { - return $this->children[$this->index]; - } - - /** - * @return scalar - */ - public function key() - { - return $this->index; - } - - /** - * @return void - */ - public function next() - { - ++$this->index; - } - - /** - * @return void - */ - public function rewind() - { - $this->index = 0; - } - - /** - * @return bool - */ - public function valid() - { - return array_key_exists($this->index, $this->children); - } - - /** - * @return int - */ - public function count() - { - return count($this->children); - } - - /** - * @return bool - */ - public function hasChildren() - { - return !empty($this->children); - } - - /** - * @return \RecursiveArrayIterator - */ - public function getChildren() - { - return new \RecursiveArrayIterator($this->children); - } -} - -$tree = new Tree(); -$node1 = new Node('value1', 1); -$tree->getHead()->addChild($node1); -$node2 = new Node('value2', 2); -$node1->addChild($node2); - -print_r($tree->findAll(2)->offsetGet(0)); ---EXPECTF-- -Node Object -( - [children:protected] => Array - ( - ) - - [parent:protected] => Node Object - ( - [children:protected] => Array - ( - [0] => Node Object - *RECURSION* - ) - - [parent:protected] => Node Object - ( - [children:protected] => Array - ( - [0] => Node Object - *RECURSION* - ) - - [parent:protected] => - [data:protected] => HEAD - [uid:protected] => %s - [index:protected] => 0 - [assureUnique:protected] => - [storage:ArrayIterator:private] => Array - ( - ) - - ) - - [data:protected] => value1 - [uid:protected] => 1 - [index:protected] => 1 - [assureUnique:protected] => - [storage:ArrayIterator:private] => Array - ( - ) - - ) - - [data:protected] => value2 - [uid:protected] => 2 - [index:protected] => 0 - [assureUnique:protected] => - [storage:ArrayIterator:private] => Array - ( - ) - -) diff --git a/ext/spl/tests/iterator_031.phpt b/ext/spl/tests/iterator_031.phpt index 8bd3ca7c54cf..40342f4bb47e 100644 --- a/ext/spl/tests/iterator_031.phpt +++ b/ext/spl/tests/iterator_031.phpt @@ -1,5 +1,5 @@ --TEST-- -SPL: AppendIterator::append() rewinds when necessary +SPL: AppendIterator::append() rewinds when neccessary --FILE-- array( - "a", - 1, - ), - "a" => array( - 2, - "b", - 3 => array( - 4, - "c", - ), - "3" => array( - 4, - "c", - ), - ), -); - -$it = new RecursiveArrayIterator($arr); -$it = new RecursiveTreeIterator($it); - -echo "----\n"; -echo $it->getPostfix(); -echo "\n\n"; - -echo "----\n"; -$it->setPostfix("POSTFIX"); -echo $it->getPostfix(); -echo "\n\n"; - -echo "----\n"; -foreach($it as $k => $v) { - echo "[$k] => $v\n"; -} - -echo "----\n"; -$it->setPostfix(""); -echo $it->getPostfix(); -echo "\n\n"; - -echo "----\n"; -foreach($it as $k => $v) { - echo "[$k] => $v\n"; -} - - - -?> -===DONE=== ---EXPECTF-- ----- - - ----- -POSTFIX - ----- -[0] => |-ArrayPOSTFIX -[0] => | |-aPOSTFIX -[1] => | \-1POSTFIX -[a] => \-ArrayPOSTFIX -[0] => |-2POSTFIX -[1] => |-bPOSTFIX -[3] => \-ArrayPOSTFIX -[0] => |-4POSTFIX -[1] => \-cPOSTFIX ----- - - ----- -[0] => |-Array -[0] => | |-a -[1] => | \-1 -[a] => \-Array -[0] => |-2 -[1] => |-b -[3] => \-Array -[0] => |-4 -[1] => \-c -===DONE=== diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index d56f48f8966a..97896f81542c 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -43,8 +43,8 @@ var_dump(iterator_apply($it, 'test')); echo "===ERRORS===\n"; var_dump(iterator_apply($it, 'test', 1)); -var_dump(iterator_apply($it, 'non_existing_function')); -var_dump(iterator_apply($it, 'non_existing_function', NULL, 2)); +var_dump(iterator_apply($it, 'non_existing_functon')); +var_dump(iterator_apply($it, 'non_existing_functon', NULL, 2)); ?> ===DONE=== @@ -77,7 +77,7 @@ int(4) Error: Argument 3 passed to iterator_apply() must be of the type array, integer given Error: iterator_apply() expects parameter 3 to be array, integer given NULL -Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name +Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_functon' not found or invalid function name NULL Error: iterator_apply() expects at most 3 parameters, 4 given NULL diff --git a/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt b/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt index 076c68771239..659ffb4bc065 100644 --- a/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt +++ b/ext/spl/tests/spl_priorityqeue_insert_two_params_error.phpt @@ -1,5 +1,5 @@ --TEST-- -SPL: priorityQueue parameter test on insert method +SPL: priorityQueue paramter test on insert method --CREDITS-- Sean Burlington www.practicalweb.co.uk TestFest London May 2009 diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4 index 6959a6f916f3..1365def03316 100644 --- a/ext/sqlite3/config0.m4 +++ b/ext/sqlite3/config0.m4 @@ -3,7 +3,7 @@ dnl config.m4 for extension sqlite3 dnl vim:et:ts=2:sw=2 PHP_ARG_WITH(sqlite3, whether to enable the SQLite3 extension, -[ --without-sqlite3[=DIR] Do not include SQLite3 support. DIR is the prefix to +[ --without-sqlite3[=DIR] Do not include SQLite3 support. DIR is the prefix to SQLite3 installation directory.], yes) if test $PHP_SQLITE3 != "no"; then diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c index 6d013b6751bf..f3c06d49b1b0 100644 --- a/ext/sqlite3/libsqlite/sqlite3.c +++ b/ext/sqlite3/libsqlite/sqlite3.c @@ -361,7 +361,7 @@ ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. ** 0 means mutexes are permanently disable and the library is never ** threadsafe. 1 means the library is serialized which is the highest -** level of threadsafety. 2 means the library is multithreaded - multiple +** level of threadsafety. 2 means the libary is multithreaded - multiple ** threads can use SQLite as long as no two threads try to use the same ** database connection at the same time. ** @@ -11864,7 +11864,7 @@ SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8); ** ************************************************************************* ** -** This file contains definitions of global variables and constants. +** This file contains definitions of global variables and contants. */ /* An array to map all upper-case characters into their corresponding @@ -12731,7 +12731,7 @@ struct VdbeFunc { */ struct sqlite3_context { FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ - VdbeFunc *pVdbeFunc; /* Auxiliary data, if created. */ + VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ Mem s; /* The return value is stored here */ Mem *pMem; /* Memory cell used to store aggregate context */ int isError; /* Error code returned by the function. */ @@ -16130,7 +16130,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){ ** 1. All memory allocations sizes are rounded up to a power of 2. ** ** 2. If two adjacent free blocks are the halves of a larger block, -** then the two blocks are coalesced into the single larger block. +** then the two blocks are coalesed into the single larger block. ** ** 3. New memory is allocated from the first available free block. ** @@ -19267,7 +19267,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( } if( xtype==etGENERIC && precision>0 ) precision--; #if 0 - /* Rounding works like BSD when the constant 0.4999 is used. Weird! */ + /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); #else /* It makes more sense to use 0.5 */ @@ -20926,7 +20926,7 @@ SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 en /* store the result */ *pResult = result; - /* return true if number and no extra non-whitespace characters after */ + /* return true if number and no extra non-whitespace chracters after */ return z>=zEnd && nDigits>0 && eValid; #else return !sqlite3Atoi64(z, pResult, length, enc); @@ -23962,7 +23962,7 @@ static int os2Delete( } /* -** Check the existence and status of a file. +** Check the existance and status of a file. */ static int os2Access( sqlite3_vfs *pVfs, /* Not used on os2 */ @@ -26315,7 +26315,7 @@ static int nolockClose(sqlite3_file *id) { /****************************************************************************** ************************* Begin dot-file Locking ****************************** ** -** The dotfile locking implementation uses the existence of separate lock +** The dotfile locking implementation uses the existance of separate lock ** files in order to control access to the database. This works on just ** about every filesystem imaginable. But there are serious downsides: ** @@ -26330,7 +26330,7 @@ static int nolockClose(sqlite3_file *id) { ** ** Dotfile locking works by creating a file in the same directory as the ** database and with the same name but with a ".lock" extension added. -** The existence of a lock file implies an EXCLUSIVE lock. All other lock +** The existance of a lock file implies an EXCLUSIVE lock. All other lock ** types (SHARED, RESERVED, PENDING) are mapped into EXCLUSIVE. */ @@ -29637,7 +29637,7 @@ static int unixDelete( } /* -** Test the existence of or access permissions of file zPath. The +** Test the existance of or access permissions of file zPath. The ** test performed depends on the value of flags: ** ** SQLITE_ACCESS_EXISTS: Return 1 if the file exists @@ -30074,7 +30074,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will ** force proxy locking to be used for every database file opened, and 0 ** will force automatic proxy locking to be disabled for all database -** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or +** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or ** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING). */ @@ -33788,7 +33788,7 @@ static int winDelete( } /* -** Check the existence and status of a file. +** Check the existance and status of a file. */ static int winAccess( sqlite3_vfs *pVfs, /* Not used on win32 */ @@ -34345,7 +34345,7 @@ SQLITE_API int sqlite3_os_end(void){ /* ** A bitmap is an instance of the following structure. ** -** This bitmap records the existence of zero or more bits +** This bitmap records the existance of zero or more bits ** with values between 1 and iSize, inclusive. ** ** There are three possible representations of the bitmap. @@ -35828,7 +35828,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurgeable){ int sz; /* Bytes of memory required to allocate the new cache */ /* - ** The separateCache variable is true if each PCache has its own private + ** The seperateCache variable is true if each PCache has its own private ** PGroup. In other words, separateCache is true for mode (1) where no ** mutexing is required. ** @@ -41734,7 +41734,7 @@ static void pagerUnlockIfUnused(Pager *pPager){ ** page is initialized to all zeros. ** ** If noContent is true, it means that we do not care about the contents -** of the page. This occurs in two separate scenarios: +** of the page. This occurs in two seperate scenarios: ** ** a) When reading a free-list leaf page from the database, and ** @@ -44929,7 +44929,7 @@ SQLITE_PRIVATE int sqlite3WalOpen( } /* -** Change the size to which the WAL file is truncated on each reset. +** Change the size to which the WAL file is trucated on each reset. */ SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){ if( pWal ) pWal->mxWalSize = iLimit; @@ -48700,7 +48700,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ }else if( gap+2<=top ){ /* Search the freelist looking for a free slot big enough to satisfy ** the request. The allocation is made from the first free slot in - ** the list that is large enough to accommodate it. + ** the list that is large enough to accomadate it. */ int pc, addr; for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){ @@ -50520,7 +50520,7 @@ SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){ /* ** This routine is called prior to sqlite3PagerCommit when a transaction -** is committed for an auto-vacuum database. +** is commited for an auto-vacuum database. ** ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages ** the database file should be truncated to during the commit process. @@ -52264,7 +52264,7 @@ SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ ** which in turn can make database access faster. ** ** If the "exact" parameter is not 0, and the page-number nearby exists -** anywhere on the free-list, then it is guaranteed to be returned. This +** anywhere on the free-list, then it is guarenteed to be returned. This ** is only used by auto-vacuum databases when allocating a new table. */ static int allocateBtreePage( @@ -58372,7 +58372,7 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){ ** by running with Valgrind. ** ** About the #ifdef SQLITE_OMIT_TRACE: Normally, this routine is never called -** unless p->nOp>0. This is because in the absence of SQLITE_OMIT_TRACE, +** unless p->nOp>0. This is because in the absense of SQLITE_OMIT_TRACE, ** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as ** a new VDBE is created. So we are free to set addr to p->nOp-1 without ** having to double-check to make sure that the result is non-negative. But @@ -59355,7 +59355,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ /* The complex case - There is a multi-file write-transaction active. ** This requires a master journal file to ensure the transaction is - ** committed atomically. + ** committed atomicly. */ #ifndef SQLITE_OMIT_DISKIO else{ @@ -59551,7 +59551,7 @@ static void invalidateCursorsOnModifiedBtrees(sqlite3 *db){ ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the -** statement transaction is committed. +** statement transaction is commtted. ** ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. ** Otherwise SQLITE_OK. @@ -60076,7 +60076,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){ ** the blob of data that it corresponds to. In a table record, all serial ** types are stored at the start of the record, and the blobs of data at ** the end. Hence these functions allow the caller to handle the -** serial-type and data blob separately. +** serial-type and data blob seperately. ** ** The following table describes the various storage classes for data: ** @@ -61383,7 +61383,7 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ } /* -** Return the auxiliary data pointer, if any, for the iArg'th argument to +** Return the auxilary data pointer, if any, for the iArg'th argument to ** the user-function defined by pCtx. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ @@ -61398,7 +61398,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ } /* -** Set the auxiliary data pointer and delete function, for the iArg'th +** Set the auxilary data pointer and delete function, for the iArg'th ** argument to the user-function defined by pCtx. Any previous value is ** deleted by calling the delete function specified when it was set. */ @@ -63408,7 +63408,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( } #endif - /* On any opcode with the "out2-prerelease" tag, free any + /* On any opcode with the "out2-prerelase" tag, free any ** external allocations out of mem[p2] and set mem[p2] to be ** an undefined integer. Opcodes will either fill in the integer ** value or convert mem[p2] to a different type. @@ -65590,7 +65590,7 @@ case OP_AutoCommit: { ** other process can start another write transaction while this transaction is ** underway. Starting a write transaction also creates a rollback journal. A ** write transaction must be started before any changes can be made to the -** database. If P2 is 2 or greater than an EXCLUSIVE lock is also obtained +** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained ** on the file. ** ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is @@ -69899,7 +69899,7 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){ /* ** Walk an expression tree. Invoke the callback once for each node -** of the expression, while descending. (In other words, the callback +** of the expression, while decending. (In other words, the callback ** is invoked before visiting children.) ** ** The return value from the callback should be one of the WRC_* @@ -70936,7 +70936,7 @@ static int resolveOrderGroupBy( } /* -** Resolve names in the SELECT statement p and all of its descendants. +** Resolve names in the SELECT statement p and all of its descendents. */ static int resolveSelectStep(Walker *pWalker, Select *p){ NameContext *pOuterNC; /* Context that contains this SELECT */ @@ -71244,7 +71244,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelectNames( ** affinity of that column is returned. Otherwise, 0x00 is returned, ** indicating no affinity for the expression. ** -** i.e. the WHERE clause expressions in the following statements all +** i.e. the WHERE clause expresssions in the following statements all ** have an affinity: ** ** CREATE TABLE t1(a); @@ -72784,7 +72784,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ ** ** If rMayHaveNull is zero, that means that the subquery is being used ** for membership testing only. There is no need to initialize any -** registers to indicate the presence or absence of NULLs on the RHS. +** registers to indicate the presense or absence of NULLs on the RHS. ** ** For a SELECT or EXISTS operator, return the register that holds the ** result. For IN operators or if an error occurs, the return value is 0. @@ -74260,13 +74260,13 @@ static int evalConstExpr(Walker *pWalker, Expr *pExpr){ /* ** Preevaluate constant subexpressions within pExpr and store the -** results in registers. Modify pExpr so that the constant subexpressions +** results in registers. Modify pExpr so that the constant subexpresions ** are TK_REGISTER opcodes that refer to the precomputed values. ** ** This routine is a no-op if the jump to the cookie-check code has ** already occur. Since the cookie-check jump is generated prior to ** any other serious processing, this check ensures that there is no -** way to accidentally bypass the constant initializations. +** way to accidently bypass the constant initializations. ** ** This routine is also a no-op if the SQLITE_FactorOutConst optimization ** is disabled via the sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) @@ -74392,7 +74392,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int int r1, r2; assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); - if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ + if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */ if( NEVER(pExpr==0) ) return; /* No way this can happen */ op = pExpr->op; switch( op ){ @@ -74512,7 +74512,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int int r1, r2; assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); - if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ + if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */ if( pExpr==0 ) return; /* The value of pExpr->op and op are related as follows: @@ -75132,7 +75132,7 @@ static void renameParentFunc( ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER ** statement. The second is a table name. The table name in the CREATE ** TRIGGER statement is replaced with the third argument and the result -** returned. This is analogous to renameTableFunc() above, except for CREATE +** returned. This is analagous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ static void renameTriggerFunc( @@ -79452,7 +79452,7 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, /* Drop all SQLITE_MASTER table and index entries that refer to the ** table. The program name loops through the master table and deletes ** every row that refers to a table of the same name as the one being - ** dropped. Triggers are handled separately because a trigger can be + ** dropped. Triggers are handled seperately because a trigger can be ** created in the temp database that refers to a table in another ** database. */ @@ -82374,7 +82374,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ ** ** If p1 is negative, then we begin abs(p1) from the end of x[]. ** -** If p2 is negative, return the p2 characters preceding p1. +** If p2 is negative, return the p2 characters preceeding p1. */ static void substrFunc( sqlite3_context *context, @@ -83172,7 +83172,7 @@ static void zeroblobFunc( /* ** The replace() function. Three arguments are all strings: call ** them A, B, and C. The result is also a string which is derived -** from A by replacing every occurrence of B with C. The match +** from A by replacing every occurance of B with C. The match ** must be exact. Collating sequences are not used. */ static void replaceFunc( @@ -86752,7 +86752,7 @@ static int xferOptimization( } #endif #ifndef SQLITE_OMIT_FOREIGN_KEY - /* Disallow the transfer optimization if the destination table constrains + /* Disallow the transfer optimization if the destination table constains ** any foreign key constraints. This is more restrictive than necessary. ** But the main beneficiary of the transfer optimization is the VACUUM ** command, and the VACUUM command disables foreign key constraints. So @@ -90574,7 +90574,7 @@ SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3 *db, Select *p){ } /* -** Given 1 to 3 identifiers preceding the JOIN keyword, determine the +** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the ** type of join. Return an integer constant that expresses that type ** in terms of the following bit values: ** @@ -91892,7 +91892,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ /* ** "LIMIT -1" always shows all rows. There is some - ** controversy about what the correct behavior should be. + ** contraversy about what the correct behavior should be. ** The current implementation interprets "LIMIT 0" to mean ** no rows. */ @@ -93175,7 +93175,7 @@ static int flattenSubquery( pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, - ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET + ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET ** because they could be computed at compile-time. But when LIMIT and OFFSET ** became arbitrary expressions, we were forced to add restrictions (13) ** and (14). */ @@ -93544,7 +93544,7 @@ static u8 minMaxQuery(Select *p){ /* ** The select statement passed as the first argument is an aggregate query. -** The second argument is the associated aggregate-info object. This +** The second argment is the associated aggregate-info object. This ** function tests if the SELECT is of the form: ** ** SELECT count(*) FROM @@ -93617,7 +93617,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF ** without worrying about messing up the presistent representation ** of the view. ** -** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword +** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword ** on joins and the ON and USING clause of joins. ** ** (4) Scan the list of columns in the result set (pEList) looking @@ -94252,7 +94252,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pSub==0 || pItem->isPopulated ) continue; /* Increment Parse.nHeight by the height of the largest expression - ** tree referred to by this, the parent select. The child select + ** tree refered to by this, the parent select. The child select ** may contain expression trees of at most ** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit ** more conservative than necessary, but much easier than enforcing @@ -94472,7 +94472,7 @@ SQLITE_PRIVATE int sqlite3Select( */ if( pGroupBy ){ KeyInfo *pKeyInfo; /* Keying information for the group by clause */ - int j1; /* A-vs-B comparison jump */ + int j1; /* A-vs-B comparision jump */ int addrOutputRow; /* Start of subroutine that outputs a result row */ int regOutputRow; /* Return address register for output subroutine */ int addrSetAbort; /* Set the abort flag and return */ @@ -96115,7 +96115,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( /* ** This is called to code the required FOR EACH ROW triggers for an operation ** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) -** is given by the op parameter. The tr_tm parameter determines whether the +** is given by the op paramater. The tr_tm parameter determines whether the ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then ** parameter pChanges is passed the list of columns being modified. ** @@ -99313,7 +99313,7 @@ static void exprAnalyzeOrTerm( } if( (chngToIN & getMask(pMaskSet, pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the - ** chngToIN set but t1 is not. This term will be either preceded + ** chngToIN set but t1 is not. This term will be either preceeded ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); @@ -102953,7 +102953,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** (1) The table must not depend on other tables that have not ** yet run. ** - ** (2) A full-table-scan plan cannot supersede indexed plan unless + ** (2) A full-table-scan plan cannot supercede indexed plan unless ** the full-table-scan is an "optimal" plan as defined above. ** ** (3) All tables have an INDEXED BY clause or this table lacks an @@ -107619,7 +107619,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** a statement. ** ** (4) CREATE The keyword CREATE has been seen at the beginning of a -** statement, possibly preceded by EXPLAIN and/or followed by +** statement, possibly preceeded by EXPLAIN and/or followed by ** TEMP or TEMPORARY ** ** (5) TRIGGER We are in the middle of a trigger definition that must be @@ -108525,7 +108525,7 @@ static int binCollFunc( /* ** Another built-in collating sequence: NOCASE. ** -** This collating sequence is intended to be used for "case independent +** This collating sequence is intended to be used for "case independant ** comparison". SQLite's knowledge of upper and lower case equivalents ** extends only to the 26 characters used in the English language. ** @@ -116368,7 +116368,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats( ** of the current row. ** ** More specifically, the returned buffer contains 1 varint for each -** occurrence of the phrase in the column, stored using the normal (delta+2) +** occurence of the phrase in the column, stored using the normal (delta+2) ** compression and is terminated by either an 0x01 or 0x00 byte. For example, ** if the requested column contains "a b X c d X X" and the position-list ** for 'X' is requested, the buffer returned may contain: @@ -118508,7 +118508,7 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that precede the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo @@ -123270,9 +123270,9 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ ** is the snippet with the highest score, where scores are calculated ** by adding: ** -** (a) +1 point for each occurrence of a matchable phrase in the snippet. +** (a) +1 point for each occurence of a matchable phrase in the snippet. ** -** (b) +1000 points for the first occurrence of each matchable phrase in +** (b) +1000 points for the first occurence of each matchable phrase in ** the snippet for which the corresponding mCovered bit is not set. ** ** The selected snippet parameters are stored in structure *pFragment before @@ -123373,7 +123373,7 @@ static int fts3StringAppend( } /* If there is insufficient space allocated at StrBuffer.z, use realloc() - ** to grow the buffer until so that it is big enough to accommodate the + ** to grow the buffer until so that it is big enough to accomadate the ** appended data. */ if( pStr->n+nAppend+1>=pStr->nAlloc ){ @@ -127688,7 +127688,7 @@ SQLITE_API int sqlite3_extension_init( ** * Implementations of the SQL scalar upper() and lower() functions ** for case mapping. ** -** * Integration of ICU and SQLite collation sequences. +** * Integration of ICU and SQLite collation seqences. ** ** * An implementation of the LIKE operator that uses ICU to ** provide case-independent matching. diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 6c65e02ee7f9..0e813b6dfdc8 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -23,7 +23,7 @@ #include -/* for backwards compatibility reasons */ +/* for backwards compatability reasons */ #ifndef SQLITE_OPEN_READONLY #define SQLITE_OPEN_READONLY 0x00000001 #endif diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 2aef0414aab6..df449d738023 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1409,7 +1409,7 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa /* }}} */ /* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type]) - Bind Parameter to a stmt variable. */ + Bind Paramater to a stmt variable. */ PHP_METHOD(sqlite3stmt, bindParam) { php_sqlite3_stmt *stmt_obj; diff --git a/ext/standard/array.c b/ext/standard/array.c index ae6e5d266fa2..cfe9be8552e6 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -352,7 +352,7 @@ PHP_FUNCTION(count) /* Numbers are always smaller than strings int this function as it * anyway doesn't make much sense to compare two different data types. - * This keeps it consistent and simple. + * This keeps it consistant and simple. * * This is not correct any more, depends on what compare_func is set to. */ @@ -830,7 +830,7 @@ PHP_FUNCTION(end) RETURN_FALSE; } - RETURN_ZVAL_FAST(*entry); + RETURN_ZVAL(*entry, 1, 0); } } /* }}} */ @@ -853,7 +853,7 @@ PHP_FUNCTION(prev) RETURN_FALSE; } - RETURN_ZVAL_FAST(*entry); + RETURN_ZVAL(*entry, 1, 0); } } /* }}} */ @@ -876,7 +876,7 @@ PHP_FUNCTION(next) RETURN_FALSE; } - RETURN_ZVAL_FAST(*entry); + RETURN_ZVAL(*entry, 1, 0); } } /* }}} */ @@ -899,7 +899,7 @@ PHP_FUNCTION(reset) RETURN_FALSE; } - RETURN_ZVAL_FAST(*entry); + RETURN_ZVAL(*entry, 1, 0); } } /* }}} */ @@ -918,8 +918,7 @@ PHP_FUNCTION(current) if (zend_hash_get_current_data(array, (void **) &entry) == FAILURE) { RETURN_FALSE; } - - RETURN_ZVAL_FAST(*entry); + RETURN_ZVAL(*entry, 1, 0); } /* }}} */ @@ -959,7 +958,7 @@ PHP_FUNCTION(min) RETVAL_NULL(); } else { if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 0, (void **) &result TSRMLS_CC) == SUCCESS) { - RETVAL_ZVAL_FAST(*result); + RETVAL_ZVAL(*result, 1, 0); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; @@ -979,7 +978,7 @@ PHP_FUNCTION(min) } } - RETVAL_ZVAL_FAST(*min); + RETVAL_ZVAL(*min, 1, 0); } if (args) { @@ -1010,7 +1009,7 @@ PHP_FUNCTION(max) RETVAL_NULL(); } else { if (zend_hash_minmax(Z_ARRVAL_PP(args[0]), php_array_data_compare, 1, (void **) &result TSRMLS_CC) == SUCCESS) { - RETVAL_ZVAL_FAST(*result); + RETVAL_ZVAL(*result, 1, 0); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element"); RETVAL_FALSE; @@ -1030,7 +1029,7 @@ PHP_FUNCTION(max) } } - RETVAL_ZVAL_FAST(*max); + RETVAL_ZVAL(*max, 1, 0); } if (args) { @@ -1042,7 +1041,7 @@ PHP_FUNCTION(max) static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */ { zval **args[3], /* Arguments to userland function */ - *retval_ptr = NULL, /* Return value - unused */ + *retval_ptr, /* Return value - unused */ *key=NULL; /* Entry key */ /* Set up known arguments */ @@ -1956,7 +1955,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack)); } zend_hash_get_current_data(Z_ARRVAL_P(stack), (void **)&val); - RETVAL_ZVAL_FAST(*val); + RETVAL_ZVAL(*val, 1, 0); /* Delete the first or last value */ zend_hash_get_current_key_ex(Z_ARRVAL_P(stack), &key, &key_len, &index, 0, NULL); @@ -2609,9 +2608,11 @@ PHP_FUNCTION(array_column) } else if (zkeyval && Z_TYPE_PP(zkeyval) == IS_LONG) { add_index_zval(return_value, Z_LVAL_PP(zkeyval), *zcolval); } else if (zkeyval && Z_TYPE_PP(zkeyval) == IS_OBJECT) { - SEPARATE_ZVAL(zkeyval); - convert_to_string(*zkeyval); - add_assoc_zval(return_value, Z_STRVAL_PP(zkeyval), *zcolval); + zval copyval; + ZVAL_ZVAL(©val, *zkeyval, 1, 0); + convert_to_string(©val); + add_assoc_zval(return_value, Z_STRVAL(copyval), *zcolval); + zval_dtor(©val); } else { add_next_index_zval(return_value, *zcolval); } @@ -2912,7 +2913,7 @@ static int zval_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ { zval **args[2]; - zval *retval_ptr = NULL; + zval *retval_ptr; args[0] = (zval **) a; args[1] = (zval **) b; @@ -3031,8 +3032,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; - zend_fcall_info *fci_key = NULL, *fci_data; - zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; + zend_fcall_info *fci_key, *fci_data; + zend_fcall_info_cache *fci_key_cache, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC); @@ -3449,8 +3450,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ char *param_spec; zend_fcall_info fci1, fci2; zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; - zend_fcall_info *fci_key = NULL, *fci_data; - zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache; + zend_fcall_info *fci_key, *fci_data; + zend_fcall_info_cache *fci_key_cache, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC); @@ -4018,7 +4019,7 @@ PHP_FUNCTION(array_rand) /* We can't use zend_hash_index_find() because the array may have string keys or gaps. */ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(input), &pos); - while (num_req && (key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &string_key_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTENT) { + while (num_req && (key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &string_key_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTANT) { randval = php_rand(TSRMLS_C); @@ -4054,6 +4055,7 @@ PHP_FUNCTION(array_sum) **entry, entry_n; HashPosition pos; + double dval; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { return; @@ -4071,7 +4073,17 @@ PHP_FUNCTION(array_sum) entry_n = **entry; zval_copy_ctor(&entry_n); convert_scalar_to_number(&entry_n TSRMLS_CC); - fast_add_function(return_value, return_value, &entry_n TSRMLS_CC); + + if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) { + dval = (double)Z_LVAL_P(return_value) + (double)Z_LVAL(entry_n); + if ( (double)LONG_MIN <= dval && dval <= (double)LONG_MAX ) { + Z_LVAL_P(return_value) += Z_LVAL(entry_n); + continue; + } + } + convert_to_double(return_value); + convert_to_double(&entry_n); + Z_DVAL_P(return_value) += Z_DVAL(entry_n); } } /* }}} */ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 3e5084e83764..9c91404eff05 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1789,8 +1789,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, num_decimal_places) - ZEND_ARG_INFO(0, dec_separator) - ZEND_ARG_INFO(0, thousands_separator) + ZEND_ARG_INFO(0, dec_seperator) + ZEND_ARG_INFO(0, thousands_seperator) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0) @@ -2679,7 +2679,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0) ZEND_ARG_INFO(0, variable_representation) - ZEND_ARG_INFO(1, consumed) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index ed773b851c33..1e1252f60a36 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -451,19 +451,6 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list a } /* }}} */ -static void browscap_zval_copy_ctor(zval **p) /* {{{ */ -{ - zval *new; - - ALLOC_ZVAL(new); - *new = **p; - - zval_copy_ctor(new); - - INIT_PZVAL(new); - *p = new; -} /* }}} */ - /* {{{ proto mixed get_browser([string browser_name [, bool return_array]]) Get information about the capabilities of a browser. If browser_name is omitted or null, HTTP_USER_AGENT is used. Returns an object by default; if return_array is true, returns an array. */ PHP_FUNCTION(get_browser) @@ -524,11 +511,11 @@ PHP_FUNCTION(get_browser) if (return_array) { array_init(return_value); - zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *)); + zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } else { object_init(return_value); - zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *)); + zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } while (zend_hash_find(Z_ARRVAL_PP(agent), "parent", sizeof("parent"), (void **) &z_agent_name) == SUCCESS) { @@ -537,10 +524,10 @@ PHP_FUNCTION(get_browser) } if (return_array) { - zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0); + zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0); } else { - zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0); + zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0); } } diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 2af2209f2bb5..fba423b19195 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -358,29 +358,7 @@ else AC_MSG_RESULT(no) fi -PHP_ENABLE_CHROOT_FUNC=no -case "$PHP_SAPI" in - embed) - PHP_ENABLE_CHROOT_FUNC=yes - ;; - - none) - for PROG in $PHP_BINARIES; do - case "$PROG" in - cgi|cli) - PHP_ENABLE_CHROOT_FUNC=yes - ;; - - *) - PHP_ENABLE_CHROOT_FUNC=no - break - ;; - esac - done - ;; -esac - -if test "$PHP_ENABLE_CHROOT_FUNC" = "yes"; then +if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function]) fi diff --git a/ext/standard/crypt_freesec.h b/ext/standard/crypt_freesec.h index 860462a2dd62..a87663d4feaa 100644 --- a/ext/standard/crypt_freesec.h +++ b/ext/standard/crypt_freesec.h @@ -4,13 +4,26 @@ #define _CRYPT_FREESEC_H #if PHP_WIN32 +# include "win32/php_stdint.h" # ifndef inline # define inline __inline # endif +#else +# include "php_config.h" +# if HAVE_INTTYPES_H +# include +# elif HAVE_STDINT_H +# include +# endif +# ifndef HAVE_UINT32_T +# if SIZEOF_INT == 4 +typedef unsigned int uint32_t; +# elif SIZEOF_LONG == 4 +typedef unsigned long int uint32_t; +# endif +# endif #endif -#include "php_stdint.h" - #define MD5_HASH_MAX_LEN 120 struct php_crypt_extended_data { diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index ccfa66bd60a8..d334e3d477d8 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -9,9 +9,15 @@ #include #ifdef PHP_WIN32 +# include "win32/php_stdint.h" # define __alignof__ __alignof # define alloca _alloca #else +# if HAVE_INTTYPES_H +# include +# elif HAVE_STDINT_H +# include +# endif # ifndef HAVE_ALIGNOF # include # define __alignof__(type) offsetof (struct { char c; type member;}, member) diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index ebabed9d24f4..095553213158 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -8,9 +8,15 @@ #include #include #ifdef PHP_WIN32 +# include "win32/php_stdint.h" # define __alignof__ __alignof # define alloca _alloca #else +# if HAVE_INTTYPES_H +# include +# elif HAVE_STDINT_H +# include +# endif # ifndef HAVE_ALIGNOF # include # define __alignof__(type) offsetof (struct { char c; type member;}, member) diff --git a/ext/standard/css.c b/ext/standard/css.c index 459a7bfc307c..d76f9ee66267 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Colin Viebrock | + | Authors: Colin Viebrock | +----------------------------------------------------------------------+ */ @@ -23,24 +23,25 @@ PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */ { - PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n"); - PUTS("pre {margin: 0; font-family: monospace;}\n"); - PUTS("a:link {color: #009; text-decoration: none; background-color: #fff;}\n"); + PUTS("body {background-color: #ffffff; color: #000000;}\n"); + PUTS("body, td, th, h1, h2 {font-family: sans-serif;}\n"); + PUTS("pre {margin: 0px; font-family: monospace;}\n"); + PUTS("a:link {color: #000099; text-decoration: none; background-color: #ffffff;}\n"); PUTS("a:hover {text-decoration: underline;}\n"); - PUTS("table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}\n"); + PUTS("table {border-collapse: collapse;}\n"); PUTS(".center {text-align: center;}\n"); - PUTS(".center table {margin: 1em auto; text-align: left;}\n"); - PUTS(".center th {text-align: center !important;}\n"); - PUTS("td, th {border: 1px solid #666; font-size: 75%; vertical-align: baseline; padding: 4px 5px;}\n"); + PUTS(".center table { margin-left: auto; margin-right: auto; text-align: left;}\n"); + PUTS(".center th { text-align: center !important; }\n"); + PUTS("td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}\n"); PUTS("h1 {font-size: 150%;}\n"); PUTS("h2 {font-size: 125%;}\n"); PUTS(".p {text-align: left;}\n"); - PUTS(".e {background-color: #ccf; width: 300px; font-weight: bold;}\n"); - PUTS(".h {background-color: #99c; font-weight: bold;}\n"); - PUTS(".v {background-color: #ddd; max-width: 300px; overflow-x: auto;}\n"); - PUTS(".v i {color: #999;}\n"); - PUTS("img {float: right; border: 0;}\n"); - PUTS("hr {width: 934px; background-color: #ccc; border: 0; height: 1px;}\n"); + PUTS(".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n"); + PUTS(".h {background-color: #9999cc; font-weight: bold; color: #000000;}\n"); + PUTS(".v {background-color: #cccccc; color: #000000;}\n"); + PUTS(".vr {background-color: #cccccc; text-align: right; color: #000000;}\n"); + PUTS("img {float: right; border: 0px;}\n"); + PUTS("hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}\n"); } /* }}} */ diff --git a/ext/standard/css.h b/ext/standard/css.h index 0b3ae87cbd86..d7275e08efd0 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Colin Viebrock | + | Authors: Colin Viebrock | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ca7e576c922f..55326dbdd3c3 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -491,18 +491,11 @@ PHP_FUNCTION(glob) /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { no_results: -#ifndef PHP_WIN32 - /* Paths containing '*', '?' and some other chars are - illegal on Windows but legit on other platforms. For - this reason the direct basedir check against the glob - query is senseless on windows. For instance while *.txt - is a pretty valid filename on EXT3, it's invalid on NTFS. */ if (PG(open_basedir) && *PG(open_basedir)) { if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) { RETURN_FALSE; } } -#endif array_init(return_value); return; } diff --git a/ext/standard/file.c b/ext/standard/file.c index 1ec6a74f3f0b..106f5c1004ec 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -818,7 +818,7 @@ PHP_FUNCTION(tempnam) if (p_len > 64) { p[63] = '\0'; } - + RETVAL_FALSE; if ((fd = php_open_temporary_fd_ex(dir, p, &opened_path, 1 TSRMLS_CC)) >= 0) { @@ -1284,7 +1284,7 @@ PHPAPI PHP_FUNCTION(fseek) */ /* DEPRECATED APIs: Use php_stream_mkdir() instead */ -PHPAPI int php_mkdir_ex(const char *dir, long mode, int options TSRMLS_DC) +PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC) { int ret; @@ -1299,7 +1299,7 @@ PHPAPI int php_mkdir_ex(const char *dir, long mode, int options TSRMLS_DC) return ret; } -PHPAPI int php_mkdir(const char *dir, long mode TSRMLS_DC) +PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC) { return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC); } @@ -1380,13 +1380,13 @@ PHP_FUNCTION(umask) { long arg1 = 0; int oldumask; - + oldumask = umask(077); if (BG(umask) == -1) { BG(umask) = oldumask; } - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) { RETURN_FALSE; } @@ -1623,7 +1623,7 @@ PHP_FUNCTION(copy) /* {{{ php_copy_file */ -PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC) +PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) { return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC); } @@ -1631,7 +1631,7 @@ PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC) /* {{{ php_copy_file_ex */ -PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRMLS_DC) +PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC) { return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC); } @@ -1639,7 +1639,7 @@ PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRML /* {{{ php_copy_file_ctx */ -PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC) +PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC) { php_stream *srcstream = NULL, *deststream = NULL; int ret = FAILURE; @@ -1799,23 +1799,22 @@ static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t le #define FPUTCSV_FLD_CHK(c) memchr(Z_STRVAL(field), c, Z_STRLEN(field)) -/* {{{ proto int fputcsv(resource fp, array fields [, string delimiter [, string enclosure [, string escape_char]]]) +/* {{{ proto int fputcsv(resource fp, array fields [, string delimiter [, string enclosure]]) Format line as CSV and write to file pointer */ PHP_FUNCTION(fputcsv) { - char delimiter = ','; /* allow this to be set as parameter */ - char enclosure = '"'; /* allow this to be set as parameter */ - char escape_char = '\\'; /* allow this to be set as parameter */ + char delimiter = ','; /* allow this to be set as parameter */ + char enclosure = '"'; /* allow this to be set as parameter */ + const char escape_char = '\\'; php_stream *stream; zval *fp = NULL, *fields = NULL; int ret; - char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL; - int delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0; + char *delimiter_str = NULL, *enclosure_str = NULL; + int delimiter_str_len = 0, enclosure_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|sss", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|ss", &fp, &fields, &delimiter_str, &delimiter_str_len, - &enclosure_str, &enclosure_str_len, - &escape_str, &escape_str_len) == FAILURE) { + &enclosure_str, &enclosure_str_len) == FAILURE) { return; } @@ -1843,17 +1842,6 @@ PHP_FUNCTION(fputcsv) enclosure = *enclosure_str; } - if (escape_str != NULL) { - if (escape_str_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character"); - RETURN_FALSE; - } else if (escape_str_len > 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character"); - } - /* use first character from string */ - escape_char = *escape_str; - } - PHP_STREAM_TO_ZVAL(stream, &fp); ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char TSRMLS_CC); diff --git a/ext/standard/file.h b/ext/standard/file.h index d6f142a7690d..2bcdfd64bf5e 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -74,11 +74,11 @@ PHP_MINIT_FUNCTION(user_streams); PHPAPI int php_le_stream_context(TSRMLS_D); PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC); -PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC); -PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk TSRMLS_DC); -PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC); -PHPAPI int php_mkdir_ex(const char *dir, long mode, int options TSRMLS_DC); -PHPAPI int php_mkdir(const char *dir, long mode TSRMLS_DC); +PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC); +PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC); +PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC); +PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC); +PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC); PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC); PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC); @@ -121,7 +121,7 @@ typedef struct { long default_socket_timeout; char *user_agent; /* for the http wrapper */ char *from_address; /* for the ftp and http wrappers */ - const char *user_stream_current_filename; /* for simple recursion protection */ + char *user_stream_current_filename; /* for simple recursion protection */ php_stream_context *default_context; HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */ HashTable *stream_filters; /* per-request copy of stream_filters_hash */ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 0b40e7319b39..8e88a8508095 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -857,7 +857,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ "dev", "ino", "mode", "nlink", "uid", "gid", "rdev", "size", "atime", "mtime", "ctime", "blksize", "blocks" }; - const char *local; + char *local; php_stream_wrapper *wrapper; if (!filename_length) { @@ -904,7 +904,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ } if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) { - /* Error Occurred */ + /* Error Occured */ if (!IS_EXISTS_CHECK(type)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); } diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 15dae1bee69d..084860c76b43 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -771,7 +771,7 @@ static void php_conv_qprint_encode_dtor(php_conv_qprint_encode *inst) } #define NEXT_CHAR(ps, icnt, lb_ptr, lb_cnt, lbchars) \ - ((lb_ptr) < (lb_cnt) ? (lbchars)[(lb_ptr)] : *(ps)) + ((lb_ptr) < (lb_cnt) ? (lbchars)[(lb_ptr)] : *(ps)) #define CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt) \ if ((lb_ptr) < (lb_cnt)) { \ @@ -791,7 +791,6 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins unsigned int line_ccnt; unsigned int lb_ptr; unsigned int lb_cnt; - unsigned int trail_ws; int opts; static char qp_digits[] = "0123456789ABCDEF"; @@ -808,7 +807,6 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins icnt = *in_left_p; pd = (unsigned char *)(*out_pp); ocnt = *out_left_p; - trail_ws = 0; for (;;) { if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && inst->lbchars != NULL && inst->lbchars_len > 0) { @@ -841,13 +839,11 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins if (lb_ptr >= lb_cnt && icnt <= 0) { break; - } + } c = NEXT_CHAR(ps, icnt, lb_ptr, lb_cnt, inst->lbchars); - if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && - (trail_ws == 0) && - (c == '\t' || c == ' ')) { + if (!(opts & PHP_CONV_QPRINT_OPT_BINARY) && (c == '\t' || c == ' ')) { if (line_ccnt < 2 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len + 1) { err = PHP_CONV_ERR_TOO_BIG; @@ -867,44 +863,12 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins err = PHP_CONV_ERR_TOO_BIG; break; } - - /* Check to see if this is EOL whitespace. */ - if (inst->lbchars != NULL) { - unsigned char *ps2; - unsigned int j, lb_cnt2; - - lb_cnt2 = 0; - ps2 = ps; - trail_ws = 1; - - for (j = icnt - 1; j > 0; j--, ps2++) { - if (*ps2 == inst->lbchars[lb_cnt2]) { - lb_cnt2++; - if (lb_cnt2 >= inst->lbchars_len) { - /* Found trailing ws. Reset to top of main - * for loop to allow for code to do necessary - * wrapping/encoding. */ - break; - } - } else if (lb_cnt2 != 0 || (*ps2 != '\t' && *ps2 != ' ')) { - /* At least one non-EOL character following, so - * don't need to encode ws. */ - trail_ws = 0; - break; - } else { - trail_ws++; - } - } - } - - if (trail_ws == 0) { - *(pd++) = c; - ocnt--; - line_ccnt--; - CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); - } + *(pd++) = c; + ocnt--; + line_ccnt--; + CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); } - } else if ((!(opts & PHP_CONV_QPRINT_OPT_FORCE_ENCODE_FIRST) || line_ccnt < inst->line_len) && ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))) { + } else if ((!(opts & PHP_CONV_QPRINT_OPT_FORCE_ENCODE_FIRST) || line_ccnt < inst->line_len) && ((c >= 33 && c <= 60) || (c >= 62 && c <= 126))) { if (line_ccnt < 2 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len + 1) { err = PHP_CONV_ERR_TOO_BIG; @@ -948,12 +912,9 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins } *(pd++) = '='; *(pd++) = qp_digits[(c >> 4)]; - *(pd++) = qp_digits[(c & 0x0f)]; + *(pd++) = qp_digits[(c & 0x0f)]; ocnt -= 3; line_ccnt -= 3; - if (trail_ws > 0) { - trail_ws--; - } CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt); } } @@ -961,7 +922,7 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins *in_pp = (const char *)ps; *in_left_p = icnt; *out_pp = (char *)pd; - *out_left_p = ocnt; + *out_left_p = ocnt; inst->line_ccnt = line_ccnt; inst->lb_ptr = lb_ptr; inst->lb_cnt = lb_cnt; diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index d04ef52be749..373293935835 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -130,9 +130,8 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream * /* {{{ php_ftp_fopen_connect */ -static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context, php_stream **preuseid, - php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC) +static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, + php_stream **preuseid, php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC) { php_stream *stream = NULL, *reuseid = NULL; php_url *resource = NULL; @@ -411,8 +410,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* {{{ php_fopen_url_wrap_ftp */ -php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { php_stream *stream = NULL, *datastream = NULL; php_url *resource = NULL; @@ -442,7 +440,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa if (strchr(mode, 'a')) { read_write = 3; /* Open for Appending */ } else { - read_write = 2; /* Open for writing */ + read_write = 2; /* Open for writting */ } } if (!read_write) { @@ -502,7 +500,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (result <= 299 && result >= 200) { if (allow_overwrite) { - /* Context permits overwriting file, + /* Context permits overwritting file, so we just delete whatever's there in preparation */ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream); @@ -693,8 +691,7 @@ static php_stream_ops php_ftp_dirstream_ops = { /* {{{ php_stream_ftp_opendir */ -php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { php_stream *stream, *reuseid, *datastream = NULL; php_ftp_dirstream_data *dirsdata; @@ -783,7 +780,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat /* {{{ php_stream_ftp_url_stat */ -static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) { php_stream *stream = NULL; php_url *resource = NULL; @@ -906,7 +903,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, /* {{{ php_stream_ftp_unlink */ -static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { php_stream *stream = NULL; php_url *resource = NULL; @@ -956,7 +953,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i /* {{{ php_stream_ftp_rename */ -static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) { php_stream *stream = NULL; php_url *resource_from = NULL, *resource_to = NULL; @@ -1035,7 +1032,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr /* {{{ php_stream_ftp_mkdir */ -static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC) { php_stream *stream = NULL; php_url *resource = NULL; @@ -1129,7 +1126,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in /* {{{ php_stream_ftp_rmdir */ -static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { php_stream *stream = NULL; php_url *resource = NULL; diff --git a/ext/standard/html.c b/ext/standard/html.c index b4d9ba109d9d..414fa65c91d3 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1221,8 +1221,8 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size const enc_to_uni *to_uni_table = NULL; const entity_ht *inv_map = NULL; /* used for !double_encode */ /* only used if flags includes ENT_HTML_IGNORE_ERRORS or ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS */ - const unsigned char *replacement = NULL; - size_t replacement_len = 0; + const unsigned char *replacement; + size_t replacement_len; if (all) { /* replace with all named entities */ if (CHARSET_PARTIAL_SUPPORT(charset)) { @@ -1596,7 +1596,7 @@ PHP_FUNCTION(get_html_translation_table) flags = ENT_COMPAT; int doctype; entity_table_opt entity_table; - const enc_to_uni *to_uni_table = NULL; + const enc_to_uni *to_uni_table; char *charset_hint = NULL; int charset_hint_len; enum entity_charset charset; diff --git a/ext/standard/http.c b/ext/standard/http.c index f9b802195035..547df5218695 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -56,7 +56,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, arg_sep_len = strlen(arg_sep); for (zend_hash_internal_pointer_reset(ht); - (key_type = zend_hash_get_current_key_ex(ht, &key, &key_len, &idx, 0, NULL)) != HASH_KEY_NON_EXISTENT; + (key_type = zend_hash_get_current_key_ex(ht, &key, &key_len, &idx, 0, NULL)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward(ht) ) { if (key_type == HASH_KEY_IS_STRING && key_len && key[key_len-1] == '\0') { diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index ac6fdad4fef3..b8676bbba4df 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -84,8 +84,7 @@ #define HTTP_WRAPPER_HEADER_INIT 1 #define HTTP_WRAPPER_REDIRECTED 2 -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ +php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; php_url *resource = NULL; @@ -922,7 +921,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const char } /* }}} */ -php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC); } diff --git a/ext/standard/image.c b/ext/standard/image.c index bd80f11dec97..4984e4064a3e 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -112,7 +112,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC) result->width = (unsigned int)dim[0] | (((unsigned int)dim[1])<<8); result->height = (unsigned int)dim[2] | (((unsigned int)dim[3])<<8); result->bits = dim[4]&0x80 ? ((((unsigned int)dim[4])&0x07) + 1) : 0; - result->channels = 3; /* always */ + result->channels = 3; /* allways */ return result; } @@ -606,7 +606,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) /* JPEG 2000 components can be vastly different from one another. Each component can be sampled at a different resolution, use - a different colour space, have a separate colour depth, and + a different colour space, have a seperate colour depth, and be compressed totally differently! This makes giving a single "bit depth" answer somewhat problematic. For this implementation we'll use the highest depth encountered. */ diff --git a/ext/standard/info.c b/ext/standard/info.c index cfff023afa8e..e8ba908070b1 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | - | Colin Viebrock | + | Colin Viebrock | +----------------------------------------------------------------------+ */ @@ -67,7 +67,7 @@ static int php_info_print_html_esc(const char *str, int len) /* {{{ */ int written; char *new_str; TSRMLS_FETCH(); - + new_str = php_escape_html_entities((unsigned char *) str, len, &new_len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC); written = php_output_write(new_str, new_len TSRMLS_CC); efree(new_str); @@ -81,11 +81,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */ int len, written; va_list argv; TSRMLS_FETCH(); - + va_start(argv, fmt); len = vspprintf(&buf, 0, fmt, argv); va_end(argv); - + written = php_output_write(buf, len TSRMLS_CC); efree(buf); return written; @@ -103,7 +103,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC { char *key; uint len; - + if (ht) { if (zend_hash_num_elements(ht)) { HashPosition pos; @@ -113,15 +113,11 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC } else { php_info_printf("\nRegistered %s => ", name); } - + zend_hash_internal_pointer_reset_ex(ht, &pos); while (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) { - if (!sapi_module.phpinfo_as_text) { - php_info_print_html_esc(key, len-1); - } else { - php_info_print(key); - } + php_info_print(key); zend_hash_move_forward_ex(ht, &pos); if (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) { php_info_print(", "); @@ -129,7 +125,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC break; } } - + if (!sapi_module.phpinfo_as_text) { php_info_print("\n"); } @@ -164,10 +160,10 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* { } } else { if (!sapi_module.phpinfo_as_text) { - php_info_printf("%s\n", zend_module->name); + php_info_printf("%s\n", zend_module->name); } else { php_info_printf("%s\n", zend_module->name); - } + } } } /* }}} */ @@ -212,7 +208,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) php_info_print(name); php_info_print("[\""); - + switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) { case HASH_KEY_IS_STRING: if (!sapi_module.phpinfo_as_text) { @@ -287,7 +283,7 @@ void php_info_print_style(TSRMLS_D) PHPAPI char *php_info_html_esc(char *string TSRMLS_DC) { size_t new_len; - return php_escape_html_entities((unsigned char *) string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); + return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC); } /* }}} */ @@ -442,7 +438,7 @@ char* php_get_windows_name() sub = "Web Edition"; else sub = "Standard Edition"; } - } + } } if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) { @@ -535,7 +531,7 @@ PHPAPI char *php_get_uname(char mode) DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1; char ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; - + GetComputerName(ComputerName, &dwSize); if (mode == 's') { @@ -584,7 +580,7 @@ PHPAPI char *php_get_uname(char mode) if (mode == 's') { php_uname = buf.sysname; } else if (mode == 'r') { - snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d", + snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d", buf.netware_major, buf.netware_minor, buf.netware_revision); php_uname = tmp_uname; } else if (mode == 'n') { @@ -674,7 +670,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) char temp_api[10]; php_uname = php_get_uname('a'); - + if (!sapi_module.phpinfo_as_text) { php_info_print_box_start(1); } @@ -698,7 +694,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) php_info_printf("

PHP Version %s

\n", PHP_VERSION); } else { php_info_print_table_row(2, "PHP Version", PHP_VERSION); - } + } php_info_print_box_end(); php_info_print_table_start(); php_info_print_table_row(2, "System", php_uname ); @@ -783,7 +779,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) #else php_info_print_table_row(2, "DTrace Support", "disabled" ); #endif - + php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC); php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC); php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC); @@ -815,7 +811,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) php_info_print("

Configuration

\n"); } else { SECTION("Configuration"); - } + } if (!(flag & PHP_INFO_MODULES)) { SECTION("PHP Core"); display_ini_entries(NULL); @@ -889,7 +885,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) } - if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) { + if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) { php_info_print_hr(); php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC); } @@ -930,24 +926,24 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) if (!sapi_module.phpinfo_as_text) { php_info_print(""); - } + } } /* }}} */ PHPAPI void php_info_print_table_start(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { - php_info_print("\n"); + php_info_print("
\n"); } else { php_info_print("\n"); - } + } } /* }}} */ PHPAPI void php_info_print_table_end(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { - php_info_print("
\n"); + php_info_print("
\n"); } } @@ -965,7 +961,7 @@ PHPAPI void php_info_print_box_start(int flag) /* {{{ */ php_info_print("\n"); } else { php_info_print("\n"); - } + } } } /* }}} */ @@ -998,7 +994,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* { } else { spaces = (74 - strlen(header)); php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " "); - } + } } /* }}} */ @@ -1013,7 +1009,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...) va_start(row_elements, num_cols); if (!sapi_module.phpinfo_as_text) { php_info_print(""); - } + } for (i=0; i"); - } + } for (i=0; i", (i==0 ? "e" : value_class ) ); - } + } row_element = va_arg(row_elements, char *); if (!row_element || !*row_element) { if (!sapi_module.phpinfo_as_text) { @@ -1071,7 +1067,7 @@ static void php_info_print_table_row_internal(int num_cols, php_info_print(row_element); if (i < num_cols-1) { php_info_print(" => "); - } + } } } if (!sapi_module.phpinfo_as_text) { @@ -1091,7 +1087,7 @@ static void php_info_print_table_row_internal(int num_cols, PHPAPI void php_info_print_table_row(int num_cols, ...) { va_list row_elements; - + va_start(row_elements, num_cols); php_info_print_table_row_internal(num_cols, "v", row_elements); va_end(row_elements); @@ -1100,11 +1096,11 @@ PHPAPI void php_info_print_table_row(int num_cols, ...) /* {{{ php_info_print_table_row_ex */ -PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, +PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, ...) { va_list row_elements; - + va_start(row_elements, value_class); php_info_print_table_row_internal(num_cols, value_class, row_elements); va_end(row_elements); @@ -1232,7 +1228,7 @@ PHP_FUNCTION(php_ini_scanned_files) if (zend_parse_parameters_none() == FAILURE) { return; } - + if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) { RETURN_STRING(php_ini_scanned_files, 1); } else { @@ -1248,7 +1244,7 @@ PHP_FUNCTION(php_ini_loaded_file) if (zend_parse_parameters_none() == FAILURE) { return; } - + if (php_ini_opened_path) { RETURN_STRING(php_ini_opened_path, 1); } else { diff --git a/ext/standard/info.h b/ext/standard/info.h index b616204b30f2..46a0dfc24080 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ @@ -14,7 +14,6 @@ +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | - | Colin Viebrock | +----------------------------------------------------------------------+ */ @@ -23,9 +22,9 @@ #ifndef INFO_H #define INFO_H -#define PHP_ENTRY_NAME_COLOR "#ccf" -#define PHP_CONTENTS_COLOR "#ccc" -#define PHP_HEADER_COLOR "#99c" +#define PHP_ENTRY_NAME_COLOR "#ccccff" +#define PHP_CONTENTS_COLOR "#cccccc" +#define PHP_HEADER_COLOR "#9999cc" #define PHP_INFO_GENERAL (1<<0) #define PHP_INFO_CREDITS (1<<1) @@ -51,9 +50,9 @@ #endif /* HAVE_CREDITS_DEFS */ -#define PHP_LOGO_DATA_URI "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHkAAABACAYAAAA+j9gsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAD4BJREFUeNrsnXtwXFUdx8/dBGihmE21QCrQDY6oZZykon/gY5qizjgM2KQMfzFAOioOA5KEh+j4R9oZH7zT6MAMKrNphZFSQreKHRgZmspLHSCJ2Co6tBtJk7Zps7tJs5t95F5/33PvWU4293F29ybdlPzaM3df2XPv+Zzf4/zOuWc1tkjl+T0HQ3SQC6SBSlD6WKN4rusGm9F1ps/o5mPriOf8dd0YoNfi0nt4ntB1PT4zYwzQkf3kR9/sW4xtpS0CmE0SyPUFUJXFMIxZcM0jAZ4xrKMudQT7963HBF0n6EaUjkP0vI9K9OEHWqJLkNW1s8mC2WgVTwGAqWTafJzTWTKZmQuZ/k1MpAi2+eys6mpWfVaAPzcILu8EVKoCAaYFtPxrAXo8qyNwzZc7gSgzgN9Hx0Ecn3j8xr4lyHOhNrlpaJIgptM5DjCdzrJ0Jmce6bWFkOpqs0MErA4gXIBuAmY53gFmOPCcdaTXCbq+n16PPLXjewMfGcgEttECeouTpk5MplhyKsPBTiXNYyULtwIW7Cx1vlwuJyDLR9L0mQiVPb27fhA54yBbGttMpc1OWwF1cmKaH2FSF7vAjGezOZZJZ9j0dIZlMhnuRiToMO0c+N4X7oksasgEt9XS2KZCHzoem2Ixq5zpAuDTqTR14FMslZyepeEI4Ogj26n0vLj33uiigExgMWRpt+CGCsEePZqoePM738BPTaJzT7CpU0nu1yXpAXCC3VeRkCW4bfJYFZo6dmJyQTW2tvZc1nb719iyZWc5fmZ6Osu6H3uVzit52oBnMll2YizGxk8muFZLAshb/YKtzQdcaO3Y2CQ7eiy+YNGvLN+4+nJetm3bxhKJxJz316xZw1pbW9kLew+w1944XBEaPj6eYCeOx1gqNe07bK1MwIDbKcOFOR49GuePT5fcfOMX2drPXcQ0zf7y2tvbWVdXF/v1k2+yQ4dPVpQ5P0Um/NjoCX6UBMFZR6k+u7qMYVBYDIEqBW7eXAfPZX19zp2/oaGBHysNMGTFinPZik9fWggbI5Omb13zUDeB3lLsdwaK/YPeyAFU0i8Aw9/2Dwyx4SPjFQEYUlf3MTYw4Jx7CIVCbHR0oqIDNMD+FMG+ZE0dO/tsHlvAWnYS6H4qjfMC+Zld/wg92/tuv2WeeYT87j+H2aFDxysGLuSy+o/z49DQkONnmpqa2MjRyoYsZOXKGnb5Z+vZqlUrxUsAvI9At/oK+elnBpoNw+Dai9TekSMxDrgSh0KrSYshTprc2NhoRf1JtlikqirAVl98AddsSavDBDrsC+QdT7/TSoB344tzOZ39+70RbporVerqasyw1MEnC8iV6I9VTDi0uqbmfPFSq2W+gyUHXuEdb3WR5rab5jnD3i/BNMN8ChNaqsTiKa55KmBWX+Tuj0XQdQVF307nhTH0CPls+O0UPbaT5TQG/8qX68u6LpV67LQ6dNknaYgaYyPDx2TzvYGCsnhRkH8b/rsF2GDj1MCInkvxvRjOuCUlipWD/zrKx7ZOwBF0vfSSM2ShyaqAAOC1Nw+zt9/5YNbrN1zfwIdpfgnqebv/A6pnWAn4qlW1HPgHQ6OeoG3N9RO/+StMdDtmV2LxJPfBpQCGfwTgrVu38jFrKaW2tpZt2LCBdXR0sEgkwhv21u9cxQsyW3ZB1+DgoOM54btU6tu8eTPr6elhy5fr7IZNDey+e76e9/fCLcAllHpdKKinpaUlX8+111xB9VzNrYxqUAY/XVVVJYMOekLu2fFGM8VWYQRYiYkU9bD4vPlHFYnH4/zvkb1CgwACHgMoUpdyw3sFXcXUh4YHaNSHDqaxdL5jwVTXBpeXVY9oF3RcUQ+O09NT7Cayfld+4RJlP42gTIq8w66Qf/X4a6FTSSMMDcaE/NhYecMM+MdyG90OAhodWoAGkTUaSZByO5WdiA4GqwStrrM6k5vFKEXQserr63l7oR5V0NBojKctaSZtbneErOtGmFxwkGewjk0UzpCUlJSIRqMcjN8CkHLDqyRByq0PEGBBhDmdj7rQVujAaLfrrlk7xyW5gUaxpEtOmOQDr0e799NYmDVBi0+OT7FcbsaXxEQk8qprEBQMBm0vVKUBRcNjskFE8W71lSt79uzhda1d6w4ZGTUUp3NWAQ3TvW/fPvbVq+rZH/ceULOcF1/I06CY3QJohCCzNJnYdgEwwvpUKuNbUsLNpO3evZtfSGHp7+/nS2pw3LLFPVWLoA5yHQUtXvXFYjH+vU4F5yOibzsRUL38MTqC3XWh8GCWziMcDjt2BNEZUIfoUOpJkwvziT3S5ua8Jj/4yD5E0yERbPkhKv4RF4mhkN1wCMHN2rWfYZ2dnWz9+vXchNkJzBoaQ8Bxqg91wWo41YdO2dzczD+3bt06Rw0rBG4nOF8oi9M0Jsw9OgLqQ124BifLgeuHyVbN0NXUrODBmDWxgRR0pNrUYqMNgDOZGZbNzvgCuc4j0kX+GPJ2//CcMagQmKkbrm/knwVEp++SIXulM1+nhj9AY207QRDnpsnye24WA59DkuPlV/5j+z5eB2hE0W1tbTyQdNJmDpksRzFp2E9csFJAboRvDvz8gZdJgw2ek55KZphfAv+Inu8UdKnmkEUHQK93EjEZ4Rbkifq8JiactEpYAy9Nli2Gm6CjIZPn1qlKFWizleOG3BIwdKNZ+KRMxr9VHKvr1NKLXo2BhlAVFRPq1qlWW6MBr3NWyY2rTGXO5ySJlN9uDuiGsV7XTVPtl8CHYGizf/9+V5Om0hAwVV4ahuU8qia03HP26kyqFkMOTudDzjs/P/QKBUiBYa5ZNucfZJUkCG/0IhpCxYyqBF3lnLOII8q1GKqdStQ3rTh5MStwXX5O/nE1metGQzPHUH6JatA1OppQ8u1eUbpX44tO4GY5vM5Z9sduFgOfG1GwUOK6VFzaSAmrWCSfzGCuuT/O+bi6QwRdTtqXN2keJ4/ejgkJ5HedRARkbkGe6ARulgMWQ+Wc3cDAWohhoZdcue7ifJ7crfP6Me8dELd0Mv8U2begC2k9SHd3t+NnNm7cqKwRbiYUkykqvlZlmOYVLIq5bHRep46JzotOc9BhuFc0ZHGLph+CJIaXr1FZSIfxsdBiN1+LpALEK2By61Aqs0rwtV7DNBU3BMCYixYTLU6C8bM5hBwum0k1mesBpmPtlj+qXFenFsAgCVLon9DYeIxUnmh05HCdBIkCVRP6ussiepVZJZXIutCHwt2I0YGY2Kiz3AIyeG5aLNooVULQBbHy1/nAK2oEtEanheil+GO3aFg0FnwSilNC4q6OrXzywc0XCy1WMaFu/tgrCBLRuWpHuP+n1zqmRXFN0GAnwKgHeW1E1C/86UDJHFKptATZMPZTafbLXHtN3OPixKRC4ev4GwB2Gy6JxhQNEYul+KoKp79RMaGqKzy9ovzt27c7pidVZtYAGJMYOP7u6bdK1mLI1GQ+/ogSZBahwKuLO2jSZt0odw65xrUhAMNrZskLsGiIXz72F3bTjV+ixvtbWcMQr3NWCbog5VyXAIy63PLrqpJITIqHkcD9P7suSiYbG53wvTLKDbr8WBbjZqIF4F3PD3ItRn1eQd5CBF3lCM5RAIYfVp0/dgZ8SvbJ2/l8MmlvNw+8qJTjm+drWQwaAXO9KMuWncc1GBMXKkGeV/pU5ZxFIsTvzovOCu3HvDnOE7NTu3rLr+PE8fy6+IEX9947YM4n/+LbPT/88R8QqoYAuVSDrZLFKcYso2AcLBIeGDPu6h3M+yqvIE/4Y6w4LdUfi+jcr86L75KvC9+PcbVfd1hCi6U7Innwk1/+Q5rcoetsdyBg3s9aCmivBsNFifGfG9zCJUFiztmpEXAbqhMgr6SLWBPu9R1enRfm1ktrC6cVYWH+/Mqg43x6sYK1edaCex7vkRZHZkF+6P6NkXvvi/TpLNBUaqTtdcsoLtIrVTcem2EHDh7m2uq0ikMINBvafOmazzt+BkGMW9CF70DndPsOaJqb38Y1oXjdCYHOiqwbPofrKid6thMAlnxxPtMy6w4K0ubNhq73U5wd5PtVleCTd+50D2CEafLloqixyv0ufMcOGq64CVaMYN2119gfAdPpuscKOxWgCMDwxfm0pvzBhx9siRLoFt3ca7Ikf+x2yygaYzHdTSi7IT9y8fMJ2Lpdhg+ZCPA2+f05d1A88mBLHzQaoA1dL6ohVLJGi+1uQj8XQMyHIMgaGT6eDxuozMkD294LRaB7CPI27DLHQSskSFRvGa30O/zndF4fF0DMhwa//9//iZ2DcILqN7xBHn1oUweNn7eJ3WO9QHvdMlrMsphKEj8XQPgpuHVVMtGOgF0hC9CGTqbb2kHOzXx73aKiuiymEv2x22ICMYYeWSALBQ7RQ0fkoZIr4DnRtS3ohzf1dNzTG9d0PcwMLahZO8UyKTMm38wteratSVtkplq4oWj0PcfrEinPhYg14H+hvdIwCVs1bvb6O+UBMYFGl90d0LRGLRDgoHEUwYnXDniQStocTVUwfPLaKQGA/RoWOmkvtnsaG8unK+PWMKlH5e+Lznp03N27RdO0TkxmYNZKszYBlyfI3RpjsQkmMOo8ls4Wsx1EKcEVAEvayyNoeRzsO2RI+93PNRLesGYtNpBhL4l/prlgZz5ob0mbtZVFhWC301d0EuQgAHPgS7D9hssTHKyMbRfLptF213NBDRuoaqxNA2yh2VUBDnxJ1M1yRW6gOgt2x64gqXK7ht1yOWyW1+wl7bYXvhUygQXgit4KuVDuBGzSbA2bmmtayNzpRgJOGu7XosHFChZzvrGTiUKt5UMiVsmbmtsCb3+2lZmwm3hFNsA/CiYdKyfhYx3Aws8urp8nsJM72naGCG8zYwZMecjk/WHVVRbsMwU6tBVQsWJS2sNDlrgVTO0RE/vzKQtuN2+/85k5PxlUaL75D3BZwKss+JUqSFRAO/F7Eqlkmj+2gbrgYE8rZFluu+P3pOGsyWCG/Y9/GR8exC+vYfc5flxgzRdDGsDEz/8AJsxwQcBUKPCtmKOMFJO8OKMgF8r3b3sKkAm69TN+2OZCAm5ID/g9XPypwX29ufWgudq0urrKes/8nPkxgy1bdg6z/or/SFc2mzV/xs+6HwySTmdYJp2dpaWKEregYrVfn9/B0xkD2U6+e+sOaHqImTfLrycUOIZM1hJwC3oemPXbi/y5PnsrJ136bUa8pxu69BklmANWwDRkgR1wmwVaglyi3Nz6JLQ+ZG5NxQsgNdAhmIfJN7wxgoWg9fxzPQ+c/g9YAIXgeUKCyipJO4uR/wswAOIwB/5IgxvbAAAAAElFTkSuQmCC" -#define PHP_EGG_LOGO_DATA_URI "data:image/gif;base64,R0lGODlheQBAAOZ/AB0BAHB0r0xPkMmMdtjXu9CYh2sxAquv1pJsTmUCAKyQaaVnA6lwVYOGvJM1ANvbwYlPMJubzVYCAGgRAJhqLm9BCq99aLetkqpMAKJCAJdvYqtzHZZWAnNsmIUjAHdKNW8bALqST3ABAJpjEVYnA08xU5JLBG1FU8fKtIhcS4d0kYJFBLiQgkABAIQwAd3h0eDm2sXCpdXYxIiKwG05M7CtuH4UAVNGdNPWwJ5dAcB+ZOjv6NrdxqRMAN7ZuH1qeXZYYszQunp9toxRBJ2dz5yHaa6ANoVYHrWgebK54M28jdfbxpGTxpWWyY8tAJqFl6hHANzUr5J+UqOm0Z47AI9eG9LKolo1IEASAkNIjJSczVkUAYyPw1NNTqSdrYNgZ3hMGK9XAa5KAJNKGaGdv3k6BVgZE6BTGmVopNrezIJhNGgeFpJCKFogM9DTvpiQrm1afpiYxZxQClZZmKJSBaNGAWsnItLQscC8p7NaEI47BpdhQGwVFy0bH18LAJmZzCH5BAEAAH8ALAAAAAB5AEAAAAf/gH+Cg4SFhoeIiYIRRERTj48HkgeQU40Rf3FNm5yLEZ+YhnFeTYqmp6ipioyOU5OSSbGys0mTkERaTUxcM729XExMpaCYTTU+NaWqy8yoo3Gtk7SxlGRvT08qPz9f3UBAX0A/KuQNXOfnMw0NQu3t5n+YNQ9RXs33+IOfeFE1B7MHyGTjdoLGGjN+JChcyLChHz981tixQ+MEEDhwOgRoFyAAmo1C3rh5gEdZvpOnHB2Y56ZGkilvfpyws6WFzRYMH+rcOaGnz58+/UwQ2lPiiYxokqLpgIKHlSeXUEolpPLfgRgv8KQw6CdBAoU3cUp4OHanWbNA06aleOIGGjw8/x4gQSOkCZFQU+9FcPWv1hsvBF4g6fpwKNiwDRMvPMu4sdk1F+IqgZNFABoujPDmTemK2pOZWyKnKVK4Z8KwYhXnHLvYsWudSNLQ+5KltoA5Qv7c3axIZSwyKuwstBMkLgKipv2gVpjw9Vm1yNWajv3gAYUtbW7UzoLbLm9DRGAleUIjYQKyCNLwwKEG6OmbzBlLTwtiPlAQ+CdQ5xGiPog1JWwngBCMfKdbZweoUF5ZO8XGwx0QIEcWYqVF9xMILtyHX349bejhh/ghERcPSHjgIYDacdfAJ5t1Np5w551lRwxpLGEFGNG9J5aFaq2wAYge+gQkkBfI9oASZXw4VP+AtaHhHUrhxfIGDa2ZJcEHbvBgI44/6cicWkFWYcSQHE5ApodlxLBEdVasoGRXZjA54G74IPiFYlYisISWN+YoAXxjgbnhBBT0ZyaQQx16JghgBFHdA3dU8eZXEmTX5JPMdPbEGsw15NWnEmjAQ1wQJpCcjjgVxhNQRoRggIb1NafokBMggMMDa95BwZtfgsDkHDMQscxektzZqQSfeoWsskUYecceySrbAgA2MRhtshO0WoYEIng1galDyXpmTwrI8AAPBBBAQYemLXRoAm3Y1oCwqBBLBg2pqdYQC6M+QAAD0f5J4bXRghBCCCssS3CgIPbUrVcX4IruvwG7G6v/QiUIkIUQ9JriSBxt5JvQQoAudMGe/iqQ2HJdUaqYAQeboNBXyi503qz1PfzVGjFInC4CoDaUn8tMzmvKXm/wIYIIEzDdU9AuM3dyXAQM1tByyJJc7UJlGLEBByNrXa1QSlJqEwIEnLsEAVEgIHa1Zo58U8Ybd3wIEW+wYYMHfPftgQ2ABy444HigTIASeizddIw6PV1z1BKUscACOYBwNXxEefjVTWZckLaWBDx7GLXUtlDf6DYFKAAXdg8ShxZxsOGEA7TX7sTtuOeOux6F93uHER444ffwfA8uOAhl5LBB5QnYIILzDzO9oYlDK5uCGwTsuQQOpb5NFKo2aTdH/xOa/bGJFinMXvv66jvQvu28S+wvEnrYjrv77Ot++wqFhrCBCSAI3u36pjsXuGCAfkNC2s4lAxzEYAzG6xDfQGCDpz0kAXzQDhpaxwQtaOB96wuhCGmnh5OtyV9WoID6bjfCEbqgAmBQgxQUoIYKkAALIGwh+xhwh8+thwB4GIP+cHdA3fmNBrUxmiCCMYO/8c2AUDQg3+7nAD1Y8YoXkIHhohAC/OVOh7SjggGwcAUjrIAEN7yhC6gARhGeQQnpekCNcIAD+rURjOIjn/m4oIUTLG1pftjCFu4zqydKEQky0GJ1CJDCvf3NkQSkogNWYAADgEEKBiiDCVZgAgNgqP+NbGSjHhT4uTm6QQE5vGPtylAbjkVgFypQWAKmBYDSoQZrCtFAIlHmgygowQM6+9QfB5dJTnLABENYAAdykIMVlMGTASTeFIXnBAX0sDppSIMM3BAECghQdyS84gipQIUTZGGDfwDGCa5Wy1rS0p3tbOdNUoADLcall1ycwJ/2abMELC0BWzCACUzAzMkpcwQcoMMxDbCFlkXrYR6wQA8/94LtuSEGegPch55oABd0NIDRdEEVkbi6JsyAC21gpzzjyVKWXgEFu6wOPkNwy5IF1Jg5MKgyc8CBZXLgjDWpaQs+cIEoxPEBL3hBA4OABH1m7ZZYiKpUWyBVQYKABNr/CQAvhOBQf4pAJ6wRGE5ustIWZNGe94xCFJCAr5pKIKBlOMIQlpnTyXFgBENg5k9dQIKatNMMNEAAEqxg1AWmAQZL2GYQ9gCod7b0se0MEBp6oQLBCXB4FOxJBSvYpYQgwA27vCc+rRCCD5hBrG8lQRlWMIS5Us6gd6XrT58pyCsUAQlKIGwvCeCD6vAABtrEgRsusIZbQva4tezDbRowgy+Q87nQfa77vjhCJ4whBvVcAsoe4IPu9tIKSkACEsZw1UyWYa50hS1e9brJZ5YBCdxVa3cXeC4YKFW4QUBATZF7XOUKYB3OzYCAB0xgAUe3wASmAhLckN1+ydS7vVXC/wIqUIFiznUIIzBCMimHUMod05mrDQF3e/soXB0Wsfi9QBlq9jaBwROyfagMgKmA4BrbuMBUoAAKGIzWuDy4u0agwAoqvNqecqAKajDA5HiazGNucgWsNcKtSoyrF+xgB4nFQRBQsAf9+S2a1PMQ4CZQwYfE678NCPCN12zjBdezxz5GqhKMgAAwEBkMHEjmCI4wgg0sYAQddjKUh3CEDVghLtrdEwyuHFxu0i/BNM5AdKVbO3LSDnckXccPqFCHTnu6DgMGNZsLfIYY8BjOcYEBEqRAATBU0gAryPMCNkBrP+N1BMoc6KCrQIEi7SkNL1g0lhvIzQuMIdI2FnUGQP/d6Rt/gDszEEIH9NCDalv72tX+tLa3DWoG7PjN2h0VD9QjBSkcwYYGqEAVWjvrWucA0Lh28mqHUIUqKGAJSRU2YokdBDzswQFrbnaoPW1jc86BCe2ggR4GynCGy8EEcpADtieO7TooIAinTvQSYBCDctuQBOmWKwfaTWtAVyGnFAYxvdWAABRc+cr7xq+/HaDsAn9awNyucVb/IIQGlEBRJuooFMtQBhdcUQ9QbnjDHy4HJGCcx4lWtRTUcIU+AMCS6+ZArUsO6MlVGOQkgKEMLwDzRgeh3/+GArc9rfZtt13tOK8DFNhQmxlEINpw8OofFee0n1Rwo5W8KsgreXH/jGd3CaMpQpLRmO5193kDXtvACCjA668N4eNhl2ERkppI/AbhAhAAOIHrQPHSX5vtUDD4JxAuhDbofe+wj33sN1c6P7TcDbiXQRpQUO4roLECZahAax9vBK8hNAdVQOgQKPn7GEoBBdrk5pYVYIdDmcgDRh9oxOVAh+7TYfveD3/45aAdjgmiHR1owetlz/7Zw6cFKbjA2d2QBjyUGwxXgOERKECBIVCA1sW3AYVCAUbQZ3jlTBQGBmBAVGlwdp+HAEFFISBQSURXBkd3gWNgAhmYgQxnTgLABJjwSu1QAgDALe13grH3fmZQBDEQBDJwAWpQQxUGQzBUBZLHa17D/2uUdwRHAAaU9GowpIB4cFFFYAaP9X5YECiD8zyD4zc2YAcaY36L0AAdYXUmmCwoyH4lcyVFgAJFgEaMl3IrMAL1FgL8t3WS11o/CIZYgEZqUAQf4Fjy9H7IkoWyJz6agQntgAbU4k8EQzB/tH4SQC0MgRMfAAFt2IbpBgaERnlqQEMh0CqRRwE5sHzPBIYkcAWl8ydHmC92KHt0wzqFEAFN0A5zgBN/mIrC9EeDaEtjFTljBHL6t39HQGeCFV5IEIn8VwVQdolYAAZGYAC21IoshRjr94nxkgVKNIpcsBFwsCzBpIoPNUvFeBMhcASKGENqoIBgcARqQAEIgAD8h/8AVcCDdvZ1NwQGFIAF7mQTR0g66vdPWPh6WNgGGhMArUMIEdCMQgAHLuCExrNZ7ceJLTVUaOR7QdiNPMhy4RiOu1iOllhJNxRVAIAFQdWJ7uRVgBiNCcAkAcAiiXB3G6ECxyZpk8ZG04VAxIMfVlUfE7AFUZV5e7AHDMAAFnCTLJCTOWkBNbkHEPCTdiaR7EhVQ+mO03JLsiSNXkE3aACSq9CMGwEBUDCVVAkFGHCVVZmVU3lzBQYCZJQCNqkDOjAAZEmWBXCWaHmWAyCWOsCTDIAAKQAGE7kYp0IWwqSUXuEHKYKP5ROSCNcRKQAFYmCVV1mYhjmVhpmYislXYGn/AWwplmWZlgVQlo8pljX5llcQVSAgSbkDkIHzPLJnKXPCDKQoBCMplYqZmqqpmCZwBY3pmGUZmWpplmSpAwzAlpe5B5qIBVQgBoO5lYSZlaJ2kuSkB+YEbflYLxFAhR3xBWcgBqsZnalpAGAZjrc5AJKZnWt5mbfJkzO5m78JnNKplWJQBx+QIk6SnKpQmh0RACmAAdApnfK5AofIcimQAjSJnZJpmxqwBw2JADTplhBgdSQQnlQpn4Q5mBCQIv9FJyeBCdHWER2QAnIQn/KZmnnwAR9wnxrQoRoKlpFpARqQAh9AAynQoXAJljWpiR/AABmglYIZnb6JAQtqGwGA/ylTgQnMCZjPaaEXepUZ+gEacJMpEA5AwKFrWQA8eZ9F2qE3qQE2iYgAcJts8KJZuZq+CQU12iRM4KC8QYo7GgA/sAcx+qMYEAZlkAIsYAE0IA5X0AVF0KFoKaL3+QNv2gU0wAAswAA0AAEf0Ad7oANsQAVZ6aNX6ZtiMAZtYRuX4aUG8glNEKYTegY9YKiqGQYGIKQIoKFf0AU/0KEpYAGTeZ/hqAKe+gUfgAAaYKIWgIhUSqhVGZ+IigFjsKWV0ah9aSCekE6m2Z4d8AUQQAfwGZ1jQKIMsAcc2qEasKEDwABCKqKqOqIpgACOaZt+OpmDGp6I6puKmiK10R2Oqv+rh7B67NCeAfCrM3kGYbCu7LquNokANnmT8moBV8AAa+ma88qTN1kAlgkBGjCZepAB21oHtbqo2zEHaLAi4SquIUmuHfERH9EB3CCOW2cEPXmbY0mWzmqvOnCiZKmTFoAAYymWezAGgcoAhFoHbPABBnuwAWB3jcCw+MAiTBChSqEUErsNnzqvbbmWPmmZNJmxssmvx/oB4AAEbeGt30oXDaAb6imzpEmz5XqzVNsBHUAOKoAN3XCZRWoB2PC124ARAqAx2yEglvGydhEVUPsdoPAHuxChHoEGczC3dFu3c3sbY0u2Zbu3t/ERQnBSaeuUayuzoLAbTcALU6sUdnsSt2Nrt0mxETPABE57Cbmqq4EAADs=" -#define ZEND_LOGO_DATA_URI "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAAvCAYAAADKH9ehAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEWJJREFUeNrsXQl0VNUZvjNJSAgEAxHCGsNitSBFxB1l0boUW1pp3VAUrKLWKgUPUlEB13K0Yq1alaXWuh5EadWK1F0s1gJaoaCgQDRKBBJDVhKSzPR+zPfg5vLevCUzmZnwvnP+k8ybN3fevfff73/vBAJTHxc+khL5kr6T1ODk5nAgTRTWloghFVtEg/zfh2PkSvq9pJGSKiX9SdKittbJoD/PSYkrJD0vKeB4IsNNotfuUtHk/CM+IvijpF9KGiDpGEkLJZ3lC7qPeKKTpD9IWiDpUOfWPCi61ZeLvD2VIhTwp9QlTjK5NsIXdB/xxHmSpvD/OucWPSAyQw2+LfeG1SbXVra1Tqb785xUaNdMel0g7Iu5V1zPv6dJqpD0kKR/+ILuI55o8oeg1bFT0kWSOkraQxK+oPvw0TZR3ZY758foyQXf//ZxUFh0Q/GEfNf9gHkaJ6m7pHJJSyTt9tnXhxtBR2EGlnHCMbZMaHuHzX19JZ0u6VRJh0k6hM+BpMjnklZIelPSNhff3V5StkNlEWBMFm+3LcC+BW3GuZP2GvfmiEiCCMUzxZIKRGSt9zeML/fdGAW9JB3O8c6SlMZ+b5f0qaQiF7EpnieXY1auvZfG7zhSUk8RSS428F7M5xfsh1eAV/vxOzoq16sklZBqbdpo5H2qDPRQXoP3Ki0+20FSFyrZUgt+Rt/7KH2vZb8/t/iMG2Sy/0dI6sbvgHGoV8a3xErQb5Q0iTfHCplkzlkW7w+VNF3ST7QJUzFK0pVkDFiw+yV95uC7r5Z0k3CW2ApwIkrJ9B9IelfSh2SIlqC/pDFUZAVk0rQoMhk2GYswx+AtWvMKPtcyEckW37pPwsIHNAuBniDpYhEpBMmJwvibJL0gIlVh39r0C8UlczkXQ/mM6OtEzuf3RfPVAxUY47f5PStcGKPxpOMldbbxiBptPMavJX1PuQ/P/olyz12S7rD4PLyqBTQ8gyXVSOot6VK+dxR53wyl7POjkv7pkpcwpleJSCHP4eQjM0BB/ZuG4Hl9EO8mQx4ZQ0FfL+k+k+t4wNlULpkO24IGnSzpQklzKPDRAMvZ1eXz9uXfH/Pvx5Ie44C5zYQXUgDPj6LEnMCQ3AFkjjupjGF9/kJmxPw1oiquz+6dalXcCRSmYxwK0kDSRI71azb3Y+6GiMi6P/5ey3F3YpExjxdQoG61uX8gBetkh2OWFkUIVGUT1pS9yosZNu1nkl8uZH+mikhxkx1wz7mkB0WkXsKJFw1ZuSWKotY9wjNJS6mUy41JK5P0c2qCnBgIeQWZvEK7Dnf6WUljTT5TS7d0KwezkJShdWIeGeuKKJo7FktUQylcl0i6RtL/HH4OjP+wB0UTLTGHfubRDWyi1g7SaoZQ495z9w7RpaHKqHEfLeklEyWzk+7dl3TTu1KQCpV7+pBB4IWstFFAgvOpJnTL6DoW0xPbw3k/nIYkW+kbmHeXhUEABklazrBDBdzTDfyuBo5DPq1eoUk7ZbSk70l6n3MZjUdCDpQvMF/rezn7/hX7Xs8wsj/7rsrWdQxnZtrwwENUosJkDDZxTjOUkEH1ds6lzJyDZzGScRsonGNcMCIG+WgRKTRQ8Su2p7uRi/mlKjZKekREChS2KIOcTvfqp3RZDlM+cxnfv8Thc75Pt8kqo92VzNTbxBqcQlceivAdByHDIxbvFTMOLovyHAGGK3qc/jJDoDc4hpjABzBm4UAglBFqEAOqt8mB29ss4uJnNCHfSK/tVZMYEfMykt7Bcco1eDLDHCT8gmzzRdLHZL6wRSgzg6GIgVl8Xj2uhPA+oQn53yTdK2mVMC8NzuJ8zaSyM/ApxyzWCFJRvUQ3eQ29BTNFcRgt+FTl2g30zDZZtD/ZRMifE5ES6Y9MxqAHQ7XZikI9nd97j5p1f83GZTPr6Crt2sOcOB1zTYT8HrqjVRZx4wbSAt47SXn/YsZV9zp4zuvJgNGQRaszmoN1rBY6IH4dHiVHcA5dZd2zeIbPv8ZBkghYTQFTx/h1WvSz6c3kM5ewGG8Prvxc5DZWS2u+dypnM5Y3sIJMXmbxfXW0misZN56oxITnWsyl2fg+6+C+zWTefMWr68RwaYF271htHBZqCsKqL28wB/ACjYShrE9nUjfWmEU33A7woqbR4k5UlNk4yoYOzOHvtGs30KO1QgnlZC2VohGOIGn7WEvW0ZdoMeCHfBgdo8X++m3V+s2wEHKzJMblJom92+ne2SHDwT1gknUispPpJLrrVZqwLxTmy5F5jOdVS72F/b6UwlbrcEytrD00+a8l/ZUM82jEZd8peu8uNYS8JxNWqis5IYqQCy1rPUULh8Y7fOYal3zzmPb6aJN7zlf+32bBV9ESclNE85WUX4j4oNbl/fM1b2eoxX3jyXNqiDTP4Xe8Rm9ItfSjvAr6DM0d+o5MXW/CuHO0a7eZTLYT3KF9LktYZ/WdCI+IkoV+lFZ6l3J9OF14HdM0F3MrhXxFjJmqhh5FBera24XqxaCqL0UosK97Z2ku+yJaEqf4D62ByoROcjZuN78Xaa9zTBSzKvxvC+vlrmgWVPU2h4j4FCO5lZ+vNBnpYHHfOOX/PfR83eApTaGM8CLop5l88WSLWAOu4AiNme5owcBO1xhlLGO/eGAFkyYqrtFe5zKzqU7KBE5o/BAIiv7VJSK7qV4GhEF1XtSk0YseWl6lWYI+cXj6pigJLkH3Vk0qfebxe4q0JGOGSDxCWn/Nchk9qJgMfGKS87LDes1IHeVW0LszgaC6sPMYE5lBt4CzRcuy4lVMLKlWfWwcJ+YpxtcGjtOYfzRjTgNIlv0rnpyCveeHNFSJ/jUlonH/3nNYqyOU28qYhHOLbzVPqFc81JQDKxnQ5twLdmjfmQzlxU6eoZ/mma3y8D3VonlhUr6bElhMwJ81RseSxW+jfOYULdYGAw5s4WBtpeU0ijKwxnp/HCfn70piCNlMFEUU8/WpmnZe1Bq80r96m5yMkIwx9nnNHTWFs114q0ArM1HsiUY7j5/rKFIThdrrzR7agHyoy9vd3Ag64uEfKa+xjIKlLqtTUBB7FWgJrQ9joFl1d2cQ2wzHaeDXa6/ztO9Wx+OT+FrzSAKuV12ptOZp+ljnaVawk8uxDpnMZXYCGB3PXqe5sl7QQ5ubhhQR9B4mQpvjIR+gJgrbOxV0rK/rVUyXmyRWdI2a2YLEhVP3BwmN9sJ9BtQpKkxiSDOrUeUhaeQaPevKzKQ3oIVTSGatcynoRl29sIkh440a8pURNoz00Ab4Ts1obxCps1FKl8k5IpKbcmsgu6nz6ETQC+iSqoKKOPmVJBmYnDjHX4EozB9s7TgwykkyYS13URAHpmstYIloOP/HEi6Wx5a4+DwSpH2V18tTyHUPm3iQeS1s09ai4/0ntVgNRQmzHTRulGwaQNnei3FgHqPcMBEJlXrNioAaE8AcupKBd7ElBu1uTxCzg+dmKB4TahiQNX/OxssAb00Uzdeci4S3FYhEQdfkWCrc1cI2K+2EDhsP1OUxZGUnOWTmcgphV0UgZ4jUR1hLlBiuJfqJpb61CXimOrq8RqiEeu6TU3iMwdzYgWhUnWHDDKr0ptLar6USqmOfYYiGMMTUN/KgziGVTo+pNJHBBfF0zVAQc6N2DUL+tcO2Yc1Rk2ss+yBmOko43yCSCljJXAWA7PD4eAt6MBy2yiNACRvVVN05t40pPLYPsT+zlRDpOLG/Jt8OSGKhmnBpivV7q/Y6JkucVgkyWKb52rVZwl0tvNDi+AzRvKjfK1Dnjvpd1FhPEc1LBVsbqENXN35cFaPY2BIVGdlWYZKqgPPj/RythNtpcNycpoOxwAae0bGwhAkAQg01cfiDWDRqZtHhCqFQ5FAtOXKXh/Yh6Ci2N5YMUDW2SHg/N3scn02N++cnMIZCBdwS9gtApRxqDc6OlzWtSrdc8cJGlzP5fzZDri1tQNixISWL/5fSQvcVzfe/wzXfSG8Kuw03pHB/t5KMik+EYJ1EC1d0zCw6fofqRI2ZJwpvyxN4uPs0q/6UR2szyESobxatf3aa7jvfrT0DGPNpYV3H3CI0BYLGllQdy7TX14rUP/zzDHpuRp0EPLnJvH68Qij/RXnyIyku5Ea+5S3NO7s01q77eMY1qqY8T7Qs+4qtq+o2UWhjZO6HuWhjJBlZXWbAHvbFSTAxqMW+RbuG3VfviAP36tshujINh6Tr3kE0BNMl5x8Qq6+mVTdwrMlzpRrGaGPzVpw9NDNFngjoFZZzRCS/FRPXHRZT31X2MgfYTQYX1WE1moaaQJfKEFTs/camkXnUwt9YtNWPiuc67VmRlb0yiRgS/cAe7is0QXuTAm9kikM2DNc5OkeGRaMU8tq0TJHbUCOtezMeRfITiSv1PLLbGE5gb/NOB/1AuR1KlLETDltidyR4XIPasyEnc6eIbRa9kfNifFeXJOAnVJBiKfFCvobcLKccLHWojHJpIPH3iXQlpoNLrdcH44sucvmQOHHjZ9rDrGdbixVmbk/XGy4mtiKuoQDjmQpFJLs6wuSZvqKmL0ky6zOZLry+420UKUaue5ooyeqy9+iopgM989cp1Dcp16bSU1tOJbyFyjedTID5wOk6OAUFFXUDKFRLkmBM3xH7fzIJwPLsxexDMWP2b8g38DqN45ywCuH0VNuv+XmjwOYCjtUakbg6AkGlNoQGBMB5A9g8hh2g7zFE2U4F35FxfHfmwwbxcz3Yl32C/oAwPwDAS6UXdpOhXPZ27Trc9R/SLTla0zzGoXl2QAexnLVZJB/CZMpV7HthfL4lJIrb54u+tdv3/rCiSbw+k88yM9ZxXgKwlHmZycq13iSr0KeMHmUZw6r1VICrLT4D5fy4wq/5DAvfjaWC9oAd9KxwTNUJynUjL+EqpwSTME1zOWMBuIxmZ7p9RCsNq+NmdxW09I1MdNkJeYZNHsIt0qKEO2Z4kvmHadS+Xqv2cqzc93rpuhdl54tg2DISuJljBW3uZjMHrAPqHOYK6zPIM23G2+14Rts4cyLbdxo3Y667UskOo/W/m/PwRhQBwZFkT2vXzDbTtLMZCyfP1155bbfDrpjKZoYH41bO+d97jmEgMPVxFMF0iHESIkiNtDhKuwV058cw0dBZNP+lFsSU/6VWf0E4P/x+IF2eJnokr4uW/2jAKPYjjRb7Cxef70c3qsCl0im1Gj/Uu2eF6sWo0rUiTQq7zS+pYjywnXYwcyOZfI4mKgHj9N2ttHqbRfSlQXhjw5XXy4S7ZbzOovkxVRsphHp8ia3HlyleZS1zHcvoVrdjuNFdEe7edGHzSbpSria/WZ3+cxYV5DCx/4w7FUfyfTW0WO+i7x2YrzKUXZFw/sut+OxJDGkHUxEZPwgCquQcIgxZR9oXekDQk8FF60bqwocupaIoEz6EmaC3C+0Ro6Wgp4eb2tpPJqN+4xXFXQ3TfUfCc5PDNnLZDpLIV1NADKyjZa87mHgmWX57bYdIfIY3pdCGf43xQUXI62kBn3fZxi4SPC8crIjDQ4yzFAaz/XcPJn7xf03VRzIB5Z7qCbBzPQi5jga2E9bCD+ELug8ficEZCk/Cmj8Ro3aLtLxDR1/QffhIHNRTUZCf+S5G7SJBp2b7G31B9+EjcVAFEInZQ2LU7jiN1zf4gu7DR+KwTvkfO9bGx6BNnEQ8XXmN5cT3fEH34SNxwN4A9dgknIEwyWNbeRTwV7WYHBVwFQfbwKb7vOUjiYAiKVT1PczXqCLD/n5UbuLcNxTKoCgExSFNmsFCHI6iJBQFnUbqqbWPHyFceDAOrC/oPpIN+FVaVLrNUa6dLPbvoEQdO4pd1OUylBVkCutsOkqosbNvwcE6qL6g+0hG3MY4ejots1pT3kE4P9QDdfuLKeDfHswD6gu6j2TF2yQcLoqEGurre9EdP1QTfmxJRdn0NlrvD+jmY69Egz+UQvxfgAEALJ4EcRDa/toAAAAASUVORK5CYII=" +#define PHP_LOGO_DATA_URI "data:image/gif;base64,R0lGODlheABDAOZqAH+CuDk3RyglKszN4qGky9PV57K01ENCWIOGuYKDs1JScpCSwsLE3qqs0ExLY1tcg93e7Ds4PG5xpWptnWFjjXV5sXt+teXm8JmcxoyNwbm62Wtrkk5Oa3F0qXp6o4iLvXJ0o3RzmI6QwVpbfuLj73t9raSl0G1wonJ2rJWWyLu92XR4roWIu5KVw9jZ6pKSxGRmkmtun6WozpSWxS4rL1NRaLO012xqjFxbdoqNv2ZolmhqmpyfyDEuOa6w05yczVVWeJ6hypaZxYGCr2dplz89ULy+2l5giZiZyIyOv4mKuldYfLa319XX6CIeIGxvns7Q5L/A3Hd7tHZ4p19efZmZzG5vmHN3riIeH////5COj1lWV8fGx+7u9dXU1fb2+oKAgayqq3Ryc/Hw8Z6cnePi40tISbm4uWdkZYmJtgD/AEdGX9/g7ZuczGlrnG9zp4yMuri52bi615qbzKeqz9vc65qcyWZkhGhniaeo0m5woIuLucbH4MfJ4WlsnJeYyyH5BAEAAGoALAAAAAB4AEMAAAf/gGqCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXlm0/bXOYnp+gP3l5Nj4acUwaGkwGPj4NMgRBPBhCLQtJIjkfGTkiLymgwqENGgx9TQVQUAN9fAxRUSpyrK90sbNCMy26HwgAFhYVVyglFgkZwcPrjCZxfC5sbBAQdS7JA9QysyIf/iwAEQgEQLDgN4LhpKxA8UbCCT87nkwZkoSdRTVBbAxgQ+KCRxIk8jUQskCKyZMoU6pceXJcBwkTduiAQeEIBStDRFzEFIQJFI4eL7gwQqcFy6NIk6K88iYGjCNHHoxYcsSDzp2Qfmh0AYEjBCMEWCgdSzbplRM6HiwBokDBiCkz/7AuMqGhQBMXdQoYSFK2r1+kHWAsUcCBgwM8CeQayhNlAJQCA3zk+LtyAYbLmDF8oJz0DQUFDtasUeBBsZo8Rvj0GcBkBueVH7JwmU2bS5fXSt0sWXPggIMQO91FYcCgAQLcKzFwwcK8uZnbyJN22F2kyJrSw374kGNEBQ8L0VeqINO8uZgC4ZVeeXAgQAAOcECZMMBEDgEA6VcWEFOeORkV+Sn1hgLu9XAHJnPQ4YMBMhwXoEpdmNEfFlwQ8KBSMazRQw8H7FHJDzI00EBJF6YEQBYTYpHFZiUm9UAAGwInSRsE7ONgiycpN6EZX+ColB9F0EADFZHYEQQBM4CH1P8HmTXZJItHqRDGhGJc0CSJLDHp5Jb4jYWCAzQIUMMjSGAQBJRHffBFFmy26eabWXRRQANdolQAGBOSAWebFwxg4UkL7Ckom10M0IBSQAgggAONzCAEBmIpRcByKVZqBhhcfAEgSl1sUWmKNGyhRRldkGjAlJ9OuAUYXnRxKFIjCOAEo4psI8SNSY2X6qdbeAFBlyfu+ikYY2AgxQB4CqtqGQMkNYITTuCQSAoitIBmUhDwp2yKYUBgEgZebJsiGrdd4Km45dHgRbNIrQEtdoX84ctkZX0hIbr9eQGglPjm2wCK/TZHQxl/HhWAEwIsYEg/9JIVW8DlbdHjnRAzp8X/BeFWjIUY0B3VgaxjEpICAh/UOdakO8I5xhnaTugFAZ1OyMWbY3CBRopaZIFqxHCWcca5E5aBJUsKQJsGId7gOpau/YnhLUoLNNAFeRNqwQDA/a2IEgYNfBFB1VloUTW7gBrwRbL9hWGAUjTMOsgfACCgZFnZ5rmpiVl83XQWGZfH40oQAN1czoIzd8baKn0wBs53H7UEtAqrIYIFJpNlr8wFpxS4qjpT+XRKMfd3RhY0BG3sSqGXp0XjLHUA7Q2CsJBQXw9POMa1J23eHxpZoN3cfyoFG3QZE9KQxVGpD846S0W4rUY4c5OFcn8R9MjS5f0RjrlK4BafxRmqXnAU/9blAa8UB070IEgFlDFdHhqfp1R72uQ3d7tK/Pa3Rdhjs4QB8dtTCgWgJYgVUKZu2VueSQwAvqD1rTnV04/vmAOGLBQOC4djCQOo1p/7CZCAKbgC+/yCvfJUiCXJY04EOre7+J0khVgIA+lMtxIAeG1C5CLLAJ0gCBQYsC/C6yDujkWp7PWuassLYnm8AMB0HU8/HCxPGBS4kh0KogMoGCFZdES9J6LkAwXwQun6Q4MxfOGCJ0xJ9yb0vfBxDwJinFD1KncUK6phIVpcWhSZQy4V+FEFEOjCGLQwRtENoH7M8SBK8sczsWWvC38EZBfK4EiZUXEl6FPf8zpwhb7sR/9VWghlKMVwrxSJ4QsEeKAKvWinCWKhghcUlSi1QMphia8szaPVB97Qgb5ESGNo+MICToVDF5rEXBOSYSEDdsqhSed1gkiBBN7wQ6UosV/NPJYrrbYSRGKBiRoDgzD78jgnRO55EujlWNbYLxqcYZxSQGZ/uPCqramSOW0MWATOcAFnss15gnjBCSTQSaUwUlxmIMMYBlCnGXbQn8TUH//wZQYZMoCOSSmaE45GiCGc4A1joZj+ZjlLMnBhDIVCU6BIGkpWnkQFXGDp6C4oBpaG0qQoZcAQpQMyQ6TgBCdQJ1JgyIUL0IMeBfgjAfxpEkAe9aiZA9QAnkqPQy6TOV7/MOpRk+pHAux0LAdL2CGSEIMToAAp10wkU30khQU0sTxZwChy3OUEeBkiAWUtaHLuuUK2sqQBDYxYx/JTTmkpogR5ZclB+WhMv0qBAZVsDhjQE6By0moRiDWrBKvGAMeqRHdSvCRlNHpZRpRgAjHoQB6lQNR6etYkeXPZ6aLTgQNAq7SNSABqJaDFtGJhDGv10QIWx0a5+oUIPYCWYSOhhCdMQLNS+N8Wpktd3r3WntSlLhgG+xoFyEoAMprEC0DghxjwFgAFoCo9EHddKaBXvRBwLWWIcDAnRICjlkiAG1D7htW2168nsK1yQfGCKfgBtar9r19RwAFZOaEI+AWF/xL04IYD91fBJTrBGhzcg/CygwUUPrAEzorh8BzhAIoSQA9gpxgWgGAHbnBDDKhZYsr4gQMBCJMAAsBi0wgiCSUgwg5gPAEa1zgpEyBQD4QkJrv6eBApSIAedEAEIbshqP7F8BuOgOMNLbkIeHjBkxfxAinr4Mxn3sFHSXzdHRxBAe2B0YYOcAMPjfkRL0DAFIgAgz77mQh++KhQ8zMBIjwANNVxj6JxEAI735kSIhjCnilA6UpT+gh9rnCg38BpTkvg058GKlCJcGm2iKY3B6hOEQJwABxsIDGPFkYKPlACEFgBKlB5gK53PZUlrAUIbGkLYQpjmNCcujdFUAAVbjgwBDHHWjEpUAICPOCBDWwgLb4GdrDbQmzDcIAKIxiBFaxQgmY/+9yLEEEaEHAVdLv73fCOd7wDAQA7AA==" +#define PHP_EGG_LOGO_DATA_URI "data:image/gif;base64,R0lGODlheABDAOf/ABIZISAeIhwhLA8jRwYlVSUoLyIpNSkoKwkvbR4tRBUwVDMuNysxOx87Yg89gDo3RTI5SgBCkDg6PDY7RyBCcTxBQz9BVD9ETxxPkQ9SoktIYkROVkpNWDJSeilVhkxObEZTZQVevgBfxVZQZRxcn1BUYFNTc1FXWRZht1ZYVQBm0ghlzBhksVVafyNlqSpkn1hcZwBr2EVfhABs0lRdcF5adRJpyWBcaVlgYl5dh15efh5q0gdw3iFsxhBy2Rtxxhhx0Ttsn2BkigB45SxwtDFwq0dslGNoc1pqfRtz6GRmkypzwFZuiQl772psaWlpiiF25Ax94zB10BB+3iV44BR96yN71TJ5vit7zih73GluoDt6tk53nix66QOG+nBwl0l7r3F2cjOAzSKB9guI9SKC8HF1lW90pm93jTCC3SaE6zWC12F8knR6fHV5gzaC5SmH6ESC3y6H9kGGyiqJ8UuDzXx5oWV9v1aA0nl6qWmAnXl6tHJ8tV6AyVGGuS6K/EyHwyKO/D6J5T+K2SGQ9zqL3ziN9jaP6jmP8WaHwYGCsHqIkC6U/C2V9naFv0GS50mS2IGFuYeHnEWU4iyZ/16P2ISIr1iSz4mLiF2SxV+TvImLlmiSsnqPrIeLvzmc/kOa9Uaa74aNtHWRyXiSvk+a6YyNvIGQwo6OsImTnFib3lKd5l2d2kKi/WSd0k2h9zeo/1Gi8ZSUw5GVyn+czE2m/46bsY2ZyHugwUmr/12n8GCn6pieoGWn5Hekzpueq26n25yby1ms/ICk25ejrlGy/56iymav+V2y+2yv7Wex9KaopWG2/1e5/5Wu2H216265/HW3/qus0aavxWe+/66wvYy33YC4+Hi7+bO0uHPB/aq3wa6112vF/4e/9pfA27u31YDF/XnK/5PG77y/25TI/MDBxYbN/qvH7LfH2qPP+47V/57T/cPN2abT9c3M5Jna/77S7LrU57HV+KLg/7zd+tbb3dbb6a7l/sbh99Hi+Lrp++Pm7+Hx/P3//P///yH5BAEKAP8ALAAAAAB4AEMAAAj+AP8JHEiwoMGDCBMqXMiwocOHECNKnEixosWLFoNpDIaxo8ePwaRJ4yaNHDhw5EySFCnNmEtjt2TJMmXKk01PpmbN+sgTZEly7+7de0eUaMqj4FaKfBlzps1IkfZI3cMnzx5Fnnb23MrQGLig/PgJHTvUZEtjNZ9CXcu2bVSpfPicOaOlrpY8ikxx3fvPGLd3YQOHfUdOWkw+jkaNEjVtquPHkCNLnVtXieUcSr7k5YvRK2DB9wrLctSnUi9dxYpRo6atEy/JsGM7pqskh+0WLXLY0csZYrC/QsOGNubplrNkxWq1Wp6rObNu53y5kU2dupbaLUxob5FHVu+Fxsj+kb3HzdTUc/TonWtWrLnqXMWaiQvnC031+7LPKMn+4YOGJ4p8Z1BJRA0ljSeQ1XMOPOt00wx7xYhDjWrinDNOEFzQwgd+HEamnwkahGiCHQL+QyBR4MgSWzjw0CNOM+4xKN868FhjhB/PqIMON844c8spp6zlSSSexIXYUx06pkULGlhggQZfcObVUdK8FRs70NCzDnvNUeNgN+vQ4w4XfvSizDHIQAMNM8LooosyaWqDDTbhhOPNnc9g88www/RIHH5nMOmkBiT2FNJRxuBXjzAMTghLK/IVAyY843TgAhaHIKIpIXDQgUgjhwjySCijllLKKrqssssuqaqaTDL+e57CYQ4WPPDAB7x15BdKxlgp2zi9JBPLOetQkwsssBTTYDPwwMMOBSRYgQghdMhRxrVl0AHHG9xuO0UWghRSyCOlTCJuIZNAoq4qwMh63xkm2LrAExiFNFKV96GzyyOICPNIOfRQs9wnucCjTTf07OMOBREAQQcZZXhRxcTYUmExFVFEkUUWaXTscRqhlDuIGGJA0ssoHGqhwQILWJCrRPZKo+J9z5xpCBnUNtrKJwTjc4426bHTQQQzVHFtFU00AUUXEw8BxRBUDBHFtnAIksYUVpOLzDGpTjLIIJA40mEOD7AcJczGtORrbJ48E8orn8jhhRyv4AMPMrBQAkv+M14ijI/QRHeBLdJdMA3F0jzwAIUPb2iKCBwbTwHHI6PqEoub6c6xYcoWHHCADhEF49LM1UWyCyigEMIIIYY0EY56xeycCzO5NAP0PoDPEDG2XSR9eBeHQ8GDD3CUk4862AgD+cZZwAHHIY/EEssqkGjeIR8aeD7CQ6L/eZ8jlWg6hxVkQFxFi8bunOze4tCDzzgNOFB0E9c2UcUYSRd++BA++JCFPm5wwjLKcQjnZcEHQJjcuB6BKl2oQmwdMoHnNNAQWdyiV/iJRB2yoAY1vOEFVbBWFegBD3HkYjmtaI+X4PG++PmgfnKIobXKEDWnDWF4abgHBwzgBG/AQXL+kANCGg6RBitYAQtrgMQqVgFBDrXgAAGgoEJkcou1xeYWdZjCFKKghiqQQAr4o0N61hG7T+gtF+IQBz7wYQ0FEG0M12IEz0DBM001QlNU8EEa2nEBA7QBG5ATxLeAgMRChGINP0jkD7AghkQ08T4tCEAAapCQWZhCFgi6zyjWIAhr2MIFQ5DaD4bQBUS4Dx7NeJQZYQGdfdDjGQOIQAzo14h5yCMf+ahHPfIhj3ZsQx7QgMMg2jEBAbQBecd4xSOIuIZmkguJWFDkJWiRJA1IslAFmQVOMkmdSFxiDYfQhz/8gYQodMFpwAsFPlzZjJ0xohVoPMc+4OEKAkSACnL+IMQxsnGBC3DgnyXgwAYusIFslGMV1SjmAU6AAzfwIh3YCMUkelEKcj0CXWuI5hzmYA0ryuYBATiAdwqSlvvwQRVYyMI8xumPVKTBaEgrwzHWCI/YMeKdxdBG+9jBBQJkoAqBQAQ2NlECGJSABjCgwVEDygBzeGMTEyiAAUrQTwYUIAzeCIUtiPGNZ+jCVI9Iww/EcAlX+OIWHDoDFLdHkFkQyaORuURKB5GCaoxTD4gog7WaMAZvjJE9rUjWg9JTKQKggAyMaEQ53FDUauAyl/r4RQkY0AZ+HOECASBGNX7BWAEAYBGlYAJBcRAGTGBiG8oQK1kzwQpSbK46JpD+5MuGBFfI3AELQKBCEAxQgHbYwwWNKB+22JEeF7WHldQIEzy8kQAEZOETO5sHDU5Qgm08QxiNgEMhzFGCAlTgHiWYgATycad52KKYJ3gGCATAgA1woJ8GwEQpevCDQQACEHMwqzPuA0Up/sOttX0MH3oAhBn4wAPTOAANNpEFMuyVfuxoETy6cSxJSXgdroglHGbXCnnQwA1HSIcyJhaFQqSjuwzYBgcYcIRywCENkPhFAQBwAmJ+Nh7TIAYaeAsMIPRADHPwwxKuAAhXkOIUpJNMJAMwUvMEeCoDtsEKVjADEhQgAAIggRrIUIXCNYEM7KARPNIHC3Gs48zhkIH+YUEhDIGlgwM3cIMtjlEFKrzhEe1Y8QIka4BFxEINgngGGjy7iGp4Fhe64Fo8DAAATkyhB1iYQxBcsAQiXGELW8iENcwjmTNIkl7/ePJUPLEEKatABTsAAgUSgAE43OxavVMDO85h5mZANxfJPbM3GoCANLyiGMyAxDQ4AINNWEMYhEDEIdTxiwsU4AhouIAAqoEINWTBGRAAAAC2MWgGJEOZj7hEAgDAhTSgAAtXeIELWMBuEpCACJl2RqIiY4EoCsSkgOjBCmIQgx34GwiF4CAhhHutRqwjjetABnRhQawzZ2IAGXiFMNqjilT8MxvooAYzoMGObBxhAgywBxL++oiODmahE4xmQDuyvQFtvCIUhfCDZzlxiB8sYQ5bIAG7WeBuF5CgCGDwAy6SLJUPBGAB967OKbBggx3wIAYq4PcOfBAFOljdwVXwAjPCcY5uSCgXyulGs8rRAQLUgRlsyoU30MCBEpjjHubYBjGcQGwIpOIeMJjABp5BBzVYAQmePcI0ZkwMbQgjFpDoxKHhIIYrXKEIL3gBEdTtbgz8HNOcgIwSJCmQ18LGE3MAwgpUwIMh8LvfPqBCsgcOMTLQ6WDnmBB75lOODDsgFhpnRivmAYK2X4AGE7hA8IvqhnhUY8Vt8IYa6FAHC2h7G0gAwAbkMQ49pYMGAJAAKwT+MYgrECEIHog8vOHt7hcUYQuZf8zmA/Df6owCC1OOOg/KUIWnx2AIjYCbIT5BBkNwHRoVcg7MkFPUcA7eUHZigAy0Iwy5IA8QAGdHAGJHAAMw4AbbMA+PIAkcMAG8UA5UoAaJwGgXkA7ZJgG8cIK8AAOYlQrmMgiWFgQyAAZbQAQu4AKRB35BEARbgAvqx3n/EBeyUQdSIAKoFgM+MARkoAZPFwWH8AqtMC37Bw3noCZmdg51Uid+AHG6gAwMWAu5sA0TcAMlwA+5VA/zEA/qcAyIUArtQAzEcA/XQAVwgAsW0Ge2IAEAwADvBVAX0AbPUAhgA29GgAZ2wARgAHn+JPACYLAhlsAFXOAr6ycQZ+B5kDEKPzADoxcDw/OBZaAGqfcKyAAKzNEKwhAOycMiB5cM4QAMCuAAk6ANtOOF0PALxOYG/XAMn9B3VmcI1vYK0VAO0QAKQwAH4xAP98APSMBb9rANqbAIbpAK1gU9I+MCWyADViEVXAAGL+ABMiAKsBGJP0iJjnEKYtB0UcdvPEAFj1MGQ6AGsRAO0KANasIMyKAM2nAMUpgMu6AKl0ABCPADCrgzlNAKi1UCJbAJ/SAMhlAG+1M+VJAtjUAIVMADnggEVkAKHCAAOOANwrAL3lAOyhAKhyAujQdvLeAYkZAJWwAGRgAGcGV0SPf+D3twBrBBCz+wbzvQb5rYjocACogQCsKgDcmgDXUiDtCADLrQC7twCYDgARRAAAhgA8sBC59wU69QDzTQdsSQD7kgQkNQBWRAB1FTOFUwAxTpAzbQA53AAABADNAACj8EB8o2koUwB5dABGBwkpDhB2DABeIoFfUmRZ4wF5FhCnNgAyIweudYenCgBqUQC6FwDMpwCZcQDuIgj/QoBhjgAAiAABGAAoeAQq1ACYxACbnQD8SQCr/AD+wACnJgOF0gB0l4Q1BABTuAhFQABGswaAXwDcIACm8ABEAgOWmALqswB98nBJEBhJ32aQIxC3MhjqfwAzbgA5mYOFDzBnD+AIqxIAzQoApqgg0AGA7FgJRr0ANWIIrKwTNVeVOtcA7lwA7qUA6toFdlADwhlIRwIDw8MAO46QOq4EvtgA1PSAVU9i1TAIjdRwQyQJMdsmQjJZOE+RiJgJgr4G85eYRcBAehoAxvogtzIJnHsHU/U570CAqUMJDtGQgsGghyEAipwQgLKTiFwwP0Y3VUUAVQwG/0wz9AEAq6IAwF6gMxMAPDmQZYMDLw9gFJsgf91VZa4KCOIQYhMGX+dkOpJwiv0ITSswu9sAXKoAxrwnVT2Aq0U5Us6gVj4AV/4AVuOgayWQZKMzFQwJD2Uwaf0nemN0sMOQPVyYSgoAZRMAT+MzADWWBESep9QWACSRJbAfAy/6AIUeoYjrAEISACiTkDVAAFHVQ1QJoqqpAJXHAJpRCPxGKFDLgzaKqmY7Cmc+OirZo099llWVcGhNAIPlkFQ5CTE8MDK2ADUfAKjaAGX9mffmoDRyQGRFAEMpAkahUAbAWlkyoVpmCpU9ZviVMFzgMKoTA9quAHIAABMgAJukAnVmh4yqGqjOCmavoHbeqmMeQFhuAFSUM/clAFt5o6N6QCsUkGUGCkbNYKXMY/MxACBktfiiql+AFSInUQplAXm3MLV2ChM8BvnKpsoCA9q8AKIBB8MNAJvYCU0BAOsEg7N0WagcCmf7CmcqP+pl4AMU3AA0nQBHNDBqCAq4SgBjwKMTxgA3Bws2QQCOwIBDZgsCGAAijAAkSgBNV0TQkhqVowFXOgb5m4A3KIOofQravgCv2EBlFxCqzwJtigDfIopGj6B4HgroHACHLQpoaAPxGTOE0gm4QgiohQBToLBS/bBf0JBy5KCOzoA/SFAkeLtCwQBEmyZJSkEHlQF1LhCjeZiUaoBoggCC9WCKWgCRNgBo7BB6OwC8rAdfLoTmzrru46BmjLqknjBUkws0GLq69QbVRQNLLZBLs6BNlSBVNjBT2AtL7LAi7AtE4kSf7FuHWRB7TAdIrJb4VKdVlwCLqgCRcQGZ+rU/D+eEJoOgaBsKauCqdkUK/1ijOgkAtwmUcvVD4xW3p0ADxRAASYerRLkAEZcLgRRLwP0bhaUK02UKinJzwW8wbQK72SMQracK4Tdyw8Q7ot6qJyUK9dVgafAAqxCwdRcIQvS69OYzQ8oAJWWqg2sAQukAFXcI3VcQb1Zm8QIamKMLGYuJMTmXocmgycML2S8QxXCA0a1x7tWQvIgAyyA13r6gVlkITQlSkV/JDcGzx1+nSh5KOEdAUukAj4oQQLIEmLGxGm8AWQ0AP7u2+lJ4eI8AqSKcCScQrnYIXUIAxww6JoGwitADe31go3VZVPyK2QY2CqI1zAMwR0QH+h9IH+U1CckxBk3ghbUHQAZzMRwcAKkXuhBna1r/AmmUDDNUyy2oAMuVCVbfsHhCAHhvAHMbS2awu7W3oIUmADWYAIrdAImlwGjdAIgWAIA2d1zyNRG8uD1KEEIBUAEgCpEjEOa4CJ+5Z6VysM9QgMG/CXUvEM2kANOCwMtcAIaXtT0iw3oMyilEAwuRAKoVBEaTC+ckzNN5VPrEctcNAIo7IKyYDLsKEFJzxJHjEIUubFX6nKbaIMwEADlgAbySMMbCIM0tyiN+WibhrL7vnGsaAMkDAIsXAMwgCUzQE30izN5UMHyQYqDJQMvgAbfPABUBQALvMRqmAFhXqbH6jKDo3+DL2ABJIgGXygDasskC1qCIbwogu8ttCVQuWpDZegCvdYCkRZtlXpYMJl0VGgbJfTC8DwGKjAByrz0QuQyB6RDGlQqM2rBuf8CpezC5xwBPy8xmRwzS4a0HLzou7phWhXjy/ACspQCshAlOGgxmgaCLOJt3J4CKai1L5CK55zAPPCFX/opzPgb1RXy6WwC5oAA9z0GL0Qzg7WtgtsCGlr0+8kDJYdJx6wBazQCw7NDNpQC+tJCSwqm4aAMbU8CaowCuahBR/wAH39AKC2F5NAtBc6dVQXBYJwKq4AA5bwl6uQOgHNrnJQzaBs1gMZ0bmgDcrQAAPgAZcgppg5MIb+cFMQcy1yuAZ9cAd7oAXxsgB9PQLYxBeQUGAVW7H9EwVTcNjAUAJfYBdS6gmlgAhBG7RuSgij3bY2nc21wIC58ArQoAsNoAAYAAbQIJ7Q0B7qKt9VkAXYLRc50Nos490W8ARa8R2qQJ3XqpPEk9DJgARmYBkgXheTeAd9sAZxoAbWPDdqet9yBE8nlAv/TQEUcAWqMLbNDM2fQDl4kN3bnQMmUCtlwzIT7su9AbnzvLw+MAXKgA3JwAZu4FZ5AOJSrgQifgYk3gd4YOLc4jgRLJqX45R2yQp8MgqOsCHX4eNNAuS28gA18AVEXiLleKmJqQIGlgXlus4wQBCmoAjAUT7lII4ZVO7eczHohG4X13EZ2hEiTrLotWIBbR4gJaIQl0C4mBp/SV4KSQkMOIAQ2pQHefAFthHqop4DuIEb2nHq2tEf/REirM7oJqADAFLhkc4QlI6pdH6kupAMu+0QlhQJdmAHX/AF2JEdqJ7qqq4BH6ADuBHseCHrs/4QkEu4iJlqFrkGk8AKrrABPEETkfDmz94RgEC4IWCkVpAG4eKlmiAB377uFeEKS4ACNvADQpQG5LILwMAE7J7vAhEQADs=" +#define ZEND_LOGO_DATA_URI "data:image/gif;base64,R0lGODlhcQBIANUAAA0NDgEDBgIFCS5EXhUdJwUPGgQKER0rOgABAgkZKiZpqxhDbQ0kOwobLQkZKSNgnSBXjh1PghpGchQ2Vx1NfAoaKiJYjQoYJgsaKQECAzdQaS0/UTE1OQUPGAkaKh5ViiFclRpJdQocLSBZjh5UhhpIcw8qQxc+YwwgMwcVIQkaKQgXIwcZJTM6PwIEBRkaGjEyMv9mAP///8zMzMfHx7+/v6urq5KSknNzc1VVVTw8PDc3NyYmJgcHBwMDAwAAACwAAAAAcQBIAAAG/8CZcEgsGo/IpHJ5/DGf0KiU+Ks6p9Kr0KrFer9GbReM7IrJ6O95Zt262durUy5uD8/rtL58h7vlf3+AcHlsdoR7iU12eIhzbXVVfpOTgGOKiWNrkpKUhZ99iJijl4d5kFSdXKmdb6OvsFOXsbS1oba4ubq7vL1DNjg6ODW+xVg3OTw/AisCOMbQSsA6AD8FDAsjIwwv0d5DNcnLIhMU2uclPzbf3jwC2Ofx585MwTfssD8n8vwjKDpLcggo8OMZPkw8GPSTN6HKCxg5hhHJ8WOCv4IHFeEwsDAeiQULJjBYUQXGM4oWtTU0mDGNjR/mOi48gcJKynMrW+oBcFNmP/8SJnri/JFDJ5kaL0T4XLqwYVGjWGy8MFCCqVWGRKFKsQGgAImrYIc+1bqEq9ewaEc0vEc2CdKzacOmY9vWxjoiMAx81Sajr9+/MhaE2Iu2hAAexPraJUbGxo3HkB/f/XKjCgBhwH5kOwcYsAoU5dKSMIBYSN8cOSZvxRGjtevXOnREZDwFhogSE1AYqKIwXl8VBlKoUNHXgAEUJwhfJVGgtGkZsek+Afa6uvUY0bFUjEdhgnJtIUwwmLDAb4cU3tM2pz2jb/YnN67Lr/4eSuWYPkmEGDyiL4MODITgm1+CkdBZgSh00xkMOkiHRHzWxSahDvNJyN4SG6HV1wSfJcf/GWAMdObfCQv8IOILDUoj34QTrhgbS0zAgEJYfqGgQnp8yXACA8N9NkFfHQRX4wl+6cADDH2h6KBdz7jIYosRShjFdmD5B6CAH/JIHkgh9JUCeuXJAOBpPDTYF4MO4mDCAU5KmMMNxNDAWpSx2QdTlTJwiNxeIhbYnwzDZeMlcTLAAAOc7qVIxAsVsrjkdRNCkeFVNd5ImIgqmCDgbyoICiihZd5gQ189KDoDDTcYcN1lE+JAgxE2QCrlEzLi+V+Af+4XpnHCafpnoL8SWugNOwD5gqg4oMbDCtahkAGD9RUBIX2xjbUElUyJ6BcDJoQJ2AldfuppoCJe0IEOB5hw/wIEKFRQnQgesJrDhUTI+iJ8d2arbXGdjhDub6BxOm6nJvzVwMEMSCDBAw+AwIAHr3kgQgdl5vAqEjXYq4NqSeAgAFjd2djjyL7qJ9JwDCQXnq/+mqBpCQXsWIEHKVPwQcMgOOyAaw4k0EAKGCmhsbVKVLbCBFUtte+GC+ylH5df6cffCFIbKAMJJ5A4GARcdz2BA2CH3YAIDABA7y8aO1g0NeOEttDSgLJMowwuh9D13VwDFTbYCZjQMEBIDO3FNACY0NFvwY3M72ZoLWCACRTgLfnXYTPwAQgKmFAUDjjQ1SbHtfXWz29gggSSSHKHRcIKJkAAguR4R/C1CJFD8P+AAiykABoCQrQJoxc4FHC4uPLod+DUfxI4mF8O/AhYgXj/JdjNEUSgwAMY1ECDxjpcDEZl330IrDzapvyViCn7FUD5yXXdWcqXg3D7CdPCNqHaWNSA7YDPIw+kkH1BTo3OA6QA9UUAIvhfCoZEAgj0ZUdhA03tRvAAEvhuDzpQCj8wJTcvgamAVgqYDIQTpgIkcIQfFFOAHCgDBjTPdFvj2gPaRDQy4CBf5JMBr4bTQeINinTe+U0BCiYDBzSgL2BbAAtT4IA+xbBrIODe2cDwghltEIVb8p8PPyWwPxlAAERsgAeQ6AAlklFEDtAUFKNIp9iADlXJQs2bbuA9Jdz/ED/i69eHwgUsTvkFPVb7QQUk0BcPNLGIZWRhEsPFqzTazXUzbKOphBCrNnaujkUwS/jgFqItkqszCKDdGRFpRlJa7VuDiaQliVBJ7t0LVl0JX/K0ZYAuCuyUfrEGBUaZREUmEgL/KiJoIqBKagljCPUz5pN+N4MaxLIj4RmZNINSN/BUE2s86gsADBABEJSgbit7ZDjzFgKRgC1lEJgPdiw2g2Ta70lvOkINeACXhTzNdPgUDAX24zR+asN4MjiSAS73AX5WjZxPhMA9Q/ABdbYGVY1aJuiGsBFZxqUjhhFGDlwgP4aN4HWwC2nXLOjQiLJIInbUy0Wt4pQa2IUH/ydQwARmKr8RiDSkJW3T/TCJMXpadKX/ZEBWKEqAFgDgBjCYgAJAetO75VSZjuKpEuYpgKQBlR8lYqZdhsCBhTG1qSR96pMkREcvUNWq/CBPXOixBA5QIGdN5dpTsTPWBkk1CmftR0N+YACkhUUEgJOGD0jwVa7l7LCvy2ld33TXKeQ1HiuxQQ5eUIUVoEBdS5kAAJ7gghM84G45Y9jtSgCCCHjAA2PzwGHqOqF4KuKxagkaJTmngxcIzycU+AH+iFADFCwVtCAgTwRQEIALQEAEIlBBB15QJtbKZrdpqAEMqhrbGiIThx0pgHWJgAMJ/NawDxhADzj3DBioSwQGAIfADpyLUloIpCbbHQJPlsIAGCxhBxa4HcM6at865qCcRFlsWXORA5MwIYMyWQADBBBfIdzgBRpAwVtvpzkjhCM1lHQMZKb4DY/xozsiEMAPeNDeJNDAMT/YwAkkwICJcpgsL9mMgglyGRxMlAmiAoCN2zIFeoZ4xK6NLo+nYIMX3XjISNZKEAAAOw==" BEGIN_EXTERN_C() PHP_FUNCTION(phpversion); @@ -85,4 +84,3 @@ void register_phpinfo_constants(INIT_FUNC_ARGS); END_EXTERN_C() #endif /* INFO_H */ - diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 9499981f2726..4c243f778f17 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -328,7 +328,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC); #else /* Since popen() doesn't indicate if the internal fork() doesn't work - * (e.g. the shell can't be executed) we explicitly set it to 0 to be + * (e.g. the shell can't be executed) we explicitely set it to 0 to be * sure we don't catch any older errno value. */ errno = 0; sendmail = popen(sendmail_cmd, "w"); diff --git a/ext/standard/math.c b/ext/standard/math.c index f6b3d5406ebe..be2d655263f1 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1226,7 +1226,7 @@ PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, } /* }}} */ -/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_separator, string thousands_separator]]) +/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]]) Formats a number with grouped thousands */ PHP_FUNCTION(number_format) { diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 3f525a793ad7..672c0652219b 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -69,7 +69,7 @@ char machine_little_endian; /* Mapping of byte from char (8bit) to long for machine endian */ static int byte_map[1]; -/* Mappings of bytes from int (machine dependent) to int for machine endian */ +/* Mappings of bytes from int (machine dependant) to int for machine endian */ static int int_map[sizeof(int)]; /* Mappings of bytes from shorts (16bit) for all endian environments */ @@ -514,7 +514,7 @@ static long php_unpack(char *data, int size, int issigned, int *map) /* unpack() is based on Perl's unpack(), but is modified a bit from there. * Rather than depending on error-prone ordered lists or syntactically - * unpleasant pass-by-reference, we return an object with named parameters + * unpleasant pass-by-reference, we return an object with named paramters * (like *_fetch_object()). Syntax is "f[repeat]name/...", where "f" is the * formatter char (like pack()), "[repeat]" is the optional repeater argument, * and "name" is the name of the variable to use. diff --git a/ext/standard/password.c b/ext/standard/password.c index ca852038a67e..212799100c30 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -66,20 +66,20 @@ static php_password_algo php_password_determine_algo(const char *hash, const siz return PHP_PASSWORD_UNKNOWN; } -static int php_password_salt_is_alphabet(const char *str, const size_t len) /* {{{ */ +static zend_bool php_password_salt_is_alphabet(const char *str, const size_t len) /* {{{ */ { size_t i = 0; for (i = 0; i < len; i++) { if (!((str[i] >= 'A' && str[i] <= 'Z') || (str[i] >= 'a' && str[i] <= 'z') || (str[i] >= '0' && str[i] <= '9') || str[i] == '.' || str[i] == '/')) { - return FAILURE; + return 0; } } - return SUCCESS; + return 1; } /* }}} */ -static int php_password_salt_to64(const char *str, const size_t str_len, const size_t out_len, char *ret) /* {{{ */ +static zend_bool php_password_salt_to64(const char *str, const size_t str_len, const size_t out_len, char *ret) /* {{{ */ { size_t pos = 0; size_t ret_len = 0; @@ -108,7 +108,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s } /* }}} */ -static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ +static zend_bool php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */ { int buffer_valid = 0; size_t i, raw_length; @@ -395,7 +395,7 @@ PHP_FUNCTION(password_hash) efree(buffer); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %lu expecting %lu", (unsigned long) buffer_len, (unsigned long) required_salt_len); RETURN_NULL(); - } else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) { + } else if (0 == php_password_salt_is_alphabet(buffer, buffer_len)) { salt = safe_emalloc(required_salt_len, 1, 1); if (php_password_salt_to64(buffer, buffer_len, required_salt_len, salt) == FAILURE) { efree(hash_format); diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 0fb27baacd8e..f8d7bda48238 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -157,8 +157,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i } /* }}} */ -php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { int fd = -1; int mode_rw = 0; diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 366a1295b3c2..5f78256bcb42 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -23,8 +23,8 @@ #ifndef PHP_FOPEN_WRAPPERS_H #define PHP_FOPEN_WRAPPERS_H -php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); extern PHPAPI php_stream_wrapper php_stream_http_wrapper; extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper; extern php_stream_wrapper php_stream_php_wrapper; diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index afc5f178e4fc..35343b3d5d06 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -115,7 +115,6 @@ do { \ PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval **nzval); PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval **val); -PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); #define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index d78ca9976b82..4e39a40be4eb 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -172,7 +172,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent #endif p += el_len + 1; break; - case HASH_KEY_NON_EXISTENT: + case HASH_KEY_NON_EXISTANT: break; } } diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 0df127362f4e..28dcc63f1320 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -151,7 +151,7 @@ PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t len unsigned char c, *ret, *d; char *hex = "0123456789ABCDEF"; - ret = safe_emalloc(3, length + (((3 * length)/(PHP_QPRINT_MAXL-9)) + 1), 1); + ret = safe_emalloc(1, 3 * length + 3 * (((3 * length)/PHP_QPRINT_MAXL) + 1), 0); d = ret; while (length--) { @@ -286,4 +286,4 @@ PHP_FUNCTION(quoted_printable_encode) * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 - */ + */ \ No newline at end of file diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 0610ecfc49fd..209cb7f9b224 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -583,7 +583,7 @@ PHP_FUNCTION(stream_get_wrappers) HashPosition pos; array_init(return_value); for (zend_hash_internal_pointer_reset_ex(url_stream_wrappers_hash, &pos); - (key_flags = zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTENT; + (key_flags = zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward_ex(url_stream_wrappers_hash, &pos)) { if (key_flags == HASH_KEY_IS_STRING) { add_next_index_stringl(return_value, stream_protocol, stream_protocol_len - 1, 1); @@ -668,7 +668,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) type = zend_hash_get_current_key_ex(Z_ARRVAL_P(stream_array), &key, &key_len, &num_ind, 0, NULL); - if (type == HASH_KEY_NON_EXISTENT || + if (type == HASH_KEY_NON_EXISTANT || zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == FAILURE) { continue; /* should not happen */ } @@ -1591,7 +1591,7 @@ PHP_FUNCTION(stream_is_local) /* }}} */ /* {{{ proto bool stream_supports_lock(resource stream) - Tells whether the stream supports locking through flock(). */ + Tells wether the stream supports locking through flock(). */ PHP_FUNCTION(stream_supports_lock) { php_stream *stream; diff --git a/ext/standard/string.c b/ext/standard/string.c index 2f05b65bb939..f3f78100b4c6 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -13,7 +13,7 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | - | Stig S�ther Bakken | + | Stig Sæther Bakken | | Zeev Suraski | +----------------------------------------------------------------------+ */ @@ -23,6 +23,11 @@ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ #include +#ifdef PHP_WIN32 +# include "win32/php_stdint.h" +#else +# include +#endif #include "php.h" #include "php_rand.h" #include "php_string.h" @@ -275,7 +280,6 @@ PHP_FUNCTION(hex2bin) result = php_hex2bin((unsigned char *)data, datalen, &newlen); if (!result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input string must be hexadecimal string"); RETURN_FALSE; } @@ -1577,7 +1581,7 @@ PHP_FUNCTION(pathinfo) const char *p; int idx; - /* Have we already looked up the basename? */ + /* Have we alrady looked up the basename? */ if (!have_basename && !ret) { php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC); } @@ -3199,7 +3203,7 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2, int le static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2) { int sum; - int pos1 = 0, pos2 = 0, max; + int pos1, pos2, max; php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); if ((sum = max)) { @@ -4559,7 +4563,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, char *tbuf, *buf, *p, *tp, *rp, c, lc; int br, i=0, depth=0, in_q = 0; int state = 0, pos; - char *allow_free = NULL; + char *allow_free; if (stateptr) state = *stateptr; diff --git a/ext/standard/tests/array/009.phpt b/ext/standard/tests/array/009.phpt index 7b3bba22610d..f88f8763fad8 100644 --- a/ext/standard/tests/array/009.phpt +++ b/ext/standard/tests/array/009.phpt @@ -94,7 +94,7 @@ var_dump( current($temp_array, $temp_array) ); var_dump( reset($temp_array, $temp_array) ); var_dump( next($temp_array, $temp_array) ); -// invalid args type, valid argument: array +// invalid args type, valid arguement: array $int_var = 1; $float_var = 1.5; $string = "string"; diff --git a/ext/standard/tests/array/array_column_basic.phpt b/ext/standard/tests/array/array_column_basic.phpt index 418f373872f7..7c30cdfd1050 100644 --- a/ext/standard/tests/array/array_column_basic.phpt +++ b/ext/standard/tests/array/array_column_basic.phpt @@ -178,7 +178,7 @@ array(3) { *** Testing multiple data types *** array(8) { [0]=> - object(stdClass)#%d (0) { + object(stdClass)#1 (0) { } [1]=> float(34.2345) @@ -197,7 +197,7 @@ array(8) { } array(8) { [1]=> - object(stdClass)#%d (0) { + object(stdClass)#1 (0) { } [2]=> float(34.2345) diff --git a/ext/standard/tests/array/array_combine_variation3.phpt b/ext/standard/tests/array/array_combine_variation3.phpt index 1381fe0f4c92..03de632905cf 100644 --- a/ext/standard/tests/array/array_combine_variation3.phpt +++ b/ext/standard/tests/array/array_combine_variation3.phpt @@ -29,7 +29,7 @@ the lazy dog This is a double quoted string EOT; -// heredoc with different whitespaces +// heredoc with diferent whitespaces $diff_whitespaces = <<arr)); //found, key is in member array -/* error condition, first argument as object */ +/* error condition, first arguemnt as object */ var_dump( array_key_exists($key_check_obj, $key_check_obj) ); echo "Done\n"; ?> diff --git a/ext/standard/tests/array/array_key_exists_variation2.phpt b/ext/standard/tests/array/array_key_exists_variation2.phpt index 69a1f0a6d1ba..a6e9cd2bbff5 100644 --- a/ext/standard/tests/array/array_key_exists_variation2.phpt +++ b/ext/standard/tests/array/array_key_exists_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test array_key_exists() function : usage variations - Pass different data types to $search arg +Test array_key_exists() function : usage variations - Pass differnt data types to $search arg --FILE-- 1, "two"=>2, "three" => 3]; -var_dump(array_walk($ar, function(){ var_dump(func_get_args());})); - -echo "\nclosure with array\n"; -$ar = ["one" => 1, "two"=>2, "three" => 3]; -$user_data = ["sum" => 42]; -$func = function($value, $key, &$udata) { - var_dump($udata); - $udata["sum"] += $value; -}; - -var_dump(array_walk($ar, $func, $user_data)); -echo "End result:"; -var_dump($user_data["sum"]); - -echo "\nclosure with use\n"; -$ar = ["one" => 1, "two"=>2, "three" => 3]; -$user_data = ["sum" => 42]; -$func = function($value, $key) use (&$user_data) { - var_dump($user_data); - $user_data["sum"] += $value; -}; - -var_dump(array_walk($ar, $func, $user_data)); -echo "End result:"; -var_dump($user_data["sum"]); - - -echo "\nclosure with object\n"; -$ar = ["one" => 1, "two"=>2, "three" => 3]; -$user_data = (object)["sum" => 42]; -$func = function($value, $key, &$udata) { - var_dump($udata); - $udata->sum += $value; -}; - -var_dump(array_walk($ar, $func, $user_data)); -echo "End result:"; -var_dump($user_data->sum); - - - -echo "\nfunction with object\n"; -function sum_it_up_object($value, $key, $udata) -{ - var_dump($udata); - $udata->sum += $value; -} - -$ar = ["one" => 1, "two"=>2, "three" => 3]; -$user_data = (object)["sum" => 42]; - -var_dump(array_walk($ar, "sum_it_up_object", $user_data)); -echo "End result:"; -var_dump($user_data->sum); - - -echo "\nfunction with array\n"; -function sum_it_up_array($value, $key, $udata) -{ - var_dump($udata); - $udata['sum'] += $value; -} - -$ar = ["one" => 1, "two"=>2, "three" => 3]; -$user_data = ["sum" => 42]; - -var_dump(array_walk($ar, "sum_it_up_array", $user_data)); -echo "End result:"; -var_dump($user_data['sum']); - -echo "\nclosure and exception\n"; -$ar = ["one" => 1, "two"=>2, "three" => 3]; -try { - var_dump(array_walk($ar, function($v, $k) { if ($v == 2) throw new Exception; } )); -} catch (Exception $e) { - var_dump($e->getTrace()); -} - - -echo "Done\n"; -?> ---EXPECTF-- -Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: array_walk() expects parameter 1 to be array, boolean given in %s on line %d -NULL - -Warning: array_walk() expects parameter 1 to be array, null given in %s on line %d -NULL -array(2) { - [0]=> - int(1) - [1]=> - string(3) "one" -} -array(2) { - [0]=> - int(2) - [1]=> - string(3) "two" -} -array(2) { - [0]=> - int(3) - [1]=> - string(5) "three" -} -bool(true) - -closure with array -array(1) { - ["sum"]=> - int(42) -} -array(1) { - ["sum"]=> - int(43) -} -array(1) { - ["sum"]=> - int(45) -} -bool(true) -End result:int(42) - -closure with use -array(1) { - ["sum"]=> - int(42) -} -array(1) { - ["sum"]=> - int(43) -} -array(1) { - ["sum"]=> - int(45) -} -bool(true) -End result:int(48) - -closure with object -object(stdClass)#1 (1) { - ["sum"]=> - int(42) -} -object(stdClass)#1 (1) { - ["sum"]=> - int(43) -} -object(stdClass)#1 (1) { - ["sum"]=> - int(45) -} -bool(true) -End result:int(48) - -function with object -object(stdClass)#2 (1) { - ["sum"]=> - int(42) -} -object(stdClass)#2 (1) { - ["sum"]=> - int(43) -} -object(stdClass)#2 (1) { - ["sum"]=> - int(45) -} -bool(true) -End result:int(48) - -function with array -array(1) { - ["sum"]=> - int(42) -} -array(1) { - ["sum"]=> - int(42) -} -array(1) { - ["sum"]=> - int(42) -} -bool(true) -End result:int(42) - -closure and exception -array(2) { - [0]=> - array(2) { - ["function"]=> - string(9) "{closure}" - ["args"]=> - array(2) { - [0]=> - int(2) - [1]=> - string(3) "two" - } - } - [1]=> - array(4) { - ["file"]=> - string(%d) "%s" - ["line"]=> - int(%d) - ["function"]=> - string(10) "array_walk" - ["args"]=> - array(2) { - [0]=> - &array(3) { - ["one"]=> - int(1) - ["two"]=> - int(2) - ["three"]=> - int(3) - } - [1]=> - object(Closure)#2 (1) { - ["parameter"]=> - array(2) { - ["$v"]=> - string(10) "" - ["$k"]=> - string(10) "" - } - } - } - } -} -Done diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index 63c5f51ee090..654637ab5a27 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -25,7 +25,7 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n"; var_dump( array_walk($input, "callback1") ); var_dump( array_walk($input, "callback2", 4) ); -// expected: Warning is suppressed +// expected: Warning is supressed var_dump( @array_walk($input, "callback1") ); var_dump( @array_walk($input, "callback2", 4) ); diff --git a/ext/standard/tests/array/array_walk_recursive_basic2.phpt b/ext/standard/tests/array/array_walk_recursive_basic2.phpt index a049c0b812f6..c71d92b4569a 100644 --- a/ext/standard/tests/array/array_walk_recursive_basic2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_basic2.phpt @@ -25,7 +25,7 @@ function test_alter(&$item, $key, $prefix) // with proper type var_dump($item); // value var_dump($key); // key - var_dump($prefix); // additional argument passed to callback function + var_dump($prefix); // additional agument passed to callback function echo "\n"; // new line to separate the output between each element } diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index 8e0c8829e632..d628e9327afa 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -25,7 +25,7 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter var_dump( array_walk_recursive($input, "callback1") ); var_dump( array_walk_recursive($input, "callback2", 4) ); -// expected: Warning is suppressed +// expected: Warning is supressed var_dump( @array_walk_recursive($input, "callback1") ); var_dump( @array_walk_recursive($input, "callback2", 4) ); diff --git a/ext/standard/tests/array/arsort_variation1.phpt b/ext/standard/tests/array/arsort_variation1.phpt index bff8d413031b..1545abe34e0f 100644 --- a/ext/standard/tests/array/arsort_variation1.phpt +++ b/ext/standard/tests/array/arsort_variation1.phpt @@ -74,7 +74,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of arsort() -// when $array argument is supplied with different values from $unexpected_values +// when $array arugment is supplied with different values from $unexpected_values echo "\n-- Testing arsort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/arsort_variation2.phpt b/ext/standard/tests/array/arsort_variation2.phpt index ddfe319a46f7..b85653052f73 100644 --- a/ext/standard/tests/array/arsort_variation2.phpt +++ b/ext/standard/tests/array/arsort_variation2.phpt @@ -70,7 +70,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of arsort() -// when $flag argument is supplied with different values from $unexpected_values +// when $flag arugment is supplied with different values from $unexpected_values echo "\n-- Testing arsort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/asort_variation1.phpt b/ext/standard/tests/array/asort_variation1.phpt index 67eb5bf21c34..5420f0524c5d 100644 --- a/ext/standard/tests/array/asort_variation1.phpt +++ b/ext/standard/tests/array/asort_variation1.phpt @@ -74,7 +74,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of asort() -// when $array argument is supplied with different values from $unexpected_values +// when $array arugment is supplied with different values from $unexpected_values echo "\n-- Testing asort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/asort_variation2.phpt b/ext/standard/tests/array/asort_variation2.phpt index 138e12453702..6cce644331cd 100644 --- a/ext/standard/tests/array/asort_variation2.phpt +++ b/ext/standard/tests/array/asort_variation2.phpt @@ -70,7 +70,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of asort() -// when $flag argument is supplied with different values from $unexpected_values +// when $flag arugment is supplied with different values from $unexpected_values echo "\n-- Testing asort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/bug31158.phpt b/ext/standard/tests/array/bug31158.phpt index da7a9ec90726..e672a10b28d6 100644 --- a/ext/standard/tests/array/bug31158.phpt +++ b/ext/standard/tests/array/bug31158.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #31158 (array_splice on $GLOBALS crashes) ---INI-- -error_reporting = E_ALL --FILE-- "01", "ActionKey" => "00", "ContactCommissionArticle"=> "0,00", - "QuantdependentPriceKey"=> "", + "QuantDependantPriceKey"=> "", "Quant" => "1", "QuantUnit" => "", "Meas" => array( @@ -584,7 +584,7 @@ gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) /Docs/Doc/DocItems/DocItem/ContactCommissionArticle=0,00 gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) -/Docs/Doc/DocItems/DocItem/QuantdependentPriceKey +/Docs/Doc/DocItems/DocItem/QuantDependantPriceKey gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) /Docs/Doc/DocItems/DocItem/Quant=1 diff --git a/ext/standard/tests/array/bug34066_1.phpt b/ext/standard/tests/array/bug34066_1.phpt index 6d0f7f84e933..edc16efd05d8 100644 --- a/ext/standard/tests/array/bug34066_1.phpt +++ b/ext/standard/tests/array/bug34066_1.phpt @@ -123,7 +123,7 @@ Bug #34066 (recursive array_walk causes segfault) "ProceedKeyArticle" => "01", "ActionKey" => "00", "ContactCommissionArticle"=> "0,00", - "QuantdependentPriceKey"=> "", + "QuantDependantPriceKey"=> "", "Quant" => "1", "QuantUnit" => "", "Meas" => array( @@ -543,7 +543,7 @@ gen_xml(prefix=/Docs/) /Docs/ContactCommissionArticle=0,00 gen_xml(prefix=/Docs/) end gen_xml(prefix=/Docs/) -/Docs/QuantdependentPriceKey +/Docs/QuantDependantPriceKey gen_xml(prefix=/Docs/) end gen_xml(prefix=/Docs/) /Docs/Quant=1 diff --git a/ext/standard/tests/array/bug40709.phpt b/ext/standard/tests/array/bug40709.phpt index 7e132ba3d4c1..eb0c712000d5 100644 --- a/ext/standard/tests/array/bug40709.phpt +++ b/ext/standard/tests/array/bug40709.phpt @@ -2,7 +2,7 @@ Bug #40709 (array_reduce() behaves strange with one item stored arrays) --FILE-- diff --git a/ext/standard/tests/array/bug65304.phpt b/ext/standard/tests/array/bug65304.phpt deleted file mode 100644 index e5c9dfc5e6a4..000000000000 --- a/ext/standard/tests/array/bug65304.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #65304 (Use of max int in array_sum) ---FILE-- - ---EXPECTF-- -float(%s) -float(%s) diff --git a/ext/standard/tests/array/in_array_variation4.phpt b/ext/standard/tests/array/in_array_variation4.phpt index a27bb196b460..b88a5a2d628c 100644 --- a/ext/standard/tests/array/in_array_variation4.phpt +++ b/ext/standard/tests/array/in_array_variation4.phpt @@ -19,7 +19,7 @@ $file_handle = fopen(__FILE__, "r"); //directory type resource $dir_handle = opendir( dirname(__FILE__) ); -//store resources in array for comparison. +//store resources in array for comparision. $resources = array($file_handle, $dir_handle); // search for resouce type in the resource array diff --git a/ext/standard/tests/array/krsort_variation1.phpt b/ext/standard/tests/array/krsort_variation1.phpt index fa13242a08ce..e4cbaf8d2cec 100644 --- a/ext/standard/tests/array/krsort_variation1.phpt +++ b/ext/standard/tests/array/krsort_variation1.phpt @@ -72,7 +72,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of krsort() -// when $array argument is supplied with different values from $unexpected_values +// when $array arugment is supplied with different values from $unexpected_values echo "\n-- Testing krsort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/krsort_variation2.phpt b/ext/standard/tests/array/krsort_variation2.phpt index d193589de448..13762024705e 100644 --- a/ext/standard/tests/array/krsort_variation2.phpt +++ b/ext/standard/tests/array/krsort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of krsort() -// when 'sort_flags' argument is supplied with different values +// when 'sort_flags' arugment is supplied with different values echo "\n-- Testing krsort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/ksort_variation1.phpt b/ext/standard/tests/array/ksort_variation1.phpt index 37a35d1c0112..d8c037fa95c6 100644 --- a/ext/standard/tests/array/ksort_variation1.phpt +++ b/ext/standard/tests/array/ksort_variation1.phpt @@ -72,7 +72,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of ksort() -// when $array argument is supplied with different values from $unexpected_values +// when $array arugment is supplied with different values from $unexpected_values echo "\n-- Testing ksort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/ksort_variation2.phpt b/ext/standard/tests/array/ksort_variation2.phpt index 102c1c1eb650..4969844e759d 100644 --- a/ext/standard/tests/array/ksort_variation2.phpt +++ b/ext/standard/tests/array/ksort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of ksort() -// when 'sort_flags' argument is supplied with different values +// when 'sort_flags' arugment is supplied with different values echo "\n-- Testing ksort() by supplying different unexpected values for 'sort_flags' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/sizeof_basic2.phpt b/ext/standard/tests/array/sizeof_basic2.phpt index b56682c31a4a..a2ab2eedfda1 100644 --- a/ext/standard/tests/array/sizeof_basic2.phpt +++ b/ext/standard/tests/array/sizeof_basic2.phpt @@ -19,7 +19,7 @@ echo "*** Testing sizeof() : basic functionality ***\n"; $int_array = array(1, 2, 3, 4); $string_array = array("Saffron", "White", "Green"); -$indexed_array = array("Aggression" => "Saffron", "Peace" => "White", "Growth" => "Green"); +$indexed_array = array("Agression" => "Saffron", "Peace" => "White", "Growth" => "Green"); $mixed_array = array(1, 2, "Aggression" => "Saffron", 10 => "Ten", "Ten" => 10); echo "-- Testing sizeof() with integer array in default, COUNT_NORMAL, COUNT_RECURSIVE modes --\n"; diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt index cb8fecc822d7..a2462757d6d7 100644 --- a/ext/standard/tests/array/sizeof_variation4.phpt +++ b/ext/standard/tests/array/sizeof_variation4.phpt @@ -54,7 +54,7 @@ $values = array ( /* 20 */ $fp ); -// loop through the each element of the $values array for 'var' argument +// loop through the each element of the $values array for 'var' arugment // and check the functionality of sizeof() $counter = 1; foreach($values as $value) diff --git a/ext/standard/tests/array/sort_variation1.phpt b/ext/standard/tests/array/sort_variation1.phpt index 9243de08e475..f6991bdf67ba 100644 --- a/ext/standard/tests/array/sort_variation1.phpt +++ b/ext/standard/tests/array/sort_variation1.phpt @@ -73,7 +73,7 @@ $unexpected_values = array ( ); // loop though each element of the array and check the working of sort() -// when $array argument is supplied with different values from $unexpected_values +// when $array arugment is supplied with different values from $unexpected_values echo "\n-- Testing sort() by supplying different unexpected values for 'array' argument --\n"; echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n"; diff --git a/ext/standard/tests/array/sort_variation2.phpt b/ext/standard/tests/array/sort_variation2.phpt index af3deba4b985..7cb8ed642a83 100644 --- a/ext/standard/tests/array/sort_variation2.phpt +++ b/ext/standard/tests/array/sort_variation2.phpt @@ -69,7 +69,7 @@ $unexpected_values = array( ); // loop though each element of the array and check the working of sort() -// when $flag argument is supplied with different values +// when $flag arugment is supplied with different values echo "\n-- Testing sort() by supplying different unexpected values for 'flag' argument --\n"; $counter = 1; diff --git a/ext/standard/tests/array/uasort_error.phpt b/ext/standard/tests/array/uasort_error.phpt index cc2dd3a21753..820ab58478fa 100644 --- a/ext/standard/tests/array/uasort_error.phpt +++ b/ext/standard/tests/array/uasort_error.phpt @@ -50,7 +50,7 @@ var_dump( uasort($array_arg) ); echo "-- Testing uasort() function with non-existent compare function --\n"; var_dump( uasort($array_arg, 'non_existent') ); -// With non existent comparison function and extra argument +// With non existent comparison function and extra arguemnt echo "-- Testing uasort() function with non-existent compare function and extra argument --\n"; var_dump( uasort($array_arg, 'non_existent', $extra_arg) ); diff --git a/ext/standard/tests/array/uasort_object2.phpt b/ext/standard/tests/array/uasort_object2.phpt index 889db9886aef..cd32d8d947d4 100644 --- a/ext/standard/tests/array/uasort_object2.phpt +++ b/ext/standard/tests/array/uasort_object2.phpt @@ -8,7 +8,7 @@ Test uasort() function : object functionality - sort diff. objects * /* - * This testcase tests uasort() functionality with different objects + * This testcase tests uasort() functionality with differnt objects * Objects of different classes: * simple class, * child class, diff --git a/ext/standard/tests/array/uasort_variation10.phpt b/ext/standard/tests/array/uasort_variation10.phpt index e0c5e72f7e13..809cb78f565d 100644 --- a/ext/standard/tests/array/uasort_variation10.phpt +++ b/ext/standard/tests/array/uasort_variation10.phpt @@ -11,7 +11,7 @@ Test uasort() function : usage variations - sort array with reference variables * Testing uasort() with 'array_arg' containing different reference variables */ -// comparison function +// comparision function /* Prototype : int cmp_function(mixed $value1, mixed $value2) * Parameters : $value1 and $value2 - values to be compared * Return value : 0 - if both values are same diff --git a/ext/standard/tests/array/uasort_variation4.phpt b/ext/standard/tests/array/uasort_variation4.phpt index 0ed797fb8720..c2844bfd2416 100644 --- a/ext/standard/tests/array/uasort_variation4.phpt +++ b/ext/standard/tests/array/uasort_variation4.phpt @@ -12,7 +12,7 @@ Test uasort() function : usage variations - sort different numeric values * integer, octal, hexadecimal & float */ -// comparison function +// comparision function /* Prototype : int cmp_function(mixed $value1, mixed $value2) * Parameters : $value1 and $value2 - values to be compared * Return value : 0 - if both values are same diff --git a/ext/standard/tests/array/usort_error2.phpt b/ext/standard/tests/array/usort_error2.phpt index 7bf0f659e036..308199fc1f57 100644 --- a/ext/standard/tests/array/usort_error2.phpt +++ b/ext/standard/tests/array/usort_error2.phpt @@ -36,7 +36,7 @@ $extra_arg = 10; echo "\n-- Testing usort() function with non-existent compare function --\n"; var_dump( usort($array_arg, 'non_existent') ); -// With non existent comparison function and extra argument +// With non existent comparison function and extra arguemnt echo "\n-- Testing usort() function with non-existent compare function and extra argument --\n"; var_dump( usort($array_arg, 'non_existent', $extra_arg) ); ?> diff --git a/ext/standard/tests/class_object/class_exists_variation_001.phpt b/ext/standard/tests/class_object/class_exists_variation_001.phpt index 52a3584763e1..c9146ba9f78e 100644 --- a/ext/standard/tests/class_object/class_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/class_exists_variation_001.phpt @@ -1,5 +1,5 @@ --TEST-- -Test class_exists() function : usage variations - unexpected types for argument 1 +Test class_exists() function : usage variations - unexpected types for agument 1 --FILE-- --FILE-- --EXPECT-- The system cannot find the drive specified. diff --git a/ext/standard/tests/file/bug41874_2.phpt b/ext/standard/tests/file/bug41874_2.phpt index bf76a749fd82..5d7b7cad8df7 100644 --- a/ext/standard/tests/file/bug41874_2.phpt +++ b/ext/standard/tests/file/bug41874_2.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- --EXPECT-- diff --git a/ext/standard/tests/file/bug41874_3.phpt b/ext/standard/tests/file/bug41874_3.phpt index 05095c6f10c7..4d7b139ad78c 100644 --- a/ext/standard/tests/file/bug41874_3.phpt +++ b/ext/standard/tests/file/bug41874_3.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { ?> --FILE-- --EXPECT-- The system cannot find the drive specified. \ No newline at end of file diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 3a9f9c31a467..91976b04db3f 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream) +Bug #52820 (writes to fopencookie FILE* not commited when seeking the stream) --SKIPIF-- " if each element of stat1 is > than stat2 "<" if each element of stat1 is < than stat2 $fields = contains the key of the elements that needs to be compared. - type of the comparison is based on $op argument value + type of the comparision is based on $op argument value $flag = specify true to dump the stat1 and stat2 */ diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index a347d9d3d1d8..127901ad797a 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -10,7 +10,6 @@ display_errors=false if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (!function_exists("file_get_contents")) die ("skip file_get_contents function is not found"); - if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); ?> --FILE-- ---FILE-- - 'aaa,bbb', - 1 => 'aaa,"bbb"', - 2 => '"aaa","bbb"', - 3 => 'aaa,bbb', - 4 => '"aaa",bbb', - 5 => '"aaa", "bbb"', - 6 => ',', - 7 => 'aaa,', - 8 => ',"aaa"', - 9 => '"",""', - 10 => '"""""",', - 11 => '""""",aaa', - 12 => 'aaa,bbb ', - 13 => 'aaa,"bbb "', - 14 => 'aaa"aaa","bbb"bbb', - 15 => 'aaa"aaa""",bbb', - 16 => 'aaa,"/"bbb,ccc', - 17 => 'aaa"/"a","bbb"', - 18 => '"/"","aaa"', - 19 => '"/""",aaa', -); - -$file = dirname(__FILE__) . 'fgetcsv.csv'; -@unlink($file); - -$fp = fopen($file, "w"); -foreach ($list as $v) { - fputcsv($fp, explode(',', $v), ',', '"', '/'); -} -fclose($fp); - -$res = file($file); -foreach($res as &$val) -{ - $val = substr($val, 0, -1); -} -echo '$list = ';var_export($res);echo ";\n"; - -$fp = fopen($file, "r"); -$res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '/')) -{ - $res[] = join(',',$l); -} -fclose($fp); - -echo '$list = ';var_export($res);echo ";\n"; - -@unlink($file); - -?> -===DONE=== - ---EXPECT-- -$list = array ( - 0 => 'aaa,bbb', - 1 => 'aaa,"""bbb"""', - 2 => '"""aaa""","""bbb"""', - 3 => 'aaa,bbb', - 4 => '"""aaa""",bbb', - 5 => '"""aaa"""," ""bbb"""', - 6 => ',', - 7 => 'aaa,', - 8 => ',"""aaa"""', - 9 => '"""""",""""""', - 10 => '"""""""""""""",', - 11 => '"""""""""""",aaa', - 12 => 'aaa,"bbb "', - 13 => 'aaa,"""bbb """', - 14 => '"aaa""aaa""","""bbb""bbb"', - 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""/"bbb",ccc', - 17 => '"aaa""/"a""","""bbb"""', - 18 => '"""/"""","""aaa"""', - 19 => '"""/"""""",aaa', -); -$list = array ( - 0 => 'aaa,bbb', - 1 => 'aaa,"bbb"', - 2 => '"aaa","bbb"', - 3 => 'aaa,bbb', - 4 => '"aaa",bbb', - 5 => '"aaa", "bbb"', - 6 => ',', - 7 => 'aaa,', - 8 => ',"aaa"', - 9 => '"",""', - 10 => '"""""",', - 11 => '""""",aaa', - 12 => 'aaa,bbb ', - 13 => 'aaa,"bbb "', - 14 => 'aaa"aaa","bbb"bbb', - 15 => 'aaa"aaa""",bbb', - 16 => 'aaa,"/"bbb,ccc', - 17 => 'aaa"/"a","bbb"', - 18 => '"/"","aaa"', - 19 => '"/""",aaa', -); -===DONE=== diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt index 915ab0e55869..18ecf9a1dd59 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt @@ -52,7 +52,7 @@ foreach($file_content_types as $file_content_type){ fwrite($file_handle,(binary)$data_to_be_written); // set file pointer to 0 - var_dump( rewind($file_handle) ); // set to beginning of file + var_dump( rewind($file_handle) ); // set to begining of file var_dump( ftell($file_handle) ); foreach($whence_set as $whence){ diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt index 63d0edd5a557..866009467a3c 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt @@ -51,7 +51,7 @@ foreach($file_content_types as $file_content_type){ fwrite($file_handle,(binary)$data_to_be_written); // set file pointer to 0 - var_dump( rewind($file_handle) ); // set to beginning of file + var_dump( rewind($file_handle) ); // set to begining of file var_dump( ftell($file_handle) ); foreach($whence_set as $whence){ diff --git a/ext/standard/tests/file/fstat_variation1.phpt b/ext/standard/tests/file/fstat_variation1.phpt index 14b7b31c4be0..b2ad54196c78 100644 --- a/ext/standard/tests/file/fstat_variation1.phpt +++ b/ext/standard/tests/file/fstat_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function fstat() by substituting argument 1 with array values. +Test function fstat() by substituting agument 1 with array values. --FILE-- -==DONE== ---EXPECT-- -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation4.phpt b/ext/standard/tests/file/glob_variation4.phpt deleted file mode 100644 index 00d8f648aad3..000000000000 --- a/ext/standard/tests/file/glob_variation4.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test glob() function: ensure no platform difference, variation 2 ---FILE-- - -==DONE== ---EXPECT-- -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation5.phpt b/ext/standard/tests/file/glob_variation5.phpt deleted file mode 100644 index 10db40099bc5..000000000000 --- a/ext/standard/tests/file/glob_variation5.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test glob() function: ensure no platform difference, variation 3 ---SKIPIF-- - ---FILE-- - -==DONE== ---EXPECT-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(true) -==DONE== diff --git a/ext/standard/tests/file/glob_variation6.phpt b/ext/standard/tests/file/glob_variation6.phpt deleted file mode 100644 index 9cd9c2b3538b..000000000000 --- a/ext/standard/tests/file/glob_variation6.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test glob() function: ensure no platform difference, variation 4 ---SKIPIF-- - ---FILE-- - -==DONE== ---EXPECT-- -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -array(0) { -} -bool(true) -==DONE== diff --git a/ext/standard/tests/file/lchown_basic.phpt b/ext/standard/tests/file/lchown_basic.phpt index f2aff597c559..9675d3acae8c 100644 --- a/ext/standard/tests/file/lchown_basic.phpt +++ b/ext/standard/tests/file/lchown_basic.phpt @@ -14,8 +14,8 @@ if (!function_exists("posix_getuid")) die("skip no posix_getuid()"); */ echo "*** Testing lchown() : basic functionality ***\n"; -$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic.txt'; -$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt'; +$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt'; +$symlink = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'symlink.txt'; $uid = posix_getuid(); @@ -29,8 +29,8 @@ var_dump( fileowner( $symlink ) === $uid ); --CLEAN-- diff --git a/ext/standard/tests/file/mkdir-002.phpt b/ext/standard/tests/file/mkdir-002.phpt index d149098df07e..ccfd6c3d741e 100644 --- a/ext/standard/tests/file/mkdir-002.phpt +++ b/ext/standard/tests/file/mkdir-002.phpt @@ -9,24 +9,24 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- diff --git a/ext/standard/tests/file/mkdir-003.phpt b/ext/standard/tests/file/mkdir-003.phpt index fdd49f340f00..50ad5e6c4ecc 100644 --- a/ext/standard/tests/file/mkdir-003.phpt +++ b/ext/standard/tests/file/mkdir-003.phpt @@ -3,17 +3,17 @@ recursive mkdir() tests --FILE-- diff --git a/ext/standard/tests/file/symlink_to_symlink.phpt b/ext/standard/tests/file/symlink_to_symlink.phpt index 8b7ff65cf0d3..b7554f9bd07c 100644 --- a/ext/standard/tests/file/symlink_to_symlink.phpt +++ b/ext/standard/tests/file/symlink_to_symlink.phpt @@ -19,8 +19,8 @@ symlink(basename($prefix . "_file"), $prefix . "_link1"); symlink(basename($prefix . "_link1"), $prefix . "_link2"); // symlink to a non-existent path -@unlink($prefix . "_nonexistent"); -symlink(basename($prefix . "_nonexistent"), $prefix . "_link3"); +@unlink($prefix . "_nonexistant"); +symlink(basename($prefix . "_nonexistant"), $prefix . "_link3"); // symlink to a regular file using an absolute path symlink($prefix . "_file", $prefix . "_link4"); @@ -45,6 +45,6 @@ unlink($prefix . "_file"); --EXPECTF-- %unicode|string%(%d) "symlink_to_symlink.php_file" %unicode|string%(%d) "symlink_to_symlink.php_link1" -%unicode|string%(%d) "symlink_to_symlink.php_nonexistent" +%unicode|string%(%d) "symlink_to_symlink.php_nonexistant" %unicode|string%(%d) "%s/symlink_to_symlink.php_file" %unicode|string%(%d) "%s/symlink_to_symlink.php_link4" diff --git a/ext/standard/tests/file/tempnam_variation5.phpt b/ext/standard/tests/file/tempnam_variation5.phpt index cf2eff8bec3f..26c3f91f1f9d 100644 --- a/ext/standard/tests/file/tempnam_variation5.phpt +++ b/ext/standard/tests/file/tempnam_variation5.phpt @@ -16,13 +16,13 @@ if(substr(PHP_OS, 0, 3) == "WIN") $file_path = dirname(__FILE__); echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n"; -$dir_name = $file_path."/tempnam_variation5"; +$dir_name = $file_path."/tempnam_variation6"; mkdir($dir_name); -$h = fopen($dir_name."/tempnam_variation5.tmp", "w"); +$h = fopen($dir_name."/tempnam_variation6.tmp", "w"); for($i=1; $i<=3; $i++) { echo "-- Iteration $i --\n"; - $created_file = tempnam("$dir_name", "tempnam_variation5.tmp"); + $created_file = tempnam("$dir_name", "tempnam_variation6.tmp"); if( file_exists($created_file) ) { echo "File name is => "; @@ -35,7 +35,7 @@ for($i=1; $i<=3; $i++) { unlink($created_file); } fclose($h); -unlink($dir_name."/tempnam_variation5.tmp"); +unlink($dir_name."/tempnam_variation6.tmp"); rmdir($dir_name); echo "\n*** Done ***\n"; @@ -43,10 +43,10 @@ echo "\n*** Done ***\n"; --EXPECTF-- *** Test tempnam() function: by passing an existing filename as prefix *** -- Iteration 1 -- -File name is => %stempnam_variation5%etempnam_variation5.tmp%s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s -- Iteration 2 -- -File name is => %stempnam_variation5%etempnam_variation5.tmp%s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s -- Iteration 3 -- -File name is => %stempnam_variation5%etempnam_variation5.tmp%s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s *** Done *** diff --git a/ext/standard/tests/file/touch_basic.phpt b/ext/standard/tests/file/touch_basic.phpt index b39c84b7e0f4..c41fdf1d7b0d 100644 --- a/ext/standard/tests/file/touch_basic.phpt +++ b/ext/standard/tests/file/touch_basic.phpt @@ -19,7 +19,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing touch() : basic functionality ***\n"; -$filename = dirname(__FILE__)."/touch_basic.dat"; +$filename = dirname(__FILE__)."/touch.dat"; echo "\n--- testing touch creates a file ---\n"; @unlink($filename); diff --git a/ext/standard/tests/file/touch_variation2.phpt b/ext/standard/tests/file/touch_variation2.phpt index 9477a3494e24..9ccb90c751ed 100644 --- a/ext/standard/tests/file/touch_variation2.phpt +++ b/ext/standard/tests/file/touch_variation2.phpt @@ -6,7 +6,7 @@ Dave Kelsey --INI-- enable_dl=1 --FILE-- diff --git a/ext/standard/tests/mail/ezmlm_hash_variation1.phpt b/ext/standard/tests/mail/ezmlm_hash_variation1.phpt index 58957c84a98c..aa1e521e9232 100644 --- a/ext/standard/tests/mail/ezmlm_hash_variation1.phpt +++ b/ext/standard/tests/mail/ezmlm_hash_variation1.phpt @@ -24,8 +24,8 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimiter -$delimiters = array ( +// array with different values for $delimeter +$delimeters = array ( // integer values 0, @@ -68,13 +68,13 @@ $delimiters = array ( @$unset_var ); -// loop through with each element of the $delimiters array to test explode() function +// loop through with each element of the $delimeters array to test explode() function $count = 1; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; -foreach($delimiters as $delimiter) { +foreach($delimeters as $delimeter) { echo "-- Iteration $count --\n"; - var_dump( explode($delimiter, $string, $limit) ); + var_dump( explode($delimeter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/mail/mail_include.inc b/ext/standard/tests/mail/mail_include.inc index 0785552e5481..a0ff5e0c170c 100644 --- a/ext/standard/tests/mail/mail_include.inc +++ b/ext/standard/tests/mail/mail_include.inc @@ -15,7 +15,7 @@ $mailbox_prefix = "phpttest"; // name used for test mailbox * @para, string mailbox_suffix Suffix used to uniquely identify mailboxes * @param int message_count number of test msgs to be written to new mailbox * - * @return IMAP stream to new mailbox on success; FALSE on failure + * @return IMAP stream to new mailbox on sucesss; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ global $server, $default_mailbox, $username, $password; diff --git a/ext/standard/tests/network/ip2long_variation1.phpt b/ext/standard/tests/network/ip2long_variation1.phpt index b228c9bd14ac..ca67aa41a8e2 100644 --- a/ext/standard/tests/network/ip2long_variation1.phpt +++ b/ext/standard/tests/network/ip2long_variation1.phpt @@ -1,5 +1,10 @@ --TEST-- -Test ip2long() function : usage variation 1 +Test ip2long() function : usage variation +--SKIPIF-- + --FILE-- ---FILE-- - -===DONE=== ---EXPECT-- -bool(false) -int(2130706433) -bool(false) -int(0) -bool(false) -int(-1062731776) -bool(false) -bool(false) -===DONE=== diff --git a/ext/standard/tests/network/ip2long_variation2_x64.phpt b/ext/standard/tests/network/ip2long_variation2_x64.phpt deleted file mode 100644 index a6fde5bdd985..000000000000 --- a/ext/standard/tests/network/ip2long_variation2_x64.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test ip2long() function : usage variation 2, 64 bit ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -bool(false) -int(2130706433) -bool(false) -int(0) -bool(false) -int(3232235520) -bool(false) -bool(false) -===DONE=== diff --git a/ext/standard/tests/serialize/bug65481.phpt b/ext/standard/tests/serialize/bug65481.phpt deleted file mode 100644 index 65634f63ba45..000000000000 --- a/ext/standard/tests/serialize/bug65481.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #65481 (shutdown segfault due to serialize) ---FILE-- -e[] = $e; - $e->e = $c->e; - } - - return serialize(array(serialize($c))); - } - - public function unserialize($str) - { - $r = unserialize($str); - $r = unserialize($r[0]); - } -} - -$token = new Token; -$token = serialize($token); - -?> -Done ---EXPECT-- -Test -Done diff --git a/ext/standard/tests/serialize/serialization_error_001.phpt b/ext/standard/tests/serialize/serialization_error_001.phpt index c6c17512f397..da6f50cc02b2 100644 --- a/ext/standard/tests/serialize/serialization_error_001.phpt +++ b/ext/standard/tests/serialize/serialization_error_001.phpt @@ -21,7 +21,7 @@ var_dump( unserialize() ); //Test serialize with one more than the expected number of arguments var_dump( serialize(1,2) ); -var_dump( unserialize(1,$x,2) ); +var_dump( unserialize(1,2) ); echo "Done"; ?> @@ -31,12 +31,12 @@ echo "Done"; Warning: serialize() expects exactly 1 parameter, 0 given in %s on line 16 NULL -Warning: unserialize() expects at least 1 parameter, 0 given in %s on line 17 +Warning: unserialize() expects exactly 1 parameter, 0 given in %s on line 17 bool(false) Warning: serialize() expects exactly 1 parameter, 2 given in %s on line 20 NULL -Warning: unserialize() expects at most 2 parameters, 3 given in %s on line 21 +Warning: unserialize() expects exactly 1 parameter, 2 given in %s on line 21 bool(false) Done diff --git a/ext/standard/tests/serialize/unserialize_consumed.phpt b/ext/standard/tests/serialize/unserialize_consumed.phpt deleted file mode 100644 index 6cc11e273faa..000000000000 --- a/ext/standard/tests/serialize/unserialize_consumed.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Unserialization of partial strings ---FILE-- - "\n", - 'line-length' => 74 - )); - var_dump(stream_get_contents($fd, -1, 0)); - - stream_filter_remove($res); - - rewind($fd); - stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 6 - )); - var_dump(stream_get_contents($fd, -1, 0)); - - fclose($fd); -} - -test_64166("FIRST \nSECOND"); -test_64166("FIRST \nSECOND"); - -?> ---EXPECT-- -string(15) "FIRST=20 -SECOND" -string(19) "FIRST= -=20 -SECON= -D" -string(18) "FIRST=20=20 -SECOND" -string(24) "FIRST= -=20= -=20 -SECON= -D" diff --git a/ext/standard/tests/streams/bug64166_2.phpt b/ext/standard/tests/streams/bug64166_2.phpt deleted file mode 100644 index 9d6655d5c1eb..000000000000 --- a/ext/standard/tests/streams/bug64166_2.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace - split reads ---FILE-- - "\n", - 'line-length' => 74 - )); - $str = ""; - while(($c = fread($fd, 1))!= "") $str .= $c; - var_dump($str); - - stream_filter_remove($res); - - rewind($fd); - stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 6 - )); - $str = ""; - while(($c = fread($fd, 1))!= "") $str .= $c; - var_dump($str); - - fclose($fd); -} - -test_64166("FIRST \nSECOND"); -test_64166("FIRST \nSECOND"); - -?> ---EXPECT-- -string(15) "FIRST=20 -SECOND" -string(19) "FIRST= -=20 -SECON= -D" -string(18) "FIRST=20=20 -SECOND" -string(24) "FIRST= -=20= -=20 -SECON= -D" diff --git a/ext/standard/tests/streams/bug64166_3.phpt b/ext/standard/tests/streams/bug64166_3.phpt deleted file mode 100644 index d896ba800c95..000000000000 --- a/ext/standard/tests/streams/bug64166_3.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitespace - writes ---FILE-- - "\n", - 'line-length' => 74 - )); - fwrite($fd, $data); - rewind($fd); - - var_dump(stream_get_contents($fd, -1, 0)); - - stream_filter_remove($res); - - rewind($fd); - stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( - 'line-break-chars' => "\n", - 'line-length' => 6 - )); - fwrite($fd, $data); - rewind($fd); - var_dump(stream_get_contents($fd, -1, 0)); - - fclose($fd); -} - -test_64166("FIRST \nSECOND"); -test_64166("FIRST \nSECOND"); - -?> ---EXPECT-- -string(15) "FIRST=20 -SECOND" -string(19) "FIRST= -=20 -SECON= -D" -string(18) "FIRST=20=20 -SECOND" -string(24) "FIRST= -=20= -=20 -SECON= -D" diff --git a/ext/standard/tests/streams/bug65483.phpt b/ext/standard/tests/streams/bug65483.phpt deleted file mode 100644 index d214bbbbcc4a..000000000000 --- a/ext/standard/tests/streams/bug65483.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #65483: quoted-printable encode stream filter incorrectly encoding spaces ---FILE-- - ---EXPECT-- -string(9) "a b=3Dc d" diff --git a/ext/standard/tests/strings/addslashes_variation1.phpt b/ext/standard/tests/strings/addslashes_variation1.phpt index 6dfeb7e69b05..cc245ae04b3a 100644 --- a/ext/standard/tests/strings/addslashes_variation1.phpt +++ b/ext/standard/tests/strings/addslashes_variation1.phpt @@ -79,7 +79,7 @@ $values = array ( // loop through each element of the array and check the working of addslashes() -// when $str argument is supplied with different values +// when $str arugment is supplied with different values echo "\n--- Testing addslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/bug36306.phpt b/ext/standard/tests/strings/bug36306.phpt index 6317c974ab01..2d8449aac331 100644 --- a/ext/standard/tests/strings/bug36306.phpt +++ b/ext/standard/tests/strings/bug36306.phpt @@ -6,10 +6,10 @@ Bug #36306 (crc32() 64bit) /* as an example how to write crc32 tests PHP does not have uint values, you cannot display crc32 like a signed integer. - Have to find some small strings to truly reproduce + Have to find some small strings to truely reproduce the problem, this example being not a problem */ -echo dechex(crc32("platform independent")) . "\n"; +echo dechex(crc32("platform independant")) . "\n"; ?> --EXPECT-- -cbd056ba +ccd9fe66 diff --git a/ext/standard/tests/strings/bug38322.phpt b/ext/standard/tests/strings/bug38322.phpt index 79f66f1fa0cf..37f5a93f66ed 100644 --- a/ext/standard/tests/strings/bug38322.phpt +++ b/ext/standard/tests/strings/bug38322.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #38322 (reading past array in sscanf() leads to segfault/arbitrary code execution) +Bug #38322 (reading past array in sscanf() leads to segfault/arbitary code execution) --FILE-- '; diff --git a/ext/standard/tests/strings/bug64879.phpt b/ext/standard/tests/strings/bug64879.phpt deleted file mode 100644 index 1df90c6d85ca..000000000000 --- a/ext/standard/tests/strings/bug64879.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #64879: quoted_printable_encode() wrong size calculation (CVE-2013-2110) ---FILE-- - ---EXPECTF-- -Done diff --git a/ext/standard/tests/strings/chop_variation1.phpt b/ext/standard/tests/strings/chop_variation1.phpt index bb5bca4ecfe7..de5ecd816464 100644 --- a/ext/standard/tests/strings/chop_variation1.phpt +++ b/ext/standard/tests/strings/chop_variation1.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of chop() -// when $str argument is supplied with different values +// when $str arugment is supplied with different values echo "\n--- Testing chop() by supplying different values for 'str' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/chop_variation2.phpt b/ext/standard/tests/strings/chop_variation2.phpt index 02d32306ecd3..f0416e77bc14 100644 --- a/ext/standard/tests/strings/chop_variation2.phpt +++ b/ext/standard/tests/strings/chop_variation2.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of chop() -// when $charlist argument is supplied with different values +// when $charlist arugment is supplied with different values echo "\n--- Testing chop() by supplying different values for 'charlist' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/chunk_split_error.phpt b/ext/standard/tests/strings/chunk_split_error.phpt index 341f04ffd350..9313b65b5b8c 100644 --- a/ext/standard/tests/strings/chunk_split_error.phpt +++ b/ext/standard/tests/strings/chunk_split_error.phpt @@ -10,7 +10,7 @@ Test chunk_split() function : error conditions /* * Testing error conditions of chunk_split() with zero arguments -* and for more than expected number of arguments +* and for more than expected number of argments */ echo "*** Testing chunk_split() : error conditions ***\n"; diff --git a/ext/standard/tests/strings/explode_error.phpt b/ext/standard/tests/strings/explode_error.phpt index e88b1b0c6bf5..f7342e7ad347 100644 --- a/ext/standard/tests/strings/explode_error.phpt +++ b/ext/standard/tests/strings/explode_error.phpt @@ -14,11 +14,11 @@ echo "\n-- Testing explode() function with no arguments --\n"; var_dump( explode() ); echo "\n-- Testing explode() function with more than expected no. of arguments --\n"; -$delimiter = " "; +$delimeter = " "; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; $extra_arg = 10; -var_dump( explode($delimiter, $string, $limit, $extra_arg) ); +var_dump( explode($delimeter, $string, $limit, $extra_arg) ); ?> ===Done=== diff --git a/ext/standard/tests/strings/explode_variation1.phpt b/ext/standard/tests/strings/explode_variation1.phpt index f16f69bece13..9c9ce116959b 100644 --- a/ext/standard/tests/strings/explode_variation1.phpt +++ b/ext/standard/tests/strings/explode_variation1.phpt @@ -24,8 +24,8 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimiter -$delimiters = array ( +// array with different values for $delimeter +$delimeters = array ( // integer values /*1*/ 0, @@ -68,13 +68,13 @@ $delimiters = array ( /*22*/ @$unset_var ); -// loop through with each element of the $delimiters array to test explode() function +// loop through with each element of the $delimeters array to test explode() function $count = 1; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; $limit = 5; -foreach($delimiters as $delimiter) { +foreach($delimeters as $delimeter) { echo "-- Iteration $count --\n"; - var_dump( explode($delimiter, $string, $limit) ); + var_dump( explode($delimeter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/explode_variation2.phpt b/ext/standard/tests/strings/explode_variation2.phpt index 4de4637ac14b..9e1f72c5ac9b 100644 --- a/ext/standard/tests/strings/explode_variation2.phpt +++ b/ext/standard/tests/strings/explode_variation2.phpt @@ -70,11 +70,11 @@ $strings = array ( // loop through with each element of the $strings array to test explode() function $count = 1; -$delimiter = " "; +$delimeter = " "; $limit = 5; foreach($strings as $string) { echo "-- Iteration $count --\n"; - var_dump( explode($delimiter, $string, $limit) ); + var_dump( explode($delimeter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/explode_variation3.phpt b/ext/standard/tests/strings/explode_variation3.phpt index 2e878931076e..54d5222caa97 100644 --- a/ext/standard/tests/strings/explode_variation3.phpt +++ b/ext/standard/tests/strings/explode_variation3.phpt @@ -24,7 +24,7 @@ class sample { //getting the resource $file_handle = fopen(__FILE__, "r"); -// array with different values for $delimiter +// array with different values for $delimeter $limits = array ( // integer values @@ -70,11 +70,11 @@ $limits = array ( // loop through with each element of the $limits array to test explode() function $count = 1; -$delimiter = " "; +$delimeter = " "; $string = "piece1 piece2 piece3 piece4 piece5 piece6"; foreach($limits as $limit) { echo "-- Iteration $count --\n"; - var_dump( explode($delimiter, $string, $limit) ); + var_dump( explode($delimeter, $string, $limit) ); $count ++; } diff --git a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt index 76d590c35b02..7f7e229354ae 100644 --- a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt @@ -65,7 +65,7 @@ $values = array ( // loop through each element of the array and check the working of get_html_translation_table() -// when $table argument is supplied with different values +// when $table arugment is supplied with different values echo "\n--- Testing get_html_translation_table() by supplying different values for 'table' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt index ea42af996ca5..b792a555451e 100644 --- a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt @@ -68,7 +68,7 @@ $values = array ( // loop through each element of the array and check the working of get_html_translation_table() -// when $quote_style argument is supplied with different values +// when $quote_style arugment is supplied with different values echo "\n--- Testing get_html_translation_table() by supplying different values for 'quote_style' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt index b36556f1a278..b15307614a9d 100644 --- a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt +++ b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt @@ -30,7 +30,7 @@ $multiline_string = <<Roy's height\r > Sam\t's height 1111\t\t & 0000\v\v = \f0000 diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt index 3997c54b59eb..4d3502f18ab1 100644 Binary files a/ext/standard/tests/strings/implode1.phpt and b/ext/standard/tests/strings/implode1.phpt differ diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index e2635f05f8d7..02bcf3440639 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -84,7 +84,7 @@ $values = array ( // loop through each element of the array and check the working of join() -// when $glue argument is supplied with different values +// when $glue arugment is supplied with different values echo "\n--- Testing join() by supplying different values for 'glue' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt index 46e91afd3bb6..50395f17647b 100644 --- a/ext/standard/tests/strings/join_variation2.phpt +++ b/ext/standard/tests/strings/join_variation2.phpt @@ -82,7 +82,7 @@ $values = array ( // loop through each element of the array and check the working of join() -// when $pieces argument is supplied with different values +// when $pieces arugment is supplied with different values echo "\n--- Testing join() by supplying different values for 'pieces' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/lcfirst.phpt b/ext/standard/tests/strings/lcfirst.phpt index e603f4bbf8d4..4c5bec898dd5 100644 Binary files a/ext/standard/tests/strings/lcfirst.phpt and b/ext/standard/tests/strings/lcfirst.phpt differ diff --git a/ext/standard/tests/strings/setlocale_basic1.phpt b/ext/standard/tests/strings/setlocale_basic1.phpt index c806e6fabf8c..957357f6c177 100644 --- a/ext/standard/tests/strings/setlocale_basic1.phpt +++ b/ext/standard/tests/strings/setlocale_basic1.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , - * or FALSE if locale functionality is not implemented in this platform. + * or FALSE if locale functinality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_basic2.phpt b/ext/standard/tests/strings/setlocale_basic2.phpt index 7204c459114f..fe61b9b43122 100644 --- a/ext/standard/tests/strings/setlocale_basic2.phpt +++ b/ext/standard/tests/strings/setlocale_basic2.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functionality is not implemented in this platform. + if locale functinality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_basic3.phpt b/ext/standard/tests/strings/setlocale_basic3.phpt index 997dad98e7cd..47917e34e4bc 100644 --- a/ext/standard/tests/strings/setlocale_basic3.phpt +++ b/ext/standard/tests/strings/setlocale_basic3.phpt @@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) { /* Prototype : string setlocale (int $category , string $locale [,string $..] ) : string setlocale(int $category , array $locale); * Description: Sets locale information.Returns the new current locale , or FALSE - if locale functionality is not implemented in this platform. + if locale functinality is not implemented in this platform. * Source code: ext/standard/string.c */ diff --git a/ext/standard/tests/strings/setlocale_error.phpt b/ext/standard/tests/strings/setlocale_error.phpt index 361d00c5843a..e3f3765fbf7d 100644 --- a/ext/standard/tests/strings/setlocale_error.phpt +++ b/ext/standard/tests/strings/setlocale_error.phpt @@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --EXPECTF-- -*** Testing strcspn() : with different unexpected values of mask argument *** +*** Testing strcspn() : with diferent unexpected values of mask argument *** -- Iteration with mask value as "0" -- int(10) diff --git a/ext/standard/tests/strings/strip_tags_variation5.phpt b/ext/standard/tests/strings/strip_tags_variation5.phpt index 20b569390502..54601e9b6585 100644 --- a/ext/standard/tests/strings/strip_tags_variation5.phpt +++ b/ext/standard/tests/strings/strip_tags_variation5.phpt @@ -33,7 +33,7 @@ $multiline_string = <<This is a double quoted string EOT; -// here doc with different whitespaces +// here doc with diferent whitespaces $diff_whitespaces = <<hello\r world\t 1111\t\t != 2222\v\v diff --git a/ext/standard/tests/strings/stripcslashes_variation1.phpt b/ext/standard/tests/strings/stripcslashes_variation1.phpt index a2754c610311..32c8963df7f1 100644 --- a/ext/standard/tests/strings/stripcslashes_variation1.phpt +++ b/ext/standard/tests/strings/stripcslashes_variation1.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of stripcslashes() -// when $str argument is supplied with different values +// when $str arugment is supplied with different values echo "\n--- Testing stripcslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/stripslashes_variation1.phpt b/ext/standard/tests/strings/stripslashes_variation1.phpt index fb104199bd47..5693a26efcd2 100644 --- a/ext/standard/tests/strings/stripslashes_variation1.phpt +++ b/ext/standard/tests/strings/stripslashes_variation1.phpt @@ -80,7 +80,7 @@ $values = array ( // loop through each element of the array and check the working of stripslashes() -// when $str argument is supplied with different values +// when $str arugment is supplied with different values echo "\n--- Testing stripslashes() by supplying different values for 'str' argument ---\n"; $counter = 1; for($index = 0; $index < count($values); $index ++) { diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt index df39f2469ce3..5a1114d5cb91 100644 Binary files a/ext/standard/tests/strings/strlen.phpt and b/ext/standard/tests/strings/strlen.phpt differ diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt index 44785ef6c866..9b44584ee165 100644 Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ diff --git a/ext/standard/tests/strings/strrchr_basic.phpt b/ext/standard/tests/strings/strrchr_basic.phpt index b5bfe2d9c257..f396834837c3 100644 --- a/ext/standard/tests/strings/strrchr_basic.phpt +++ b/ext/standard/tests/strings/strrchr_basic.phpt @@ -30,11 +30,11 @@ var_dump( strrchr("Hello, World", "Hello, World") ); //needle as haystack //needle string containing one existing and one non-existing char var_dump( strrchr("Hello, World", "Hi") ); -//multiple existence of needle in haystack +//multiple existance of needle in haystack var_dump( strrchr("Hello, World", "o") ); var_dump( strrchr("Hello, World", "ooo") ); -var_dump( strrchr("Hello, World", "Zzzz") ); //non-existent needle in haystack +var_dump( strrchr("Hello, World", "Zzzz") ); //non-existant needle in haystack echo "*** Done ***"; ?> --EXPECTF-- diff --git a/ext/standard/tests/strings/strspn_variation2.phpt b/ext/standard/tests/strings/strspn_variation2.phpt index 57929fa3528b..7af61e559ae9 100644 --- a/ext/standard/tests/strings/strspn_variation2.phpt +++ b/ext/standard/tests/strings/strspn_variation2.phpt @@ -15,7 +15,7 @@ error_reporting(E_ALL & ~E_NOTICE); * Testing strspn() : with different unexpected values for mask argument */ -echo "*** Testing strspn() : with different unexpected values of mask argument ***\n"; +echo "*** Testing strspn() : with diferent unexpected values of mask argument ***\n"; $str = 'string_val'; $start = 1; @@ -102,7 +102,7 @@ fclose($file_handle); echo "Done" ?> --EXPECTF-- -*** Testing strspn() : with different unexpected values of mask argument *** +*** Testing strspn() : with diferent unexpected values of mask argument *** -- Iteration with mask value as "0" -- int(0) diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt index bdedb7e9f671..b135258f882e 100644 Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ diff --git a/ext/standard/tests/strings/strtok_variation1.phpt b/ext/standard/tests/strings/strtok_variation1.phpt index cb06fc43c357..b8febacfb961 100644 --- a/ext/standard/tests/strings/strtok_variation1.phpt +++ b/ext/standard/tests/strings/strtok_variation1.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of strtok() -// when $str argument is supplied with different values +// when $str arugment is supplied with different values echo "\n--- Testing strtok() by supplying different values for 'str' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/strtok_variation2.phpt b/ext/standard/tests/strings/strtok_variation2.phpt index 13da4405824b..19a6f26fb514 100644 --- a/ext/standard/tests/strings/strtok_variation2.phpt +++ b/ext/standard/tests/strings/strtok_variation2.phpt @@ -81,7 +81,7 @@ $values = array ( // loop through each element of the array and check the working of strtok() -// when $token argument is supplied with different values +// when $token arugment is supplied with different values echo "\n--- Testing strtok() by supplying different values for 'token' argument ---\n"; $counter = 1; diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index fd314cbd9d27..7d3a695d4ebf 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -26,7 +26,7 @@ echo "\n-- Testing substr_replace() function with start and length different typ var_dump(substr_replace($s1, "evening", array(5))); var_dump(substr_replace($s1, "evening", 5, array(8))); -echo "\n-- Testing substr_replace() function with start and length with a different number of elements --\n"; +echo "\n-- Testing substr_replace() function with start and length with a different number of elments --\n"; var_dump(substr_replace($s1, "evening", array(5, 1), array(8))); echo "\n-- Testing substr_replace() function with start and length as arrays but string not--\n"; @@ -58,7 +58,7 @@ string(12) "Good morning" Warning: substr_replace(): 'from' and 'len' should be of same type - numerical or array in %s on line %d string(12) "Good morning" --- Testing substr_replace() function with start and length with a different number of elements -- +-- Testing substr_replace() function with start and length with a different number of elments -- Warning: substr_replace(): 'from' and 'len' should have the same number of elements in %s on line %d string(12) "Good morning" diff --git a/ext/standard/tests/strings/trim1.phpt b/ext/standard/tests/strings/trim1.phpt index dd52efd98e4e..b9323afbdf6e 100644 Binary files a/ext/standard/tests/strings/trim1.phpt and b/ext/standard/tests/strings/trim1.phpt differ diff --git a/ext/standard/tests/strings/trim_error.phpt b/ext/standard/tests/strings/trim_error.phpt index 51dc848c9d05..092deb6dca64 100644 --- a/ext/standard/tests/strings/trim_error.phpt +++ b/ext/standard/tests/strings/trim_error.phpt @@ -4,7 +4,7 @@ Test trim() function : error conditions http://::#: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(1) ":" -} - --> x://::6.5: array(3) { ["scheme"]=> string(1) "x" @@ -863,8 +856,6 @@ echo "Done"; --> http://?: bool(false) ---> http://#: bool(false) - --> http://?:: bool(false) --> http://:?: bool(false) @@ -872,4 +863,4 @@ echo "Done"; --> http://blah.com:123456: bool(false) --> http://blah.com:abcdef: bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt index ed0f08a84f53..464e977ffc7a 100644 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ b/ext/standard/tests/url/parse_url_basic_002.phpt @@ -96,7 +96,6 @@ echo "Done"; --> x:/blah.com : string(1) "x" --> x://::abc/? : bool(false) --> http://::? : string(4) "http" ---> http://::# : string(4) "http" --> x://::6.5 : string(1) "x" --> http://?:/ : string(4) "http" --> http://@?:/ : string(4) "http" @@ -119,9 +118,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt index a2bbfa6482bd..57f182bfa311 100644 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ b/ext/standard/tests/url/parse_url_basic_003.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : string(1) ":" ---> http://::# : string(1) ":" --> x://::6.5 : string(1) ":" --> http://?:/ : string(1) "?" --> http://@?:/ : string(1) "?" @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt index 839ebee554ff..6abf4ed453c9 100644 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ b/ext/standard/tests/url/parse_url_basic_004.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : int(6) --> http://?:/ : NULL --> http://@?:/ : NULL @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index c113461fe759..3bcc89106d2e 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : string(0) "" @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 24de1cc23384..741a424a616d 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt index d4006879f4e9..bf8f98042e63 100644 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ b/ext/standard/tests/url/parse_url_basic_007.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : string(9) "/blah.com" --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : string(1) "/" --> http://@?:/ : string(1) "/" @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt index b283829c4662..a61fd06943cc 100644 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ b/ext/standard/tests/url/parse_url_basic_008.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt index a7d70f34da7e..5302388f6f51 100644 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ b/ext/standard/tests/url/parse_url_basic_009.phpt @@ -95,7 +95,6 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL ---> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -118,9 +117,8 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) ---> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done +Done \ No newline at end of file diff --git a/ext/standard/tests/url/urls.inc b/ext/standard/tests/url/urls.inc index 4192f4a86977..27521c852007 100644 --- a/ext/standard/tests/url/urls.inc +++ b/ext/standard/tests/url/urls.inc @@ -75,7 +75,6 @@ $urls = array( 'x:/blah.com', 'x://::abc/?', 'http://::?', -'http://::#', 'x://::6.5', 'http://?:/', 'http://@?:/', @@ -100,7 +99,6 @@ $urls = array( 'http://@:/', 'http://:/', 'http://?', -'http://#', 'http://?:', 'http://:?', 'http://blah.com:123456', @@ -108,4 +106,4 @@ $urls = array( ); -?> +?> \ No newline at end of file diff --git a/ext/standard/url.c b/ext/standard/url.c index 190b4665ebe7..94f6638d6472 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -266,7 +266,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) p = s; } else { /* memrchr is a GNU specific extension - Emulate for wide compatibility */ + Emulate for wide compatability */ for(p = e; *p != ':' && p >= s; p--); } diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 2c2dfda1b1e4..cb5983f685d5 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -544,69 +544,56 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= '.') { + if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy36; - if (yych <= '\v') goto yy32; - goto yy36; + if (yych <= 0x08) goto yy34; + if (yych <= '\v') goto yy30; + goto yy34; } else { - if (yych <= '\r') goto yy32; - if (yych == ' ') goto yy32; - goto yy36; + if (yych <= '\r') goto yy30; + if (yych <= 0x1F) goto yy34; + goto yy30; } } else { if (yych <= '@') { - if (yych <= '/') goto yy28; - if (yych == '>') goto yy30; - goto yy36; + if (yych != '>') goto yy34; } else { - if (yych <= 'Z') goto yy34; - if (yych <= '`') goto yy36; - if (yych <= 'z') goto yy34; - goto yy36; + if (yych <= 'Z') goto yy32; + if (yych <= '`') goto yy34; + if (yych <= 'z') goto yy32; + goto yy34; } } -yy28: - ++YYCURSOR; - if ((yych = *YYCURSOR) == '>') goto yy39; -yy29: -#line 323 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain_begin; } -#line 576 "ext/standard/url_scanner_ex.c" -yy30: ++YYCURSOR; -yy31: #line 320 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 582 "ext/standard/url_scanner_ex.c" -yy32: +#line 571 "ext/standard/url_scanner_ex.c" +yy30: ++YYCURSOR; yych = *YYCURSOR; - goto yy38; -yy33: + goto yy37; +yy31: #line 321 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg; } -#line 590 "ext/standard/url_scanner_ex.c" -yy34: +#line 579 "ext/standard/url_scanner_ex.c" +yy32: ++YYCURSOR; #line 322 "ext/standard/url_scanner_ex.re" { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 595 "ext/standard/url_scanner_ex.c" +#line 584 "ext/standard/url_scanner_ex.c" +yy34: + ++YYCURSOR; +#line 323 "ext/standard/url_scanner_ex.re" + { passthru(STD_ARGS); goto state_plain_begin; } +#line 589 "ext/standard/url_scanner_ex.c" yy36: - yych = *++YYCURSOR; - goto yy29; -yy37: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy38: +yy37: if (yybm[0+yych] & 128) { - goto yy37; + goto yy36; } - goto yy33; -yy39: - ++YYCURSOR; - yych = *YYCURSOR; goto yy31; } #line 324 "ext/standard/url_scanner_ex.re" @@ -615,7 +602,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s state_arg: start = YYCURSOR; -#line 619 "ext/standard/url_scanner_ex.c" +#line 606 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -654,32 +641,32 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= '@') goto yy44; - if (yych <= 'Z') goto yy42; - if (yych <= '`') goto yy44; - if (yych >= '{') goto yy44; -yy42: + if (yych <= '@') goto yy42; + if (yych <= 'Z') goto yy40; + if (yych <= '`') goto yy42; + if (yych >= '{') goto yy42; +yy40: ++YYCURSOR; yych = *YYCURSOR; - goto yy47; -yy43: + goto yy45; +yy41: #line 329 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 669 "ext/standard/url_scanner_ex.c" -yy44: +#line 656 "ext/standard/url_scanner_ex.c" +yy42: ++YYCURSOR; #line 330 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 674 "ext/standard/url_scanner_ex.c" -yy46: +#line 661 "ext/standard/url_scanner_ex.c" +yy44: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy47: +yy45: if (yybm[0+yych] & 128) { - goto yy46; + goto yy44; } - goto yy43; + goto yy41; } #line 331 "ext/standard/url_scanner_ex.re" @@ -687,7 +674,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s state_before_val: start = YYCURSOR; -#line 691 "ext/standard/url_scanner_ex.c" +#line 678 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -726,45 +713,45 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych == ' ') goto yy50; - if (yych == '=') goto yy52; - goto yy54; -yy50: + if (yych == ' ') goto yy48; + if (yych == '=') goto yy50; + goto yy52; +yy48: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ' ') goto yy57; - if (yych == '=') goto yy55; -yy51: + if (yych == ' ') goto yy55; + if (yych == '=') goto yy53; +yy49: #line 337 "ext/standard/url_scanner_ex.re" { --YYCURSOR; goto state_next_arg_begin; } -#line 740 "ext/standard/url_scanner_ex.c" -yy52: +#line 727 "ext/standard/url_scanner_ex.c" +yy50: ++YYCURSOR; yych = *YYCURSOR; - goto yy56; -yy53: + goto yy54; +yy51: #line 336 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 748 "ext/standard/url_scanner_ex.c" -yy54: +#line 735 "ext/standard/url_scanner_ex.c" +yy52: yych = *++YYCURSOR; - goto yy51; -yy55: + goto yy49; +yy53: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy56: +yy54: if (yybm[0+yych] & 128) { - goto yy55; + goto yy53; } - goto yy53; -yy57: + goto yy51; +yy55: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych == ' ') goto yy57; - if (yych == '=') goto yy55; + if (yych == ' ') goto yy55; + if (yych == '=') goto yy53; YYCURSOR = YYMARKER; - goto yy51; + goto yy49; } #line 338 "ext/standard/url_scanner_ex.re" @@ -773,124 +760,151 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s state_val: start = YYCURSOR; -#line 777 "ext/standard/url_scanner_ex.c" +#line 764 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 192, 192, 224, 224, 192, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 192, 224, 64, 224, 224, 224, 224, 128, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 0, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 160, 160, 248, 248, 160, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 160, 248, 56, 248, 248, 248, 248, 200, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 0, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy65; - if (yych <= '\n') goto yy67; - goto yy65; + if (yych <= 0x08) goto yy63; + if (yych <= '\n') goto yy64; + goto yy63; } else { - if (yych <= '\r') goto yy67; - if (yych <= 0x1F) goto yy65; - goto yy67; + if (yych <= '\r') goto yy64; + if (yych <= 0x1F) goto yy63; + goto yy64; } } else { if (yych <= '&') { - if (yych != '"') goto yy65; + if (yych != '"') goto yy63; } else { - if (yych <= '\'') goto yy64; - if (yych == '>') goto yy67; - goto yy65; + if (yych <= '\'') goto yy62; + if (yych == '>') goto yy64; + goto yy63; } } yych = *(YYMARKER = ++YYCURSOR); - if (yych != '>') goto yy76; + goto yy77; +yy61: +#line 346 "ext/standard/url_scanner_ex.re" + { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } +#line 827 "ext/standard/url_scanner_ex.c" +yy62: + yych = *(YYMARKER = ++YYCURSOR); + goto yy69; yy63: + yych = *++YYCURSOR; + goto yy67; +yy64: + ++YYCURSOR; #line 347 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 840 "ext/standard/url_scanner_ex.c" -yy64: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '>') goto yy63; - goto yy71; -yy65: +#line 838 "ext/standard/url_scanner_ex.c" +yy66: ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - goto yy69; -yy66: -#line 346 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } -#line 852 "ext/standard/url_scanner_ex.c" yy67: - yych = *++YYCURSOR; - goto yy63; + if (yybm[0+yych] & 8) { + goto yy66; + } + goto yy61; yy68: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; yy69: - if (yybm[0+yych] & 32) { + if (yybm[0+yych] & 16) { goto yy68; } - goto yy66; -yy70: + if (yych <= '&') goto yy72; + if (yych >= '(') goto yy61; ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy71: - if (yybm[0+yych] & 64) { - goto yy70; + if (yybm[0+(yych = *YYCURSOR)] & 8) { + goto yy66; } - if (yych <= '=') goto yy73; -yy72: - YYCURSOR = YYMARKER; - goto yy63; -yy73: - ++YYCURSOR; +yy71: #line 345 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 881 "ext/standard/url_scanner_ex.c" -yy75: +#line 865 "ext/standard/url_scanner_ex.c" +yy72: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy72; + } + if (yych <= '=') goto yy75; +yy74: + YYCURSOR = YYMARKER; + goto yy61; +yy75: + yych = *++YYCURSOR; + goto yy71; yy76: - if (yybm[0+yych] & 128) { - goto yy75; + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; +yy77: + if (yybm[0+yych] & 64) { + goto yy76; } - if (yych >= '>') goto yy72; + if (yych <= '!') goto yy80; + if (yych >= '#') goto yy61; ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 8) { + goto yy66; + } +yy79: #line 344 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 894 "ext/standard/url_scanner_ex.c" +#line 897 "ext/standard/url_scanner_ex.c" +yy80: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy80; + } + if (yych >= '>') goto yy74; + ++YYCURSOR; + yych = *YYCURSOR; + goto yy79; } #line 348 "ext/standard/url_scanner_ex.re" @@ -1011,7 +1025,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) { - char *encoded = NULL; + char *encoded; int encoded_len; smart_str val; diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index ecacb76f9419..760f725e983b 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -317,7 +317,7 @@ state_next_arg_begin: state_next_arg: start = YYCURSOR; /*!re2c - [/]? [>] { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } + ">" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } [ \v\r\t\n]+ { passthru(STD_ARGS); goto state_next_arg; } alpha { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } any { passthru(STD_ARGS); goto state_plain_begin; } @@ -343,7 +343,7 @@ state_val: /*!re2c ["] (any\[">])* ["] { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } ['] (any\['>])* ['] { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } - (any\[ \r\t\n>'"])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } + (any\[ \r\t\n>])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } any { passthru(STD_ARGS); goto state_next_arg_begin; } */ @@ -463,7 +463,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) { - char *encoded = NULL; + char *encoded; int encoded_len; smart_str val; diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 1e5c38a3731e..b009e67aa155 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -474,7 +474,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) } else { php_stream_bucket_prepend(brigade, bucket TSRMLS_CC); } - /* This is a hack necessary to accommodate situations where bucket is appended to the stream + /* This is a hack necessary to accomodate situations where bucket is appended to the stream * multiple times. See bug35916.phpt for reference. */ if (bucket->refcount == 1) { @@ -559,7 +559,7 @@ PHP_FUNCTION(stream_get_filters) if (filters_hash) { for(zend_hash_internal_pointer_reset(filters_hash); - (key_flags = zend_hash_get_current_key_ex(filters_hash, &filter_name, &filter_name_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTENT; + (key_flags = zend_hash_get_current_key_ex(filters_hash, &filter_name, &filter_name_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; zend_hash_move_forward(filters_hash)) if (key_flags == HASH_KEY_IS_STRING) { add_next_index_stringl(return_value, filter_name, filter_name_len - 1, 1); diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 76701ff24b19..f0142ed04996 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -70,7 +70,7 @@ PHPAPI int php_uuencode(char *src, int src_len, char **dest) /* {{{ */ int len = 45; char *p, *s, *e, *ee; - /* encoded length is ~ 38% greater than the original */ + /* encoded length is ~ 38% greater then the original */ p = *dest = safe_emalloc((size_t) ceil(src_len * 1.38), 1, 46); s = src; e = src + src_len; diff --git a/ext/standard/var.c b/ext/standard/var.c index c1e7c2f3ee34..f76a14cfa664 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -649,7 +649,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt for (;; zend_hash_move_forward_ex(HASH_OF(retval_ptr), &pos)) { i = zend_hash_get_current_key_ex(HASH_OF(retval_ptr), &key, NULL, &index, 0, &pos); - if (i == HASH_KEY_NON_EXISTENT) { + if (i == HASH_KEY_NON_EXISTANT) { break; } @@ -860,7 +860,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var zend_hash_internal_pointer_reset_ex(myht, &pos); for (;; zend_hash_move_forward_ex(myht, &pos)) { i = zend_hash_get_current_key_ex(myht, &key, &key_len, &index, 0, &pos); - if (i == HASH_KEY_NON_EXISTENT) { + if (i == HASH_KEY_NON_EXISTANT) { break; } if (incomplete_class && strcmp(key, MAGIC_MEMBER) == 0) { @@ -945,7 +945,7 @@ PHP_FUNCTION(serialize) } /* }}} */ -/* {{{ proto mixed unserialize(string variable_representation[, int &consumed]) +/* {{{ proto mixed unserialize(string variable_representation) Takes a string representation of variable and recreates it */ PHP_FUNCTION(unserialize) { @@ -953,9 +953,8 @@ PHP_FUNCTION(unserialize) int buf_len; const unsigned char *p; php_unserialize_data_t var_hash; - zval *consumed = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &buf, &buf_len, &consumed) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { RETURN_FALSE; } @@ -974,11 +973,6 @@ PHP_FUNCTION(unserialize) RETURN_FALSE; } PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - - if (consumed) { - zval_dtor(consumed); - ZVAL_LONG(consumed, ((char*)p) - buf); - } } /* }}} */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index f7546428b1e6..ddf43b02cf14 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -26,7 +26,6 @@ /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1024 -#define VAR_ENTRIES_DBG 0 typedef struct { zval *data[VAR_ENTRIES_MAX]; @@ -37,7 +36,7 @@ typedef struct { static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -61,7 +60,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -83,35 +82,11 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) var_hash->data[var_hash->used_slots++] = *rval; } -PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = (*var_hashx)->last_dtor; -#if VAR_ENTRIES_DBG - fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); -#endif - - if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!(*var_hashx)->first_dtor) { - (*var_hashx)->first_dtor = var_hash; - } else { - ((var_entries *) (*var_hashx)->last_dtor)->next = var_hash; - } - - (*var_hashx)->last_dtor = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif @@ -129,7 +104,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) { var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif @@ -152,7 +127,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) void *next; long i; var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif @@ -226,7 +201,7 @@ static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen #define YYMARKER marker -#line 234 "ext/standard/var_unserializer.re" +#line 209 "ext/standard/var_unserializer.re" @@ -457,7 +432,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -#line 461 "ext/standard/var_unserializer.c" +#line 436 "ext/standard/var_unserializer.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -517,9 +492,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy95; yy3: -#line 812 "ext/standard/var_unserializer.re" +#line 785 "ext/standard/var_unserializer.re" { return 0; } -#line 523 "ext/standard/var_unserializer.c" +#line 498 "ext/standard/var_unserializer.c" yy4: yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy89; @@ -562,13 +537,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) goto yy3; yy14: ++YYCURSOR; -#line 806 "ext/standard/var_unserializer.re" +#line 779 "ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } -#line 572 "ext/standard/var_unserializer.c" +#line 547 "ext/standard/var_unserializer.c" yy16: yych = *++YYCURSOR; goto yy3; @@ -598,7 +573,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 660 "ext/standard/var_unserializer.re" +#line 635 "ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; long elements; @@ -650,9 +625,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) do { /* Try to find class directly */ - BG(serialize_lock)++; + BG(serialize_lock) = 1; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); return 0; @@ -660,7 +635,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ce = *pce; break; } - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); @@ -680,9 +655,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); - BG(serialize_lock)++; + BG(serialize_lock) = 1; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); zval_ptr_dtor(&user_func); @@ -696,7 +671,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) zval_ptr_dtor(&arg_func_name); break; } - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } @@ -724,9 +699,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) *p = YYCURSOR; if (custom_object) { - int ret; - - ret = object_custom(UNSERIALIZE_PASSTHRU, ce); + int ret = object_custom(UNSERIALIZE_PASSTHRU, ce); if (ret && incomplete_class) { php_store_class_name(*rval, class_name, len2); @@ -744,7 +717,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return object_common2(UNSERIALIZE_PASSTHRU, elements); } -#line 748 "ext/standard/var_unserializer.c" +#line 721 "ext/standard/var_unserializer.c" yy25: yych = *++YYCURSOR; if (yych <= ',') { @@ -769,7 +742,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 652 "ext/standard/var_unserializer.re" +#line 627 "ext/standard/var_unserializer.re" { INIT_PZVAL(*rval); @@ -777,7 +750,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } -#line 781 "ext/standard/var_unserializer.c" +#line 754 "ext/standard/var_unserializer.c" yy32: yych = *++YYCURSOR; if (yych == '+') goto yy33; @@ -798,7 +771,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '{') goto yy18; ++YYCURSOR; -#line 632 "ext/standard/var_unserializer.re" +#line 607 "ext/standard/var_unserializer.re" { long elements = parse_iv(start + 2); /* use iv() not uiv() in order to check data range */ @@ -818,7 +791,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 822 "ext/standard/var_unserializer.c" +#line 795 "ext/standard/var_unserializer.c" yy39: yych = *++YYCURSOR; if (yych == '+') goto yy40; @@ -839,7 +812,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 603 "ext/standard/var_unserializer.re" +#line 578 "ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -868,7 +841,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_STRINGL(*rval, str, len, 0); return 1; } -#line 872 "ext/standard/var_unserializer.c" +#line 845 "ext/standard/var_unserializer.c" yy46: yych = *++YYCURSOR; if (yych == '+') goto yy47; @@ -889,7 +862,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 575 "ext/standard/var_unserializer.re" +#line 550 "ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -917,7 +890,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 921 "ext/standard/var_unserializer.c" +#line 894 "ext/standard/var_unserializer.c" yy53: yych = *++YYCURSOR; if (yych <= '/') { @@ -1005,7 +978,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) } yy63: ++YYCURSOR; -#line 565 "ext/standard/var_unserializer.re" +#line 540 "ext/standard/var_unserializer.re" { #if SIZEOF_LONG == 4 use_double: @@ -1015,7 +988,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); return 1; } -#line 1019 "ext/standard/var_unserializer.c" +#line 992 "ext/standard/var_unserializer.c" yy65: yych = *++YYCURSOR; if (yych <= ',') { @@ -1074,7 +1047,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; -#line 550 "ext/standard/var_unserializer.re" +#line 525 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -1089,7 +1062,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1093 "ext/standard/var_unserializer.c" +#line 1066 "ext/standard/var_unserializer.c" yy76: yych = *++YYCURSOR; if (yych == 'N') goto yy73; @@ -1116,7 +1089,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy79; if (yych != ';') goto yy18; ++YYCURSOR; -#line 523 "ext/standard/var_unserializer.re" +#line 498 "ext/standard/var_unserializer.re" { #if SIZEOF_LONG == 4 int digits = YYCURSOR - start - 3; @@ -1143,7 +1116,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 1147 "ext/standard/var_unserializer.c" +#line 1120 "ext/standard/var_unserializer.c" yy83: yych = *++YYCURSOR; if (yych <= '/') goto yy18; @@ -1151,24 +1124,24 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; -#line 516 "ext/standard/var_unserializer.re" +#line 491 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_BOOL(*rval, parse_iv(start + 2)); return 1; } -#line 1162 "ext/standard/var_unserializer.c" +#line 1135 "ext/standard/var_unserializer.c" yy87: ++YYCURSOR; -#line 509 "ext/standard/var_unserializer.re" +#line 484 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_NULL(*rval); return 1; } -#line 1172 "ext/standard/var_unserializer.c" +#line 1145 "ext/standard/var_unserializer.c" yy89: yych = *++YYCURSOR; if (yych <= ',') { @@ -1191,7 +1164,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy91; if (yych != ';') goto yy18; ++YYCURSOR; -#line 486 "ext/standard/var_unserializer.re" +#line 461 "ext/standard/var_unserializer.re" { long id; @@ -1206,7 +1179,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (*rval == *rval_ref) return 0; if (*rval != NULL) { - var_push_dtor_no_addref(var_hash, rval); + zval_ptr_dtor(rval); } *rval = *rval_ref; Z_ADDREF_PP(rval); @@ -1214,7 +1187,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1218 "ext/standard/var_unserializer.c" +#line 1191 "ext/standard/var_unserializer.c" yy95: yych = *++YYCURSOR; if (yych <= ',') { @@ -1237,7 +1210,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy97; if (yych != ';') goto yy18; ++YYCURSOR; -#line 465 "ext/standard/var_unserializer.re" +#line 440 "ext/standard/var_unserializer.re" { long id; @@ -1258,9 +1231,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1262 "ext/standard/var_unserializer.c" +#line 1235 "ext/standard/var_unserializer.c" } -#line 814 "ext/standard/var_unserializer.re" +#line 787 "ext/standard/var_unserializer.re" return 0; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 76c501e1b58c..4d99cbfd7894 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -24,7 +24,6 @@ /* {{{ reference-handling for unserializer: var_* */ #define VAR_ENTRIES_MAX 1024 -#define VAR_ENTRIES_DBG 0 typedef struct { zval *data[VAR_ENTRIES_MAX]; @@ -35,7 +34,7 @@ typedef struct { static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -59,7 +58,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { var_entries *var_hash = (*var_hashx)->last_dtor; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -81,35 +80,11 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) var_hash->data[var_hash->used_slots++] = *rval; } -PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = (*var_hashx)->last_dtor; -#if VAR_ENTRIES_DBG - fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval)); -#endif - - if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!(*var_hashx)->first_dtor) { - (*var_hashx)->first_dtor = var_hash; - } else { - ((var_entries *) (*var_hashx)->last_dtor)->next = var_hash; - } - - (*var_hashx)->last_dtor = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif @@ -127,7 +102,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) { var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif @@ -150,7 +125,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) void *next; long i; var_entries *var_hash = (*var_hashx)->first; -#if VAR_ENTRIES_DBG +#if 0 fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif @@ -497,7 +472,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (*rval == *rval_ref) return 0; if (*rval != NULL) { - var_push_dtor_no_addref(var_hash, rval); + zval_ptr_dtor(rval); } *rval = *rval_ref; Z_ADDREF_PP(rval); @@ -708,9 +683,9 @@ object ":" uiv ":" ["] { do { /* Try to find class directly */ - BG(serialize_lock)++; + BG(serialize_lock) = 1; if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); return 0; @@ -718,7 +693,7 @@ object ":" uiv ":" ["] { ce = *pce; break; } - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); @@ -738,9 +713,9 @@ object ":" uiv ":" ["] { args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); - BG(serialize_lock)++; + BG(serialize_lock) = 1; if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (EG(exception)) { efree(class_name); zval_ptr_dtor(&user_func); @@ -754,7 +729,7 @@ object ":" uiv ":" ["] { zval_ptr_dtor(&arg_func_name); break; } - BG(serialize_lock)--; + BG(serialize_lock) = 0; if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } @@ -782,9 +757,7 @@ object ":" uiv ":" ["] { *p = YYCURSOR; if (custom_object) { - int ret; - - ret = object_custom(UNSERIALIZE_PASSTHRU, ce); + int ret = object_custom(UNSERIALIZE_PASSTHRU, ce); if (ret && incomplete_class) { php_store_class_name(*rval, class_name, len2); diff --git a/ext/sybase_ct/config.m4 b/ext/sybase_ct/config.m4 index 276fe1267550..81df1f3126f2 100644 --- a/ext/sybase_ct/config.m4 +++ b/ext/sybase_ct/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(sybase-ct, for Sybase-CT support, -[ --with-sybase-ct[=DIR] Include Sybase-CT support. DIR is the Sybase home +[ --with-sybase-ct[=DIR] Include Sybase-CT support. DIR is the Sybase home directory [/home/sybase]]) if test "$PHP_SYBASE_CT" != "no"; then diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index ee53d484cfb9..bd4cf1429cb3 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -1121,7 +1121,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) break; case CS_CMD_FAIL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, canceling rest"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, cancelling rest"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); fail = 1; break; @@ -1131,7 +1131,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) case CS_PARAM_RESULT: case CS_ROW_RESULT: /* Unexpected results, cancel them. */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling current"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling current"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); break; @@ -1141,7 +1141,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) break; default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling all"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling all"); ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); break; } @@ -1696,7 +1696,7 @@ PHP_FUNCTION(sybase_free_result) /* Did we fetch up until the end? */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: canceling the rest of the results"); */ + /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cancelling the rest of the results"); */ ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); php_sybase_finish_results(result TSRMLS_CC); } diff --git a/ext/sybase_ct/tests/bug26407.phpt b/ext/sybase_ct/tests/bug26407.phpt index 27f5f99b9d1f..35bf6df7ada3 100644 --- a/ext/sybase_ct/tests/bug26407.phpt +++ b/ext/sybase_ct/tests/bug26407.phpt @@ -80,7 +80,7 @@ bool(true) select "bar" -Notice: sybase_query(): Sybase: Unexpected results, canceling current in %stest.inc on line %d +Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %stest.inc on line %d <<< Return: resource array(1) { [0]=> diff --git a/ext/sybase_ct/tests/bug43578.phpt b/ext/sybase_ct/tests/bug43578.phpt index 9f75b9c0ea06..e840402edc2f 100644 --- a/ext/sybase_ct/tests/bug43578.phpt +++ b/ext/sybase_ct/tests/bug43578.phpt @@ -23,7 +23,7 @@ Sybase-CT bug #43578 (Incurred fault #6 - if returned textfield ist empty) var_dump(sybase_query('insert into #Resource values (123, NULL)', $db)); var_dump(sybase_query('insert into #Resource values (124, "")', $db)); - // Select non-existent + // Select non-existant var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 122')); // Select null diff --git a/ext/sybase_ct/tests/test_fetch_object.phpt b/ext/sybase_ct/tests/test_fetch_object.phpt index 2d225cd9cf44..c23658fa35d3 100644 --- a/ext/sybase_ct/tests/test_fetch_object.phpt +++ b/ext/sybase_ct/tests/test_fetch_object.phpt @@ -40,7 +40,7 @@ Sybase-CT sybase_fetch_object // Test with object var_export(fetch_object($db, new article())); echo "\n"; - // Test with non-existent class + // Test with non-existant class var_export(fetch_object($db, '***')); echo "\n"; sybase_close($db); diff --git a/ext/sybase_ct/tests/test_msghandler.phpt b/ext/sybase_ct/tests/test_msghandler.phpt index 3189aaac210b..afe97cbef359 100644 --- a/ext/sybase_ct/tests/test_msghandler.phpt +++ b/ext/sybase_ct/tests/test_msghandler.phpt @@ -13,7 +13,7 @@ Sybase-CT server message handler $db= sybase_connect_ex(); - echo 'Nonexistent: '; sybase_set_messagehandler_ex('function_does_not_exist'); + echo 'Nonexistant: '; sybase_set_messagehandler_ex('function_does_not_exist'); echo 'Static method: '; sybase_set_messagehandler_ex(array('sybase', 'static_handler')); echo 'Instance method: '; sybase_set_messagehandler_ex(array(new sybase(), 'handler')); echo 'Lambda function: '; sybase_set_messagehandler_ex(create_function('', 'return FALSE;')); @@ -25,7 +25,7 @@ Sybase-CT server message handler sybase_close($db); ?> --EXPECTF-- -Nonexistent: +Nonexistant: Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, function 'function_does_not_exist' not found or invalid function name in %stest.inc on line %d NULL Static method: bool(true) diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index a57e25e6c327..e268047b695f 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -228,7 +228,7 @@ PHP_FUNCTION(msg_stat_queue) /* {{{ proto bool msg_queue_exists(int key) - Check whether a message queue exists */ + Check wether a message queue exists */ PHP_FUNCTION(msg_queue_exists) { long key; diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt index 6f52f3bd7ee6..3a962be31a41 100644 --- a/ext/sysvsem/tests/sysv.phpt +++ b/ext/sysvsem/tests/sysv.phpt @@ -23,11 +23,11 @@ echo "Got semaphore $sem_id.\n"; // Accuire semaphore if (! sem_acquire($sem_id)) { - echo "Fail to acquire semaphore $sem_id.\n"; + echo "Fail to aquire semaphore $sem_id.\n"; sem_remove($sem_id); exit; } -echo "Success acquire semaphore $sem_id.\n"; +echo "Success aquire semaphore $sem_id.\n"; $shm_id = shm_attach($SHMKEY, $MEMSIZE); if ($shm_id === FALSE) { @@ -100,7 +100,7 @@ echo "End.\n"; --EXPECTF-- Start. Got semaphore Resource id #%i. -Success acquire semaphore Resource id #%i. +Success aquire semaphore Resource id #%i. Success to attach shared memory : %s. Write var1 to shared memory. Write var2 to shared memory. diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 index 102f6a827e83..675498c8ceca 100644 --- a/ext/tidy/config.m4 +++ b/ext/tidy/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(tidy,for TIDY support, -[ --with-tidy[=DIR] Include TIDY support]) +[ --with-tidy[=DIR] Include TIDY support]) if test "$PHP_TIDY" != "no"; then diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index c3b9d8c3468b..5cfb1645692c 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -1443,7 +1443,7 @@ static PHP_FUNCTION(tidy_get_config) /* }}} */ /* {{{ proto int tidy_get_status() - Get status of specified document. */ + Get status of specfied document. */ static PHP_FUNCTION(tidy_get_status) { TIDY_FETCH_OBJECT; diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4 index 8f933d490aac..2b02a92aa9fc 100644 --- a/ext/wddx/config.m4 +++ b/ext/wddx/config.m4 @@ -7,11 +7,11 @@ PHP_ARG_ENABLE(wddx,whether to enable WDDX support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no) fi PHP_ARG_WITH(libexpat-dir, libexpat dir for WDDX, -[ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no) +[ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no) if test "$PHP_WDDX" != "no"; then diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index afeca9048957..967da6a49042 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -405,7 +405,7 @@ static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC) if (Z_STRLEN_P(var) > 0) { char *buf; - size_t buf_len; + int buf_len; buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC); @@ -626,12 +626,12 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) */ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC) { + char *tmp_buf; + char *name_esc; + int name_esc_len; HashTable *ht; if (name) { - size_t name_esc_len; - char *tmp_buf, *name_esc; - name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S)); snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc); diff --git a/ext/xml/compat.c b/ext/xml/compat.c index a4c66d259b3a..fbebb635eebf 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -39,7 +39,7 @@ _qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, x if (URI) { /* Use libxml functions otherwise its memory deallocation is screwed up */ *qualified = xmlStrdup(URI); - *qualified = xmlStrncat(*qualified, parser->_ns_separator, 1); + *qualified = xmlStrncat(*qualified, parser->_ns_seperator, 1); *qualified = xmlStrncat(*qualified, name, xmlStrlen(name)); } else { *qualified = xmlStrdup(name); @@ -469,7 +469,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m parser = (XML_Parser) emalloc(sizeof(struct _XML_Parser)); memset(parser, 0, sizeof(struct _XML_Parser)); parser->use_namespace = 0; - parser->_ns_separator = NULL; + parser->_ns_seperator = NULL; parser->parser = xmlCreatePushParserCtxt((xmlSAXHandlerPtr) &php_xml_compat_handlers, (void *) parser, NULL, 0, NULL); if (parser->parser == NULL) { @@ -491,7 +491,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m if (sep != NULL) { parser->use_namespace = 1; parser->parser->sax2 = 1; - parser->_ns_separator = xmlStrdup(sep); + parser->_ns_seperator = xmlStrdup(sep); } else { /* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt so must be set in the handlers */ @@ -619,109 +619,109 @@ XML_GetErrorCode(XML_Parser parser) } static const XML_Char *const error_mapping[] = { - (const XML_Char *)"No error", - (const XML_Char *)"No memory", - (const XML_Char *)"Invalid document start", - (const XML_Char *)"Empty document", - (const XML_Char *)"Not well-formed (invalid token)", - (const XML_Char *)"Invalid document end", - (const XML_Char *)"Invalid hexadecimal character reference", - (const XML_Char *)"Invalid decimal character reference", - (const XML_Char *)"Invalid character reference", - (const XML_Char *)"Invalid character", - (const XML_Char *)"XML_ERR_CHARREF_AT_EOF", - (const XML_Char *)"XML_ERR_CHARREF_IN_PROLOG", - (const XML_Char *)"XML_ERR_CHARREF_IN_EPILOG", - (const XML_Char *)"XML_ERR_CHARREF_IN_DTD", - (const XML_Char *)"XML_ERR_ENTITYREF_AT_EOF", - (const XML_Char *)"XML_ERR_ENTITYREF_IN_PROLOG", - (const XML_Char *)"XML_ERR_ENTITYREF_IN_EPILOG", - (const XML_Char *)"XML_ERR_ENTITYREF_IN_DTD", - (const XML_Char *)"PEReference at end of document", - (const XML_Char *)"PEReference in prolog", - (const XML_Char *)"PEReference in epilog", - (const XML_Char *)"PEReference: forbidden within markup decl in internal subset", - (const XML_Char *)"XML_ERR_ENTITYREF_NO_NAME", - (const XML_Char *)"EntityRef: expecting ';'", - (const XML_Char *)"PEReference: no name", - (const XML_Char *)"PEReference: expecting ';'", - (const XML_Char *)"Undeclared entity error", - (const XML_Char *)"Undeclared entity warning", - (const XML_Char *)"Unparsed Entity", - (const XML_Char *)"XML_ERR_ENTITY_IS_EXTERNAL", - (const XML_Char *)"XML_ERR_ENTITY_IS_PARAMETER", - (const XML_Char *)"Unknown encoding", - (const XML_Char *)"Unsupported encoding", - (const XML_Char *)"String not started expecting ' or \"", - (const XML_Char *)"String not closed expecting \" or '", - (const XML_Char *)"Namespace declaration error", - (const XML_Char *)"EntityValue: \" or ' expected", - (const XML_Char *)"EntityValue: \" or ' expected", - (const XML_Char *)"< in attribute", - (const XML_Char *)"Attribute not started", - (const XML_Char *)"Attribute not finished", - (const XML_Char *)"Attribute without value", - (const XML_Char *)"Attribute redefined", - (const XML_Char *)"SystemLiteral \" or ' expected", - (const XML_Char *)"SystemLiteral \" or ' expected", - /* (const XML_Char *)"XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ - (const XML_Char *)"Comment not finished", - (const XML_Char *)"Processing Instruction not started", - (const XML_Char *)"Processing Instruction not finished", - (const XML_Char *)"NOTATION: Name expected here", - (const XML_Char *)"'>' required to close NOTATION declaration", - (const XML_Char *)"'(' required to start ATTLIST enumeration", - (const XML_Char *)"'(' required to start ATTLIST enumeration", - (const XML_Char *)"MixedContentDecl : '|' or ')*' expected", - (const XML_Char *)"XML_ERR_MIXED_NOT_FINISHED", - (const XML_Char *)"ELEMENT in DTD not started", - (const XML_Char *)"ELEMENT in DTD not finished", - (const XML_Char *)"XML declaration not started", - (const XML_Char *)"XML declaration not finished", - (const XML_Char *)"XML_ERR_CONDSEC_NOT_STARTED", - (const XML_Char *)"XML conditional section not closed", - (const XML_Char *)"Content error in the external subset", - (const XML_Char *)"DOCTYPE not finished", - (const XML_Char *)"Sequence ']]>' not allowed in content", - (const XML_Char *)"CDATA not finished", - (const XML_Char *)"Reserved XML Name", - (const XML_Char *)"Space required", - (const XML_Char *)"XML_ERR_SEPARATOR_REQUIRED", - (const XML_Char *)"NmToken expected in ATTLIST enumeration", - (const XML_Char *)"XML_ERR_NAME_REQUIRED", - (const XML_Char *)"MixedContentDecl : '#PCDATA' expected", - (const XML_Char *)"SYSTEM or PUBLIC, the URI is missing", - (const XML_Char *)"PUBLIC, the Public Identifier is missing", - (const XML_Char *)"< required", - (const XML_Char *)"> required", - (const XML_Char *)"' required to close NOTATION declaration", + "'(' required to start ATTLIST enumeration", + "'(' required to start ATTLIST enumeration", + "MixedContentDecl : '|' or ')*' expected", + "XML_ERR_MIXED_NOT_FINISHED", + "ELEMENT in DTD not started", + "ELEMENT in DTD not finished", + "XML declaration not started", + "XML declaration not finished", + "XML_ERR_CONDSEC_NOT_STARTED", + "XML conditional section not closed", + "Content error in the external subset", + "DOCTYPE not finished", + "Sequence ']]>' not allowed in content", + "CDATA not finished", + "Reserved XML Name", + "Space required", + "XML_ERR_SEPARATOR_REQUIRED", + "NmToken expected in ATTLIST enumeration", + "XML_ERR_NAME_REQUIRED", + "MixedContentDecl : '#PCDATA' expected", + "SYSTEM or PUBLIC, the URI is missing", + "PUBLIC, the Public Identifier is missing", + "< required", + "> required", + "use_namespace) { - if (parser->_ns_separator) { - xmlFree(parser->_ns_separator); + if (parser->_ns_seperator) { + xmlFree(parser->_ns_seperator); } } if (parser->parser->myDoc) { diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 index ebfc0471e086..65f22915b93a 100644 --- a/ext/xml/config.m4 +++ b/ext/xml/config.m4 @@ -7,11 +7,11 @@ PHP_ARG_ENABLE(xml,whether to enable XML support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no) fi PHP_ARG_WITH(libexpat-dir, libexpat install dir, -[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no) +[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no) if test "$PHP_XML" != "no"; then diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index 1c94e45fd3e9..424785f566fd 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -38,9 +38,6 @@ #include #include -/* For compatibility with the misspelled version. */ -#define _ns_seperator _ns_separator - typedef xmlChar XML_Char; typedef void (*XML_StartElementHandler)(void *, const XML_Char *, const XML_Char **); @@ -64,7 +61,7 @@ typedef struct _XML_Memory_Handling_Suite { typedef struct _XML_Parser { int use_namespace; - xmlChar *_ns_separator; + xmlChar *_ns_seperator; void *user; xmlParserCtxtPtr parser; diff --git a/ext/xml/tests/bug65236.phpt b/ext/xml/tests/bug65236.phpt deleted file mode 100644 index 67b26d663f6a..000000000000 --- a/ext/xml/tests/bug65236.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #65236 (heap corruption in xml parser) ---SKIPIF-- - ---FILE-- -", 1000), $a); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: xml_parse_into_struct(): Maximum depth exceeded - Results truncated in %s on line %d -Done diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 1ef01c88646a..2fea4f8ab9b4 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -274,10 +274,10 @@ zend_module_entry xml_module_entry = { * the encoding is currently done internally by expat/xmltok. */ xml_encoding xml_encodings[] = { - { (XML_Char *)"ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, - { (XML_Char *)"US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, - { (XML_Char *)"UTF-8", NULL, NULL }, - { (XML_Char *)NULL, NULL, NULL } + { "ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, + { "US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, + { "UTF-8", NULL, NULL }, + { NULL, NULL, NULL } }; static XML_Memory_Handling_Suite php_xml_mem_hdlrs; @@ -428,7 +428,7 @@ static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) } if (parser->ltags) { int inx; - for (inx = 0; ((inx < parser->level) && (inx < XML_MAXLEVEL)); inx++) + for (inx = 0; inx < parser->level; inx++) efree(parser->ltags[ inx ]); efree(parser->ltags); } @@ -805,50 +805,45 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch } if (parser->data) { - if (parser->level <= XML_MAXLEVEL) { - zval *tag, *atr; - int atcnt = 0; + zval *tag, *atr; + int atcnt = 0; - MAKE_STD_ZVAL(tag); - MAKE_STD_ZVAL(atr); - - array_init(tag); - array_init(atr); + MAKE_STD_ZVAL(tag); + MAKE_STD_ZVAL(atr); - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","open",1); - add_assoc_long(tag,"level",parser->level); + array_init(tag); + array_init(atr); - parser->ltags[parser->level-1] = estrdup(tag_name); - parser->lastwasopen = 1; + _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - attributes = (const XML_Char **) attrs; + add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ + add_assoc_string(tag,"type","open",1); + add_assoc_long(tag,"level",parser->level); - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); + parser->ltags[parser->level-1] = estrdup(tag_name); + parser->lastwasopen = 1; - add_assoc_stringl(atr,att,val,val_len,0); + attributes = (const XML_Char **) attrs; - atcnt++; - attributes += 2; + while (attributes && *attributes) { + att = _xml_decode_tag(parser, attributes[0]); + val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); + + add_assoc_stringl(atr,att,val,val_len,0); - efree(att); - } + atcnt++; + attributes += 2; - if (atcnt) { - zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); - } else { - zval_ptr_dtor(&atr); - } + efree(att); + } - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); - } else if (parser->level == (XML_MAXLEVEL + 1)) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated"); + if (atcnt) { + zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); + } else { + zval_ptr_dtor(&atr); } + + zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); } efree(tag_name); @@ -900,7 +895,7 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) efree(tag_name); - if ((parser->ltags) && (parser->level <= XML_MAXLEVEL)) { + if (parser->ltags) { efree(parser->ltags[parser->level-1]); } @@ -984,23 +979,18 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) } } - if (parser->level <= XML_MAXLEVEL) { - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); + MAKE_STD_ZVAL(tag); + + array_init(tag); + + _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); - add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); - add_assoc_string(tag,"value",decoded_value,0); - add_assoc_string(tag,"type","cdata",1); - add_assoc_long(tag,"level",parser->level); + add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); + add_assoc_string(tag,"value",decoded_value,0); + add_assoc_string(tag,"type","cdata",1); + add_assoc_long(tag,"level",parser->level); - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); - } else if (parser->level == (XML_MAXLEVEL + 1)) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated"); - } + zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); } } else { efree(decoded_value); diff --git a/ext/xmlreader/config.m4 b/ext/xmlreader/config.m4 index d346b58eea4f..3614996fb433 100644 --- a/ext/xmlreader/config.m4 +++ b/ext/xmlreader/config.m4 @@ -7,7 +7,7 @@ PHP_ARG_ENABLE(xmlreader, whether to enable XMLReader support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLReader: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR XMLReader: libxml2 install prefix], no, no) fi if test "$PHP_XMLREADER" != "no"; then diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 02ebc7738ef8..3c5bc32f28c7 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -708,7 +708,7 @@ PHP_METHOD(xmlreader, moveToAttribute) /* }}} */ /* {{{ proto boolean XMLReader::moveToAttributeNo(int index) -Positions reader at attribute at specified index. +Positions reader at attribute at spcecified index. Returns TRUE on success and FALSE on failure */ PHP_METHOD(xmlreader, moveToAttributeNo) { @@ -805,7 +805,7 @@ PHP_METHOD(xmlreader, read) if (intern != NULL && intern->ptr != NULL) { retval = xmlTextReaderRead(intern->ptr); if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -847,7 +847,7 @@ PHP_METHOD(xmlreader, next) retval = xmlTextReaderNext(intern->ptr); } if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); RETURN_FALSE; } else { RETURN_BOOL(retval); @@ -1155,7 +1155,7 @@ PHP_METHOD(xmlreader, expand) node = xmlTextReaderExpand(intern->ptr); if (node == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while expanding "); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding "); RETURN_FALSE; } else { nodec = xmlDocCopyNode(node, docp, 1); diff --git a/ext/xmlreader/tests/003.phpt b/ext/xmlreader/tests/003.phpt index 85353a8242c3..48aa4be0ba27 100644 --- a/ext/xmlreader/tests/003.phpt +++ b/ext/xmlreader/tests/003.phpt @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test --FILE-- book1'; diff --git a/ext/xmlreader/tests/004.phpt b/ext/xmlreader/tests/004.phpt index b2d7254fe4f8..d4f044e97fc1 100644 --- a/ext/xmlreader/tests/004.phpt +++ b/ext/xmlreader/tests/004.phpt @@ -5,7 +5,7 @@ XMLReader: libxml2 XML Reader, attributes test --FILE-- book1'; diff --git a/ext/xmlreader/tests/007.phpt b/ext/xmlreader/tests/007.phpt index aacd059b6e45..842f25e5f61a 100644 --- a/ext/xmlreader/tests/007.phpt +++ b/ext/xmlreader/tests/007.phpt @@ -8,7 +8,7 @@ XMLReader: libxml2 XML Reader, setRelaxNGSchema $xmlstring = 'hello'; $relaxngfile = dirname(__FILE__) . '/relaxNG.rng'; -$file = dirname(__FILE__) . '/_007.xml'; +$file = dirname(__FILE__) . '/__007.xml'; file_put_contents($file, $xmlstring); $reader = new XMLReader(); diff --git a/ext/xmlreader/tests/008.phpt b/ext/xmlreader/tests/008.phpt index 2dbb5e7c874b..e3af00e4f7f3 100644 --- a/ext/xmlreader/tests/008.phpt +++ b/ext/xmlreader/tests/008.phpt @@ -23,7 +23,7 @@ $xmlstring = ' '; $dtdfile = rawurlencode(dirname(__FILE__)) . '/dtdexample.dtd'; -$file = dirname(__FILE__) . '/_008.xml'; +$file = dirname(__FILE__) . '/__008.xml'; file_put_contents($file, $xmlstring); diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4 index f82016edcb00..389d4adaf010 100644 --- a/ext/xmlrpc/config.m4 +++ b/ext/xmlrpc/config.m4 @@ -8,18 +8,18 @@ sinclude(libxmlrpc/acinclude.m4) sinclude(libxmlrpc/xmlrpc.m4) PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support, -[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support]) +[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support]) if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no) fi PHP_ARG_WITH(libexpat-dir, libexpat dir for XMLRPC-EPI, -[ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no) +[ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no) PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI, -[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no) +[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no) if test "$PHP_XMLRPC" != "no"; then diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c index a084d0e64f34..7211d2cd9419 100644 --- a/ext/xmlrpc/libxmlrpc/simplestring.c +++ b/ext/xmlrpc/libxmlrpc/simplestring.c @@ -66,7 +66,7 @@ static const char rcsid[] = "#(@) $Id$"; * * simplestring is, as the name implies, a simple API for dealing with C strings. * Why would I write yet another string API? Because I couldn't find any that were - * a) free / GPL, b) simple/lightweight, c) fast, not doing unnecessary strlens all + * a) free / GPL, b) simple/lightweight, c) fast, not doing unneccesary strlens all * over the place. So. It is simple, and it seems to work, and it is pretty fast. * * Oh, and it is also binary safe, ie it can handle strings with embedded NULLs, diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c index ac103e0616ed..664e8b77b3f9 100644 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c +++ b/ext/xmlrpc/libxmlrpc/xml_to_soap.c @@ -279,7 +279,7 @@ XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request, else if (!strcmp(attr_iter->key, TOKEN_MUSTUNDERSTAND)) { b_must_understand = strchr(attr_iter->val, '1') ? 1 : 0; } - /* actor, used in conjunction with must understand. */ + /* actor, used in conjuction with must understand. */ else if (!strcmp(attr_iter->key, TOKEN_ACTOR)) { actor = attr_iter->val; } diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index ce70c2afd909..ec2321b347e3 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -897,7 +897,7 @@ const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, (len > 0) ? simplestring_addn(&value->id, id, len) : simplestring_add(&value->id, id); - /* upper or lower case string in place if required. could be a separate func. */ + /* upper or lower case string in place if required. could be a seperate func. */ if(id_case == xmlrpc_case_lower || id_case == xmlrpc_case_upper) { int i; for(i = 0; i < value->id.len; i++) { @@ -1609,7 +1609,7 @@ XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) { * XMLRPC_CopyValue () * NOTES * Use this when function when you need to modify the contents of - * the copied value separately from the original. + * the copied value seperately from the original. * * this function is recursive, thus the value and all of its children * (if any) will be duplicated. diff --git a/ext/xmlrpc/tests/003.phpt b/ext/xmlrpc/tests/003.phpt deleted file mode 100644 index 3d6796dbaba9..000000000000 --- a/ext/xmlrpc/tests/003.phpt +++ /dev/null @@ -1,109 +0,0 @@ ---TEST-- -xmlrpc_encode() Simple test encode array ---SKIPIF-- - ---FILE-- - "red", - "two" => "blue", - "three" => "green" -); - -$response = xmlrpc_encode($params); -echo $response; - -$params = array( - "red", - "blue", - "green" -); - -$response = xmlrpc_encode($params); -echo $response; - -$params = array( - 0 => "red", - 1 => "blue", - 3 => "green" -); - -$response = xmlrpc_encode($params); -echo $response; - ---EXPECT-- - - - - - - - one - - red - - - - two - - blue - - - - three - - green - - - - - - - - - - - - - - red - - - blue - - - green - - - - - - - - - - - - - 0 - - red - - - - 1 - - blue - - - - 3 - - green - - - - - - \ No newline at end of file diff --git a/ext/xmlrpc/tests/004.phpt b/ext/xmlrpc/tests/004.phpt deleted file mode 100644 index 04f3ef315e63..000000000000 --- a/ext/xmlrpc/tests/004.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -xmlrpc_encode() Simple test encode int ---SKIPIF-- - ---FILE-- - - - - - 1 - - - \ No newline at end of file diff --git a/ext/xmlrpc/tests/005.phpt b/ext/xmlrpc/tests/005.phpt deleted file mode 100644 index 613dfde24991..000000000000 --- a/ext/xmlrpc/tests/005.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -xmlrpc_encode() Simple test encode type double and String - ---CREDITS-- -Michel Araujo -#PHPSP 2013-08-22 - ---SKIPIF-- - - ---FILE-- - - - - - 3.24234 - - - - - - - - -3.24234 - - - - - - - - Is string - - - \ No newline at end of file diff --git a/ext/xmlrpc/tests/006.phpt b/ext/xmlrpc/tests/006.phpt deleted file mode 100644 index f33932d5a210..000000000000 --- a/ext/xmlrpc/tests/006.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -xmlrpc_decode() Simple test decode type string - ---CREDITS-- -Michel Araujo -#PHPSP 2013-08-22 - ---SKIPIF-- - - ---FILE-- - - - - - Is string - - - -XML; - -$response = xmlrpc_decode($xml); -echo $response; - ---EXPECT-- -Is string \ No newline at end of file diff --git a/ext/xmlrpc/tests/007.phpt b/ext/xmlrpc/tests/007.phpt deleted file mode 100644 index 84c15a7d8a36..000000000000 --- a/ext/xmlrpc/tests/007.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -xmlrpc_decode() Simple test decode type int - ---CREDITS-- -Michel Araujo -#PHPSP 2013-08-22 - ---SKIPIF-- - - ---FILE-- - - - - - 1 - - - -XML; - -$response = xmlrpc_decode($xml); -echo $response; - ---EXPECT-- -1 \ No newline at end of file diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index b73cbcfe2478..925b554a5676 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -502,7 +502,7 @@ static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht) } bArray = 1; last_num = num_index; - } else if (res == HASH_KEY_NON_EXISTENT) { + } else if (res == HASH_KEY_NON_EXISTANT) { break; } else if (res == HASH_KEY_IS_STRING) { if (bArray) { @@ -582,7 +582,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep int res = my_zend_hash_get_current_key(Z_ARRVAL_P(val_arr), &my_key, &num_index); switch (res) { - case HASH_KEY_NON_EXISTENT: + case HASH_KEY_NON_EXISTANT: break; case HASH_KEY_IS_STRING: case HASH_KEY_IS_LONG: diff --git a/ext/xmlwriter/config.m4 b/ext/xmlwriter/config.m4 index b3b98012f8f8..0a5d07943009 100644 --- a/ext/xmlwriter/config.m4 +++ b/ext/xmlwriter/config.m4 @@ -7,7 +7,7 @@ PHP_ARG_ENABLE(xmlwriter, whether to enable XMLWriter support, if test -z "$PHP_LIBXML_DIR"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLWriter: libxml2 install prefix], no, no) + [ --with-libxml-dir=DIR XMLWriter: libxml2 install prefix], no, no) fi if test "$PHP_XMLWRITER" != "no"; then diff --git a/ext/xmlwriter/tests/bug41287.phpt b/ext/xmlwriter/tests/bug41287.phpt index 72b6720f1d4c..0612b21f15c5 100644 --- a/ext/xmlwriter/tests/bug41287.phpt +++ b/ext/xmlwriter/tests/bug41287.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #41287 (Namespace functions don't allow xmlns definition to be optional) +Bug #41287 (Namespace functions don't allow xmlns defintion to be optional) --SKIPIF-- = 1.1.0 required)]) if test "$PHP_XSL" != "no"; then diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index af11104a2e82..1785519c15ae 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -476,7 +476,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet) static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */ { - xmlDocPtr newdocp = NULL; + xmlDocPtr newdocp; xmlDocPtr doc = NULL; xmlNodePtr node = NULL; xsltTransformContextPtr ctxt; diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 805d92442e01..85f9119f5aac 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -11,7 +11,7 @@ if test -z "$PHP_ZLIB_DIR"; then fi PHP_ARG_WITH(pcre-dir, pcre install prefix, -[ --with-pcre-dir ZIP: pcre install prefix], no, no) +[ --with-pcre-dir ZIP: pcre install prefix], no, no) if test "$PHP_ZIP" != "no"; then diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index 5ce1c1070ae0..2f56881b0a9d 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -348,7 +348,7 @@ _zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error) /* _zip_check_torrentzip: - check whether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ + check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ static void _zip_check_torrentzip(struct zip *za) diff --git a/ext/zip/lib/zipconf.h b/ext/zip/lib/zipconf.h index 646c0bde53f0..2b4340c861c5 100644 --- a/ext/zip/lib/zipconf.h +++ b/ext/zip/lib/zipconf.h @@ -13,7 +13,11 @@ #define LIBZIP_VERSION_MINOR 10 #define LIBZIP_VERSION_MICRO 0 -#include +#ifdef PHP_WIN32 +#include +#else +#include +#endif typedef int8_t zip_int8_t; #define ZIP_INT8_MIN INT8_MIN diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 969bac1aa6b5..b73082ba716c 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1654,7 +1654,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* char *path = NULL; char *remove_path = NULL; char *add_path = NULL; - int pattern_len, add_path_len = 0, remove_path_len = 0, path_len = 0; + int pattern_len, add_path_len, remove_path_len, path_len = 0; long remove_all_path = 0; long flags = 0; zval *options = NULL; diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index dace407d14f3..7dd9ff09d0b5 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -81,8 +81,8 @@ typedef struct _ze_zip_object { int filename_len; } ze_zip_object; -php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC); +php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC); extern php_stream_wrapper php_stream_zip_wrapper; #endif diff --git a/ext/zip/tests/bug64342_0.phpt b/ext/zip/tests/bug64342_0.phpt index ea7afa8e0a7d..066d3e6fc202 100644 --- a/ext/zip/tests/bug64342_0.phpt +++ b/ext/zip/tests/bug64342_0.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #64342 ZipArchive::addFile() has to check file existence (variation 1) +Bug #64342 ZipArchive::addFile() has to check file existance (variation 1) --SKIPIF-- = 1.0.9)]) +[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, [ --with-zlib-dir= Define the location of zlib install directory], no, no) diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index 3e4b9381e7c8..6b1d0cd80c51 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -58,7 +58,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib) zend_bool handler_registered; ZEND_END_MODULE_GLOBALS(zlib); -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); extern php_stream_ops php_stream_gzio_ops; extern php_stream_wrapper php_stream_gzip_wrapper; extern php_stream_filter_factory php_zlib_filter_factory; diff --git a/ext/zlib/tests/bug61139.phpt b/ext/zlib/tests/bug61139.phpt index 71961a64dc64..eaca00369bf0 100644 --- a/ext/zlib/tests/bug61139.phpt +++ b/ext/zlib/tests/bug61139.phpt @@ -10,9 +10,5 @@ if (!extension_loaded('zlib')) { --EXPECTF-- Warning: gzopen(): gzopen failed in %s on line %d diff --git a/ext/zlib/tests/bug65391.phpt b/ext/zlib/tests/bug65391.phpt deleted file mode 100644 index 439473fc5d0f..000000000000 --- a/ext/zlib/tests/bug65391.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) ---SKIPIF-- - ---GET-- -dummy=1 ---FILE-- - -Done ---EXPECTF-- -Array -( - [0] => X-Powered-By: PHP/%s - [1] => Vary: Cookie - [2] => Vary: Accept-Encoding -) -Done diff --git a/ext/zlib/tests/gzfile_variation1.phpt b/ext/zlib/tests/gzfile_variation1.phpt index 131170b4b75a..767abb7e30c0 100644 --- a/ext/zlib/tests/gzfile_variation1.phpt +++ b/ext/zlib/tests/gzfile_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test function gzfile() by substituting argument 1 with array values. +Test function gzfile() by substituting agument 1 with array values. --SKIPIF-- op & PHP_OUTPUT_HANDLER_START) && (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) ) { - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); } return FAILURE; } @@ -220,7 +220,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o deflateEnd(&ctx->Z); return FAILURE; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); } } @@ -478,7 +478,7 @@ static PHP_FUNCTION(ob_gzhandler) sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC); break; } - sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC); } if (!ZLIBG(ob_gzhandler)) { diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 2fd9dc7766ec..1b00eb8713b9 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -106,7 +106,7 @@ php_stream_ops php_stream_gzio_ops = { NULL /* set_option */ }; -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, +php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { struct php_gz_stream_data_t *self; diff --git a/main/SAPI.h b/main/SAPI.h index 6fc60c886513..92b7329dbc16 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -27,7 +27,6 @@ #include "zend_operators.h" #ifdef PHP_WIN32 #include "win95nt.h" -#include "win32/php_stdint.h" #endif #include @@ -83,7 +82,7 @@ typedef struct { char *post_data, *raw_post_data; char *cookie_data; long content_length; - int64_t post_data_length, raw_post_data_length; + uint post_data_length, raw_post_data_length; char *path_translated; char *request_uri; @@ -120,7 +119,7 @@ typedef struct _sapi_globals_struct { void *server_context; sapi_request_info request_info; sapi_headers_struct sapi_headers; - int64_t read_post_bytes; + int read_post_bytes; unsigned char headers_sent; struct stat global_stat; char *default_mimetype; diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index eb33ac7ba126..6f11cf3f3254 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -475,7 +475,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c char resolved_path[MAXPATHLEN]; char trypath[MAXPATHLEN]; const char *ptr, *end, *p; - const char *actual_path; + char *actual_path; php_stream_wrapper *wrapper; if (!filename || CHECK_NULL_PATH(filename, filename_length)) { diff --git a/main/main.c b/main/main.c index 2f56afa03a3f..40304c7f9ce6 100644 --- a/main/main.c +++ b/main/main.c @@ -114,10 +114,6 @@ #endif /* }}} */ -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions; #ifndef ZTS @@ -279,14 +275,13 @@ static void php_binary_init(TSRMLS_D) if ((envpath = getenv("PATH")) != NULL) { char *search_dir, search_path[MAXPATHLEN]; char *last = NULL; - struct stat s; path = estrdup(envpath); search_dir = php_strtok_r(path, ":", &last); while (search_dir) { snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location); - if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK) && VCWD_STAT(binary_location, &s) == 0 && S_ISREG(s.st_mode)) { + if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) { found = 1; break; } @@ -789,9 +784,6 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c /* no docref given but function is known (the default) */ if (!docref && is_function) { int doclen; - while (*function == '_') { - function++; - } if (space[0] == '\0') { doclen = spprintf(&docref_buf, 0, "function.%s", function); } else { @@ -1531,7 +1523,7 @@ int php_request_startup(TSRMLS_D) int retval = SUCCESS; #ifdef HAVE_DTRACE - DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method)); + DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method)); #endif /* HAVE_DTRACE */ #ifdef PHP_WIN32 @@ -1841,7 +1833,7 @@ void php_request_shutdown(void *dummy) #endif #ifdef HAVE_DTRACE - DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method)); + DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method)); #endif /* HAVE_DTRACE */ } /* }}} */ @@ -2078,8 +2070,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod EG(exception_class) = NULL; PG(disable_functions) = NULL; PG(disable_classes) = NULL; - EG(exception) = NULL; - EG(objects_store).object_buckets = NULL; #if HAVE_SETLOCALE setlocale(LC_CTYPE, ""); diff --git a/main/php.h b/main/php.h index 17ac8b4fd29d..7c1f8fd0c7b9 100644 --- a/main/php.h +++ b/main/php.h @@ -180,8 +180,6 @@ typedef unsigned int socklen_t; # endif #endif -#include "php_stdint.h" - #include "zend_hash.h" #include "zend_alloc.h" #include "zend_stack.h" diff --git a/main/php_ini.c b/main/php_ini.c index e9529a2d29f2..cb2c7ea80895 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -802,12 +802,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC) char path_bak[MAXPATHLEN]; #endif -#if PHP_WIN32 - /* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */ - if (path_len >= MAXPATHLEN) { -#else if (path_len > MAXPATHLEN) { -#endif return; } diff --git a/main/php_stdint.h b/main/php_stdint.h deleted file mode 100644 index 87edb0fde085..000000000000 --- a/main/php_stdint.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Michael Wallner | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_STDINT_H -#define PHP_STDINT_H - -#if defined(_MSC_VER) -/* Make sure the regular stdint.h wasn't included already and prevent it to be - included afterwards. Though if some other library needs some stuff from - stdint.h included afterwards and misses it, we'd have to extend ours. On - the other hand, if stdint.h was included before, some conflicts might - happen so we'd likewise have to fix ours. */ -# if !defined(_STDINT) -# define _STDINT -# include "win32/php_stdint.h" -# endif -# define HAVE_INT8_T 1 -# define HAVE_UINT8_T 1 -# define HAVE_INT16_T 1 -# define HAVE_UINT16_T 1 -# define HAVE_INT32_T 1 -# define HAVE_UINT32_T 1 -# define HAVE_INT64_T 1 -# define HAVE_UINT64_T 1 -#else - -#include "php_config.h" - -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_INTTYPES_H -# include -#endif - -#if HAVE_STDINT_H -# include -#endif - -#ifndef HAVE_INT8_T -# ifdef HAVE_INT8 -typedef int8 int8_t; -# else -typedef signed char int8_t; -# endif -#endif - -#ifndef INT8_C -# define INT8_C(c) c -#endif - -#ifndef HAVE_UINT8_T -# ifdef HAVE_UINT8 -typedef uint8 uint8_t -# elif HAVE_U_INT8_T -typedef u_int8_t uint8_t; -# else -typedef unsigned char uint8_t; -# endif -#endif - -#ifndef UINT8_C -# define UINT8_C(c) c -#endif - -#ifndef HAVE_INT16_T -# ifdef HAVE_INT16 -typedef int16 int16_t; -# elif SIZEOF_SHORT >= 2 -typedef signed short int16_t; -# else -# error "No suitable 16bit integer type found" -# endif -#endif - -#ifndef INT16_C -# define INT16_C(c) c -#endif - -#ifndef HAVE_UINT16_T -# ifdef HAVE_UINT16 -typedef uint16 uint16_t -# elif HAVE_U_INT16_T -typedef u_int16_t uint16_t; -# elif SIZEOF_SHORT >= 2 -typedef unsigned short uint16_t; -# else -# error "No suitable 16bit integer type found" -# endif -#endif - -#ifndef UINT16_C -# define UINT16_C(c) c -#endif - -#ifndef HAVE_INT32_T -# ifdef HAVE_INT32 -typedef int32 int32_t; -# elif SIZEOF_INT >= 4 -typedef int int32_t; -# elif SIZEOF_LONG >= 4 -typedef long int32_t; -# else -# error "No suitable 32bit integer type found" -# endif -#endif - -#ifndef INT32_C -# define INT32_C(c) c -#endif - -#ifndef HAVE_UINT32_T -# ifdef HAVE_UINT32 -typedef uint32 uint32_t -# elif HAVE_U_INT32_T -typedef u_int32_t uint32_t; -# elif SIZEOF_INT >= 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG >= 4 -typedef unsigned long uint32_t; -# else -# error "No suitable 32bit integer type found" -# endif -#endif - -#ifndef UINT32_C -# define UINT32_C(c) c ## U -#endif - -#ifndef HAVE_INT64_T -# ifdef HAVE_INT64 -typedef int64 int64_t; -# elif SIZEOF_INT >= 8 -typedef int int64_t; -# elif SIZEOF_LONG >= 8 -typedef long int64_t; -# elif SIZEOF_LONG_LONG >= 8 -typedef long long int64_t; -# else -# error "No suitable 64bit integer type found" -# endif -#endif - -#ifndef INT64_C -# if SIZEOF_INT >= 8 -# define INT64_C(c) c -# elif SIZEOF_LONG >= 8 -# define INT64_C(c) c ## L -# elif SIZEOF_LONG_LONG >= 8 -# define INT64_C(c) c ## LL -# endif -#endif - -#ifndef HAVE_UINT64_T -# ifdef HAVE_UINT64 -typedef uint64 uint64_t -# elif HAVE_U_INT64_T -typedef u_int64_t uint64_t; -# elif SIZEOF_INT >= 8 -typedef unsigned int uint64_t; -# elif SIZEOF_LONG >= 8 -typedef unsigned long uint64_t; -# elif SIZEOF_LONG_LONG >= 8 -typedef unsigned long long uint64_t; -# else -# error "No suitable 64bit integer type found" -# endif -#endif - -#ifndef UINT64_C -# if SIZEOF_INT >= 8 -# define UINT64_C(c) c ## U -# elif SIZEOF_LONG >= 8 -# define UINT64_C(c) c ## UL -# elif SIZEOF_LONG_LONG >= 8 -# define UINT64_C(c) c ## ULL -# endif -#endif - -#endif /* !PHP_WIN32 */ -#endif /* PHP_STDINT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_streams.h b/main/php_streams.h index c56014c62e17..5acf942e434b 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -131,31 +131,31 @@ typedef struct _php_stream_ops { typedef struct _php_stream_wrapper_ops { /* open/create a wrapped stream */ - php_stream *(*stream_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, + php_stream *(*stream_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); /* close/destroy a wrapped stream */ int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC); /* stat a wrapped stream */ int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); /* stat a URL */ - int (*url_stat)(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); + int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); /* open a "directory" stream */ - php_stream *(*dir_opener)(php_stream_wrapper *wrapper, const char *filename, const char *mode, + php_stream *(*dir_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); const char *label; /* delete a file */ - int (*unlink)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); + int (*unlink)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); /* rename a file */ - int (*rename)(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC); + int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); /* Create/Remove directory */ - int (*stream_mkdir)(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC); - int (*stream_rmdir)(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); + int (*stream_mkdir)(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); + int (*stream_rmdir)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); /* Metadata handling */ - int (*stream_metadata)(php_stream_wrapper *wrapper, const char *url, int options, void *value, php_stream_context *context TSRMLS_DC); + int (*stream_metadata)(php_stream_wrapper *wrapper, char *url, int options, void *value, php_stream_context *context TSRMLS_DC); } php_stream_wrapper_ops; struct _php_stream_wrapper { @@ -322,26 +322,26 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, #define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC) #define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC) -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, const char *delim, size_t delim_len TSRMLS_DC); +PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC); /* CAREFUL! this is equivalent to puts NOT fputs! */ -PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC); +PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC); #define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf) TSRMLS_CC) PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); #define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb) TSRMLS_CC) -PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); +PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); #define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL TSRMLS_CC) #define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC) -PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC); +PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC); #define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context TSRMLS_CC) -PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC); +PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC); #define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context TSRMLS_CC) -PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC); +PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC); #define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC) PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC); #define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent) TSRMLS_CC) @@ -351,7 +351,7 @@ PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_ PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b); PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b); -PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags, php_stream_context *context, +PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, int (*compare) (const char **a, const char **b) TSRMLS_DC); #define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare) TSRMLS_CC) @@ -540,13 +540,13 @@ void php_shutdown_stream_hashes(TSRMLS_D); PHP_RSHUTDOWN_FUNCTION(streams); BEGIN_EXTERN_C() -PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper(const char *protocol TSRMLS_DC); -PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC); -PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC); -PHPAPI const char *php_stream_locate_eol(php_stream *stream, const char *buf, size_t buf_len TSRMLS_DC); +PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); +PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC); +PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); +PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC); +PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC); +PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC); #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC) #define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC TSRMLS_CC) diff --git a/main/php_variables.c b/main/php_variables.c index 7018eae57bbd..fd52f311d17d 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -55,7 +55,7 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC) { char *p = NULL; - char *ip = NULL; /* index pointer */ + char *ip; /* index pointer */ char *index; char *var, *var_orig; int var_len, index_len; diff --git a/main/rfc1867.c b/main/rfc1867.c index 4adc25767db0..e3e6e1d1d531 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -34,10 +34,6 @@ #include "rfc1867.h" #include "ext/standard/php_string.h" -#if defined(PHP_WIN32) && !defined(HAVE_ATOLL) -# define atoll(s) _atoi64(s) -#endif - #define DEBUG_FILE_UPLOAD ZEND_DEBUG static int dummy_encoding_translation(TSRMLS_D) @@ -66,7 +62,7 @@ static void safe_php_register_variable(char *var, char *strval, int val_len, zva #define MAX_SIZE_ANONNAME 33 /* Errors */ -#define UPLOAD_ERROR_OK 0 /* File upload successful */ +#define UPLOAD_ERROR_OK 0 /* File upload succesful */ #define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ #define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ #define UPLOAD_ERROR_C 3 /* Partially uploaded */ @@ -402,7 +398,7 @@ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC) static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) { char *line; - mime_header_entry prev_entry = {0}, entry; + mime_header_entry prev_entry, entry; int prev_len, cur_len; /* didn't find boundary, abort */ @@ -680,9 +676,8 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ { char *boundary, *s = NULL, *boundary_end = NULL, *start_arr = NULL, *array_index = NULL; char *temp_filename = NULL, *lbuf = NULL, *abuf = NULL; - int boundary_len = 0, cancel_upload = 0, is_arr_upload = 0, array_len = 0; - int64_t total_bytes = 0, max_file_size = 0; - int skip_upload = 0, anonindex = 0, is_anonymous; + int boundary_len = 0, total_bytes = 0, cancel_upload = 0, is_arr_upload = 0, array_len = 0; + int max_file_size = 0, skip_upload = 0, anonindex = 0, is_anonymous; zval *http_post_files = NULL; HashTable *uploaded_files = NULL; multipart_buffer *mbuff; @@ -903,7 +898,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ } if (!strcasecmp(param, "MAX_FILE_SIZE")) { - max_file_size = atoll(value); + max_file_size = atol(value); } efree(param); @@ -1215,32 +1210,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ { zval file_size, error_type; - int size_overflow = 0; - char file_size_buf[65]; - ZVAL_LONG(&error_type, cancel_upload); + error_type.value.lval = cancel_upload; + error_type.type = IS_LONG; /* Add $foo[error] */ if (cancel_upload) { - ZVAL_LONG(&file_size, 0); + file_size.value.lval = 0; + file_size.type = IS_LONG; } else { - if (total_bytes > LONG_MAX) { -#ifdef PHP_WIN32 - if (_i64toa_s(total_bytes, file_size_buf, 65, 10)) { - file_size_buf[0] = '0'; - file_size_buf[1] = '\0'; - } -#else - { - int __len = snprintf(file_size_buf, 65, "%lld", total_bytes); - file_size_buf[__len] = '\0'; - } -#endif - size_overflow = 1; - - } else { - ZVAL_LONG(&file_size, total_bytes); - } + file_size.value.lval = total_bytes; + file_size.type = IS_LONG; } if (is_arr_upload) { @@ -1257,10 +1237,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ snprintf(lbuf, llen, "%s_size", param); } if (!is_anonymous) { - if (size_overflow) { - ZVAL_STRING(&file_size, file_size_buf, 1); - } - safe_php_register_variable_ex(lbuf, &file_size, NULL, size_overflow TSRMLS_CC); + safe_php_register_variable_ex(lbuf, &file_size, NULL, 0 TSRMLS_CC); } /* Add $foo[size] */ @@ -1269,10 +1246,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */ } else { snprintf(lbuf, llen, "%s[size]", param); } - if (size_overflow) { - ZVAL_STRING(&file_size, file_size_buf, 1); - } - register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, size_overflow TSRMLS_CC); + register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 TSRMLS_CC); } efree(param); } diff --git a/main/snprintf.h b/main/snprintf.h index f4ed4d234de1..de03542cad22 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -27,7 +27,7 @@ sprintf offers the ability to make a lot of failures since it does not know the size of the buffer it uses. Therefore usage of sprintf often results in possible entries for buffer overrun attacks. So please use this version only if you are sure the call is safe. sprintf - always terminstes the buffer it writes to. + allways terminstes the buffer it writes to. snprintf knows the buffers size and will not write behind it. But you will have to use either a static buffer or allocate a dynamic buffer @@ -48,7 +48,7 @@ spprintf is the dynamical version of snprintf. It allocates the buffer in size snprintf and offers possible memory leakes if you miss freeing the buffer allocated by the function. Therfore this function should be used where either no maximum is known or the maximum is much bigger - than normal size required. spprintf always terminates the buffer. + than normal size required. spprintf allways terminates the buffer. Example: @@ -60,7 +60,7 @@ spprintf is the dynamical version of snprintf. It allocates the buffer in size sprintf(buffer, "test"); | snprintf(buffer, MAX, "test"); | spprintf(&buffer, MAX, "text"); | | if (!buffer) | | return OUT_OF_MEMORY - // sprintf always terminates | // manual termination of | // spprintf allays terminates buffer + // sprintf allways terminates | // manual termination of | // spprintf allays terminates buffer // buffer | // buffer *IS* required | | buffer[MAX-1] = 0; | action_with_buffer(buffer); | action_with_buffer(buffer); | action_with_buffer(buffer); diff --git a/main/spprintf.h b/main/spprintf.h index d9aa9533e5c4..397928a79450 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -22,7 +22,7 @@ The pbuf parameter of all spprintf version receives a pointer to the allocated buffer. This buffer must be freed manually after usage using efree() function. -The buffer will always be terminated by a zero character. When pbuf is NULL +The buffer will allways be terminated by a zero character. When pbuf is NULL the function can be used to calculate the required size of the buffer but for that purpose snprintf is faster. When both pbuf and the return value are 0 than you are out of memory. diff --git a/main/streams/cast.c b/main/streams/cast.c index bf96d3cf806c..878b4b52e76f 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -31,18 +31,10 @@ /* Under BSD, emulate fopencookie using funopen */ #if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) - -/* NetBSD 6.0+ uses off_t instead of fpos_t in funopen */ -# if defined(__NetBSD__) && (__NetBSD_Version__ >= 600000000) -# define PHP_FPOS_T off_t -# else -# define PHP_FPOS_T fpos_t -# endif - typedef struct { int (*reader)(void *, char *, int); int (*writer)(void *, const char *, int); - PHP_FPOS_T (*seeker)(void *, PHP_FPOS_T, int); + fpos_t (*seeker)(void *, fpos_t, int); int (*closer)(void *); } COOKIE_IO_FUNCTIONS_T; @@ -76,11 +68,11 @@ static int stream_cookie_writer(void *cookie, const char *buffer, int size) return php_stream_write((php_stream *)cookie, (char *)buffer, size); } -static PHP_FPOS_T stream_cookie_seeker(void *cookie, off_t position, int whence) +static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence) { TSRMLS_FETCH(); - return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence); + return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence); } static int stream_cookie_closer(void *cookie) diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index 8c3836fea02a..9c051a59210a 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -109,9 +109,9 @@ PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC } /* }}} */ -static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char **p_file TSRMLS_DC) /* {{{ */ +static void php_glob_stream_path_split(glob_s_t *pglob, char *path, int get_path, char **p_file TSRMLS_DC) /* {{{ */ { - const char *pos, *gpath = path; + char *pos, *gpath = path; if ((pos = strrchr(path, '/')) != NULL) { path = pos+1; @@ -141,7 +141,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T { glob_s_t *pglob = (glob_s_t *)stream->abstract; php_stream_dirent *ent = (php_stream_dirent*)buf; - const char *path; + char *path; /* avoid problems if someone mis-uses the stream */ if (count == sizeof(php_stream_dirent) && pglob) { @@ -206,12 +206,12 @@ php_stream_ops php_glob_stream_ops = { }; /* {{{ php_glob_stream_opener */ -static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, +static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { glob_s_t *pglob; int ret; - const char *tmp, *pos; + char *tmp, *pos; if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { return NULL; diff --git a/main/streams/memory.c b/main/streams/memory.c index 90780ea78ffe..328d3be39901 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -598,9 +598,7 @@ PHPAPI php_stream_ops php_stream_rfc2397_ops = { php_stream_temp_set_option }; -static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, const char *path, - const char *mode, int options, char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ +static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream; php_stream_temp_data *ts; @@ -642,11 +640,11 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con MAKE_STD_ZVAL(meta); array_init(meta); if (!semi) { /* there is only a mime type */ - add_assoc_stringl(meta, "mediatype", (char *) path, mlen, 1); + add_assoc_stringl(meta, "mediatype", path, mlen, 1); mlen = 0; } else if (sep && sep < semi) { /* there is a mime type */ plen = semi - path; - add_assoc_stringl(meta, "mediatype", (char *) path, plen, 1); + add_assoc_stringl(meta, "mediatype", path, plen, 1); mlen -= plen; path += plen; } else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 6700df0b29a0..d88b30c4791c 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -30,7 +30,7 @@ BEGIN_EXTERN_C() PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC); #define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC) -PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC); +PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC); #define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC TSRMLS_CC) PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 52df73d731a4..c2d911032ef8 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -26,16 +26,16 @@ # include #endif -typedef php_stream *(php_stream_transport_factory_func)(const char *proto, size_t protolen, - const char *resourcename, size_t resourcenamelen, +typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long protolen, + char *resourcename, long resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC TSRMLS_DC); typedef php_stream_transport_factory_func *php_stream_transport_factory; BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC); -PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC); +PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC); +PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC); #define STREAM_XPORT_CLIENT 0 #define STREAM_XPORT_SERVER 1 @@ -46,7 +46,7 @@ PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC); #define STREAM_XPORT_CONNECT_ASYNC 16 /* Open a client or server socket connection */ -PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, int options, +PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, @@ -59,13 +59,13 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in /* Bind the stream to a local address */ PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, size_t namelen, + const char *name, long namelen, char **error_text TSRMLS_DC); /* Connect to a remote address */ PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, size_t namelen, + const char *name, long namelen, int asynchronous, struct timeval *timeout, char **error_text, @@ -141,7 +141,7 @@ typedef struct _php_stream_xport_param { struct { char *name; - size_t namelen; + long namelen; int backlog; struct timeval *timeout; struct sockaddr *addr; diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 949b827679ec..39df31a17050 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -851,7 +851,7 @@ static php_stream_ops php_plain_files_dirstream_ops = { NULL /* set_option */ }; -static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, +static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { DIR *dir = NULL; @@ -989,7 +989,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha /* }}} */ -static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, +static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { @@ -999,7 +999,7 @@ static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, co return php_stream_fopen_rel(path, mode, opened_path, options); } -static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) { char *p; @@ -1029,7 +1029,7 @@ static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *u return VCWD_STAT(url, &ssb->sb); } -static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { char *p; int ret; @@ -1058,7 +1058,7 @@ static int php_plain_files_unlink(php_stream_wrapper *wrapper, const char *url, return 1; } -static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) { char *p; int ret; @@ -1147,7 +1147,7 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f return 1; } -static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, int mode, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mode, int options, php_stream_context *context TSRMLS_DC) { int ret, recursive = options & PHP_STREAM_MKDIR_RECURSIVE; char *p; @@ -1235,7 +1235,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i } } -static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int php_plain_files_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { #if PHP_WIN32 int url_len = strlen(url); @@ -1262,7 +1262,7 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i return 1; } -static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC) +static int php_plain_files_metadata(php_stream_wrapper *wrapper, char *url, int option, void *value, php_stream_context *context TSRMLS_DC) { struct utimbuf *newtime; char *p; @@ -1371,11 +1371,10 @@ php_stream_wrapper php_plain_files_wrapper = { }; /* {{{ php_stream_fopen_with_path */ -PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC) +PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC) { /* code ripped off from fopen_wrappers.c */ - char *pathbuf, *end; - const char *ptr; + char *pathbuf, *ptr, *end; const char *exec_fname; char trypath[MAXPATHLEN]; php_stream *stream; diff --git a/main/streams/streams.c b/main/streams/streams.c index d74f9fd04aa7..623aabff6048 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -803,7 +803,7 @@ PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC) return EOF; } -PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC) +PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC) { int len; char newline[2] = "\n"; /* is this OK for Win? */ @@ -835,11 +835,11 @@ PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D return (stream->ops->stat)(stream, ssb TSRMLS_CC); } -PHPAPI const char *php_stream_locate_eol(php_stream *stream, const char *buf, size_t buf_len TSRMLS_DC) +PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC) { size_t avail; - const char *cr, *lf, *eol = NULL; - const char *readptr; + char *cr, *lf, *eol = NULL; + char *readptr; if (!buf) { readptr = stream->readbuf + stream->readpos; @@ -911,7 +911,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, if (avail > 0) { size_t cpysz = 0; char *readptr; - const char *eol; + char *eol; int done = 0; readptr = stream->readbuf + stream->readpos; @@ -994,11 +994,11 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, #define STREAM_BUFFERED_AMOUNT(stream) \ ((size_t)(((stream)->writepos) - (stream)->readpos)) -static const char *_php_stream_search_delim(php_stream *stream, - size_t maxlen, - size_t skiplen, - const char *delim, /* non-empty! */ - size_t delim_len TSRMLS_DC) +static char *_php_stream_search_delim(php_stream *stream, + size_t maxlen, + size_t skiplen, + char *delim, /* non-empty! */ + size_t delim_len TSRMLS_DC) { size_t seek_len; @@ -1018,10 +1018,10 @@ static const char *_php_stream_search_delim(php_stream *stream, } } -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, const char *delim, size_t delim_len TSRMLS_DC) +PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC) { - char *ret_buf; /* returned buffer */ - const char *found_delim = NULL; + char *ret_buf, /* returned buffer */ + *found_delim = NULL; size_t buffered_len, tent_ret_len; /* tentative returned length */ int has_delim = delim_len > 0; @@ -1676,9 +1676,9 @@ int php_shutdown_stream_wrappers(int module_number TSRMLS_DC) /* Validate protocol scheme names during registration * Must conform to /^[a-zA-Z0-9+.-]+$/ */ -static inline int php_stream_wrapper_scheme_validate(const char *protocol, unsigned int protocol_len) +static inline int php_stream_wrapper_scheme_validate(char *protocol, int protocol_len) { - unsigned int i; + int i; for(i = 0; i < protocol_len; i++) { if (!isalnum((int)protocol[i]) && @@ -1693,9 +1693,9 @@ static inline int php_stream_wrapper_scheme_validate(const char *protocol, unsig } /* API for registering GLOBAL wrappers */ -PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) +PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) { - unsigned int protocol_len = strlen(protocol); + int protocol_len = strlen(protocol); if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { return FAILURE; @@ -1704,7 +1704,7 @@ PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrap return zend_hash_add(&url_stream_wrappers_hash, protocol, protocol_len + 1, &wrapper, sizeof(wrapper), NULL); } -PHPAPI int php_unregister_url_stream_wrapper(const char *protocol TSRMLS_DC) +PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC) { return zend_hash_del(&url_stream_wrappers_hash, protocol, strlen(protocol) + 1); } @@ -1719,9 +1719,9 @@ static void clone_wrapper_hash(TSRMLS_D) } /* API for registering VOLATILE wrappers */ -PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) +PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) { - unsigned int protocol_len = strlen(protocol); + int protocol_len = strlen(protocol); if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { return FAILURE; @@ -1734,7 +1734,7 @@ PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_st return zend_hash_add(FG(stream_wrappers), protocol, protocol_len + 1, &wrapper, sizeof(wrapper), NULL); } -PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRMLS_DC) +PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC) { if (!FG(stream_wrappers)) { clone_wrapper_hash(TSRMLS_C); @@ -1745,7 +1745,7 @@ PHPAPI int php_unregister_url_stream_wrapper_volatile(const char *protocol TSRML /* }}} */ /* {{{ php_stream_locate_url_wrapper */ -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC) +PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC) { HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); php_stream_wrapper **wrapperpp = NULL; @@ -1880,7 +1880,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const /* {{{ _php_stream_mkdir */ -PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC) { php_stream_wrapper *wrapper = NULL; @@ -1895,7 +1895,7 @@ PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream /* {{{ _php_stream_rmdir */ -PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC) { php_stream_wrapper *wrapper = NULL; @@ -1909,10 +1909,10 @@ PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context * /* }}} */ /* {{{ _php_stream_stat_path */ -PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) { php_stream_wrapper *wrapper = NULL; - const char *path_to_open = path; + char *path_to_open = path; int ret; /* Try to hit the cache first */ @@ -1954,12 +1954,12 @@ PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf /* }}} */ /* {{{ php_stream_opendir */ -PHPAPI php_stream *_php_stream_opendir(const char *path, int options, +PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC) { php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; - const char *path_to_open; + char *path_to_open; if (!path || !*path) { return NULL; @@ -2003,12 +2003,12 @@ PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_ /* }}} */ /* {{{ php_stream_open_wrapper_ex */ -PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mode, int options, +PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; - const char *path_to_open; + char *path_to_open; int persistent = options & STREAM_OPEN_PERSISTENT; char *resolved_path = NULL; char *copy_of_path = NULL; @@ -2264,7 +2264,7 @@ PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b) /* {{{ php_stream_scandir */ -PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags, php_stream_context *context, +PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, int (*compare) (const char **a, const char **b) TSRMLS_DC) { php_stream *stream; @@ -2289,7 +2289,6 @@ PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags } else { if(vector_size*2 < vector_size) { /* overflow */ - php_stream_closedir(stream); efree(vector); return FAILURE; } @@ -2303,7 +2302,6 @@ PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags nfiles++; if(vector_size < 10 || nfiles == 0) { /* overflow */ - php_stream_closedir(stream); efree(vector); return FAILURE; } @@ -2312,7 +2310,7 @@ PHPAPI int _php_stream_scandir(const char *dirname, char **namelist[], int flags *namelist = vector; - if (nfiles > 0 && compare) { + if (compare) { qsort(*namelist, nfiles, sizeof(char *), (int(*)(const void *, const void *))compare); } return nfiles; diff --git a/main/streams/transports.c b/main/streams/transports.c index 2d31074ded80..c24bf97ce6e9 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -29,12 +29,12 @@ PHPAPI HashTable *php_stream_xport_get_hash(void) return &xport_hash; } -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC) +PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC) { return zend_hash_update(&xport_hash, protocol, strlen(protocol) + 1, &factory, sizeof(factory), NULL); } -PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC) +PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC) { return zend_hash_del(&xport_hash, protocol, strlen(protocol) + 1); } @@ -49,7 +49,7 @@ PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC) if (local_err) { efree(local_err); local_err = NULL; } \ } -PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, int options, +PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, @@ -194,7 +194,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in /* Bind the stream to a local address */ PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, size_t namelen, + const char *name, long namelen, char **error_text TSRMLS_DC) { @@ -222,7 +222,7 @@ PHPAPI int php_stream_xport_bind(php_stream *stream, /* Connect to a remote address */ PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, size_t namelen, + const char *name, long namelen, int asynchronous, struct timeval *timeout, char **error_text, diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 1e626e4b4c77..69edbaafa91d 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -45,14 +45,14 @@ struct php_user_stream_wrapper { php_stream_wrapper wrapper; }; -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context TSRMLS_DC); -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode, +static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); +static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); +static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); +static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); +static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); +static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); +static int user_wrapper_metadata(php_stream_wrapper *wrapper, char *url, int option, void *value, php_stream_context *context TSRMLS_DC); +static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); static php_stream_wrapper_ops user_stream_wops = { @@ -332,8 +332,7 @@ static zval *user_stream_create_object(struct php_user_stream_wrapper *uwrap, ph return object; } -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *filename, const char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) +static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; php_userstream_data_t *us; @@ -438,7 +437,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * return stream; } -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char *filename, const char *mode, +static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; @@ -1152,7 +1151,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value } -static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) +static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zfilename, *zfuncname, *zretval; @@ -1199,8 +1198,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int return ret; } -static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, - int options, php_stream_context *context TSRMLS_DC) +static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zold_name, *znew_name, *zfuncname, *zretval; @@ -1252,8 +1250,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from return ret; } -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, - int options, php_stream_context *context TSRMLS_DC) +static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zfilename, *zmode, *zoptions, *zfuncname, *zretval; @@ -1311,8 +1308,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int return ret; } -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, - int options, php_stream_context *context TSRMLS_DC) +static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zfilename, *zoptions, *zfuncname, *zretval; @@ -1365,8 +1361,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, return ret; } -static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, int option, - void *value, php_stream_context *context TSRMLS_DC) +static int user_wrapper_metadata(php_stream_wrapper *wrapper, char *url, int option, void *value, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zfilename, *zoption, *zvalue, *zfuncname, *zretval; @@ -1449,8 +1444,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i } -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, const char *url, int flags, - php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) +static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) { struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; zval *zfilename, *zfuncname, *zretval, *zflags; diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index 4edc68b015f8..beffc73e103d 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -194,7 +194,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) * Essentially, we are waiting for the socket to become writeable, which means * that all pending data has been sent. * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefinitely. + * but at the same time avoid hanging indefintely. * */ do { n = php_pollfd_for_ms(sock->socket, POLLOUT, 500); @@ -230,7 +230,7 @@ static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC #endif } -static inline int sock_sendto(php_netstream_data_t *sock, const char *buf, size_t buflen, int flags, +static inline int sock_sendto(php_netstream_data_t *sock, char *buf, size_t buflen, int flags, struct sockaddr *addr, socklen_t addrlen TSRMLS_DC) { @@ -521,7 +521,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock } #endif -static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, char **err TSRMLS_DC) +static inline char *parse_ip_address_ex(const char *str, int str_len, int *portno, int get_err, char **err TSRMLS_DC) { char *colon; char *host = NULL; @@ -774,8 +774,8 @@ static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, } -PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t protolen, - const char *resourcename, size_t resourcenamelen, +PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, long protolen, + char *resourcename, long resourcenamelen, const char *persistent_id, int options, int flags, struct timeval *timeout, php_stream_context *context STREAMS_DC TSRMLS_DC) diff --git a/netware/start.c b/netware/start.c index 8651a6ccca51..2765ffba12fb 100644 --- a/netware/start.c +++ b/netware/start.c @@ -24,7 +24,7 @@ void *gLibHandle = (void *) NULL; rtag_t gAllocTag = (rtag_t) NULL; NXMutex_t *gLibLock = (NXMutex_t *) NULL; -int gLibId = 0; +int gLibId = 0; int DisposeLibraryData( void *data) @@ -35,17 +35,17 @@ int DisposeLibraryData( void *data) int _NonAppStart ( - void *NLMHandle, - void *errorScreen, + void *NLMHandle, + void *errorScreen, const char *cmdLine, const char *loadDirPath, size_t uninitializedDataLength, - void *NLMFileHandle, - int (*readRoutineP)( int conn, void *fileHandle, size_t offset, - size_t nbytes, size_t *bytesRead, void *buffer ), + void *NLMFileHandle, + int (*readRoutineP)( int conn, void *fileHandle, size_t offset, + size_t nbytes, size_t *bytesRead, void *buffer ), size_t customDataOffset, size_t customDataSize, - int messageCount, + int messageCount, const char **messages ) { diff --git a/php.ini-development b/php.ini-development index beebabbd24f0..149dec5505ad 100644 --- a/php.ini-development +++ b/php.ini-development @@ -199,12 +199,13 @@ engine = On ; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the tags as PHP source which should be processed as such. For several +; years we recommended that you not use the short tag shortcut and +; instead to use the full tag combination. With the widespread use +; of XML and use of these tags by other languages, the server can become easily +; confused and end up parsing the wrong code in the wrong context. +; This shortcut is still supported for backwards compatibility, but we +; recommend against its use. ; Default Value: On ; Development Value: Off ; Production Value: Off @@ -908,6 +909,7 @@ default_socket_timeout = 60 ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll +;extension=php_zip.dll ;;;;;;;;;;;;;;;;;;; ; Module Settings ; @@ -1399,14 +1401,6 @@ session.save_handler = files ; http://php.net/session.save-path ;session.save_path = "/tmp" -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - ; Whether to use cookies. ; http://php.net/session.use-cookies session.use_cookies = 1 @@ -1486,7 +1480,7 @@ session.gc_maxlifetime = 1440 ; collection through a shell script, cron entry, or some other method. ; For example, the following script would is the equivalent of ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm +; find /path/to/sessions -cmin +24 | xargs rm ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope. @@ -1648,7 +1642,7 @@ mssql.min_error_severity = 10 mssql.min_message_severity = 10 ; Compatibility mode with old versions of PHP 3.0. -mssql.compatibility_mode = Off +mssql.compatability_mode = Off ; Connect timeout ;mssql.connect_timeout = 5 @@ -1964,11 +1958,6 @@ ldap.max_links = -1 ; Useful for internal debugging only. ;opcache.protect_memory=0 -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - ; Local Variables: ; tab-width: 4 ; End: diff --git a/php.ini-production b/php.ini-production index 5a95344cb451..63d5c5dbfb97 100644 --- a/php.ini-production +++ b/php.ini-production @@ -199,12 +199,14 @@ engine = On ; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the tags as PHP source which should be processed as such. For several +; years we recommended that you not use the short tag shortcut and +; instead to use the full tag combination. With the widespread use +; of XML and use of these tags by other languages, the server can become easily +; confused and end up parsing the wrong code in the wrong context. +; This shortcut is still supported for backwards compatibility, but we +; recommend against its use. +; Default Value: On ; Default Value: On ; Development Value: Off ; Production Value: Off @@ -908,6 +910,7 @@ default_socket_timeout = 60 ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll +;extension=php_zip.dll ;;;;;;;;;;;;;;;;;;; ; Module Settings ; @@ -1399,14 +1402,6 @@ session.save_handler = files ; http://php.net/session.save-path ;session.save_path = "/tmp" -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - ; Whether to use cookies. ; http://php.net/session.use-cookies session.use_cookies = 1 @@ -1486,7 +1481,7 @@ session.gc_maxlifetime = 1440 ; collection through a shell script, cron entry, or some other method. ; For example, the following script would is the equivalent of ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm +; find /path/to/sessions -cmin +24 | xargs rm ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope. @@ -1648,7 +1643,7 @@ mssql.min_error_severity = 10 mssql.min_message_severity = 10 ; Compatibility mode with old versions of PHP 3.0. -mssql.compatibility_mode = Off +mssql.compatability_mode = Off ; Connect timeout ;mssql.connect_timeout = 5 @@ -1964,11 +1959,6 @@ ldap.max_links = -1 ; Useful for internal debugging only. ;opcache.protect_memory=0 -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - ; Local Variables: ; tab-width: 4 ; End: diff --git a/run-tests.php b/run-tests.php index 54a12a177d04..84907a705f8b 100755 --- a/run-tests.php +++ b/run-tests.php @@ -601,15 +601,6 @@ function save_or_mail_results() putenv("TEST_PHP_EXECUTABLE=$php"); $environment['TEST_PHP_EXECUTABLE'] = $php; break; - case 'P': - if(constant('PHP_BINARY')) { - $php = PHP_BINARY; - } else { - break; - } - putenv("TEST_PHP_EXECUTABLE=$php"); - $environment['TEST_PHP_EXECUTABLE'] = $php; - break; case 'q': putenv('NO_INTERACTION=1'); break; @@ -692,15 +683,13 @@ function save_or_mail_results() -d foo=bar Pass -d option to the php binary (Define INI entry foo with value 'bar'). - -g Comma separated list of groups to show during test run + -g Comma seperated list of groups to show during test run (possible values: PASS, FAIL, XFAIL, SKIP, BORK, WARN, LEAK, REDIRECT). -m Test for memory leaks with Valgrind. -p Specify PHP executable to run. - -P Use PHP_BINARY as PHP executable to run. - -q Quiet, no user interaction (same as environment NO_INTERACTION). -s Write output to . diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index 7b0ee562eb66..af83e9bcfa2b 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -20,7 +20,7 @@ fi dnl Apache 1.x shared module PHP_ARG_WITH(apxs,, -[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional +[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional pathname to the Apache apxs tool [apxs]], no, no) AC_MSG_CHECKING([for Apache 1.x module support via DSO through APXS]) @@ -59,7 +59,7 @@ if test "$PHP_APXS" != "no"; then # Test that we're trying to configure with apache 1.x PHP_AP_EXTRACT_VERSION($APXS_HTTPD) if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropriate switch --with-apxs2]) + AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) fi for flag in $APXS_CFLAGS; do @@ -123,7 +123,7 @@ fi dnl Apache 1.x static module PHP_ARG_WITH(apache,, -[ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache +[ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache build directory [/usr/local/apache]], no, no) AC_MSG_CHECKING([for Apache 1.x module support]) @@ -237,7 +237,7 @@ if test -z "$enable_mod_charset" && test "$with_mod_charset"; then fi PHP_ARG_ENABLE(mod-charset, whether to enable Apache charset compatibility option, -[ --enable-mod-charset APACHE: Enable transfer tables for mod_charset (Rus Apache)], no, no) +[ --enable-mod-charset APACHE: Enable transfer tables for mod_charset (Rus Apache)], no, no) if test "$PHP_MOD_CHARSET" = "yes"; then AC_DEFINE(USE_TRANSFER_TABLES, 1, [ ]) diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 8361f7f41060..11be0ed22249 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -130,7 +130,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to receive confirmation from the server on whether or not it can send + * and needs to recieve confirmation from the server on whether or not it can send * the rest of the request. RFC 2616 * */ diff --git a/sapi/apache2filter/README b/sapi/apache2filter/README index bd6eb17066db..3054e208d346 100644 --- a/sapi/apache2filter/README +++ b/sapi/apache2filter/README @@ -54,7 +54,7 @@ HOW TO CONFIGURE DEBUGGING APACHE AND PHP - To debug Apache, we recommend: + To debug Apache, we recommened: 1. Use the Prefork MPM (Apache 1.3-like process model) by configuring Apache with '--with-mpm=prefork'. diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 index b6524fd874e0..c49488d1824f 100644 --- a/sapi/apache2filter/config.m4 +++ b/sapi/apache2filter/config.m4 @@ -62,7 +62,7 @@ if test "$PHP_APXS2FILTER" != "no"; then # Test that we're trying to configure with apache 2.x PHP_AP_EXTRACT_VERSION($APXS_HTTPD) if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropriate switch --with-apxs (without the 2)]) + AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) elif test "$APACHE_VERSION" -lt 2000040; then AC_MSG_ERROR([Please note that Apache version >= 2.0.40 is required]) fi diff --git a/sapi/apache2handler/README b/sapi/apache2handler/README index 4defa336c6a9..5cbd1b95ddcd 100644 --- a/sapi/apache2handler/README +++ b/sapi/apache2handler/README @@ -58,7 +58,7 @@ HOW TO CONFIGURE DEBUGGING APACHE AND PHP - To debug Apache, we recommend: + To debug Apache, we recommened: 1. Use the Prefork MPM (Apache 1.3-like process model) by configuring Apache with '--with-mpm=prefork'. diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index 02f8a0b3ad86..702f91f5d23c 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(apxs2,, -[ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional +[ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional pathname to the Apache apxs tool [apxs]], no, no) AC_MSG_CHECKING([for Apache 2.0 handler-module support via DSO through APXS]) @@ -61,7 +61,7 @@ if test "$PHP_APXS2" != "no"; then # Test that we're trying to configure with apache 2.x PHP_AP_EXTRACT_VERSION($APXS_HTTPD) if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropriate switch --with-apxs (without the 2)]) + AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) elif test "$APACHE_VERSION" -lt 2000044; then AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required]) fi diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index b7f95e0c1272..bcb24431128f 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -632,7 +632,7 @@ zend_first_try { } /* - * check if coming due to ErrorDocument + * check if comming due to ErrorDocument * We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs * during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting * PHP instance to handle the request rather then creating a new one. diff --git a/sapi/apache_hooks/config.m4 b/sapi/apache_hooks/config.m4 index e2c71b427469..4213b7c6a601 100644 --- a/sapi/apache_hooks/config.m4 +++ b/sapi/apache_hooks/config.m4 @@ -60,7 +60,7 @@ if test "$PHP_APACHE_HOOKS" != "no"; then # Test that we're trying to configure with apache 1.x PHP_AP_EXTRACT_VERSION($APXS_HTTPD) if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropriate switch --with-apxs2]) + AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) fi for flag in $APXS_CFLAGS; do @@ -239,7 +239,7 @@ if test -z "$enable_mod_charset" && test "$with_mod_charset"; then fi PHP_ARG_ENABLE(mod-charset, whether to enable Apache charset compatibility option, -[ --enable-mod-charset APACHE (hooks): Enable transfer tables for mod_charset (Rus Apache)], no, no) +[ --enable-mod-charset APACHE (hooks): Enable transfer tables for mod_charset (Rus Apache)], no, no) if test "$PHP_MOD_CHARSET" = "yes"; then AC_DEFINE(USE_TRANSFER_TABLES, 1, [ ]) diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c index 66adb482ed1a..dda6e4989128 100644 --- a/sapi/apache_hooks/mod_php5.c +++ b/sapi/apache_hooks/mod_php5.c @@ -275,7 +275,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to receive confirmation from the server on whether or not it can send + * and needs to recieve confirmation from the server on whether or not it can send * the rest of the request. RFC 2616 * */ diff --git a/sapi/caudium/config.m4 b/sapi/caudium/config.m4 index 5ce55f3f0102..8aba33e23d20 100644 --- a/sapi/caudium/config.m4 +++ b/sapi/caudium/config.m4 @@ -4,7 +4,7 @@ dnl RESULT=no PHP_ARG_WITH(caudium,, -[ --with-caudium[=DIR] Build PHP as a Pike module for use with Caudium. +[ --with-caudium[=DIR] Build PHP as a Pike module for use with Caudium. DIR is the Caudium server dir [/usr/local/caudium/server]], no, no) AC_MSG_CHECKING([for Caudium support]) diff --git a/sapi/cgi/Makefile.frag b/sapi/cgi/Makefile.frag index d3d7cb3553ab..505119e57288 100644 --- a/sapi/cgi/Makefile.frag +++ b/sapi/cgi/Makefile.frag @@ -5,9 +5,5 @@ $(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CGI_OBJS) install-cgi: $(SAPI_CGI_PATH) @echo "Installing PHP CGI binary: $(INSTALL_ROOT)$(bindir)/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) @$(INSTALL) -m 0755 $(SAPI_CGI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php-cgi$(program_suffix)$(EXEEXT) - @echo "Installing PHP CGI man page: $(INSTALL_ROOT)$(mandir)/man1/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @$(INSTALL_DATA) sapi/cgi/php-cgi.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php-cgi$(program_suffix).1 diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 221b0021756d..9e6b74ac6164 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -508,7 +508,7 @@ static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) uint read_bytes = 0; int tmp_read_bytes; - count_bytes = MIN(count_bytes, SG(request_info).content_length - SG(read_post_bytes)); + count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes)); while (read_bytes < count_bytes) { tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_bytes); if (tmp_read_bytes <= 0) { @@ -1955,11 +1955,7 @@ consult the installation file that came with this distribution, or visit \n\ } if (bindpath) { - int backlog = 128; - if (getenv("PHP_FCGI_BACKLOG")) { - backlog = atoi(getenv("PHP_FCGI_BACKLOG")); - } - fcgi_fd = fcgi_listen(bindpath, backlog); + fcgi_fd = fcgi_listen(bindpath, 128); if (fcgi_fd < 0) { fprintf(stderr, "Couldn't create FastCGI listen socket on port %s\n", bindpath); #ifdef ZTS diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4 index 49e61c83c3da..67251aeb588d 100644 --- a/sapi/cgi/config9.m4 +++ b/sapi/cgi/config9.m4 @@ -71,8 +71,6 @@ if test "$PHP_CGI" != "no"; then dnl Expose to Makefile PHP_SUBST(SAPI_CGI_PATH) PHP_SUBST(BUILD_CGI) - - PHP_OUTPUT(sapi/cgi/php-cgi.1) else AC_MSG_RESULT(yes) fi diff --git a/sapi/cgi/php-cgi.1.in b/sapi/cgi/php-cgi.1.in deleted file mode 100644 index 340e6c5d6096..000000000000 --- a/sapi/cgi/php-cgi.1.in +++ /dev/null @@ -1 +0,0 @@ -.so man1/php.1 diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in index c113030d14dd..0e9d07ac771d 100644 --- a/sapi/cli/php.1.in +++ b/sapi/cli/php.1.in @@ -1,8 +1,6 @@ .TH PHP 1 "2013" "The PHP Group" "Scripting Language" .SH NAME php \- PHP Command Line Interface 'CLI' -.P -php-cgi \- PHP Common Gateway Interface 'CGI' command .SH SYNOPSIS .B php [options] [ @@ -20,21 +18,21 @@ php-cgi \- PHP Common Gateway Interface 'CGI' command .LP .B php [options] [\-B -.IR begin_code ] +.IR code ] .B \-R .IR code [\-E -.IR end_code ] +.IR code ] [[\-\-] .IR args.\|.\|. ] .LP .B php [options] [\-B -.IR begin_code ] +.IR code ] .B \-F .IR file [\-E -.IR end_code ] +.IR code ] [[\-\-] .IR args.\|.\|. ] .LP @@ -86,7 +84,7 @@ and therefore reading from .B STDIN explicitly changes the next input line or skips input lines. .LP -PHP also contains an built-in web server for application development purpose. By using the \-S option where +PHP also contains an embedded web server for application development purpose. By using the \-S option where .B addr:port point to a local address and port PHP will listen to HTTP requests on that address and port and serve files from the current working directory or the .B docroot @@ -237,9 +235,9 @@ without using script tags .B \-\-process\-begin \fIcode\fP .TP .PD 1 -.B \-B \fIbegin_code\fP +.B \-B \fIcode\fP Run PHP -.IR begin_code +.IR code before processing input lines .TP .PD 0 @@ -264,9 +262,9 @@ for every input line .B \-\-process\-end \fIcode\fP .TP .PD 1 -.B \-E \fIend_code\fP +.B \-E \fIcode\fP Run PHP -.IR end_code +.IR code after processing all input lines .TP .PD 0 @@ -281,14 +279,14 @@ Output HTML syntax highlighted source .TP .PD 1 .B \-S \fIaddr:port\fP -Start built-in web server on the given local address and port +Start embedded Webserver on the given local address and port .TP .PD 0 .B \-\-docroot \fIdocroot\fP .TP .PD 1 .B \-t \fIdocroot\fP -Specify the document root to be used by the built-in web server +Specify the document root to be used by the embedded web server .TP .PD 0 .B \-\-version diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 9f3fc4b5b73a..729052334d6c 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -503,7 +503,6 @@ static void php_cli_usage(char *argv0) " %s [options] -r [--] [args...]\n" " %s [options] [-B ] -R [-E ] [--] [args...]\n" " %s [options] [-B ] -F [-E ] [--] [args...]\n" - " %s [options] -S : [-t docroot]\n" " %s [options] -- [args...]\n" " %s [options] -a\n" "\n" @@ -545,7 +544,7 @@ static void php_cli_usage(char *argv0) " --rz Show information about Zend extension .\n" " --ri Show configuration for extension .\n" "\n" - , prog, prog, prog, prog, prog, prog, prog); + , prog, prog, prog, prog, prog, prog); } /* }}} */ diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index d50cc4f8a037..5c9b2e86de02 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -20,7 +20,6 @@ /* $Id: php_cli.c 306938 2011-01-01 02:17:06Z felipe $ */ #include -#include #include #include @@ -195,17 +194,17 @@ typedef struct php_cli_server { HashTable clients; } php_cli_server; -typedef struct php_cli_server_http_response_status_code_pair { +typedef struct php_cli_server_http_reponse_status_code_pair { int code; const char *str; -} php_cli_server_http_response_status_code_pair; +} php_cli_server_http_reponse_status_code_pair; typedef struct php_cli_server_ext_mime_type_pair { const char *ext; const char *mime_type; } php_cli_server_ext_mime_type_pair; -static php_cli_server_http_response_status_code_pair status_map[] = { +static php_cli_server_http_reponse_status_code_pair status_map[] = { { 100, "Continue" }, { 101, "Switching Protocols" }, { 200, "OK" }, @@ -252,7 +251,7 @@ static php_cli_server_http_response_status_code_pair status_map[] = { { 511, "Network Authentication Required" }, }; -static php_cli_server_http_response_status_code_pair template_map[] = { +static php_cli_server_http_reponse_status_code_pair template_map[] = { { 400, "

%s

Your browser sent a request that this server could not understand.

" }, { 404, "

%s

The requested resource %s was not found on this server.

" }, { 500, "

%s

The server is temporarily unavailable.

" }, @@ -338,43 +337,28 @@ static char *get_last_error() /* {{{ */ return pestrdup(strerror(errno), 1); } /* }}} */ -static int status_comp(const void *a, const void *b) /* {{{ */ -{ - const php_cli_server_http_response_status_code_pair *pa = (const php_cli_server_http_response_status_code_pair *) a; - const php_cli_server_http_response_status_code_pair *pb = (const php_cli_server_http_response_status_code_pair *) b; - - if (pa->code < pb->code) { - return -1; - } else if (pa->code > pb->code) { - return 1; - } - - return 0; -} /* }}} */ - static const char *get_status_string(int code) /* {{{ */ { - php_cli_server_http_response_status_code_pair needle, *result = NULL; - - needle.code = code; - needle.str = NULL; - - result = bsearch(&needle, status_map, sizeof(status_map) / sizeof(needle), sizeof(needle), status_comp); + size_t e = (sizeof(status_map) / sizeof(php_cli_server_http_reponse_status_code_pair)); + size_t s = 0; - if (result) { - return result->str; + while (e != s) { + size_t c = MIN((e + s + 1) / 2, e - 1); + int d = status_map[c].code; + if (d > code) { + e = c; + } else if (d < code) { + s = c; + } else { + return status_map[c].str; + } } - - /* Returning NULL would require complicating append_http_status_line() to - * not segfault in that case, so let's just return a placeholder, since RFC - * 2616 requires a reason phrase. This is basically what a lot of other Web - * servers do in this case anyway. */ - return "Unknown Status Code"; + return NULL; } /* }}} */ static const char *get_template_string(int code) /* {{{ */ { - size_t e = (sizeof(template_map) / sizeof(php_cli_server_http_response_status_code_pair)); + size_t e = (sizeof(template_map) / sizeof(php_cli_server_http_reponse_status_code_pair)); size_t s = 0; while (e != s) { @@ -412,7 +396,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c { { char **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "host", sizeof("host"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "Host", sizeof("Host"), (void**)&val)) { smart_str_appendl_ex(buffer, "Host", sizeof("Host") - 1, persistent); smart_str_appendl_ex(buffer, ": ", sizeof(": ") - 1, persistent); smart_str_appends_ex(buffer, *val, persistent); @@ -568,7 +552,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ { php_cli_server_client *client = SG(server_context); char **val; - if (FAILURE == zend_hash_find(&client->request.headers, "cookie", sizeof("cookie"), (void**)&val)) { + if (FAILURE == zend_hash_find(&client->request.headers, "Cookie", sizeof("Cookie"), (void**)&val)) { return NULL; } return *val; @@ -1335,7 +1319,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque static const char *index_files[] = { "index.php", "index.html", NULL }; char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1); char *p = buf, *prev_path = NULL, *q, *vpath; - size_t prev_path_len = 0; + size_t prev_path_len; int is_static_file = 0; if (!buf) { @@ -1566,9 +1550,12 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p return 1; } { - char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); - zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); - efree(header_name); + char *header_name = client->current_header_name; + size_t header_name_len = client->current_header_name_len; + char c = header_name[header_name_len]; + header_name[header_name_len] = '\0'; + zend_hash_add(&client->request.headers, header_name, header_name_len + 1, &value, sizeof(char *), NULL); + header_name[header_name_len] = c; } if (client->current_header_name_allocated) { @@ -1726,7 +1713,7 @@ static void php_cli_server_client_populate_request_info(const php_cli_server_cli request_info->post_data = client->request.content; request_info->content_length = request_info->post_data_length = client->request.content_len; request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; - if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { request_info->content_type = *val; } } /* }}} */ @@ -1964,7 +1951,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); - if (SUCCESS == zend_hash_find(&client->request.headers, "authorization", sizeof("authorization"), (void**)&auth)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { php_handle_auth_data(*auth TSRMLS_CC); } SG(sapi_headers).http_response_code = 200; diff --git a/sapi/cli/php_http_parser.h b/sapi/cli/php_http_parser.h index 31502e213af7..2bf2356725a2 100644 --- a/sapi/cli/php_http_parser.h +++ b/sapi/cli/php_http_parser.h @@ -29,13 +29,15 @@ extern "C" { #include #if defined(_WIN32) && !defined(__MINGW32__) # include +# include "win32/php_stdint.h" # include "config.w32.h" #else # include "php_config.h" +# ifdef HAVE_STDINT_H +# include +# endif #endif -#include "php_stdint.h" - /* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run * faster */ diff --git a/sapi/cli/tests/bug65066_100.phpt b/sapi/cli/tests/bug65066_100.phpt deleted file mode 100644 index 3a97c7e910ce..000000000000 --- a/sapi/cli/tests/bug65066_100.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #65066 (Cli server not responsive when responding with 422 http status code): 100 status code ---INI-- -allow_url_fopen=1 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -HTTP/1.1 100 Continue -Host: %s -Connection: close -X-Powered-By: PHP/%s -Content-type: text/html diff --git a/sapi/cli/tests/bug65066_422.phpt b/sapi/cli/tests/bug65066_422.phpt deleted file mode 100644 index 2552d1d11d94..000000000000 --- a/sapi/cli/tests/bug65066_422.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #65066 (Cli server not responsive when responding with 422 http status code): 422 status code ---INI-- -allow_url_fopen=1 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -HTTP/1.1 422 Unknown Status Code -Host: %s -Connection: close -X-Powered-By: PHP/%s -Content-type: text/html diff --git a/sapi/cli/tests/bug65066_511.phpt b/sapi/cli/tests/bug65066_511.phpt deleted file mode 100644 index aa4a9a003068..000000000000 --- a/sapi/cli/tests/bug65066_511.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #65066 (Cli server not responsive when responding with 422 http status code): 511 status code ---INI-- -allow_url_fopen=1 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -HTTP/1.1 511 Network Authentication Required -Host: %s -Connection: close -X-Powered-By: PHP/%s -Content-type: text/html diff --git a/sapi/cli/tests/bug65633.phpt b/sapi/cli/tests/bug65633.phpt deleted file mode 100644 index 55834095b187..000000000000 --- a/sapi/cli/tests/bug65633.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #65633 (built-in server treat some http headers as case-sensitive) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -HTTP/1.1 200 OK -Connection: close -X-Powered-By: %s -Content-type: text/html - -array(1) { - ["foo"]=> - string(3) "bar" -} -string(3) "bar" diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 77a79e0f0493..40c53619957f 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -3,7 +3,7 @@ define ("PHP_CLI_SERVER_HOSTNAME", "localhost"); define ("PHP_CLI_SERVER_PORT", 8964); define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT); -function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE, $cmd_args = null) { +function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) { $php_executable = getenv('TEST_PHP_EXECUTABLE'); $doc_root = __DIR__; $router = "index.php"; @@ -19,14 +19,14 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE, ); if (substr(PHP_OS, 0, 3) == 'WIN') { - $cmd = "{$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); } else { - $cmd = "exec {$php_executable} -t {$doc_root} -n {$cmd_args} -S " . PHP_CLI_SERVER_ADDRESS; + $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CLI_SERVER_ADDRESS; if (!$no_router) { $cmd .= " {$router}"; } diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt deleted file mode 100644 index fe13d9000703..000000000000 --- a/sapi/cli/tests/upload_2G.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -file upload greater than 2G ---SKIPIF-- -=8"); -} - -if ($f = fopen("/proc/meminfo","r")) { - while (!feof($f)) { - if (!strncmp($line = fgets($f), "MemFree", 7)) { - if (substr($line,8)/1024/1024 > 3) { - $enough_free_ram = true; - } - } - } -} - -if (empty($enough_free_ram)) { - die("need +3G free RAM"); -} -?> ---FILE-- - -Done ---EXPECTF-- -Test - -HTTP/1.1 200 OK -Host: %s -Connection: close -X-Powered-By: PHP/%s -Content-type: text/html - -array(1) { - ["file1"]=> - array(5) { - ["name"]=> - string(9) "file1.txt" - ["type"]=> - string(10) "text/plain" - ["tmp_name"]=> - string(14) "/tmp/php%s" - ["error"]=> - int(0) - ["size"]=> - int(2150000000) - } -} -Done diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4 index 5ffb9b39bd7c..3a61b458f03a 100644 --- a/sapi/embed/config.m4 +++ b/sapi/embed/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_ENABLE(embed,, -[ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library +[ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library TYPE is either 'shared' or 'static'. [TYPE=shared]], no, no) AC_MSG_CHECKING([for embedded SAPI library support]) diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index bd6d64930b1f..3a2690ee2277 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_ENABLE(fpm,, -[ --enable-fpm Enable building of the fpm SAPI executable], no, no) +[ --enable-fpm Enable building of the fpm SAPI executable], no, no) dnl configure checks {{{ AC_DEFUN([AC_FPM_STDLIBS], @@ -557,31 +557,11 @@ if test "$PHP_FPM" != "no"; then AC_FPM_SELECT PHP_ARG_WITH(fpm-user,, - [ --with-fpm-user[=USER] Set the user for php-fpm to run as. (default: nobody)], nobody, no) + [ --with-fpm-user[=USER] Set the user for php-fpm to run as. (default: nobody)], nobody, no) PHP_ARG_WITH(fpm-group,, - [ --with-fpm-group[=GRP] Set the group for php-fpm to run as. For a system user, this - should usually be set to match the fpm username (default: nobody)], nobody, no) - - PHP_ARG_WITH(fpm-systemd,, - [ --with-fpm-systemd Activate systemd integration], no, no) - - if test "$PHP_FPM_SYSTEMD" != "no" ; then - AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon") - AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"]) - if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then - AC_MSG_ERROR([Your system does not support systemd.]) - else - AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration]) - PHP_FPM_SD_FILES="fpm/fpm_systemd.c" - PHP_ADD_LIBRARY(systemd-daemon) - php_fpm_systemd=notify - fi - else - php_fpm_systemd=simple - fi - PHP_SUBST_OLD(php_fpm_systemd) - AC_DEFINE_UNQUOTED(PHP_FPM_SYSTEMD, "$php_fpm_systemd", [fpm systemd service type]) + [ --with-fpm-group[=GRP] Set the group for php-fpm to run as. For a system user, this + should usually be set to match the fpm username (default: nobody)], nobody, no) if test -z "$PHP_FPM_USER" -o "$PHP_FPM_USER" = "yes" -o "$PHP_FPM_USER" = "no"; then php_fpm_user="nobody" @@ -651,7 +631,7 @@ if test "$PHP_FPM" != "no"; then fpm/events/port.c \ " - PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES $PHP_FPM_SD_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)') + PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)') case $host_alias in *aix*) diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index 99905c8b605a..cf3f098c5367 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -610,7 +610,7 @@ static int fcgi_read_request(fcgi_request *req) } zend_hash_internal_pointer_reset_ex(req->env, &pos); - while ((key_type = zend_hash_get_current_key_ex(req->env, &str_index, &str_length, &num_index, 0, &pos)) != HASH_KEY_NON_EXISTENT) { + while ((key_type = zend_hash_get_current_key_ex(req->env, &str_index, &str_length, &num_index, 0, &pos)) != HASH_KEY_NON_EXISTANT) { int zlen; zend_hash_move_forward_ex(req->env, &pos); if (key_type != HASH_KEY_IS_STRING) { diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index cd5fc34d0f2d..0a8a0e37e3e9 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -45,10 +45,6 @@ #include "fpm_log.h" #include "fpm_events.h" #include "zlog.h" -#ifdef HAVE_SYSTEMD -#include "fpm_systemd.h" -#endif - #define STR2STR(a) (a ? a : "undefined") #define BOOL2STR(a) (a ? "yes" : "no") @@ -77,10 +73,6 @@ struct fpm_global_config_s fpm_global_config = { #endif .process_max = 0, .process_priority = 64, /* 64 means unset */ -#ifdef HAVE_SYSTEMD - .systemd_watchdog = 0, - .systemd_interval = -1, /* -1 means not set */ -#endif }; static struct fpm_worker_pool_s *current_wp = NULL; static int ini_recursion = 0; @@ -108,9 +100,6 @@ static struct ini_value_parser_s ini_fpm_global_options[] = { { "rlimit_files", &fpm_conf_set_integer, GO(rlimit_files) }, { "rlimit_core", &fpm_conf_set_rlimit_core, GO(rlimit_core) }, { "events.mechanism", &fpm_conf_set_string, GO(events_mechanism) }, -#ifdef HAVE_SYSTEMD - { "systemd_interval", &fpm_conf_set_time, GO(systemd_interval) }, -#endif { 0, 0, 0 } }; @@ -697,7 +686,7 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha if (tmp != NULL) { if (tmp != *path) { - zlog(ZLOG_ERROR, "'$prefix' must be use at the beginning of the value"); + zlog(ZLOG_ERROR, "'$prefix' must be use at the begining of the value"); return -1; } @@ -1163,12 +1152,6 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ fpm_global_config.error_log = strdup("log/php-fpm.log"); } -#ifdef HAVE_SYSTEMD - if (0 > fpm_systemd_conf()) { - return -1; - } -#endif - #ifdef HAVE_SYSLOG_H if (!fpm_global_config.syslog_ident) { fpm_global_config.syslog_ident = strdup("php-fpm"); @@ -1557,9 +1540,6 @@ static void fpm_conf_dump() /* {{{ */ zlog(ZLOG_NOTICE, "\trlimit_files = %d", fpm_global_config.rlimit_files); zlog(ZLOG_NOTICE, "\trlimit_core = %d", fpm_global_config.rlimit_core); zlog(ZLOG_NOTICE, "\tevents.mechanism = %s", fpm_event_machanism_name()); -#ifdef HAVE_SYSTEMD - zlog(ZLOG_NOTICE, "\tsystemd_interval = %ds", fpm_global_config.systemd_interval/1000); -#endif zlog(ZLOG_NOTICE, " "); for (wp = fpm_worker_all_pools; wp; wp = wp->next) { diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h index efd65dc6d9d7..dc54133d4310 100644 --- a/sapi/fpm/fpm/fpm_conf.h +++ b/sapi/fpm/fpm/fpm_conf.h @@ -40,10 +40,6 @@ struct fpm_global_config_s { int rlimit_files; int rlimit_core; char *events_mechanism; -#ifdef HAVE_SYSTEMD - int systemd_watchdog; - int systemd_interval; -#endif }; extern struct fpm_global_config_s fpm_global_config; diff --git a/sapi/fpm/fpm/fpm_events.c b/sapi/fpm/fpm/fpm_events.c index ce5d543f9b54..d5835f0f7ec2 100644 --- a/sapi/fpm/fpm/fpm_events.c +++ b/sapi/fpm/fpm/fpm_events.c @@ -29,10 +29,6 @@ #include "events/port.h" #include "events/kqueue.h" -#ifdef HAVE_SYSTEMD -#include "fpm_systemd.h" -#endif - #define fpm_event_set_timeout(ev, now) timeradd(&(now), &(ev)->frequency, &(ev)->timeout); static void fpm_event_cleanup(int which, void *arg); @@ -365,10 +361,6 @@ void fpm_event_loop(int err) /* {{{ */ zlog(ZLOG_DEBUG, "%zu bytes have been reserved in SHM", fpm_shm_get_size_allocated()); zlog(ZLOG_NOTICE, "ready to handle connections"); - -#ifdef HAVE_SYSTEMD - fpm_systemd_heartbeat(NULL, 0, NULL); -#endif } while (1) { diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c index 145b2550c3ba..f959cf36d872 100644 --- a/sapi/fpm/fpm/fpm_sockets.c +++ b/sapi/fpm/fpm/fpm_sockets.c @@ -405,19 +405,7 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq) zlog(ZLOG_SYSERROR, "failed to retrieve TCP_INFO for socket"); return -1; } -#if defined(__FreeBSD__) - if (info.__tcpi_sacked == 0) { - return -1; - } - - if (cur_lq) { - *cur_lq = info.__tcpi_unacked; - } - if (max_lq) { - *max_lq = info.__tcpi_sacked; - } -#else /* kernel >= 2.6.24 return non-zero here, that means operation is supported */ if (info.tcpi_sacked == 0) { return -1; @@ -430,7 +418,6 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq) if (max_lq) { *max_lq = info.tcpi_sacked; } -#endif return 0; } diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c index d81e10150db6..10b867d00a41 100644 --- a/sapi/fpm/fpm/fpm_stdio.c +++ b/sapi/fpm/fpm/fpm_stdio.c @@ -291,11 +291,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */ fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */ } else { fpm_globals.error_log_fd = fd; -#if HAVE_UNISTD_H - if (fpm_global_config.daemonize || !isatty(STDERR_FILENO)) { -#else if (fpm_global_config.daemonize) { -#endif zlog_set_fd(fpm_globals.error_log_fd); } } diff --git a/sapi/fpm/fpm/fpm_systemd.c b/sapi/fpm/fpm/fpm_systemd.c deleted file mode 100644 index c4d7ec15a494..000000000000 --- a/sapi/fpm/fpm/fpm_systemd.c +++ /dev/null @@ -1,113 +0,0 @@ -#include "fpm_config.h" - -#include -#include - -#include "fpm.h" -#include "fpm_clock.h" -#include "fpm_worker_pool.h" -#include "fpm_scoreboard.h" -#include "zlog.h" -#include "fpm_systemd.h" - - -static void fpm_systemd() /* {{{ */ -{ - static unsigned long int last=0; - struct fpm_worker_pool_s *wp; - unsigned long int requests=0, slow_req=0; - int active=0, idle=0; - - - for (wp = fpm_worker_all_pools; wp; wp = wp->next) { - if (wp->scoreboard) { - active += wp->scoreboard->active; - idle += wp->scoreboard->idle; - requests += wp->scoreboard->requests; - slow_req += wp->scoreboard->slow_rq; - } - } - -/* - zlog(ZLOG_DEBUG, "systemd %s (Processes active:%d, idle:%d, Requests:%lu, slow:%lu, Traffic:%.3greq/sec)", - fpm_global_config.systemd_watchdog ? "watchdog" : "heartbeat", - active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval); -*/ - - if (0 > sd_notifyf(0, "READY=1\n%s" - "STATUS=Processes active: %d, idle: %d, Requests: %lu, slow: %lu, Traffic: %.3greq/sec", - fpm_global_config.systemd_watchdog ? "WATCHDOG=1\n" : "", - active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval)) { - zlog(ZLOG_NOTICE, "failed to notify status to systemd"); - } - - last = requests; -} -/* }}} */ - -void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg) /* {{{ */ -{ - static struct fpm_event_s heartbeat; - - if (fpm_globals.parent_pid != getpid()) { - return; /* sanity check */ - } - - if (which == FPM_EV_TIMEOUT) { - fpm_systemd(); - - return; - } - - if (0 > sd_notifyf(0, "READY=1\n" - "STATUS=Ready to handle connections\n" - "MAINPID=%lu", - (unsigned long) getpid())) { - zlog(ZLOG_WARNING, "failed to notify start to systemd"); - } else { - zlog(ZLOG_DEBUG, "have notify start to systemd"); - } - - /* first call without setting which to initialize the timer */ - if (fpm_global_config.systemd_interval > 0) { - fpm_event_set_timer(&heartbeat, FPM_EV_PERSIST, &fpm_systemd_heartbeat, NULL); - fpm_event_add(&heartbeat, fpm_global_config.systemd_interval); - zlog(ZLOG_NOTICE, "systemd monitor interval set to %dms", fpm_global_config.systemd_interval); - } else { - zlog(ZLOG_NOTICE, "systemd monitor disabled"); - } -} -/* }}} */ - -int fpm_systemd_conf() /* {{{ */ -{ - char *watchdog; - int interval = 0; - - watchdog = getenv("WATCHDOG_USEC"); - if (watchdog) { - /* usec to msec, and half the configured delay */ - interval = (int)(atol(watchdog) / 2000L); - zlog(ZLOG_DEBUG, "WATCHDOG_USEC=%s, interval=%d", watchdog, interval); - } - - if (interval > 1000) { - if (fpm_global_config.systemd_interval > 0) { - zlog(ZLOG_WARNING, "systemd_interval option ignored"); - } - zlog(ZLOG_NOTICE, "systemd watchdog configured to %.3gsec", (float)interval / 1000.0); - fpm_global_config.systemd_watchdog = 1; - fpm_global_config.systemd_interval = interval; - - } else if (fpm_global_config.systemd_interval < 0) { - /* not set => default value */ - fpm_global_config.systemd_interval = FPM_SYSTEMD_DEFAULT_HEARTBEAT; - - } else { - /* sec to msec */ - fpm_global_config.systemd_interval *= 1000; - } - return 0; -} -/* }}} */ - diff --git a/sapi/fpm/fpm/fpm_systemd.h b/sapi/fpm/fpm/fpm_systemd.h deleted file mode 100644 index 3ee62177170e..000000000000 --- a/sapi/fpm/fpm/fpm_systemd.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef FPM_SYSTEMD_H -#define FPM_SYSTEMD_H 1 - -#include "fpm_events.h" - -/* 10s (in ms) heartbeat for systemd status */ -#define FPM_SYSTEMD_DEFAULT_HEARTBEAT (10000) - -void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg); -int fpm_systemd_conf(); - -#endif - diff --git a/sapi/fpm/init.d.php-fpm.in b/sapi/fpm/init.d.php-fpm.in index 020b942f148f..49cce79ae9b6 100644 --- a/sapi/fpm/init.d.php-fpm.in +++ b/sapi/fpm/init.d.php-fpm.in @@ -91,20 +91,6 @@ case "$1" in fi ;; - status) - if [ ! -r $php_fpm_PID ] ; then - echo "php-fpm is stopped" - exit 0 - fi - - PID=`cat $php_fpm_PID` - if ps -p $PID | grep -q $PID; then - echo "php-fpm (pid $PID) is running..." - else - echo "php-fpm dead but pid file exists" - fi - ;; - force-quit) echo -n "Terminating php-fpm " @@ -145,7 +131,7 @@ case "$1" in ;; *) - echo "Usage: $0 {start|stop|force-quit|restart|reload|status}" + echo "Usage: $0 {start|stop|force-quit|restart|reload}" exit 1 ;; diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index af4f2fa325a3..a63dec709860 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -3,14 +3,14 @@ ;;;;;;;;;;;;;;;;;;;;; ; All relative paths in this configuration file are relative to PHP's install -; prefix (@prefix@). This prefix can be dynamically changed by using the +; prefix (@prefix@). This prefix can be dynamicaly changed by using the ; '-p' argument from the command line. ; Include one or more files. If glob(3) exists, it is used to include a bunch of ; files from a glob(3) pattern. This directive can be used everywhere in the ; file. ; Relative path can also be used. They will be prefixed by: -; - the global prefix if it's been set (-p argument) +; - the global prefix if it's been set (-p arguement) ; - @prefix@ otherwise ;include=etc/fpm.d/*.conf @@ -105,15 +105,7 @@ ; - /dev/poll (Solaris >= 7) ; - port (Solaris >= 10) ; Default Value: not set (auto detection) -;events.mechanism = epoll - -; When FPM is build with systemd integration, specify the interval, -; in second, between health report notification to systemd. -; Set to 0 to disable. -; Available Units: s(econds), m(inutes), h(ours) -; Default Unit: seconds -; Default value: 10 -;systemd_interval = 10 +; events.mechanism = epoll ;;;;;;;;;;;;;;;;;;;; ; Pool Definitions ; @@ -401,7 +393,7 @@ pm.max_spare_servers = 3 ; - %{megabytes}M ; - %{mega}M ; %n: pool name -; %o: output header +; %o: ouput header ; it must be associated with embraces to specify the name of the header: ; - %{Content-Type}o ; - %{X-Powered-By}o diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in index a2df30e28d59..396a88d66f1a 100644 --- a/sapi/fpm/php-fpm.service.in +++ b/sapi/fpm/php-fpm.service.in @@ -3,7 +3,6 @@ Description=The PHP FastCGI Process Manager After=syslog.target network.target [Service] -Type=@php_fpm_systemd@ PIDFile=@localstatedir@/run/php-fpm.pid ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID diff --git a/sapi/isapi/config.m4 b/sapi/isapi/config.m4 index 6014bab09fce..7c7dcf0c2106 100644 --- a/sapi/isapi/config.m4 +++ b/sapi/isapi/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(isapi, for Zeus ISAPI support, -[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], no, no) +[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], no, no) if test "$PHP_ISAPI" != "no"; then if test "$PHP_ISAPI" = "yes"; then diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp index 9a5964a6ba7f..97824e6be8c8 100644 --- a/sapi/isapi/stresstest/stresstest.cpp +++ b/sapi/isapi/stresstest/stresstest.cpp @@ -796,7 +796,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, switch(dwHSERequest) { case (HSE_REQ_SEND_RESPONSE_HEADER) : - lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accommodate our header + lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accomodate our header if (!lpszRespBuf) return FALSE; wsprintf(lpszRespBuf,"%s", diff --git a/sapi/litespeed/README b/sapi/litespeed/README index b5cec05aa607..e548ec97db85 100644 --- a/sapi/litespeed/README +++ b/sapi/litespeed/README @@ -195,7 +195,7 @@ process. By default a LSAPI application check the existence of its parent process and exits automatically if the parent process died. This is to reduce -orphan process when web server is restarted. However, it is desirable +orphan process when web server is restarted. However, it is desireable to disable this feature, such as when a LSAPI process was started manually from command line. LSAPI_PPID_NO_CHECK should be set when you want to disable the checking of existence of parent process. diff --git a/sapi/milter/config.m4 b/sapi/milter/config.m4 index 4bcad80bb4ab..48c7a5d80435 100644 --- a/sapi/milter/config.m4 +++ b/sapi/milter/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(milter, for Milter support, -[ --with-milter[=DIR] Build PHP as Milter application], no, no) +[ --with-milter[=DIR] Build PHP as Milter application], no, no) if test "$PHP_MILTER" != "no"; then if test "$PHP_MILTER" = "yes"; then diff --git a/sapi/pi3web/config.m4 b/sapi/pi3web/config.m4 index 347a74ca0617..7859481508bb 100644 --- a/sapi/pi3web/config.m4 +++ b/sapi/pi3web/config.m4 @@ -3,7 +3,7 @@ dnl $Id$ dnl PHP_ARG_WITH(pi3web, for Pi3Web support, -[ --with-pi3web[=DIR] Build PHP as Pi3Web module], no, no) +[ --with-pi3web[=DIR] Build PHP as Pi3Web module], no, no) if test "$PHP_PI3WEB" != "no"; then if test "$PHP_PI3WEB" = "yes"; then diff --git a/sapi/roxen/config.m4 b/sapi/roxen/config.m4 index 7601b0c1ed95..9b0bb90c3524 100644 --- a/sapi/roxen/config.m4 +++ b/sapi/roxen/config.m4 @@ -7,7 +7,7 @@ PHP_ARG_WITH(roxen,, directory, normally /usr/local/roxen/server], no, no) PHP_ARG_ENABLE(roxen-zts, whether Roxen module is build using ZTS, -[ --enable-roxen-zts ROXEN: Build the Roxen module using Zend Thread Safety], no, no) +[ --enable-roxen-zts ROXEN: Build the Roxen module using Zend Thread Safety], no, no) RESULT= AC_MSG_CHECKING([for Roxen/Pike support]) diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 548bcda170ab..1a1baa7078e4 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -579,7 +579,7 @@ static void queue_request(httpd_conn *hc) m->next = NULL; tsrm_mutex_lock(qr_lock); - /* Create new threads when reaching a certain threshold */ + /* Create new threads when reaching a certain threshhold */ if (nr_threads < max_threads && nr_free_threads < 2) { nr_threads++; /* protected by qr_lock */ diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag index 7cd78fabad07..00272b02b1a8 100644 --- a/scripts/Makefile.frag +++ b/scripts/Makefile.frag @@ -44,7 +44,7 @@ install-programs: $(builddir)/phpize $(builddir)/php-config echo " page: $(program_prefix)$${page}$(program_suffix).1"; \ $(INSTALL_DATA) $(builddir)/man1/$${page}.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)$${page}$(program_suffix).1; \ done - + $(builddir)/phpize: $(srcdir)/phpize.in $(top_builddir)/config.status (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status) diff --git a/scripts/dev/conv_proto b/scripts/dev/conv_proto new file mode 100755 index 000000000000..fad9cfaa8384 --- /dev/null +++ b/scripts/dev/conv_proto @@ -0,0 +1,30 @@ +#! /bin/sh +# +# do some automatic conversion of prototypes +# + +if test "$1" = "" ; then + echo "usage: $0 list-of-files" + exit 1 +fi + +tmpfile=`mktemp -q /tmp/asd.XXXXXX` + +if test "$?" != "0" ; then + echo "$0: cannot create temporary file" + exit 1 +fi + +for file in ${1+"$@"} ; do + echo "working on $file" + cat $file | \ + sed -e \ + 's/void php3_\(.*\)(INTERNAL_FUNCTION_PARAMETERS)/PHP_FUNCTION(\1)/' \ + -e 's/^extern void /void /' \ + -e 's/^extern PHP_FUNCTION/PHP_FUNCTION/' > $tmpfile + cp $tmpfile $file +done + +rm -f $tmpfile + +exit 0 diff --git a/scripts/dev/conv_z_macros b/scripts/dev/conv_z_macros new file mode 100755 index 000000000000..ea45bc2ef98b --- /dev/null +++ b/scripts/dev/conv_z_macros @@ -0,0 +1,61 @@ +#! /bin/sh +# +# +----------------------------------------------------------------------+ +# | PHP Version 5 | +# +----------------------------------------------------------------------+ +# | Copyright (c) 1997-2007 The PHP Group | +# +----------------------------------------------------------------------+ +# | This source file is subject to version 3.01 of the PHP license, | +# | that is bundled with this package in the file LICENSE, and is | +# | available through the world-wide-web at the following url: | +# | http://www.php.net/license/3_01.txt | +# | If you did not receive a copy of the PHP license and are unable to | +# | obtain it through the world-wide-web, please send a note to | +# | license@php.net so we can mail you a copy immediately. | +# +----------------------------------------------------------------------+ +# | Author: Sascha Schumann | +# +----------------------------------------------------------------------+ +# +# $Id$ + +for i in $@; do + echo -n "Processing $i... " + sed \ + -e 's/(\*\([^()]\+\))->type/Z_TYPE_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->type/Z_TYPE_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.type/Z_TYPE(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.dval/Z_DVAL_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.dval/Z_DVAL_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.dval/Z_DVAL(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.lval/Z_LVAL_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.lval/Z_LVAL_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.lval/Z_LVAL(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.ht/Z_ARRVAL_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.ht/Z_ARRVAL_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.ht/Z_ARRVAL(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.str\.val/Z_STRVAL_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.val/Z_STRVAL_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.val/Z_STRVAL(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.str\.len/Z_STRLEN_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.len/Z_STRLEN_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.len/Z_STRLEN(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.obj\.properties/Z_OBJPROP_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.properties/Z_OBJPROP_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.properties/Z_OBJPROP(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.obj\.ce/Z_OBJCE_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.ce/Z_OBJCE_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.ce/Z_OBJCE(\1)/g' \ + -e 's/(\*\([^()]\+\))->value\.obj/Z_OBJ_PP(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj/Z_OBJ_P(\1)/g' \ + -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj/Z_OBJ(\1)/g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ + -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ + < $i > tmp && cp tmp $i + echo "DONE" +done + +rm -f tmp diff --git a/scripts/dev/extern_c.php b/scripts/dev/extern_c.php new file mode 100644 index 000000000000..72c7edcd3288 --- /dev/null +++ b/scripts/dev/extern_c.php @@ -0,0 +1,45 @@ + $line) { + if (ereg("^[[:space:]]*BEGIN_EXTERN_C", $line)) { +# echo "$file:".($nr+1)." $line"; + $flag = true; + } else if (ereg("^[[:space:]]*END_EXTERN_C", $line)) { +# echo "$file:".($nr+1)." $line"; + $flag = false; + } else if ( (ereg("^[[:space:]]*PHPAPI[[:space:]]*", $line)) + ||(ereg("^[[:space:]]*ZEND_API[[:space:]]*", $line))) { + if (strstr($line,"(")) { + if (!$flag) echo "$file:".($nr+1)." $line"; + } + } + } +} + +array_shift($_SERVER["argv"]); + +if (count($_SERVER["argv"])) { + foreach ($_SERVER["argv"] as $dir) { + scan_dir($dir); + } +} else { + scan_dir("."); +} +?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt.phar b/scripts/dev/generate-phpt.phar index c6268c0af381..d9e6ce4302d5 100644 Binary files a/scripts/dev/generate-phpt.phar and b/scripts/dev/generate-phpt.phar differ diff --git a/scripts/dev/generate-phpt/src/gtFunction.php b/scripts/dev/generate-phpt/src/gtFunction.php index 47f4bafcb34b..74058216eeab 100644 --- a/scripts/dev/generate-phpt/src/gtFunction.php +++ b/scripts/dev/generate-phpt/src/gtFunction.php @@ -19,7 +19,7 @@ public function __construct($functionName) { /** - * Get the names of function arguments and initialise mandatory and optional argument arrays + * Get the names of function argments and initialise mandatory and optional argument arrays * */ public function setArgumentNames() { diff --git a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php index 60c115a9c1af..cc5e19a5ae5f 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php +++ b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php @@ -104,7 +104,7 @@ public function fileOpening() { /** - * Add constructor argument initialisation to test case + * Add contructor argument initialisation to test case * */ public function constructorArgInit() { diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php index a62882a81a04..dfee4ea75ee7 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php @@ -23,7 +23,7 @@ public function setFunction(gtFunction $function) { /** - * constructs all possible variation testcases in array $this->variationTests + * Constucts all possible variation testcases in array $this->variationTests * */ public function constructAll() { diff --git a/scripts/phpize.in b/scripts/phpize.in index b86925e295c5..43cd8d30ffed 100644 --- a/scripts/phpize.in +++ b/scripts/phpize.in @@ -11,7 +11,7 @@ SED="@SED@" FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4" FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php" -CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ modules/ install-sh \ +CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \ mkinstalldirs missing config.nice config.sub config.guess configure configure.in \ aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \ config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \ diff --git a/server-tests-config.php b/server-tests-config.php index 0ddff28cb234..47df90f5e656 100755 --- a/server-tests-config.php +++ b/server-tests-config.php @@ -59,7 +59,7 @@ /* if true doesn't run tests, just outputs executable info */ 'TEST_CONTEXT_INFO' => false, -/* : or ; separated list of paths */ +/* : or ; seperated list of paths */ 'TEST_PATHS' => NULL /* additional configuration items that may be set to provide proxy support for testes: diff --git a/server-tests.php b/server-tests.php index 688fee485a00..ca39b198b8c8 100755 --- a/server-tests.php +++ b/server-tests.php @@ -413,7 +413,7 @@ class testHarness { public $xargs = array( #arg env var value default description 'c' => array('' ,'file' ,NULL ,'configuration file, see server-tests-config.php for example'), - 'd' => array('TEST_PATHS' ,'paths' ,NULL ,'colon separate path list'), + 'd' => array('TEST_PATHS' ,'paths' ,NULL ,'colon seperate path list'), 'e' => array('TEST_PHP_ERROR_STYLE','EMACS|MSVC' ,'EMACS' ,'editor error style'), 'h' => array('' ,'' ,NULL ,'this help'), 'i' => array('PHPRC' ,'path|file' ,NULL ,'ini file to use for tests (sets PHPRC)'), diff --git a/tests/basic/bug45986.phpt b/tests/basic/bug45986.phpt index 33c3f27eac81..1c30f10403dc 100644 --- a/tests/basic/bug45986.phpt +++ b/tests/basic/bug45986.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #45986 (wrong error message for a non existent file on rename) +Bug #45986 (wrong error message for a non existant file on rename) --CREDITS-- Sebastian Schürmann sebs@php.net diff --git a/tests/classes/array_conversion_keys.phpt b/tests/classes/array_conversion_keys.phpt deleted file mode 100644 index e3bd7e03313d..000000000000 --- a/tests/classes/array_conversion_keys.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Verifies the correct conversion of objects to arrays ---FILE-- - ---EXPECTF-- -array ( - '' . "\0" . 'foo' . "\0" . 'private' => 'private', - '' . "\0" . '*' . "\0" . 'protected' => 'protected', - 'public' => 'public', -) diff --git a/tests/classes/private_members_serialization.phpt b/tests/classes/private_members_serialization.phpt deleted file mode 100644 index c8dd3ab248a0..000000000000 --- a/tests/classes/private_members_serialization.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Verifies that it is possible to return private member names of parent classes in __sleep ---FILE-- - ---EXPECTF-- -string(114) "O:3:"bar":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}" diff --git a/tests/classes/static_properties_004.phpt b/tests/classes/static_properties_004.phpt index e98c605eb471..ce1d19dcc10c 100644 --- a/tests/classes/static_properties_004.phpt +++ b/tests/classes/static_properties_004.phpt @@ -6,7 +6,7 @@ class C { public static $p = 'original'; } class D extends C { } class E extends D { } -echo "\nInherited static properties refer to the same value across classes:\n"; +echo "\nInherited static properties refer to the same value accross classes:\n"; var_dump(C::$p, D::$p, E::$p); echo "\nChanging one changes all the others:\n"; @@ -20,7 +20,7 @@ var_dump(C::$p, D::$p, E::$p); ?> ==Done== --EXPECTF-- -Inherited static properties refer to the same value across classes: +Inherited static properties refer to the same value accross classes: %unicode|string%(8) "original" %unicode|string%(8) "original" %unicode|string%(8) "original" diff --git a/tests/output/bug60322.phpt b/tests/output/bug60322.phpt index f4d7139458af..c28ab4d61704 100644 --- a/tests/output/bug60322.phpt +++ b/tests/output/bug60322.phpt @@ -1,11 +1,8 @@ --TEST-- Bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist) ---INI-- -output_buffering=128 --FILE-- = 1400) { // disable annoying warnings. In addition, time_t defaults // to 64-bit. Ask for 32-bit. if (X64) { - ADD_FLAG('CFLAGS', ' /wd4996 '); + ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); } else { ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); } diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index 7b3b40633b98..b8bf45ea5779 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -134,7 +134,7 @@ if (VCVERS >= 1400) { // disable annoying warnings. In addition, time_t defaults // to 64-bit. Ask for 32-bit. if (X64) { - ADD_FLAG('CFLAGS', ' /wd4996 '); + ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); } else { ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); } diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index 123a75d78309..096d723a9c3c 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -1,17 +1,25 @@ bz2-1.0.6 +cclient-2007e cclient-2007f freetype-2.4.10 +icu-49.1.2 icu-50.1.2 +jpeglib-8 jpeglib-9 libcurl-7.30.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.5.1 libmpir-2.6.0 -libpng-1.5.14 +libpng-1.2.50 +libpng-1.5.13 +libpq-8.3.6 libpq-9.2.2 libssh2-1.4.2 +libtidy-20090325 libtidy-20090406 libxslt-1.1.27 +libxml-2.7.8 libxml-2.9.1 +openssl-0.9.8y openssl-1.0.1e diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php index 23d26c9c5358..947af9fbe3a1 100644 --- a/win32/build/mkdist.php +++ b/win32/build/mkdist.php @@ -238,6 +238,8 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ "php.ini-development" => "php.ini-development", "php.ini-production" => "php.ini-production", "win32/install.txt" => "install.txt", + "win32/pws-php5cgi.reg" => "pws-php5cgi.reg", + "win32/pws-php5isapi.reg" => "pws-php5isapi.reg", ); foreach ($text_files as $src => $dest) { diff --git a/win32/glob.c b/win32/glob.c index 1aeac78fda07..a197f3bbee99 100644 --- a/win32/glob.c +++ b/win32/glob.c @@ -689,7 +689,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, /* - * Extend the gl_pathv member of a glob_t structure to accommodate a new item, + * Extend the gl_pathv member of a glob_t structure to accomodate a new item, * add the new item, and update gl_pathc. * * This assumes the BSD realloc, which only copies the block when its size diff --git a/win32/install.txt b/win32/install.txt index b240ad2723e4..b1d4ee5148f5 100644 --- a/win32/install.txt +++ b/win32/install.txt @@ -9,7 +9,7 @@ Installing PHP Windows Installer Manual Installation Steps ActiveScript - Microsoft IIS + Microsoft IIS / PWS Apache 1.3.x on Microsoft Windows Apache 2.0.x on Microsoft Windows Sun, iPlanet and Netscape servers on Microsoft Windows @@ -211,7 +211,7 @@ Windows Installer (PHP 5.1.0 and earlier) The Windows PHP installer is available from the downloads page at http://www.php.net/downloads.php. This installs the CGI version of PHP - and for IIS and Xitami, it configures the web server as well. The + and for IIS, PWS, and Xitami, it configures the web server as well. The installer does not include any extra external PHP extensions (php_*.dll) as you'll only find those in the Windows Zip Package and PECL downloads. @@ -355,7 +355,7 @@ c:\php packages have the server modules in the sapi folder, PHP 5 distributions have no such directory and instead they're in the PHP folder root. The supporting DLLs for the PHP 5 extensions are also not - in a separate directory. + in a seperate directory. Note: In PHP 4, you should move all files located in the dll and sapi folders to the main folder (e.g. C:\php). @@ -433,7 +433,7 @@ c:\php follow the next step. Set the doc_root to point to your web servers document_root. For example: -doc_root = c:\inetpub\wwwroot // for IIS +doc_root = c:\inetpub\wwwroot // for IIS/PWS doc_root = c:\apache\htdocs // for Apache @@ -442,6 +442,11 @@ doc_root = c:\apache\htdocs // for Apache what is already built in. Note that on a new installation it is advisable to first get PHP working and tested without any extensions before enabling them in php.ini. + * On PWS and IIS, you can set the browscap configuration setting to + point to: c:\windows\system\inetsrv\browscap.ini on Windows 9x/Me, + c:\winnt\system32\inetsrv\browscap.ini on NT/2000, and + c:\windows\system32\inetsrv\browscap.ini on XP. For an up-to-date + browscap.ini, read the following FAQ. PHP is now setup on your system. The next step is to choose a web server, and enable it to run PHP. Choose a web server from the table of @@ -494,7 +499,7 @@ ActiveScript folder, if you wish to load extensions, etc. __________________________________________________________________ -Microsoft IIS +Microsoft IIS / PWS This section contains notes and hints specific to IIS (Microsoft Internet Information Server). @@ -506,7 +511,7 @@ Microsoft IIS yourself from those attacks. __________________________________________________________________ -General considerations for all installations of PHP with IIS +General considerations for all installations of PHP with IIS or PWS * First, read the Manual Installation Instructions. Do not skip this step as it provides crucial information for installing PHP on @@ -538,7 +543,7 @@ General considerations for all installations of PHP with IIS downloaded in the "Collection of PECL modules" package. Files such as php_zip.dll and php_ssh2.dll. Download PHP files here. * When defining the executable, the 'check that file exists' box may - also be checked. For a small performance penalty, the IIS + also be checked. For a small performance penalty, the IIS (or PWS) will check that the script file exists and sort out authentication before firing up PHP. This means that the web server will provide sensible 404 style error messages instead of CGI errors complaining @@ -1574,7 +1579,7 @@ cgi error: 11. Windows: I've followed all the instructions, but still can't get PHP and IIS to work together! - 12. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get + 12. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the following error: Security Alert! PHP CGI cannot be accessed directly.. @@ -1819,7 +1824,7 @@ cgi error: tell it that PHP is a script engine. Also, you will want to read this faq. - 12. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get + 12. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the following error: Security Alert! PHP CGI cannot be accessed directly.. diff --git a/win32/pws-php5cgi.reg b/win32/pws-php5cgi.reg new file mode 100644 index 000000000000..46edc7738649 --- /dev/null +++ b/win32/pws-php5cgi.reg @@ -0,0 +1,6 @@ +REGEDIT4 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] +".php"="[PUT PATH HERE]\\php.exe" + + diff --git a/win32/pws-php5isapi.reg b/win32/pws-php5isapi.reg new file mode 100644 index 000000000000..393604d28dee --- /dev/null +++ b/win32/pws-php5isapi.reg @@ -0,0 +1,5 @@ +REGEDIT4 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] +".php"="[PUT PATH HERE]\\php5isapi.dll" + diff --git a/win32/select.c b/win32/select.c index 92af4be7b818..d77ef3de00e1 100644 --- a/win32/select.c +++ b/win32/select.c @@ -36,7 +36,7 @@ * */ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv) { - ULONGLONG ms_total, limit; + DWORD ms_total, limit; HANDLE handles[MAXIMUM_WAIT_OBJECTS]; int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS]; int n_handles = 0, i; @@ -97,7 +97,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru FD_ZERO(&awrite); FD_ZERO(&aexcept); - limit = GetTickCount64() + ms_total; + limit = GetTickCount() + ms_total; do { retcode = 0; @@ -149,7 +149,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru } } } - } while (retcode == 0 && (ms_total == INFINITE || GetTickCount64() < limit)); + } while (retcode == 0 && (ms_total == INFINITE || GetTickCount() < limit)); if (rfds) { *rfds = aread; diff --git a/win32/sendmail.c b/win32/sendmail.c index 93e68f4b1a42..4b09697e95df 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -119,8 +119,8 @@ static char *ErrorMessages[] = {"Error while trimming mail header with PCRE, please file a bug report at http://bugs.php.net/"} /* 21 */ }; -/* This pattern converts all single occurrences of \n (Unix) - * withour a leading \r to \r\n and all occurrences of \r (Mac) +/* This pattern converts all single occurences of \n (Unix) + * withour a leading \r to \r\n and all occurences of \r (Mac) * without a trailing \n to \r\n * Thx to Nibbler from ircnet/#linuxger */ @@ -130,7 +130,7 @@ static char *ErrorMessages[] = /* This pattern removes \r\n from the start of the string, * \r\n from the end of the string and also makes sure every line * is only wrapped with a single \r\n (thus reduces multiple - * occurrences of \r\n between lines to a single \r\n) */ + * occurences of \r\n between lines to a single \r\n) */ #define PHP_WIN32_MAIL_RMVDBL_PATTERN "/^\r\n|(\r\n)+$/m" #define PHP_WIN32_MAIL_RMVDBL_REPLACE "" @@ -142,11 +142,11 @@ static char *ErrorMessages[] = #define PHP_WIN32_MAIL_DOT_REPLACE "\n.." /* This function is meant to unify the headers passed to to mail() - * This means, use PCRE to transform single occurrences of \n or \r in \r\n - * As a second step we also eleminate all \r\n occurrences which are: + * This means, use PCRE to transform single occurences of \n or \r in \r\n + * As a second step we also eleminate all \r\n occurences which are: * 1) At the start of the header * 2) At the end of the header - * 3) Two or more occurrences in the header are removed so only one is left + * 3) Two or more occurences in the header are removed so only one is left * * Returns NULL on error, or the new char* buffer on success. * You have to take care and efree() the buffer on your own. @@ -409,7 +409,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char snprintf(Buffer, sizeof(Buffer), "HELO %s\r\n", LocalHost); - /* in the beginning of the dialog */ + /* in the beggining of the dialog */ /* attempt reconnect if the first Post fail */ if ((res = Post(Buffer)) != SUCCESS) { MailConnect(); diff --git a/win32/signal.h b/win32/signal.h index df60dfb728f4..de43f98e8075 100644 --- a/win32/signal.h +++ b/win32/signal.h @@ -2,7 +2,7 @@ ** Change here: if you plan to use your own version of ** the original "#include " produces an infinite reinclusion ** of this file, instead of including the standard include-file. -** Under MS Visual Studio, there are occurrences in the source where +** Under MS Visual Studio, there are occurences in the source where ** gets included throughout the PHP sources, and this should ** include THIS file, not the standard one which does not have the ** additional signals defined below. diff --git a/win32/time.h b/win32/time.h index d5d86eb1ed78..f841a2b601fe 100644 --- a/win32/time.h +++ b/win32/time.h @@ -50,6 +50,4 @@ PHPAPI extern int setitimer(int which, const struct itimerval *value, PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp ); -PHPAPI int usleep(unsigned int useconds); - #endif