diff --git a/.gdbinit b/.gdbinit index 7782138e953..1c399c102ca 100644 --- a/.gdbinit +++ b/.gdbinit @@ -101,7 +101,7 @@ define dump_bt ____print_str $zvalue->value.str->val $zvalue->value.str->len end if $type == 7 - printf "array(%d)[%p]", $zvalue->value.arr->ht->nNumOfElements, $zvalue + printf "array(%d)[%p]", $zvalue->value.arr->nNumOfElements, $zvalue end if $type == 8 printf "object[%p]", $zvalue @@ -152,8 +152,8 @@ define ____printzv_contents set $type = $zvalue->u1.v.type # 15 == IS_INDIRECT - if $type >= 5 && $type != 15 - printf "(refcount=%d) ", $zvalue->value.counted->refcount + if $type > 5 && $type != 15 + printf "(refcount=%d) ", $zvalue->value.counted->gc.refcount end if $type == 0 @@ -181,7 +181,7 @@ define ____printzv_contents printf "array: " if ! $arg1 set $ind = $ind + 1 - ____print_ht $zvalue->value.arr + ____print_ht $zvalue->value.arr 1 set $ind = $ind - 1 set $i = $ind while $i > 0 diff --git a/.gitignore b/.gitignore index 5f267911a0b..a00615f9667 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,9 @@ *.tar.gz *.tar.bz2 *.tar.xz +*.tar.gz.asc +*.tar.bz2.asc +*.tar.xz.asc .FBCIndex .FBCLockFolder .deps @@ -242,10 +245,6 @@ ext/reflection/spl.chm ext/simplexml/examples/security.new.xml ext/spl/examples/.htaccess ext/spl/examples/*.phps -ext/sqlite/weztest.sqlite -ext/sqlite/libsqlite/src/sqlite.h -ext/sqlite/libsqlite/src/parse.out -ext/sqlite/libsqlite/src/libsqlite.dsw ext/sqlite3/tests/phpsql* ext/sqlite3/tests/*.db ext/sqlite3/tests/*.tmp diff --git a/.travis.yml b/.travis.yml index 929c769d21e..527ae8db325 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,29 @@ language: c - -branches: - except: - - phpng +sudo: false +addons: + apt: + packages: + - locales + - language-pack-de + - re2c + - libgmp-dev + - libicu-dev + - libmcrypt-dev + - libtidy-dev + - libenchant-dev + - libaspell-dev + - libpspell-dev + - librecode-dev + - libsasl2-dev + - libxpm-dev + - libt1-dev notifications: email: on_failure: change irc: + template: + - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} - Change view : %{compare_url} - Build details : %{build_url}" channels: - "irc.efnet.org#php.pecl" on_success: change @@ -29,13 +45,6 @@ env: - ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0 - ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 -before_install: - - sudo apt-get update -qq - - sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev - - sudo cp ./travis/de /var/lib/locales/supported.d/de - - sudo dpkg-reconfigure locales - - ./travis/install.sh - before_script: # Compile PHP - ./travis/compile.sh @@ -45,9 +54,7 @@ before_script: - . ./travis/ext/pdo_mysql/setup.sh - . ./travis/ext/pgsql/setup.sh - . ./travis/ext/pdo_pgsql/setup.sh - - . ./travis/ext/imap/setup.sh # Run PHPs run-tests.php script: - - ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120 - - ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg + - ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 1 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120 diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 0cfcff18f68..5cf70c92b5f 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -165,7 +165,7 @@ User Functions/Methods Naming Conventions 'foobar' 'foo_bar' -Internal Function Naming Convensions +Internal Function Naming Conventions ---------------------- 1. Functions that are part of the external API should be named @@ -178,7 +178,7 @@ Internal Function Naming Convensions Unexposed module function should be static and should not be defined in 'php_modulename.h'. - static int php_session_destroy(TSRMLS_D) + static int php_session_destroy() 2. Main module source file must be named 'modulename.c'. diff --git a/INSTALL b/INSTALL index a37d9a2c8d0..958035fd60d 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,6 @@ Installing PHP * General Installation Considerations * Installation on Unix systems - + Apache 1.3.x on Unix systems + Apache 2.x on Unix systems + Lighttpd 1.4 on Unix systems + Sun, iPlanet and Netscape servers on Sun Solaris @@ -103,7 +102,6 @@ Installation on Unix systems Table of Contents - * Apache 1.3.x on Unix systems * Apache 2.x on Unix systems * Lighttpd 1.4 on Unix systems * Sun, iPlanet and Netscape servers on Sun Solaris @@ -163,208 +161,6 @@ Table of Contents you can't figure out why, see the Problems section. __________________________________________________________________ -Apache 1.3.x on Unix systems - - This section contains notes and hints specific to Apache installs of - PHP on Unix platforms. We also have instructions and notes for Apache 2 - on a separate page. - - You can select arguments to add to the configure on line 10 below from - the list of core configure options and from extension specific options - described at the respective places in the manual. The version numbers - have been omitted here, to ensure the instructions are not incorrect. - You will need to replace the 'xxx' here with the correct values from - your files. - - Example #1 Installation Instructions (Apache Shared Module Version) for - PHP -1. gunzip apache_xxx.tar.gz -2. tar -xvf apache_xxx.tar -3. gunzip php-xxx.tar.gz -4. tar -xvf php-xxx.tar -5. cd apache_xxx -6. ./configure --prefix=/www --enable-module=so -7. make -8. make install -9. cd ../php-xxx - -10. Now, configure your PHP. This is where you customize your PHP - with various options, like which extensions will be enabled. Do a - ./configure --help for a list of available options. In our example - we'll do a simple configure with Apache 1 and MySQL support. Your - path to apxs may differ from our example. - - ./configure --with-mysql --with-apxs=/www/bin/apxs - -11. make -12. make install - - If you decide to change your configure options after installation, - you only need to repeat the last three steps. You only need to - restart apache for the new module to take effect. A recompile of - Apache is not needed. - - Note that unless told otherwise, 'make install' will also install PEAR, - various PHP tools such as phpize, install the PHP CLI, and more. - -13. Setup your php.ini file: - - cp php.ini-development /usr/local/lib/php.ini - - You may edit your .ini file to set PHP options. If you prefer your - php.ini in another location, use --with-config-file-path=/some/path in - step 10. - - If you instead choose php.ini-production, be certain to read the list - of changes within, as they affect how PHP behaves. - -14. Edit your httpd.conf to load the PHP module. The path on the right hand - side of the LoadModule statement must point to the path of the PHP - module on your system. The make install from above may have already - added this for you, but be sure to check. - - LoadModule php7_module libexec/libphp7.so - -15. And in the AddModule section of httpd.conf, somewhere under the - ClearModuleList, add this: - - AddModule mod_php7.c - -16. Tell Apache to parse certain extensions as PHP. For example, - let's have Apache parse the .php extension as PHP. You could - have any extension(s) parse as PHP by simply adding more, with - each separated by a space. We'll add .phtml to demonstrate. - - AddType application/x-httpd-php .php .phtml - - It's also common to setup the .phps extension to show highlighted PHP - source, this can be done with: - - AddType application/x-httpd-php-source .phps - -17. Use your normal procedure for starting the Apache server. (You must - stop and restart the server, not just cause the server to reload by - using a HUP or USR1 signal.) - - Alternatively, to install PHP as a static object: - - Example #2 Installation Instructions (Static Module Installation for - Apache) for PHP -1. gunzip -c apache_1.3.x.tar.gz | tar xf - -2. cd apache_1.3.x -3. ./configure -4. cd .. - -5. gunzip -c php-5.x.y.tar.gz | tar xf - -6. cd php-5.x.y -7. ./configure --with-mysql --with-apache=../apache_1.3.x -8. make -9. make install - -10. cd ../apache_1.3.x - -11. ./configure --prefix=/www --activate-module=src/modules/php7/libphp7.a - (The above line is correct! Yes, we know libphp7.a does not exist at this - stage. It isn't supposed to. It will be created.) - -12. make - (you should now have an httpd binary which you can copy to your Apache bin d -ir if - it is your first install then you need to "make install" as well) - -13. cd ../php-5.x.y -14. cp php.ini-development /usr/local/lib/php.ini - -15. You can edit /usr/local/lib/php.ini file to set PHP options. - Edit your httpd.conf or srm.conf file and add: - AddType application/x-httpd-php .php - - Depending on your Apache install and Unix variant, there are many - possible ways to stop and restart the server. Below are some typical - lines used in restarting the server, for different apache/unix - installations. You should replace /path/to/ with the path to these - applications on your systems. - - Example #3 Example commands for restarting Apache -1. Several Linux and SysV variants: -/etc/rc.d/init.d/httpd restart - -2. Using apachectl scripts: -/path/to/apachectl stop -/path/to/apachectl start - -3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl: -/path/to/httpsdctl stop -/path/to/httpsdctl start - -4. Using mod_ssl, or another SSL server, you may want to manually -stop and start: -/path/to/apachectl stop -/path/to/apachectl startssl - - The locations of the apachectl and http(s)dctl binaries often vary. If - your system has locate or whereis or which commands, these can assist - you in finding your server control programs. - - Different examples of compiling PHP for apache are as follows: -./configure --with-apxs --with-pgsql - - This will create a libphp7.so shared library that is loaded into Apache - using a LoadModule line in Apache's httpd.conf file. The PostgreSQL - support is embedded into this library. - -./configure --with-apxs --with-pgsql=shared - - This will create a libphp7.so shared library for Apache, but it will - also create a pgsql.so shared library that is loaded into PHP either by - using the extension directive in php.ini file or by loading it - explicitly in a script using the dl() function. - -./configure --with-apache=/path/to/apache_source --with-pgsql - - This will create a libmodphp7.a library, a mod_php7.c and some - accompanying files and copy this into the src/modules/php7 directory in - the Apache source tree. Then you compile Apache using - --activate-module=src/modules/php7/libphp7.a and the Apache build - system will create libphp7.a and link it statically into the httpd - binary. The PostgreSQL support is included directly into this httpd - binary, so the final result here is a single httpd binary that includes - all of Apache and all of PHP. - -./configure --with-apache=/path/to/apache_source --with-pgsql=shared - - Same as before, except instead of including PostgreSQL support directly - into the final httpd you will get a pgsql.so shared library that you - can load into PHP from either the php.ini file or directly using dl(). - - When choosing to build PHP in different ways, you should consider the - advantages and drawbacks of each method. Building as a shared object - will mean that you can compile apache separately, and don't have to - recompile everything as you add to, or change, PHP. Building PHP into - apache (static method) means that PHP will load and run faster. For - more information, see the Apache » web page on DSO support. - - Note: - - Apache's default httpd.conf currently ships with a section that - looks like this: - -User nobody -Group "#-1" - - Unless you change that to "Group nogroup" or something like that - ("Group daemon" is also very common) PHP will not be able to open - files. - - Note: - - Make sure you specify the installed version of apxs when using - --with-apxs=/path/to/apxs . You must NOT use the apxs version that - is in the apache sources but the one that is actually installed on - your system. - __________________________________________________________________ - __________________________________________________________________ - Apache 2.x on Unix systems This section contains notes and hints specific to Apache 2.x installs diff --git a/LICENSE b/LICENSE index c881c92454b..e0bc44cac13 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -------------------------------------------------------------------- The PHP License, version 3.01 -Copyright (c) 1999 - 2015 The PHP Group. All rights reserved. +Copyright (c) 1999 - 2016 The PHP Group. All rights reserved. -------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without diff --git a/Makefile.gcov b/Makefile.gcov index 8d30f34ae8c..e7c9c7054a8 100644 --- a/Makefile.gcov +++ b/Makefile.gcov @@ -57,7 +57,7 @@ php_lcov.info: lcov-test cp $$x.bbg lcov_data/$$y.bbg ; \ fi; \ done; \ - for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \ + for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \ if test -d lcov_data/$$dir; then \ rm -rf lcov_data/$$dir ; \ fi; \ diff --git a/Makefile.global b/Makefile.global index c571f3455df..9b29d5112b3 100644 --- a/Makefile.global +++ b/Makefile.global @@ -53,7 +53,7 @@ install-headers: paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ done; \ $(mkinstalldirs) $$paths && \ - echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ + echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ for i in `echo $(INSTALL_HEADERS)`; do \ if test "$(PHP_PECL_EXTENSION)"; then \ src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \ diff --git a/NEWS b/NEWS index 73c5afcaf37..e67720a5a8c 100644 --- a/NEWS +++ b/NEWS @@ -1,387 +1,122 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -09 Jul 2015, PHP 7.0.0 Beta 1 +?? ??? 2016, PHP 7.1.0alpha2 - Core: - . Fixed bug #69521 (Segfault in gc_collect_cycles()). - (arjen at react dot com, Laruence) - . Improved zend_string API (Francois Laupretre) - . Fixed bug #69955 (Segfault when trying to combine [] and assign-op on - ArrayAccess object). (Laruence) - . Fixed bug #69957 (Different ways of handling div/mod/intdiv). (Bob) + . Fixed bug #72373 (TypeError after Generator function w/declared return type + finishes). (Nikita) -- CLI server: - . Fixed bug #69655 (php -S changes MKCALENDAR request method to MKCOL). (cmb) - . Fixed bug #64878 (304 responses return Content-Type header). (cmb) -- COM: - . Fixed bug #69939 (Casting object to bool returns false). (Kalle) - -- JSON - . Fixed bug #62010 (json_decode produces invalid byte-sequences). - (Jakub Zelenka) - -- OCI8: - . Corrected oci8 hash destructors to prevent segfaults, and a few other fixes. - (Cameron Porter) - -- ODBC: - . Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined - columns). (cmb) - -- OpenSSL: - . Fixed bug #69882 (OpenSSL error "key values mismatch" after - openssl_pkcs12_read with extra cert) (Tomasz Sawicki) - -- PCRE: - . Fixed bug #53823 (preg_replace: * qualifier on unicode replace garbles the - string). (cmb) - -- Session: - . Fixed bug #69952 (Data integrity issues accessing superglobals by - reference). (Bob) - -- Standard: - . Fixed bug #69983 (get_browser fails with user agent of null). - (Kalle, cmb, Laruence) - . Fixed bug #69976 (Unable to parse "all" urls with colon char). (cmb) - . Fixed bug #69768 (escapeshell*() doesn't cater to !). (cmb) - -25 Jun 2015, PHP 7.0.0 Alpha 2 +09 Jun 2016, PHP 7.1.0alpha1 - Core: - . Fixed bug #69872 (uninitialised value in strtr with array). (Laruence) - . Fixed bug #69868 (Invalid read of size 1 in zend_compile_short_circuiting). - (Laruence) - . Fixed bug #69849 (Broken output of apache_request_headers). (Kalle) - . Fixed bug #69840 (iconv_substr() doesn't work with UTF-16BE). (Kalle) - . Fixed bug #69823 (PHP 7.0.0alpha1 segmentation fault when exactly 33 - extensions are loaded). (Laruence) - . Fixed bug #69805 (null ptr deref and seg fault in zend_resolve_class_name). - (Laruence) - . Fixed bug #69802 (Reflection on Closure::__invoke borks type hint class - name). (Dmitry) - . Fixed bug #69761 (Serialization of anonymous classes should be prevented). - (Laruence) - . Fixed bug #69551 (parse_ini_file() and parse_ini_string() segmentation - fault). (Christoph M. Becker) - . Fixed bug #69781 (phpinfo() reports Professional Editions of Windows - 7/8/8.1/10 as "Business"). (Christian Wenz) - . Fixed bug #69835 (phpinfo() does not report many Windows SKUs). - (Christian Wenz) - . Fixed bug #69889 (Null coalesce operator doesn't work for string offsets). + . Added nullable types. (Levi, Dmitry) + . Added DFA optimization framework based on e-SSA form. (Dmitry, Nikita) + . Added specialized opcode handlers (e.g. ZEND_ADD_LONG_NO_OVERFLOW). + (Dmitry) + . Change statement and fcall extension handlers to accept frame. (Joe) + . Implemented safe execution timeout handling, that prevents random crashes + after "Maximum execution time exceeded" error. (Dmitry) + . Fixed bug #53432 (Assignment via string index access on an empty string + converts to array). (Nikita) + . Fixed bug #62210 (Exceptions can leak temporary variables). (Dmitry, Bob) + . Fixed bug #62814 (It is possible to stiffen child class members visibility). (Nikita) - . Fixed bug #69891 (Unexpected array comparison result). (Nikita) - . Fixed bug #69892 (Different arrays compare indentical due to integer key - truncation). (Nikita) - . Fixed bug #69893 (Strict comparison between integer and empty string keys - crashes). (Nikita) - -- DOM: - . Fixed bug #69846 (Segmenation fault (access violation) when iterating over - DOMNodeList). (Anatol Belski) - -- GD: - . Fixed bug #61221 (imagegammacorrect function loses alpha channel). (cmb) - -- mysqlnd: - . Fixed Bug #69796 (mysqli_stmt::fetch doesn't assign null values to - bound variables). (Laruence) - -- Curl: - . Fixed bug #69831 (Segmentation fault in curl_getinfo). (im dot denisenko at - yahoo dot com) - -- Opcache: - . Removed opcache.load_comments configuration directive. Now doc comments - loading costs nothing and always enabled. (Dmitry) - . Fixed bug #69838 (Wrong size calculation for function table). (Anatol) - -- PCRE: - . Fixed bug #69864 (Segfault in preg_replace_callback) (cmb, ab) - -- PDO_pgsql: - . Fixed bug #69752 (PDOStatement::execute() leaks memory with DML - Statements when closeCuror() is u). (Philip Hofstetter) - -- SPL - . Fixed bug #69845 (ArrayObject with ARRAY_AS_PROPS broken). (Dmitry) - -- SQLite3 - . Fixed bug #69897 (segfault when manually constructing SQLite3Result). - (Kalle) - -- Standard - . Fixed bug #62922 (Truncating entire string should result in string). + . Fixed bug #69989 (Generators don't participate in cycle GC). (Nikita) + . Fixed bug #70228 (Memleak if return in finally block). (Dmitry) + . Fixed bug #71266 (Missing separation of properties HT in foreach etc). + (Dmitry) + . Fixed bug #71604 (Aborted Generators continue after nested finally). (Nikita) + . Fixed bug #71572 (String offset assignment from an empty string inserts + null byte). (Francois) + . Fixed bug #71897 (ASCII 0x7F Delete control character permitted in + identifiers). (Andrea) + . Fixed bug #72188 (Nested try/finally blocks losing return value). (Dmitry) + . Fixed bug #72213 (Finally leaks on nested exceptions). (Dmitry, Nikita) + . Implemented the RFC `Support Class Constant Visibility`. (Sean DuBois, + Reeze Xia, Dmitry) + . Added void return type. (Andrea) + . Added support for negative string offsets in string offset syntax and + various string functions. (Francois) + . Added a form of the list() construct where keys can be specified. (Andrea) + . Number operators taking numeric strings now emit E_NOTICEs or E_WARNINGs + when given malformed numeric strings. (Andrea) + . (int), intval() where $base is 10 or unspecified, settype(), decbin(), + decoct(), dechex(), integer operators and other conversions now always + respect scientific notation in numeric strings. (Andrea) + . Implemented the RFC `Catching multiple exception types`. (Bronislaw Bialek, + Pierrick) + . Raise a compile-time warning on octal escape sequence overflow. (Sara) + . Added [] = as alternative construct to list() =. (Bob) + . Implemented logging to syslog with dynamic error levels. (Jani Ollikainen) + . Fixed bug #47517 (php-cgi.exe missing UAC manifest). + (maxdax15801 at users noreply github com) -11 Jun 2015, PHP 7.0.0 Alpha 1 +- Apache2handler: + . Enable per-module logging in Apache 2.4+. (Martin Vobruba) -- Core: - . Fixed bug #69767 (Default parameter value with wrong type segfaults). - (cmb, Laruence) - . Fixed bug #69756 (Fatal error: Nesting level too deep - recursive dependency - ? with ===). (Dmitry, Laruence) - . Fixed bug #69758 (Item added to array not being removed by array_pop/shift - ). (Laruence) - . Fixed bug #68475 (Add support for $callable() sytnax with 'Class::method'). - (Julien, Aaron Piotrowski) - . Fixed bug #69485 (Double free on zend_list_dtor). (Laruence) - . Fixed bug #69427 (Segfault on magic method __call of private method in - superclass). (Laruence) - . Improved __call() and __callStatic() magic method handling. Now they are - called in a stackless way using ZEND_CALL_TRAMPOLINE opcode, without - additional stack frame. (Laruence, Dmitry) - . Optimized strings concatenation. (Dmitry, Laruence) - . Fixed weird operators behavior. Division by zero now emits warning and - returns +/-INF, modulo by zero and intdid() throws an exception, shifts - by negative offset throw exceptions. Compile-time evaluation of division - by zero is disabled. (Dmitry, Andrea, Nikita) - . Fixed bug #69371 (Hash table collision leads to inaccessible array keys). - (Laruence) - . Fixed bug #68933 (Invalid read of size 8 in zend_std_read_property). - (Laruence, arjen at react dot com) - . Fixed bug #68252 (segfault in Zend/zend_hash.c in function - _zend_hash_del_el). (Laruence) - . Fixed bug #65598 (Closure executed via static autoload incorrectly marked as - static). (Nikita) - . Fixed bug #66811 (Cannot access static::class in lambda, writen outside of a - class). (Nikita) - . Fixed bug #69568 (call a private function in closure failed). (Nikita) - . Added PHP_INT_MIN constant. (Andrea) - . Added Closure::call() method. (Andrea) - . Fixed bug #67959 (Segfault when calling phpversion('spl')). (Florian) - . Implemented the RFC `Catchable "Call to a member function bar() on a - non-object"`. (Timm) - . Added options parameter for unserialize allowing to specify acceptable - classes (https://wiki.php.net/rfc/secure_unserialize). (Stas) - . Fixed bug #63734 (Garbage collector can free zvals that are still - referenced). (Dmitry) - . Removed ZEND_ACC_FINAL_CLASS, promoting ZEND_ACC_FINAL as final class - modifier. (Guilherme Blanco) - . is_long() & is_integer() is now an alias of is_int(). (Kalle) - . Implemented FR #55467 (phpinfo: PHP Variables with $ and single quotes). (Kalle) - . Added ?? operator. (Andrea) - . Added <=> operator. (Andrea) - . Added \u{xxxxx} Unicode Codepoint Escape Syntax. (Andrea) - . Fixed oversight where define() did not support arrays yet const syntax did. - (Andrea, Dmitry) - . Use "integer" and "float" instead of "long" and "double" in ZPP, type hint - and conversion error messages. (Andrea) - . Implemented FR #55428 (E_RECOVERABLE_ERROR when output buffering in output - buffering handler). (Kalle) - . Removed scoped calls of non-static methods from an incompatible $this - context. (Nikita) - . Removed support for #-style comments in ini files. (Nikita) - . Removed support for assigning the result of new by reference. (Nikita) - . Invalid octal literals in source code now produce compile errors, fixes - PHPSadness #31. (Andrea) - . Removed dl() function on fpm-fcgi. (Nikita) - . Removed support for hexadecimal numeric strings. (Nikita) - . Removed obsolete extensions and SAPIs. See the full list in UPGRADING. (Anatol) - . Added NULL byte protection to exec, system and passthru. (Yasuo) - . Added error_clear_last() function. (Reeze Xia) - . Fixed bug #68797 (Number 2.2250738585072012e-308 converted incorrectly). - (Anatol) - . Improved zend_qsort(using hybrid sorting algo) for better performance, - and also renamed zend_qsort to zend_sort. (Laruence) - . Added stable sorting algo zend_insert_sort. (Laruence) - . Implemented the RFC `Scalar Type Decalarations v0.5`. (Anthony) - . Implemented the RFC `Group Use Declarations`. (Marcio) - . Implemented the RFC `Continue Output Buffering`. (Mike) - . Implemented the RFC `Constructor behaviour of internal classes`. (Dan, Dmitry) - . Implemented the RFC `Fix "foreach" behavior`. (Dmitry) - . Implemented the RFC `Generator Delegation`. (Bob) - . Implemented the RFC `Anonymous Class Support`. (Joe, Nikita, Dmitry) - . Implemented the RFC `Context Sensitive Lexer`. (Marcio Almada) - . Fixed bug #69511 (Off-by-one buffer overflow in php_sys_readlink). - (Jan Starke, Anatol) - -- CLI server: - . Refactor MIME type handling to use a hash table instead of linear search. - (Adam) - . Update the MIME type list from the one shipped by Apache HTTPD. (Adam) - . Added support for SEARCH WebDav method. (Mats Lindh) - -- Curl: - . Fixed bug #68937 (Segfault in curl_multi_exec). (Laruence) - . Removed support for unsafe file uploads. (Nikita) - -- Date: - . Fixed day_of_week function as it could sometimes return negative values - internally. (Derick) - . Removed $is_dst parameter from mktime() and gmmktime(). (Nikita) - . Removed date.timezone warning - (https://wiki.php.net/rfc/date.timezone_warning_removal). (Bob) - . Added "v" DateTime format modifier to get the 3-digit version of fraction - of seconds. (Mariano Iglesias) - . Implemented FR #69089: Added DateTime::RFC3339_EXTENDED to output in - RFC3339 Extended format which includes fraction of seconds (Mariano - Iglesias) - -- DBA: - . Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike) - . Fixed bug #68711 (useless comparisons). (bugreports at internot dot info) - -- DOM: - . Made DOMNode::textContent writeable. (Tjerk) - -- GD: - . Made fontFetch's path parser thread-safe. (Sara) - . Removed T1Lib support. (Kalle) - -- Fileinfo: - . Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB) - -- Filter: - . New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas) - -- FPM: - . Fixed bug #68945 (Unknown admin values segfault pools). (Laruence) - . Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright) - . Implement request #67106 (Split main fpm config). (Elan Ruusamäe, Remi) +- CLI Server: + . Fixed bug #71276 (Built-in webserver does not send Date header). + (see at seos fr) - FTP: - . Fixed bug #69082 (FTPS support on Windows). (Anatol) + . Implemented FR #55651 (Option to ignore the returned FTP PASV address). + (abrender at elitehosts dot com) - Intl: - . Removed deprecated aliases datefmt_set_timezone_id() and - IntlDateFormatter::setTimeZoneID(). (Nikita) + . Added IntlTimeZone::getWindowsID() and + IntlTimeZone::getIDForWindowsID(). (Sara) + . Fixed bug #69374 (IntlDateFormatter formatObject returns wrong utf8 value). + (lenhatanh86 at gmail com) + . Fixed bug #69398 (IntlDateFormatter formatObject returns wrong value when + time style is NONE). (lenhatanh86 at gmail com) -- JSON - . Replace non-free JSON parser with a parser from Jsond extension, fixes #63520 - (JSON extension includes a problematic license statement). (Jakub Zelenka) - . Fixed bug #68938 (json_decode() decodes empty string without error). - (jeremy at bat-country dot us) - . Fixed bug #68546 (json_decode() Fatal error: Cannot access property - started with '\0'). (Jakub Zelenka) +- Hash: + . Added SHA3 fixed mode algorithms (224, 256, 384, and 512 bit). (Sara) + . Added SHA512/256 and SHA512/224 algorithms. (Sara) -- LDAP - . Fixed bug #47222 (Implement LDAP_OPT_DIAGNOSTIC_MESSAGE). (Andreas Heigl) +- JSON: + . Exported JSON parser API including json_parser_method that can be used + for implementing custom logic when parsing JSON. (Jakub Zelenka) + . Escaped U+2028 and U+2029 when JSON_UNESCAPED_UNICODE is supplied as + json_encode options and added JSON_UNESCAPED_LINE_TERMINATORS to restore + the previous behaviour. (Eddie Kohler) -- LiteSpeed: - . Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang) +- PDO_Firebird: + . Fixed bug #60052 (Integer returned as a 64bit integer on X86_64). (Mariuz) -- libxml: - . Fixed handling of big lines in error messages with libxml >= 2.9.0. - (Christoph M. Becker) +- Pgsql: + . Implemented FR #31021 (pg_last_notice() is needed to get all notice + messages). (Yasuo) + . Implemented FR #48532 (Allow pg_fetch_all() to index numerically). (Yasuo) -- Mcrypt: - . Fixed possible read after end of buffer and use after free. (Dmitry) - . Removed mcrypt_generic_end() alias. (Nikita) - . Removed mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb(), mcrypt_ofb(). (Nikita) - -- Opcache: - . Fixed bug #69688 (segfault with eval and opcache fast shutdown). - (Laruence) - . Added experimental (disabled by default) file based opcode cache. - (Dmitry, Laruence, Anatol) - . Fixed bug with try blocks being removed when extended_info opcode - generation is turned on. (Laruence) - . Fixed bug #68644 (strlen incorrect : mbstring + func_overload=2 +UTF-8 - + Opcache). (Laruence) - -- OpenSSL: - . Added "alpn_protocols" SSL context option allowing encrypted client/server - streams to negotiate alternative protocols using the ALPN TLS extension when - built against OpenSSL 1.0.2 or newer. Negotiated protocol information is - accessible through stream_get_meta_data() output. - . Removed "CN_match" and "SNI_server_name" SSL context options. Use automatic - detection or the "peer_name" option instead. (Nikita) - -- pcntl: - . Fixed bug #60509 (pcntl_signal doesn't decrease ref-count of old handler - when setting SIG_DFL). (Julien) - . Added wifcontinued and wcontinued. (xilon-jul) - . Added rusage support to pcntl_wait() and pcntl_waitpid(). (Anton Stepanenko, - Tony) - -- PCRE: - . Removed support for the /e (PREG_REPLACE_EVAL) modifier. (Nikita) - -- PDO: - . Fixed bug #59450 (./configure fails with "Cannot find php_pdo_driver.h"). - (maxime dot besson at smile dot fr) - -- PDO_mysql: - . Fixed bug #68424 (Add new PDO mysql connection attr to control multi - statements option). (peter dot wolanin at acquia dot com) - -- PDO_pgsql: - . Removed PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT attribute in favor of - ATTR_EMULATE_PREPARES). (Nikita) - -- Reflection - . Fixed inheritance chain of Reflector interface. (Tjerk) - . Added ReflectionGenerator class. (Bob) - . Added reflection support for return types and type declarations. (Sara, - Matteo) +- Reflection: + . Fix #72209 (ReflectionProperty::getValue() doesn't fail if object doesn't match type). (Joe) - Session: - . Fixed bug #67694 (Regression in session_regenerate_id()). (Tjerk) - . Fixed bug #68941 (mod_files.sh is a bash-script). (bugzilla at ii.nl, Yasuo) + . Improved fix for bug #68063 (Empty session IDs do still start sessions). + (Yasuo) + . Fixed bug #71038 (session_start() returns TRUE on failure). + Session save handlers must return 'string' always for successful read. + i.e. Non-existing session read must return empty string. PHP 7.0 is made + not to tolerate buggy return value. (Yasuo) + . Fixed bug #71394 (session_regenerate_id() must close opened session on + errors). (Yasuo) -- SOAP: - . Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes). (Laruence) - -- SPL: - . Changed ArrayIterator implementation using zend_hash_iterator_... API. - Allowed modification of iterated ArrayObject using the same behavior - as proposed in `Fix "foreach" behavior`. Removed "Array was modified - outside object and internal position is no longer valid" hack. (Dmitry) - . Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags - nor curruption state). (Julien) - . Fixed bug #66405 (RecursiveDirectoryIterator::CURRENT_AS_PATHNAME - breaks the RecursiveIterator). (Paul Garvin) - -- Sqlite3: - . Fixed bug #68260 (SQLite3Result::fetchArray declares wrong - required_num_args). (Julien) +- SQLite3: + . Implemented FR #71159 (Upgraded bundled SQLite lib to 3.9.2). (Laruence) - Standard: - . Fixed bug #69723 (Passing parameters by reference and array_column). + . Fixed bug #71100 (long2ip() doesn't accept integers in strict mode). (Laruence) - . Fixed bug #69523 (Cookie name cannot be empty). (Christoph M. Becker) - . Fixed bug #69325 (php_copy_file_ex does not pass the argument). - (imbolk at gmail dot com) - . Fixed bug #69299 (Regression in array_filter's $flag argument in PHP 7). - (Laruence) - . Removed call_user_method() and call_user_method_array() functions. (Kalle) - . Fixed user session handlers (See rfc:session.user.return-value). (Sara) - . Added intdiv() function. (Andrea) - . Improved precision of log() function for base 2 and 10. (Marc Bennewitz) - . Remove string category support in setlocale(). (Nikita) - . Remove set_magic_quotes_runtime() and its alias magic_quotes_runtime(). - (Nikita) - . Fixed bug #65272 (flock() out parameter not set correctly in windows). - (Daniel Lowrey) - . Added preg_replace_callback_array function. (Wei Dai) - . Deprecated salt option to password_hash. (Anthony) - . Fixed bug #69686 (password_verify reports back error on PHP7 will null - string). (Anthony) - . Added Windows support for getrusage(). (Kalle) - . Removed hardcoded limit on number of pipes in proc_open(). (Tony) - -- Streams: - . Fixed bug #68532 (convert.base64-encode omits padding bytes). - (blaesius at krumedia dot de) - . Removed set_socket_blocking() in favor of its alias stream_set_blocking(). - (Nikita) - -- XSL: - . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike) - . Removed xsl.security_prefs ini option. (Nikita) - -- Zlib: - . Added deflate_init(), deflate_add(), inflate_init(), inflate_add() - functions allowing incremental/streaming compression/decompression. - (Daniel Lowrey & Bob Weinand) - -- Zip: - . Added ZipArchive::setCompressionName and ZipArchive::setCompressionIndex - methods (Remi, Cedric Delmas) - . Update bundled libzip to 1.0.1 (Remi, Anatol) - . Fixed bug #67161. (ZipArchive::getStream() returns NULL for certain file) - (Christoph M. Becker) + . Implemented FR #55716 (Add an option to pass a custom stream context to + get_headers()). (Ferenc) + . Additional validation for parse_url() for login/pass components). + (Ilia) (Julien) + . Implemented FR #69359 (Provide a way to fetch the current environment + variables). (Ferenc) + . unpack() function accepts an additional optional argument $offset. (Dmitry) + . Implemented #51879 stream context socket option tcp_nodelay (Joe) <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/README.EXT_SKEL b/README.EXT_SKEL index fdf7ad0e908..5ac48ec4fac 100644 --- a/README.EXT_SKEL +++ b/README.EXT_SKEL @@ -172,7 +172,7 @@ PHP_FUNCTION(module_name_drawtext) zval *image = NULL; zval *font = NULL; - if (zend_parse_parameters(argc TSRMLS_CC, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE) + if (zend_parse_parameters(argc, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE) return; if (image) { diff --git a/README.GIT-RULES b/README.GIT-RULES index 0fa185c9a40..a88a8c9f32f 100644 --- a/README.GIT-RULES +++ b/README.GIT-RULES @@ -12,7 +12,7 @@ Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules with regards to Git usage will:: a. Make everybody happier, especially those responsible for maintaining - Git itself. + PHP itself. b. Keep the changes consistently well documented and easily trackable. @@ -48,11 +48,11 @@ Currently we have the following branches in use:: PHP-5.6 Is used to release the PHP 5.6.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. 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. This is an old + stable version and is open for security fixes only. - PHP-5.4 Is used to release the PHP 5.4.x series. This is a current - stable version and is open for bugfixes only. + PHP-5.4 Is used to release the PHP 5.4.x series. This is an old + stable version and is open for security fixes only. PHP-5.3 This branch is closed. @@ -67,7 +67,7 @@ Currently we have the following branches in use:: The next few rules are more of a technical nature:: - 1. All changes should first go to the lowest branch (i.e. 5.4) and then + 1. All changes should first go to the lowest branch (i.e. 5.6) and then get merged up to all other branches. If a change is not needed for later branches (i.e. fixes for features which where dropped from later branches) an empty merge should be done. @@ -79,7 +79,7 @@ The next few rules are more of a technical nature:: should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but not master, which is not a public released version yet. - 3. Do not commit multiple file and dump all messages in one commit. If you + 3. Do not commit multiple files and dump all messages in one commit. If you modified several unrelated files, commit each group separately and provide a nice commit message for each one. See example below. diff --git a/README.NEW-OUTPUT-API b/README.NEW-OUTPUT-API index c43649a837a..fa4ace05a9e 100644 --- a/README.NEW-OUTPUT-API +++ b/README.NEW-OUTPUT-API @@ -8,98 +8,98 @@ API adjustment to the old output control code: Checking output control layers status: // Using OG() - php_output_get_status(TSRMLS_C); + php_output_get_status(); Starting the default output handler: - // php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC); - php_output_start_default(TSRMLS_C); + // php_start_ob_buffer(NULL, 0, 1); + php_output_start_default(); Starting an user handler by zval: - // php_start_ob_buffer(zhandler, chunk_size, erase TSRMLS_CC); - php_output_start_user(zhandler, chunk_size, flags TSRMLS_CC); + // php_start_ob_buffer(zhandler, chunk_size, erase); + php_output_start_user(zhandler, chunk_size, flags); Starting an internal handler whithout context: - // php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase TSRMLS_CC); - php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags TSRMLS_CC); + // php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase); + php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags); Starting an internal handler with context: // not possible with old API php_output_handler *h; - h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags TSRMLS_CC); + h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags); php_output_handler_set_context(h, my_context, my_context_dtor); - php_output_handler_start(h TSRMLS_CC); + php_output_handler_start(h); Testing whether a certain output handler has already been started: - // php_ob_handler_used("output handler name" TSRMLS_CC); - php_output_handler_started(handler_name, handler_name_len TSRMLS_CC); + // php_ob_handler_used("output handler name"); + php_output_handler_started(handler_name, handler_name_len); Flushing one output buffer: - // php_end_ob_buffer(1, 1 TSRMLS_CC); - php_output_flush(TSRMLS_C); + // php_end_ob_buffer(1, 1); + php_output_flush(); Flushing all output buffers: // not possible with old API - php_output_flush_all(TSRMLS_C); + php_output_flush_all(); Cleaning one output buffer: - // php_ob_end_buffer(0, 1 TSRMLS_CC); - php_output_clean(TSRMLS_C); + // php_ob_end_buffer(0, 1); + php_output_clean(); Cleaning all output buffers: // not possible with old API - php_output_clean_all(TSRMLS_C); + php_output_clean_all(); Discarding one output buffer: - // php_ob_end_buffer(0, 0 TSRMLS_CC); - php_output_discard(TSRMLS_C); + // php_ob_end_buffer(0, 0); + php_output_discard(); Discarding all output buffers: - // php_ob_end_buffers(0 TSRMLS_CC); - php_output_discard_all(TSRMLS_C); + // php_ob_end_buffers(0); + php_output_discard_all(); Stopping (and dropping) one output buffer: - // php_ob_end_buffer(1, 0 TSRMLS_CC) - php_output_end(TSRMLS_C); + // php_ob_end_buffer(1, 0) + php_output_end(); Stopping (and dropping) all output buffers: - // php_ob_end_buffers(1, 0 TSRMLS_CC); - php_output_end_all(TSRMLS_C); + // php_ob_end_buffers(1, 0); + php_output_end_all(); Retrieving output buffers contents: - // php_ob_get_buffer(zstring TSRMLS_CC); - php_output_get_contents(zstring TSRMLS_CC); + // php_ob_get_buffer(zstring); + php_output_get_contents(zstring); Retrieving output buffers length: - // php_ob_get_length(zlength TSRMLS_CC); - php_output_get_length(zlength TSRMLS_CC); + // php_ob_get_length(zlength); + php_output_get_length(zlength); Retrieving output buffering level: // OG(nesting_level); - php_output_get_level(TSRMLS_C); + php_output_get_level(); Issue a warning because of an output handler conflict: - // php_ob_init_conflict("to be started handler name", "to be tested if already started handler name" TSRMLS_CC); - php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len TSRMLS_CC); + // php_ob_init_conflict("to be started handler name", "to be tested if already started handler name"); + php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len); Registering a conflict checking function, which will be checked prior starting the handler: // not possible with old API, unless hardcoding into output.c - php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC); + php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t); Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler: // not possible with old API - php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC); + php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t); Facilitating a context from within an output handler callable with ob_start(): // not possible with old API - php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr TSRMLS_CC); + php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr); Disabling of the output handler by itself: //not possible with old API - php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL TSRMLS_CC); + php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL); Marking an output handler immutable by itself because of irreversibility of its operation: // not possible with old API - php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC); + php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL); Restarting the output handler because of a CLEAN operation: // not possible with old API diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API index 097b4978a50..7f3da76f808 100644 --- a/README.PARAMETER_PARSING_API +++ b/README.PARAMETER_PARSING_API @@ -13,8 +13,8 @@ meaningful error messages. Prototypes ---------- /* Implemented. */ -int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...); -int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...); +int zend_parse_parameters(int num_args, char *type_spec, ...); +int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...); The zend_parse_parameters() function takes the number of parameters passed to the extension function, the type specifier string, and the @@ -30,7 +30,7 @@ resources cannot be auto-converted. PHP 5.5 includes a new function: -int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...); +int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...); This function behaves like zend_parse_parameters_ex() except that instead of reading the arguments from the stack, it receives a single zval to convert @@ -63,10 +63,10 @@ Type specifiers o - object of any type (zval*) O - object of specific type given by class entry (zval*, zend_class_entry) p - valid path (string without null bytes in the middle) and its length (char*, size_t) - P - valid path (string without null bytes in the middle) as zend_string (zend_string) + P - valid path (string without null bytes in the middle) as zend_string (zend_string*) r - resource (zval*) s - string (with possible null bytes) and its length (char*, size_t) - S - string (with possible null bytes) as zend_string (zend_string) + S - string (with possible null bytes) as zend_string (zend_string*) z - the actual zval (zval*) * - variable arguments list (0 or more) + - variable arguments list (1 or more) @@ -97,11 +97,11 @@ Both mistakes might cause memory corruptions and segfaults: 1) char *str; long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */ - zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) + zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) 2) int num; /* XXX THIS IS WRONG!! Use zend_long instead. */ - zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) + zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) If you're in doubt, use check_parameters.php script to the parameters and their types (it can be found in ./scripts/dev/ directory of PHP sources): @@ -116,7 +116,7 @@ zend_long l; char *s; size_t s_len; zval *param; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz", +if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz", &l, &s, &s_len, ¶m) == FAILURE) { return; } @@ -126,7 +126,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz", zval *obj; double d = 0.5; zend_class_entry *my_ce; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d", +if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d", &obj, my_ce, &d) == FAILURE) { return; } @@ -136,7 +136,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d", If null is passed for object, obj will be set to NULL. */ zval *obj; zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", +if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a", &obj, &arr) == FAILURE) { return; } @@ -144,7 +144,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", /* Gets a separated array which can also be null. */ zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", +if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!", &arr) == FAILURE) { return; } @@ -161,10 +161,10 @@ char *s; */ size_t length; -if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, +if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lll", &l1, &l2, &l3) == SUCCESS) { /* manipulate longs */ -} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, +} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s", &s, &length) == SUCCESS) { /* manipulate string */ } else { @@ -180,7 +180,7 @@ int i, num_varargs; zval *varargs = NULL; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) { +if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &varargs, &num_varargs) == FAILURE) { return; } @@ -200,7 +200,7 @@ size_t str_len; int i, num_varargs; zval *varargs = NULL; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) { +if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) { return; } @@ -214,7 +214,7 @@ zval *array; int i, num_varargs; zval *varargs = NULL; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) { +if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) { return; } diff --git a/README.REDIST.BINS b/README.REDIST.BINS index 968c3ec0c87..97798275347 100644 --- a/README.REDIST.BINS +++ b/README.REDIST.BINS @@ -5,17 +5,16 @@ 5. ext/standard crypt 6. ext/standard crypt's blowfish implementation 7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite -8. ext/json/json_parser -9. ext/standard/rand -10. ext/standard/scanf -11. ext/standard/strnatcmp.c -12. ext/standard/uuencode -13. libxmlrpc ext/xmlrpc -14. libzip ext/zip -15. main/snprintf.c -16. main/strlcat -17. main/strlcpy -18. libgd see ext/gd/libgd/COPYING +8. ext/standard/rand +9. ext/standard/scanf +10. ext/standard/strnatcmp.c +11. ext/standard/uuencode +12. libxmlrpc ext/xmlrpc +13. libzip ext/zip +14. main/snprintf.c +15. main/strlcat +16. main/strlcpy +17. libgd see ext/gd/libgd/COPYING 5. ext/standard crypt @@ -104,31 +103,7 @@ a legal notice, here is a blessing: May you share freely, never taking more than you give. -8. ext/json/json_parser -Copyright (c) 2005 JSON.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -9. ext/standard/rand +8. ext/standard/rand The following php_mt_...() functions are based on a C++ class MTRand by Richard J. Wagner. For more information see the web page at http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html @@ -181,7 +156,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -10. ext/standard/scanf +9. ext/standard/scanf scanf.c -- This file contains the base code which implements sscanf and by extension @@ -227,7 +202,7 @@ authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. -11. ext/standard/strnatcmp.c +10. ext/standard/strnatcmp.c strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000 by Martin Pool @@ -248,7 +223,7 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. -12. ext/standard/uuencode +11. ext/standard/uuencode Portions of this code are based on Berkeley's uuencode/uudecode implementation. @@ -284,7 +259,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -13. libxmlrpc ext/xmlrpc +12. libxmlrpc ext/xmlrpc Copyright 2000 Epinions, Inc. @@ -308,7 +283,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH DAMAGES. -14. libzip ext/zip +13. libzip ext/zip zip.h -- exported declarations. Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner @@ -340,7 +315,7 @@ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -15. main/snprintf.c +14. main/snprintf.c Copyright (c) 2002, 2006 Todd C. Miller Permission to use, copy, modify, and distribute this software for any @@ -413,8 +388,8 @@ This code is based on, and used with the permission of, the SIO stdio-replacement strx_* functions by Panos Tsirigotis for xinetd. -16. main/strlcat -17. main/strlcpy +15. main/strlcat +16. main/strlcpy Copyright (c) 1998 Todd C. Miller All rights reserved. diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS index 227df6e920a..3411ed903e7 100644 --- a/README.RELEASE_PROCESS +++ b/README.RELEASE_PROCESS @@ -17,7 +17,7 @@ It is recommended to do so a couple of days before the packaging day, to have enough time to investigate failures, communicate with the authors and commit the fixes. The RM for the branch is also responsible for keeping the CI green on -ongoing bases between the releases. Check the CI status for your branch +ongoing basis between the releases. Check the CI status for your branch periodically and resolve the failures ASAP. See more in: https://wiki.php.net/rfc/travis_ci @@ -31,7 +31,7 @@ team (Bjori) on hand. 6. Verify the tags to be extra sure everything was tagged properly. -7. Moving extensions from/to PECL requires write acces to the destination. +7. Moving extensions from/to PECL requires write access to the destination. Most developers should have this. Moving extensions from php-src to PECL @@ -271,8 +271,8 @@ to upgrade. 10. Wait an hour or two, then send a mail to php-announce@lists.php.net, php-general@lists.php.net and internals@lists.php.net with a text similar to http://news.php.net/php.internals/17222. -Please make sure that the mail to php-announce@ is its own completely seperate email. -This is to make sure that repiles to the announcement on php-general@ or internals@ +Please make sure that the mail to php-announce@ is its own completely separate email. +This is to make sure that replies to the announcement on php-general@ or internals@ will not accidentally hit the php-announce@ mailinglist. Re-releasing the same version (or -pl) @@ -309,6 +309,6 @@ to upgrade. 5. Wait an hour or two, then send a mail to php-announce@lists.php.net, php-general@lists.php.net and internals@lists.php.net with a text similar to the news entry. -Please make sure that the mail to php-announce@ is its own completely seperate email. -This is to make sure that repiles to the announcement on php-general@ or internals@ +Please make sure that the mail to php-announce@ is its own completely separate email. +This is to make sure that replies to the announcement on php-general@ or internals@ will not accidentally hit the php-announce@ mailinglist. diff --git a/README.STREAMS b/README.STREAMS index 0046e6a7543..e95950bde0e 100644 --- a/README.STREAMS +++ b/README.STREAMS @@ -28,7 +28,7 @@ The main functions are: PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count); PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t count); -PHPAPI size_t php_stream_printf(php_stream * stream TSRMLS_DC, +PHPAPI size_t php_stream_printf(php_stream * stream, const char * fmt, ...); PHPAPI int php_stream_eof(php_stream * stream); PHPAPI int php_stream_getc(php_stream * stream); @@ -47,7 +47,7 @@ Opening Streams In most cases, you should use this API: PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode, - int options, char **opened_path TSRMLS_DC); + int options, char **opened_path); Where: path is the file or resource to open. @@ -80,7 +80,7 @@ PHPAPI php_stream *php_stream_fopen_tmpfile(void); Open a FILE * with tmpfile() and convert into a stream. PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir, - const char *pfx, char **opened_path TSRMLS_DC); + const char *pfx, char **opened_path); Generate a temporary file name and open it. There are some network enabled relatives in php_network.h: diff --git a/README.input_filter b/README.input_filter index 78e2edd2ec1..be260013ac6 100644 --- a/README.input_filter +++ b/README.input_filter @@ -138,7 +138,7 @@ SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter) strcpy(raw_var, "RAW_"); strlcat(raw_var,var,var_len+5); - php_register_variable_ex(raw_var, &new_var, array_ptr TSRMLS_DC); + php_register_variable_ex(raw_var, &new_var, array_ptr); php_strip_tags(*val, val_len, NULL, NULL, 0); @@ -154,7 +154,7 @@ PHP_FUNCTION(my_get_raw) zval **tmp; zval *array_ptr = NULL; - if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) { + if(zend_parse_parameters(2, "ls", &arg, &var, &var_len) == FAILURE) { return; } diff --git a/README.md b/README.md index 7618ffe383f..074481b1c86 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Pull Requests ============= PHP accepts pull requests via github. Discussions are done on github, but depending on the topic can also be relayed to the official PHP developer -mailinglist internals@lists.php.net. +mailing list internals@lists.php.net. New features require an RFC and must be accepted by the developers. See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 859b3fac015..f9bb2410501 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -165,11 +165,13 @@ TSRM_API void *tsrm_get_ls_cache(void); #define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx #define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache() -#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) +#define TSRMG(id, type, element) (TSRMG_BULK(id, type)->element) +#define TSRMG_BULK(id, type) ((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)]) -#define TSRMG_STATIC(id, type, element) (((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) -#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE -#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL +#define TSRMG_STATIC(id, type, element) (TSRMG_BULK_STATIC(id, type)->element) +#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)]) +#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE; +#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL; #if ZEND_DEBUG #define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache() #else @@ -200,6 +202,8 @@ TSRM_API void *tsrm_get_ls_cache(void); #define TSRMLS_CACHE_UPDATE() #define TSRMLS_CACHE +#define TSRM_TLS + /* BC only */ #define TSRMLS_D void #define TSRMLS_DC diff --git a/TSRM/m4/gethostbyname.m4 b/TSRM/m4/gethostbyname.m4 new file mode 100644 index 00000000000..ac3eb060185 --- /dev/null +++ b/TSRM/m4/gethostbyname.m4 @@ -0,0 +1,197 @@ +# ================================================================================= +# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html +# ================================================================================= +# +# SYNOPSIS +# +# AX_FUNC_WHICH_GETHOSTBYNAME_R +# +# DESCRIPTION +# +# Determines which historical variant of the gethostbyname_r() call +# (taking three, five, or six arguments) is available on the system and +# defines one of the following macros accordingly: +# +# HAVE_FUNC_GETHOSTBYNAME_R_6 +# HAVE_FUNC_GETHOSTBYNAME_R_5 +# HAVE_FUNC_GETHOSTBYNAME_R_3 +# +# as well as +# +# HAVE_GETHOSTBYNAME_R +# +# If used in conjunction with gethostname.c, the API demonstrated in +# test.c can be used regardless of which gethostbyname_r() is available. +# These example files can be found at +# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r +# +# based on David Arnold's autoconf suggestion in the threads faq +# +# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for +# Autoconf 2.5x, and updated for 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Caolan McNamara +# Copyright (c) 2008 Daniel Richard G. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [ + + AC_LANG_PUSH([C]) + AC_MSG_CHECKING([how many arguments gethostbyname_r() takes]) + + AC_CACHE_VAL([ac_cv_func_which_gethostbyname_r], [ + +################################################################ + +ac_cv_func_which_gethostbyname_r=unknown + +# +# ONE ARGUMENT (sanity check) +# + +# This should fail, as there is no variant of gethostbyname_r() that takes +# a single argument. If it actually compiles, then we can assume that +# netdb.h is not declaring the function, and the compiler is thereby +# assuming an implicit prototype. In which case, we're out of luck. +# +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [ + char *name = "www.gnu.org"; + (void)gethostbyname_r(name) /* ; */ + ])], + [ac_cv_func_which_gethostbyname_r=no]) + +# +# SIX ARGUMENTS +# (e.g. Linux) +# + +if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then + +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [ + char *name = "www.gnu.org"; + struct hostent ret, *retp; + char buf@<:@1024@:>@; + int buflen = 1024; + int my_h_errno; + (void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */ + ])], + [ac_cv_func_which_gethostbyname_r=six]) + +fi + +# +# FIVE ARGUMENTS +# (e.g. Solaris) +# + +if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then + +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [ + char *name = "www.gnu.org"; + struct hostent ret; + char buf@<:@1024@:>@; + int buflen = 1024; + int my_h_errno; + (void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */ + ])], + [ac_cv_func_which_gethostbyname_r=five]) + +fi + +# +# THREE ARGUMENTS +# (e.g. AIX, HP-UX, Tru64) +# + +if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then + +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [ + char *name = "www.gnu.org"; + struct hostent ret; + struct hostent_data data; + (void)gethostbyname_r(name, &ret, &data) /* ; */ + ])], + [ac_cv_func_which_gethostbyname_r=three]) + +fi + +################################################################ + +]) dnl end AC_CACHE_VAL + +case "$ac_cv_func_which_gethostbyname_r" in + three|five|six) + AC_DEFINE([HAVE_GETHOSTBYNAME_R], [1], + [Define to 1 if you have some form of gethostbyname_r().]) + ;; +esac + +case "$ac_cv_func_which_gethostbyname_r" in + three) + AC_MSG_RESULT([three]) + AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_3], [1], + [Define to 1 if you have the three-argument form of gethostbyname_r().]) + ;; + + five) + AC_MSG_RESULT([five]) + AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_5], [1], + [Define to 1 if you have the five-argument form of gethostbyname_r().]) + ;; + + six) + AC_MSG_RESULT([six]) + AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_6], [1], + [Define to 1 if you have the six-argument form of gethostbyname_r().]) + ;; + + no) + AC_MSG_RESULT([cannot find function declaration in netdb.h]) + ;; + + unknown) + AC_MSG_RESULT([can't tell]) + ;; + + *) + AC_MSG_ERROR([internal error]) + ;; +esac + +AC_LANG_POP + +]) dnl end AC_DEFUN + diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4 index b53a4bb805f..98aa2b8c912 100644 --- a/TSRM/tsrm.m4 +++ b/TSRM/tsrm.m4 @@ -1,3 +1,4 @@ +m4_include([TSRM/m4/gethostbyname.m4]) dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND) AC_DEFUN([TSRM_CHECK_GCC_ARG],[ @@ -32,6 +33,8 @@ AC_CHECK_HEADERS(stdarg.h) AC_CHECK_FUNCS(sigprocmask) +AX_FUNC_WHICH_GETHOSTBYNAME_R() + ]) @@ -89,7 +92,6 @@ else fi ]) - AC_DEFUN([TSRM_THREADS_CHECKS],[ dnl For the thread implementations, we always use --with-* diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c index 072d53a2167..09f5ad3f290 100644 --- a/TSRM/tsrm_nw.c +++ b/TSRM/tsrm_nw.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 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 | diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h index 358696162ad..d7bbee89b86 100644 --- a/TSRM/tsrm_nw.h +++ b/TSRM/tsrm_nw.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 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 | diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index e596741680b..6eba067c06e 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 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 | @@ -49,7 +49,7 @@ TSRMLS_CACHE_UPDATE(); globals->shm = NULL; globals->process_size = 0; globals->shm_size = 0; - globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com"); + globals->comspec = _strdup("cmd.exe"); /* Set it to INVALID_HANDLE_VALUE * It will be initialized correctly in tsrm_win32_access or set to @@ -437,6 +437,7 @@ static shm_pair *shm_get(int key, void *addr) TWG(shm) = newptr; ptr = newptr + TWG(shm_size); TWG(shm_size)++; + memset(ptr, 0, sizeof(*ptr)); return ptr; } @@ -598,8 +599,8 @@ TSRM_API int shmget(int key, int size, int flags) return -1; } - sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key); - sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key); + snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key); + snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key); shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); @@ -611,6 +612,12 @@ TSRM_API int shmget(int key, int size, int flags) created = TRUE; } if (!shm_handle || !info_handle) { + if (shm_handle) { + CloseHandle(shm_handle); + } + if (info_handle) { + CloseHandle(info_handle); + } return -1; } } else { @@ -620,6 +627,11 @@ TSRM_API int shmget(int key, int size, int flags) } shm = shm_get(key, NULL); + if (!shm) { + CloseHandle(shm_handle); + CloseHandle(info_handle); + return -1; + } shm->segment = shm_handle; shm->info = info_handle; shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h index 8d8bcf109e2..fbeac07b01f 100644 --- a/TSRM/tsrm_win32.h +++ b/TSRM/tsrm_win32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2016 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 | @@ -72,7 +72,7 @@ typedef struct { #ifdef ZTS # define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v) -TSRMLS_CACHE_EXTERN(); +TSRMLS_CACHE_EXTERN() #else # define TWG(v) (win32_globals.v) #endif diff --git a/UPGRADING b/UPGRADING index 6ae9b52e993..30cf107525b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -1,6 +1,4 @@ -$Id$ - -PHP X.Y UPGRADE NOTES +PHP 7.1 UPGRADE NOTES 1. Backward Incompatible Changes 2. New Features @@ -21,744 +19,157 @@ PHP X.Y UPGRADE NOTES 1. Backward Incompatible Changes ======================================== -Language changes -================ - -Changes to variable handling ----------------------------- - -* Indirect variable, property and method references are now interpreted with - left-to-right semantics. Some examples: - - $$foo['bar']['baz'] // interpreted as ($$foo)['bar']['baz'] - $foo->$bar['baz'] // interpreted as ($foo->$bar)['baz'] - $foo->$bar['baz']() // interpreted as ($foo->$bar)['baz']() - Foo::$bar['baz']() // interpreted as (Foo::$bar)['baz']() - - To restore the previous behavior add explicit curly braces: - - ${$foo['bar']['baz']} - $foo->{$bar['baz']} - $foo->{$bar['baz']}() - Foo::{$bar['baz']}() - -* The global keyword now only accepts simple variables. Instead of - - global $$foo->bar; - - it is now required to write the following: - - global ${$foo->bar}; - -* Parentheses around variables or function calls no longer have any influence - on behavior. For example the following code, where the result of a function - call is passed to a by-reference function - - function getArray() { return [1, 2, 3]; } - - $last = array_pop(getArray()); - // Strict Standards: Only variables should be passed by reference - $last = array_pop((getArray())); - // Strict Standards: Only variables should be passed by reference - - will now throw a strict standards error regardless of whether parentheses - are used. Previously no notice was generated in the second case. - -* Array elements or object properties that are automatically created during - by-reference assignments will now result in a different order. For example - - $array = []; - $array["a"] =& $array["b"]; - $array["b"] = 1; - var_dump($array); - - now results in the array ["a" => 1, "b" => 1], while previously the result - was ["b" => 1, "a" => 1]; - -Relevant RFCs: -* https://wiki.php.net/rfc/uniform_variable_syntax -* https://wiki.php.net/rfc/abstract_syntax_tree - -Changes to list() ------------------ - -* list() will no longer assign variables in reverse order. For example - - list($array[], $array[], $array[]) = [1, 2, 3]; - var_dump($array); - - will now result in $array == [1, 2, 3] rather than [3, 2, 1]. Note that only - the **order** of the assignments changed, but the assigned values stay the - same. E.g. a normal usage like - - list($a, $b, $c) = [1, 2, 3]; - // $a = 1; $b = 2; $c = 3; - - will retain its current behavior. - -* Empty list() assignments are no longer allowed. As such all of the following - are invalid: - - list() = $a; - list(,,) = $a; - list($x, list(), $y) = $a; - -* list() no longer supports unpacking strings (while previously this was only - supported in some cases). The code - - $string = "xy"; - list($x, $y) = $string; - - will now result in $x == null and $y == null (without notices) instead of - $x == "x" and $y == "y". Furthermore list() is now always guaranteed to - work with objects implementing ArrayAccess, e.g. - - list($a, $b) = (object) new ArrayObject([0, 1]); - - will now result in $a == 0 and $b == 1. Previously both $a and $b were null. - -Relevant RFCs: -* https://wiki.php.net/rfc/abstract_syntax_tree#changes_to_list -* https://wiki.php.net/rfc/fix_list_behavior_inconsistency - -Changes to foreach ------------------- - -* Iteration with foreach() no longer has any effect on the internal array - pointer, which can be accessed through the current()/next()/etc family of - functions. For example - - $array = [0, 1, 2]; - foreach ($array as &$val) { - var_dump(current($array)); - } - - will now print the value int(0) three times. Previously the output was int(1), - int(2) and bool(false). - -* When iterating arrays by-value, foreach will now always operate on a copy of - the array, as such changes to the array during iteration will not influence - iteration behavior. For example - - $array = [0, 1, 2]; - $ref =& $array; // Necessary to trigger the old behavior - foreach ($array as $val) { - var_dump($val); - unset($array[1]); - } - - will now print all three elements (0 1 2), while previously the second element - 1 was skipped (0 2). - -* When iterating arrays by-reference, modifications to the array will continue - to influence the iteration. However PHP will now do a better job of - maintaining a correct position in a number of cases. E.g. appending to an - array during by-reference iteration - - $array = [0]; - foreach ($array as &$val) { - var_dump($val); - $array[1] = 1; - } - - will now iterate over the appended element as well. As such the output of this - example will now be "int(0) int(1)", while previously it was only "int(0)". - -* Iteration of plain (non-Traversable) objects by-value or by-reference will - behave like by-reference iteration of arrays. This matches the previous - behavior apart from the more accurate position management mentioned in the - previous point. - -* Iteration of Traversable objects remains unchanged. - -Relevant RFC: https://wiki.php.net/rfc/php7_foreach - -Changes to parameter handling ------------------------------ - -* It is no longer possible to define two function parameters with the same name. - For example, the following method will trigger a compile-time error: - - public function foo($a, $b, $unused, $unused) { - // ... - } - - Code like this should be changed to use distinct parameter names, for example: - - public function foo($a, $b, $unused1, $unused2) { - // ... - } - -* The func_get_arg() and func_get_args() functions will no longer return the - original value that was passed to a parameter and will instead provide the - current value (which might have been modified). For example - - function foo($x) { - $x++; - var_dump(func_get_arg(0)); - } - foo(1); - - will now print "2" instead of "1". This code should be changed to either - perform modifications only after calling func_get_arg(s) - - function foo($x) { - var_dump(func_get_arg(0)); - $x++; - } - - or avoid modifying the parameters altogether: - - function foo($x) { - $newX = $x + 1; - var_dump(func_get_arg(0)); - } - -* Similarly exception backtraces will no longer display the original value that - was passed to a function and show the modified value instead. For example - - function foo($x) { - $x = 42; - throw new Exception; - } - foo("string"); - - will now result in the stack trace - - Stack trace: - #0 file.php(4): foo(42) - #1 {main} - - while previously it was: - - Stack trace: - #0 file.php(4): foo('string') - #1 {main} - - While this should not impact runtime behavior of your code, it is worthwhile - to be aware of this difference for debugging purposes. - - The same limitation also applies to debug_backtrace() and other functions - inspecting function arguments. - -Relevant RFC: https://wiki.php.net/phpng - -Changes to integer handling ---------------------------- - -* Invalid octal literals (containing digits larger than 7) now produce compile - errors. For example, the following is no longer valid: - - $i = 0781; // 8 is not a valid octal digit! - - Previously the invalid digits (and any following valid digits) were simply - ignored. As such $i previously held the value 7, because the last two digits - were silently discarded. - -* Bitwise shifts by negative numbers will now throw a warning and return false: - - var_dump(1 >> -1); // bool(false) - // Warning: Bit shift by negative number - -* Left bitwise shifts by a number of bits beyond the bit width of an integer - will always result in 0: - - var_dump(1 << 64); // int(0) - - Previously the behavior of this code was dependent on the used CPU - architecture. For example on x86 (including x86-64) the result was int(1), - because the shift operand was wrapped. - -* Similarly right bitwise shifts by a number of bits beyond the bit width of an - integer will always result in 0 or -1 (depending on sign): - - var_dump(1 >> 64); // int(0) - var_dump(-1 >> 64); // int(-1) - -Relevant RFC: https://wiki.php.net/rfc/integer_semantics - -Changes to string handling --------------------------- - -* Strings that contain hexadecimal numbers are no longer considered to be - numeric and don't receive special treatment anymore. Some examples of the - new behavior: - - var_dump("0x123" == "291"); // bool(false) (previously true) - var_dump(is_numeric("0x123")); // bool(false) (previously true) - var_dump("0xe" + "0x1"); // int(0) (previously 16) - - var_dump(substr("foo", "0x1")); // string(3) "foo" (previously "oo") - // Notice: A non well formed numeric value encountered - - filter_var() can be used to check if a string contains a hexadecimal number - or convert such a string into an integer: - - $str = "0xffff"; - $int = filter_var($str, FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX); - if (false === $int) { - throw new Exception("Invalid integer!"); - } - var_dump($int); // int(65535) - -* Due to the addition of the Unicode Codepoint Escape Syntax for double-quoted - strings and heredocs, "\u{" followed by an invalid sequence will now result in - an error: - - $str = "\u{xyz}"; // Fatal error: Invalid UTF-8 codepoint escape sequence - - To avoid this the leading backslash should be escaped: - - $str = "\\u{xyz}"; // Works fine - - However, "\u" without a following { is unaffected. As such the following code - won't error and will work the same as before: - - $str = "\u202e"; // Works fine - -Relevant RFCs: -* https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings -* https://wiki.php.net/rfc/unicode_escape - -Changes to error handling -------------------------- - -* There are now two exception classes: Exception and Error. Both classes - implement a new interface Throwable. Type hints in exception handling code - may need to be changed to account for this. - -* Some fatal errors and recoverable fatal errors now throw an Error instead. - As Error is a separate class from Exception, these exceptions will not be - caught by existing try/catch blocks. - - For the recoverable fatal errors which have been converted into an exception, - it is no longer possible to silently ignore the error from an error handler. - In particular, it is no longer possible to ignore type hint failures. - -* Parser errors now generate a ParseError that extends Error. Error - handling for eval()s on potentially invalid code should be changed to catch - ParseError in addition to the previous return value / error_get_last() - based handling. - -* Constructors of internal classes will now always throw an exception on - failure. Previously some constructors returned NULL or an unusable object. - -* The error level of some E_STRICT notices has been changed. - -Relevant RFCs: -* https://wiki.php.net/rfc/engine_exceptions_for_php7 -* https://wiki.php.net/rfc/throwable-interface -* https://wiki.php.net/rfc/internal_constructor_behaviour -* https://wiki.php.net/rfc/reclassify_e_strict - -Other language changes ----------------------- - -* Removed support for static calls to non-static calls form an incompatible - $this context. In this case $this will not be defined, but the call will be - allowed with a deprecation notice. An example: - - class A { - public function test() { var_dump($this); } - } - - // Note: Does NOT extend A - class B { - public function callNonStaticMethodOfA() { A::test(); } - } - - (new B)->callNonStaticMethodOfA(); - - // Deprecated: Non-static method A::test() should not be called statically - // Notice: Undefined variable $this - NULL - - Note that this only applies to calls from an incompatible context. If class B - extended from A the call would be allowed without any notices. - -* It is no longer possible to use the following class, interface and trait names - (case-insensitive): - - bool - int - float - string - null - false - true - - This applies to class/interface/trait declarations, class_alias() and use - statements. - - Furthermore the following class, interface and trait names are now reserved - for future use, but do not yet throw an error when used: - - resource - object - mixed - numeric - -* The yield language construct no longer requires parentheses when used in an - expression context. It is now a right-associative operator with precedence - between the "print" and "=>" operators. This can result in different behavior - in some cases, for example: - - echo yield -1; - // Was previously interpreted as - echo (yield) - 1; - // And is now interpreted as - echo yield (-1); - - yield $foo or die; - // Was previously interpreted as - yield ($foo or die); - // And is now interpreted as - (yield $foo) or die; - - Such cases can always be resolved by adding additional parentheses. - - . Removed ASP (<%) and script (