mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29b4532f61 |
No files matched your search
@@ -1,16 +0,0 @@
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -106,7 +106,7 @@ define dump_bt
|
||||
printf "%ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 2
|
||||
printf "%f", $zvalue->value.dval
|
||||
printf "%lf", $zvalue->value.dval
|
||||
end
|
||||
if $type == 3
|
||||
if $zvalue->value.lval
|
||||
@@ -185,7 +185,7 @@ define ____printzv_contents
|
||||
printf "long: %ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 2
|
||||
printf "double: %f", $zvalue->value.dval
|
||||
printf "double: %lf", $zvalue->value.dval
|
||||
end
|
||||
if $type == 3
|
||||
printf "bool: "
|
||||
|
||||
@@ -22,10 +22,6 @@ sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
ext/ldap/ldap.c ident
|
||||
ext/pdo_pgsql/pdo_pgsql.c ident
|
||||
ext/tidy/tidy.c ident
|
||||
NEWS merge=NEWS
|
||||
UPGRADING merge=NEWS
|
||||
UPGRADING.INTERNALS merge=NEWS
|
||||
|
||||
+4
-11
@@ -19,10 +19,6 @@
|
||||
*.tgz
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
*.tar.gz.asc
|
||||
*.tar.bz2.asc
|
||||
*.tar.xz.asc
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
@@ -135,7 +131,6 @@ tests/*/*.sh
|
||||
*/tests/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
@@ -211,8 +206,6 @@ ext/pdo_sqlite/sqlite3.h
|
||||
ext/pdo_sqlite/tests/*.db
|
||||
ext/pdo_sqlite/tests/*.tmp
|
||||
ext/phar/phar.phar
|
||||
ext/phar/phar.1
|
||||
ext/phar/phar.phar.1
|
||||
ext/pspell/tests/*.tmp
|
||||
ext/reflection/xml
|
||||
ext/reflection/html
|
||||
@@ -220,6 +213,10 @@ 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
|
||||
@@ -240,16 +237,12 @@ sapi/apache/libphp5.module
|
||||
sapi/apache2handler/libphp5.module
|
||||
sapi/apache_hooks/libphp5.module
|
||||
sapi/cgi/php-cgi
|
||||
sapi/cgi/php-cgi.1
|
||||
sapi/cli/php.1
|
||||
sapi/fpm/php-fpm
|
||||
sapi/fpm/php-fpm.1
|
||||
sapi/fpm/init.d.php-fpm
|
||||
sapi/fpm/php-fpm.conf
|
||||
sapi/fpm/fpm/php-cgi
|
||||
sapi/phpdbg/phpdbg_parser.c
|
||||
sapi/phpdbg/phpdbg_parser.h
|
||||
sapi/phpdbg/phpdbg
|
||||
scripts/php-config
|
||||
scripts/phpize
|
||||
scripts/man1/*.1
|
||||
|
||||
+8
-43
@@ -1,47 +1,14 @@
|
||||
dist: precise
|
||||
language: c
|
||||
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
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
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
|
||||
on_failure: always
|
||||
|
||||
cache:
|
||||
- apt
|
||||
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
|
||||
- REPORT_EXIT_STATUS=1
|
||||
matrix:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
@@ -54,6 +21,4 @@ before_script:
|
||||
- . ./travis/ext/pdo_pgsql/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
|
||||
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff
|
||||
+8
-31
@@ -42,7 +42,7 @@ Exceptions:
|
||||
|
||||
4. When writing functions that deal with strings, be sure to remember
|
||||
that PHP holds the length property of each string, and that it
|
||||
shouldn't be calculated with strlen(). Write your functions in such
|
||||
shouldn't be calculated with strlen(). Write your functions in a such
|
||||
a way so that they'll take advantage of the length property, both
|
||||
for efficiency and in order for them to be binary-safe.
|
||||
Functions that change strings and obtain their new lengths while
|
||||
@@ -59,8 +59,8 @@ Exceptions:
|
||||
you're calling.
|
||||
|
||||
7. When commenting out code using a #if statement, do NOT use 0 only. Instead
|
||||
use "<git username here>_0". For example, #if FOO_0, where FOO is your
|
||||
git user foo. This allows easier tracking of why code was commented out,
|
||||
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
|
||||
svn user foo. This allows easier tracking of why code was commented out,
|
||||
especially in bundled libraries.
|
||||
|
||||
8. Do not define functions that are not available. For instance, if a
|
||||
@@ -82,7 +82,7 @@ Exceptions:
|
||||
library may need to control or free the memory, or when the memory in
|
||||
question needs to survive between multiple requests.
|
||||
|
||||
User Functions/Methods Naming Conventions
|
||||
Naming Conventions
|
||||
------------------
|
||||
|
||||
1. Function names for user-level functions should be enclosed with in
|
||||
@@ -151,7 +151,7 @@ User Functions/Methods Naming Conventions
|
||||
|
||||
7. Classes should be given descriptive names. Avoid using abbreviations where
|
||||
possible. Each word in the class name should start with a capital letter,
|
||||
without underscore delimiters (CamelCaps starting with a capital letter).
|
||||
without underscore delimiters (CampelCaps starting with a capital letter).
|
||||
The class name should be prefixed with the name of the 'parent set' (e.g.
|
||||
the name of the extension)::
|
||||
|
||||
@@ -163,26 +163,6 @@ User Functions/Methods Naming Conventions
|
||||
'foobar'
|
||||
'foo_bar'
|
||||
|
||||
Internal Function Naming Convensions
|
||||
----------------------
|
||||
|
||||
1. Functions that are part of the external API should be named
|
||||
'php_modulename_function()' to avoid symbol collision. They should be in
|
||||
lowercase, with words underscore delimited. Exposed API must be defined
|
||||
in 'php_modulename.h'.
|
||||
|
||||
PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS);
|
||||
|
||||
Unexposed module function should be static and should not be defined in
|
||||
'php_modulename.h'.
|
||||
|
||||
static int php_session_destroy(TSRMLS_D)
|
||||
|
||||
2. Main module source file must be named 'modulename.c'.
|
||||
|
||||
3. Header file that is used by other sources must be named 'php_modulename.h'.
|
||||
|
||||
|
||||
Syntax and indentation
|
||||
----------------------
|
||||
|
||||
@@ -201,9 +181,9 @@ Syntax and indentation
|
||||
of PHP or one of its standard modules, please maintain the K&R
|
||||
style. This applies to just about everything, starting with
|
||||
indentation and comment styles and up to function declaration
|
||||
syntax. Also see Indentstyle.
|
||||
syntax. Also see Indentstyle_.
|
||||
|
||||
Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html
|
||||
.. _Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html
|
||||
|
||||
3. Be generous with whitespace and braces. Keep one empty line between the
|
||||
variable declaration section and the statements in a block, as well as
|
||||
@@ -279,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
|
||||
-----------------------------------
|
||||
|
||||
+3
-15
@@ -181,8 +181,8 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -205,7 +205,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
@@ -385,12 +385,6 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hash
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -444,12 +438,6 @@ PRIMARY MAINTAINER: Frank M. Kromann
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -155,7 +155,7 @@ Table of Contents
|
||||
a list of all available options along with short explanations running
|
||||
./configure --help. Our manual documents the different options
|
||||
separately. You will find the core options in the appendix, while the
|
||||
different extension specific options are described on the reference
|
||||
different extension specific options are descibed on the reference
|
||||
pages.
|
||||
|
||||
When PHP is configured, you are ready to build the module and/or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2016 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2012 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ php_lcov.info: lcov-test
|
||||
@rm -rf lcov_data/
|
||||
@$(mkinstalldirs) lcov_data/
|
||||
@echo
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | sed -e 's/.libs/zzzz/g' | sort | sed -e 's/zzzz/.libs/g' | uniq` ;\
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
|
||||
for x in $$files; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
@@ -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/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 \
|
||||
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 \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
|
||||
+2
-2
@@ -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"`; \
|
||||
@@ -120,7 +120,7 @@ clean:
|
||||
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 ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/mysqlnd/php_mysqlnd_config.h
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
+6
-29
@@ -31,11 +31,6 @@ HOW TO USE IT
|
||||
|
||||
./buildconf; ./configure --enable-module_name; make
|
||||
|
||||
The definition of PHP_MODULE_NAME_VERSION will be present in the
|
||||
php_module_name.h and injected into the zend_module_entry definition. This
|
||||
is required by the PECL website for the version string conformity checks
|
||||
against package.xml
|
||||
|
||||
But if you already have planned the overall scheme of your module, what
|
||||
functions it will contain, their return types and the arguments they take
|
||||
(a very good idea) and don't want to bother yourself with creating function
|
||||
@@ -45,29 +40,12 @@ HOW TO USE IT
|
||||
|
||||
--proto=filename.
|
||||
|
||||
SOURCE AND HEADER FILE NAME
|
||||
|
||||
./ext_skel generates 'module_name.c' and 'php_module_name.h' as main source
|
||||
and header files. Keep these names.
|
||||
|
||||
Module functions (User functions) must be named
|
||||
|
||||
module_name_function()
|
||||
|
||||
When you need to expose module functions to other modules, expose functions
|
||||
strictly needed by others. Exposed internal function must be named
|
||||
|
||||
php_module_name_function()
|
||||
|
||||
See also CODING_STANDARDS.
|
||||
|
||||
|
||||
FORMAT OF FUNCTION DEFINITIONS FILE
|
||||
|
||||
All the definitions must be on one line. In it's simplest form, it's just
|
||||
the function name, e.g.
|
||||
|
||||
module_name_function
|
||||
my_function
|
||||
|
||||
but then you'll be left with an almost empty function body without any
|
||||
argument handling.
|
||||
@@ -89,9 +67,8 @@ FORMAT OF FUNCTION DEFINITIONS FILE
|
||||
|
||||
An example:
|
||||
|
||||
module_name_function(int arg1, int arg2 [, int arg3 [, int arg4]])
|
||||
my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
|
||||
|
||||
Arguments arg1 and arg2 are required.
|
||||
Arguments arg3 and arg4 are optional.
|
||||
|
||||
If possible, the function definition should also contain it's return type
|
||||
@@ -151,15 +128,15 @@ EXAMPLE
|
||||
|
||||
The following _one_ line
|
||||
|
||||
bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
|
||||
will create this function definition for you (note that there are a few
|
||||
question marks to be replaced by you, and you must of course add your own
|
||||
value definitions too):
|
||||
|
||||
/* {{{ proto bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
*/
|
||||
PHP_FUNCTION(module_name_drawtext)
|
||||
PHP_FUNCTION(my_drawtext)
|
||||
{
|
||||
char *text = NULL;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
@@ -182,7 +159,7 @@ PHP_FUNCTION(module_name_drawtext)
|
||||
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id);
|
||||
}
|
||||
|
||||
php_error(E_WARNING, "module_name_drawtext: not yet implemented");
|
||||
php_error(E_WARNING, "my_drawtext: not yet implemented");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+11
-17
@@ -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
|
||||
PHP itself.
|
||||
Git itself.
|
||||
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
@@ -45,16 +45,15 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
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.
|
||||
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.2 This branch is closed.
|
||||
|
||||
@@ -62,22 +61,17 @@ Currently we have the following branches in use::
|
||||
|
||||
PHP-4.4 This branch is closed.
|
||||
|
||||
PHP-X.Y.Z These branches are used for the release managers for tagging
|
||||
the releases, hence they are closed to the general public.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.6) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.3) 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.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file of *any
|
||||
stable release* version with the given change. In other words,
|
||||
news about a bug fix which went into PHP-5.4, PHP-5.5 and master
|
||||
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.
|
||||
bug fixes, improvements, etc., should go into the NEWS file of the
|
||||
*first* to be released version with the given change. In other words
|
||||
any NEWS file change only needs to done in one branch.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
|
||||
@@ -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 :
|
||||
<?php
|
||||
var_dump(strrpos("ABCDEF","DEF"));
|
||||
var_dump(strrpos("ABCDEF","DAF"));
|
||||
?>
|
||||
|
||||
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 :
|
||||
<?php
|
||||
$a = "foo";
|
||||
unset($a[0][1][2]);
|
||||
?>
|
||||
|
||||
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):
|
||||
<?php
|
||||
$a = new a();
|
||||
class a {
|
||||
}
|
||||
?>
|
||||
|
||||
Example 2 (throws an error):
|
||||
<?php
|
||||
$a = new a();
|
||||
interface b{
|
||||
}
|
||||
class a implements b {
|
||||
}
|
||||
?>
|
||||
|
||||
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 :
|
||||
<?php
|
||||
class FooBar {
|
||||
}
|
||||
class ExtFooBar extends FooBar{}
|
||||
$a = new FooBar();
|
||||
var_dump(get_class($a), get_parent_class($a));
|
||||
?>
|
||||
|
||||
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 :
|
||||
<?php
|
||||
class Foo{
|
||||
function doFoo(){}
|
||||
function hasFoo(){}
|
||||
}
|
||||
var_dump(get_class_methods("Foo"));
|
||||
?>
|
||||
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 :
|
||||
<?php
|
||||
class Foo {
|
||||
function assignNew($obj) {
|
||||
$this = $obj;
|
||||
}
|
||||
}
|
||||
$a = new Foo();
|
||||
$b = new Foo();
|
||||
$a->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
|
||||
|
||||
+87
-114
@@ -8,30 +8,19 @@ General notes and tips
|
||||
1. Do not release on Fridays, Saturdays or Sundays
|
||||
because the sysadmins can not upgrade stuff then.
|
||||
|
||||
2. Package two days before a release. So if the release is to be on Thursday,
|
||||
package on Tuesday. Think about timezones as well.
|
||||
2. Package the day before a release. So if the release is to be on Thursday,
|
||||
package on Wednesday.
|
||||
|
||||
3. Ensure that the tests on Travis CI are green.
|
||||
See: https://travis-ci.org/php/php-src/builds
|
||||
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
|
||||
periodically and resolve the failures ASAP. See more in:
|
||||
https://wiki.php.net/rfc/travis_ci
|
||||
3. Ensure that Windows builds will work before packaging
|
||||
|
||||
4. Ensure that Windows builds will work before packaging
|
||||
4. Follow all steps to the letter. When unclear ask previous RM's (Derick/Ilia)
|
||||
before proceeding. Ideally make sure that for the first releases one of the
|
||||
previous RM's is around to answer questions. For the steps related to the
|
||||
php/QA/bug websites try to have someone from the webmaster team (Bjori) on hand.
|
||||
|
||||
5. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/
|
||||
Johannes/Stas/Derick/Ilia) before proceeding. Ideally make sure that for the
|
||||
first releases one of the previous RM's is around to answer questions. For the
|
||||
steps related to the php/QA/bug websites try to have someone from the webmaster
|
||||
team (Bjori) on hand.
|
||||
5. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
6. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
7. Moving extensions from/to PECL requires write acces to the destination.
|
||||
6. Moving extensions from/to PECL requires write acces to the destination.
|
||||
Most developers should have this.
|
||||
|
||||
Moving extensions from php-src to PECL
|
||||
@@ -58,52 +47,40 @@ Rolling a non stable release (alpha/beta/RC)
|
||||
|
||||
1. Check windows snapshot builder logs (http://windows.php.net/downloads/snaps/ the last revision)
|
||||
|
||||
2. Check the tests at https://travis-ci.org/php/php-src/builds
|
||||
|
||||
3. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
4. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
|
||||
3. Checkout the release branch for this release (e.g., PHP-5.4.2).
|
||||
|
||||
5. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta. Do not use dashes, you should
|
||||
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
|
||||
4. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta.
|
||||
|
||||
6. Compile and make test, with and without ZTS, using the right Bison version
|
||||
(for example, for 5.5, Bison 2.4.1 is used)
|
||||
5. Commit these changes to the branch with ``git commit -a``.
|
||||
|
||||
7. Check ./sapi/cli/php -v output for version matching.
|
||||
|
||||
8. If all is right, commit the changes to the release branch with ``git commit -a``.
|
||||
|
||||
9. Tag the repository release branch with the version, e.g.:
|
||||
6. Tag the repository with the version, e.g.:
|
||||
``git tag -u YOURKEYID php-5.4.2RC2``
|
||||
|
||||
10. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and ``NEWS``
|
||||
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
|
||||
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
Commit the changes to the main branch.
|
||||
|
||||
11. Push the changes to the main repo, the tag, the main branch and the release branch :
|
||||
7. Push the changes to the main repo:
|
||||
``git push --tags origin HEAD``
|
||||
``git push origin {main branch}``
|
||||
``git push origin {release branch}``
|
||||
|
||||
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz,bz2 and xz). Make sure you use the same GNU Bison
|
||||
version as snaps. Recent bison version are known to break ZTS.
|
||||
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
9. Copy those three tarballs to www.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick or Dan.
|
||||
MD5 sums. If you do not have this directory, talk to Derick.
|
||||
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
10. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
11. Once the release has been tagged, contact the PHP Windows development team
|
||||
(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
|
||||
--------------------------------------------------------
|
||||
|
||||
@@ -113,10 +90,10 @@ pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release".
|
||||
|
||||
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tests@lists.php.net``.
|
||||
This email is to notify the selected projects about a new release so that they
|
||||
can make sure their projects keep working. Make sure that you have been setup
|
||||
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
|
||||
as a moderator for ``primary-qa-tests@lists.php.net`` by having someone (Wez,
|
||||
Derick) run the following commands for you:
|
||||
|
||||
``ssh lists.php.net``
|
||||
@@ -132,9 +109,9 @@ Derick) run the following commands for you:
|
||||
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
4. Update ``web/php.git/include/version.inc`` (x=major version number)
|
||||
4. Update ``php.git/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1"
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
@@ -145,62 +122,70 @@ Derick) run the following commands for you:
|
||||
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other)
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
1. Checkout your release branch, you should have created when releasing previous RC
|
||||
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
|
||||
|
||||
2. If a CVE commit needs to be merged to the release, then have it committed to
|
||||
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
|
||||
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
|
||||
Don't forget to update NEWS manually in an extra commit then.
|
||||
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
|
||||
3. Commit those changes. Ensure the tests at https://travis-ci.org/php/php-src/builds are
|
||||
still passing.
|
||||
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
|
||||
|
||||
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
4. Commit those changes
|
||||
|
||||
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
5. Compile and make test, with and without ZTS, using the right Bison version
|
||||
(for example, for 5.5, Bison 2.4.1 is used)
|
||||
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for).
|
||||
When making 5.X release, you need to tag the Zend directory separately!!
|
||||
|
||||
6. Check ./sapi/cli/php -v output for version matching.
|
||||
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
|
||||
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
|
||||
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
|
||||
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
|
||||
|
||||
7. tag the repository with the version f.e. "``git tag -u YOURKEYID -s php-5.4.1``"
|
||||
8. Commit those changes
|
||||
|
||||
8. Push the tag f.e. "``git push origin php-5.4.1``"
|
||||
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
|
||||
branch if you're rolling 5.5.x releases).
|
||||
|
||||
9. run: ``PHPROOT=. ./makedist php 5.4.1``, this will export the tag, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
Check if the pear files are updated (phar).
|
||||
10. You do not have to update the tree, but of course you can with "``git pull
|
||||
origin <branch>``".
|
||||
|
||||
10. Generate the GPG signature files for the archives.
|
||||
``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx``
|
||||
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
11. Commit and push all the tarballs and signature files to web/php-distributions.git,
|
||||
then update the git submodule reference in web/php.git:
|
||||
``git submodule init;
|
||||
12. Commit those two tarballs to web/php-distributions.git, then update the git
|
||||
submodule reference in web/php.git:
|
||||
git submodule init;
|
||||
git submodule update;
|
||||
cd distributions;
|
||||
git pull origin master;
|
||||
cd ..;
|
||||
git commit distributions;
|
||||
git push;``
|
||||
This is to fetch the last commit id from php-distributions.git and commit this
|
||||
last commit id to web/php.git, then, mirrors will now sync
|
||||
git push;
|
||||
|
||||
12. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be committed to SVN too.
|
||||
|
||||
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
|
||||
|
||||
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
|
||||
------------------------------------
|
||||
|
||||
1. Update phpweb/include/releases.inc with the old release info
|
||||
(updates the download archives)
|
||||
1. Run the bumpRelease script for phpweb on your local checkout
|
||||
|
||||
a. You can run ``php bin/bumpRelease 5`` if you are making a release for the
|
||||
highest branch, otherwise you have to do this manually, see point 1.b
|
||||
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
|
||||
|
||||
b. In case multiple PHP minor versions are in active development you have
|
||||
to manually copy the old information to include/releases.inc
|
||||
@@ -213,23 +198,14 @@ Getting the stable release announced
|
||||
|
||||
c. ``$PHP_X_MD5`` array and update all the md5 sums
|
||||
|
||||
d. ``$PHP_X_SHA256`` array and update all the SHA256 sums
|
||||
d. set ``$PHP_X_RC`` to false!
|
||||
|
||||
e. set ``$PHP_X_RC`` to false!
|
||||
|
||||
f. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
e. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
|
||||
|
||||
g. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
|
||||
3. Create the release file (releases/x_y_z.php)
|
||||
Usually we use the same content as for point 6, but included in php template
|
||||
instead of the release xml.
|
||||
|
||||
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
|
||||
(prepare for next RC)
|
||||
|
||||
5. Update the ChangeLog file for the given major version
|
||||
3. Update the ChangeLog file for the given major version
|
||||
f.e. ``ChangeLog-5.php`` from the NEWS file
|
||||
|
||||
a. go over the list and put every element on one line
|
||||
@@ -249,10 +225,19 @@ f.e. ``ChangeLog-5.php`` from the NEWS file
|
||||
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
|
||||
|
||||
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
|
||||
|
||||
e. You may want to try php-web/bin/news2html to automate this task
|
||||
|
||||
6. Add a short notice to phpweb stating that there is a new release, and
|
||||
4. ``cp releases/5_4_0.php releases/5_4_1.php``
|
||||
|
||||
5. ``git add releases/5_4_1.php``
|
||||
|
||||
6. Update the ``releases/*.php`` file with relevant data. The release
|
||||
announcement file should list in detail:
|
||||
|
||||
a. security fixes,
|
||||
|
||||
b. changes in behavior (whether due to a bug fix or not)
|
||||
|
||||
7. Add a short notice to phpweb stating that there is a new release, and
|
||||
highlight the major important things (security fixes) and when it is important
|
||||
to upgrade.
|
||||
|
||||
@@ -260,18 +245,11 @@ to upgrade.
|
||||
|
||||
b. Add the content for the news entry
|
||||
|
||||
7. **Check mirrors have been synced before announcing or pushing news**
|
||||
Try, f.e. http://www.php.net/get/php-5.5.1.tar.bz2/from/a/mirror
|
||||
Try several mirrors, mirrors may update slowly (may take an hour)
|
||||
|
||||
8. Commit all the changes to their respective git repos
|
||||
8. Commit all the changes.
|
||||
|
||||
9. 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@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
@@ -288,9 +266,7 @@ Re-releasing the same version (or -pl)
|
||||
|
||||
d. ``$PHP_X_MD5`` array and update all the md5 sums
|
||||
|
||||
e. ``$PHP_X_SHA256`` array and update all the SHA256 sums
|
||||
|
||||
f. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
e. Make sure there are no outdated "notes" or edited "date" keys in the
|
||||
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
|
||||
|
||||
3. Add a short notice to phpweb stating that there is a new release, and
|
||||
@@ -307,6 +283,3 @@ 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@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
@@ -153,18 +153,3 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||
#ifdef COMPILE_DL_FOO
|
||||
ZEND_GET_MODULE(foo)
|
||||
#endif
|
||||
|
||||
PECL SITE CONFORMITY
|
||||
|
||||
If you plan to release an extension to the PECL website, there are several
|
||||
points to be regarded.
|
||||
|
||||
1. Add LICENSE or COPYING to the package.xml
|
||||
|
||||
2. The following should be defined in one of the extension header files
|
||||
|
||||
#define PHP_FOO_VERSION "1.2.3"
|
||||
|
||||
This macros has to be used within your foo_module_entry to indicate the
|
||||
extension version.
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
+14
-25
@@ -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
|
||||
@@ -50,17 +50,6 @@ Please make the mail subject prefix "[PATCH]". If attaching a patch,
|
||||
ensure it has a file extension of ".txt". This is because only MIME
|
||||
attachments of type 'text/*' are accepted.
|
||||
|
||||
The preferred way to propose PHP patch is sending pull request from
|
||||
github.
|
||||
|
||||
https://github.com/php/php-src
|
||||
|
||||
Fork the official PHP repository and send a pull request. A
|
||||
notification will be sent to the pull request mailing list. Sending a
|
||||
note to PHP Internals list (internals@lists.php.net) may help getting
|
||||
more feedback and quicker turnaround. You can also add pull requests
|
||||
to bug reports at http://bugs.php.net/.
|
||||
|
||||
|
||||
PHP Documentation Patches
|
||||
-------------------------
|
||||
@@ -89,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.
|
||||
|
||||
@@ -125,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.
|
||||
|
||||
@@ -145,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.
|
||||
@@ -153,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 "//".
|
||||
@@ -186,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.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
------------------
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automatically submit a test summary to our QA workflow
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
Please do *not* submit a failed test as a bug or ask for help on why
|
||||
it failed on your system without providing substantial backup information
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
|
||||
'make test'. server-tests was developed to provide support for
|
||||
testing PHP under it's primary environment, HTTP, and can run the
|
||||
PHP tests under any of the SAPI modules that are direct executables,
|
||||
or are accessible via HTTP.
|
||||
or are accessable via HTTP.
|
||||
|
||||
[New features]
|
||||
----------------
|
||||
@@ -95,7 +95,7 @@ include:
|
||||
$filename full native path to file, will become PATH_TRANSLATED
|
||||
$filepath =dirname($filename)
|
||||
$scriptname this is what will become SCRIPT_NAME unless you override it
|
||||
$docroot the equivalent of DOCUMENT_ROOT under Apache
|
||||
$docroot the equivelant of DOCUMENT_ROOT under Apache
|
||||
$cwd the directory that the test is being initiated from
|
||||
$this->conf all server-tests configuration vars
|
||||
$this->env all environment variables that will get passed to the test
|
||||
@@ -105,7 +105,7 @@ include:
|
||||
This section is also eval'd, and is similar in nature to --ENV--. However,
|
||||
this section is used to build the url used in an HTTP request. Valid values
|
||||
to set in this section would include:
|
||||
SCRIPT_NAME The initial part of the request url
|
||||
SCRIPT_NAME The inital part of the request url
|
||||
PATH_INFO The pathinfo part of a request url
|
||||
FRAGMENT The fragment section of a url (after #)
|
||||
QUERY_STRING The query part of a url (after ?)
|
||||
|
||||
@@ -17,7 +17,7 @@ See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
information on the process.
|
||||
|
||||
Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
|
||||
open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
|
||||
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
|
||||
|
||||
@@ -28,12 +28,3 @@ open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
|
||||
We do not merge pull requests directly on github. All PRs will be
|
||||
pulled and pushed through http://git.php.net.
|
||||
|
||||
|
||||
Guidelines for contributors
|
||||
===========================
|
||||
- [CODING_STANDARDS](/CODING_STANDARDS)
|
||||
- [README.GIT-RULES](/README.GIT-RULES)
|
||||
- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES)
|
||||
- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS)
|
||||
|
||||
Regular → Executable
File mode changed.
+1
-1
@@ -1,6 +1,6 @@
|
||||
## process this file with automake to produce Makefile.am
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
noinst_LTLIBRARIES=libtsrm.la
|
||||
libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c
|
||||
libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c
|
||||
|
||||
depend:
|
||||
@@ -143,6 +143,10 @@ SOURCE=.\tsrm_strtok_r.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_virtual_cwd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_win32.c
|
||||
# End Source File
|
||||
# End Group
|
||||
@@ -171,6 +175,10 @@ SOURCE=.\tsrm_strtok_r.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_virtual_cwd.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_win32.h
|
||||
# End Source File
|
||||
# End Group
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// vim:ft=javascript
|
||||
// $Id$
|
||||
|
||||
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
|
||||
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c tsrm_win32.c");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define TSRM_CONFIG_W32_H
|
||||
|
||||
#include <../main/config.w32.h>
|
||||
#include "Zend/zend_config.w32.h"
|
||||
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_ALLOCA 1
|
||||
@@ -12,4 +11,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#undef inline
|
||||
#ifdef ZEND_WIN32_FORCE_INLINE
|
||||
# define inline __forceinline
|
||||
#else
|
||||
# define inline
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
#define TSRM_CONFIG_COMMON_H
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
# ifdef _WIN32
|
||||
# if WINNT|WIN32
|
||||
# define TSRM_WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
@@ -30,8 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_virtual_cwd.h"
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
#include "tsrm_strtok_r.h"
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
@@ -127,6 +126,7 @@ static int php_check_dots(const char *element, int n)
|
||||
#define TOKENIZER_STRING "/"
|
||||
#endif
|
||||
|
||||
|
||||
/* default macros */
|
||||
|
||||
#ifndef IS_DIRECTORY_UP
|
||||
@@ -149,21 +149,11 @@ static int php_check_dots(const char *element, int n)
|
||||
|
||||
#define CWD_STATE_COPY(d, s) \
|
||||
(d)->cwd_length = (s)->cwd_length; \
|
||||
(d)->cwd = (char *) emalloc((s)->cwd_length+1); \
|
||||
(d)->cwd = (char *) malloc((s)->cwd_length+1); \
|
||||
memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1);
|
||||
|
||||
#define CWD_STATE_FREE(s) \
|
||||
efree((s)->cwd);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
# define CWD_STATE_FREE_ERR(state) do { \
|
||||
DWORD last_error = GetLastError(); \
|
||||
CWD_STATE_FREE(state); \
|
||||
SetLastError(last_error); \
|
||||
} while (0)
|
||||
#else
|
||||
# define CWD_STATE_FREE_ERR(state) CWD_STATE_FREE(state)
|
||||
#endif
|
||||
free((s)->cwd);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
|
||||
@@ -261,7 +251,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
|
||||
}
|
||||
|
||||
dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS);
|
||||
if(dwRet >= MAXPATHLEN || dwRet == 0) {
|
||||
if(dwRet >= MAXPATHLEN) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -296,7 +286,6 @@ CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{
|
||||
WIN32_FILE_ATTRIBUTE_DATA data;
|
||||
__int64 t;
|
||||
const size_t path_len = strlen(path);
|
||||
ALLOCA_FLAG(use_heap_large);
|
||||
|
||||
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
|
||||
return stat(path, buf);
|
||||
@@ -348,15 +337,16 @@ CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{
|
||||
HANDLE hLink = NULL;
|
||||
REPARSE_DATA_BUFFER * pbuffer;
|
||||
unsigned int retlength = 0;
|
||||
TSRM_ALLOCA_FLAG(use_heap_large);
|
||||
|
||||
hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
if(hLink == INVALID_HANDLE_VALUE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
|
||||
pbuffer = (REPARSE_DATA_BUFFER *)tsrm_do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
|
||||
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
CloseHandle(hLink);
|
||||
return -1;
|
||||
}
|
||||
@@ -373,7 +363,7 @@ CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{
|
||||
buf->st_mode |=;
|
||||
}
|
||||
#endif
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
} else {
|
||||
buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
|
||||
buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
|
||||
@@ -439,6 +429,7 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
|
||||
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
CWD_STATE_FREE(&cwd_g->cwd);
|
||||
realpath_cache_clean(TSRMLS_C);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -499,25 +490,6 @@ CWD_API void virtual_cwd_shutdown(void) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_cwd_activate(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (CWDG(cwd).cwd == NULL) {
|
||||
CWD_STATE_COPY(&CWDG(cwd), &main_cwd_state);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (CWDG(cwd).cwd != NULL) {
|
||||
CWD_STATE_FREE(&CWDG(cwd));
|
||||
CWDG(cwd).cwd = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
cwd_state *state;
|
||||
@@ -528,7 +500,7 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
char *retval;
|
||||
|
||||
*length = 1;
|
||||
retval = (char *) emalloc(2);
|
||||
retval = (char *) malloc(2);
|
||||
if (retval == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -543,7 +515,7 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
char *retval;
|
||||
|
||||
*length = state->cwd_length+1;
|
||||
retval = (char *) emalloc(*length+1);
|
||||
retval = (char *) malloc(*length+1);
|
||||
if (retval == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -555,7 +527,7 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
#endif
|
||||
*length = state->cwd_length;
|
||||
return estrdup(state->cwd);
|
||||
return strdup(state->cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -571,12 +543,12 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
|
||||
return cwd;
|
||||
}
|
||||
if (length > size-1) {
|
||||
efree(cwd);
|
||||
free(cwd);
|
||||
errno = ERANGE; /* Is this OK? */
|
||||
return NULL;
|
||||
}
|
||||
memcpy(buf, cwd, length+1);
|
||||
efree(cwd);
|
||||
free(cwd);
|
||||
return buf;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -587,14 +559,12 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len TS
|
||||
register unsigned long h;
|
||||
char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
|
||||
char *bucket_key = (char *)bucket_key_start;
|
||||
const char *e;
|
||||
const char *e = bucket_key + strlen(bucket_key);
|
||||
|
||||
if (!bucket_key) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
e = bucket_key + strlen(bucket_key);
|
||||
|
||||
for (h = 2166136261U; bucket_key < e;) {
|
||||
h *= 16777619;
|
||||
h ^= *bucket_key++;
|
||||
@@ -651,14 +621,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
}
|
||||
|
||||
|
||||
free(r);
|
||||
return;
|
||||
} else {
|
||||
@@ -734,7 +704,7 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
@@ -784,13 +754,13 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
#ifdef TSRM_WIN32
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
ALLOCA_FLAG(use_heap_large)
|
||||
TSRM_ALLOCA_FLAG(use_heap_large)
|
||||
#else
|
||||
struct stat st;
|
||||
#endif
|
||||
realpath_cache_bucket *bucket;
|
||||
char *tmp;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
TSRM_ALLOCA_FLAG(use_heap)
|
||||
|
||||
while (1) {
|
||||
if (len <= start) {
|
||||
@@ -890,7 +860,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
FindClose(hFind);
|
||||
}
|
||||
|
||||
tmp = do_alloca(len+1, use_heap);
|
||||
tmp = tsrm_do_alloca(len+1, use_heap);
|
||||
memcpy(tmp, path, len+1);
|
||||
|
||||
if(save &&
|
||||
@@ -917,13 +887,12 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
return -1;
|
||||
}
|
||||
|
||||
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
|
||||
pbuffer = (REPARSE_DATA_BUFFER *)tsrm_do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
|
||||
if (pbuffer == NULL) {
|
||||
CloseHandle(hLink);
|
||||
return -1;
|
||||
}
|
||||
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
CloseHandle(hLink);
|
||||
return -1;
|
||||
}
|
||||
@@ -939,7 +908,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
@@ -951,7 +920,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
@@ -965,7 +934,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
|
||||
@@ -976,7 +945,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
@@ -986,7 +955,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
memcpy(substitutename, path, len + 1);
|
||||
substitutename_len = len;
|
||||
} else {
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1030,21 +999,21 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
fprintf(stderr, "sub: %s ", substitutename);
|
||||
fprintf(stderr, "resolved: %s ", path);
|
||||
#endif
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
|
||||
if(isabsolute == 1) {
|
||||
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(i + j >= MAXPATHLEN - 1) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1053,7 +1022,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
path[i-1] = DEFAULT_SLASH;
|
||||
j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1074,7 +1043,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
|
||||
#elif defined(NETWARE)
|
||||
save = 0;
|
||||
tmp = do_alloca(len+1, use_heap);
|
||||
tmp = tsrm_do_alloca(len+1, use_heap);
|
||||
memcpy(tmp, path, len+1);
|
||||
#else
|
||||
if (save && php_sys_lstat(path, &st) < 0) {
|
||||
@@ -1086,25 +1055,25 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
save = 0;
|
||||
}
|
||||
|
||||
tmp = do_alloca(len+1, use_heap);
|
||||
tmp = tsrm_do_alloca(len+1, use_heap);
|
||||
memcpy(tmp, path, len+1);
|
||||
|
||||
if (save && S_ISLNK(st.st_mode)) {
|
||||
if (++(*ll) > LINK_MAX || (j = php_sys_readlink(tmp, path, MAXPATHLEN)) < 0) {
|
||||
/* too many links or broken symlinks */
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
path[j] = 0;
|
||||
if (IS_ABSOLUTE_PATH(path, j)) {
|
||||
j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
|
||||
if (j < 0) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (i + j >= MAXPATHLEN-1) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1; /* buffer overflow */
|
||||
}
|
||||
memmove(path+i, path, j+1);
|
||||
@@ -1112,7 +1081,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
path[i-1] = DEFAULT_SLASH;
|
||||
j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC);
|
||||
if (j < 0) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1127,7 +1096,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
}
|
||||
if (is_dir && !directory) {
|
||||
/* not a directory */
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1143,7 +1112,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
}
|
||||
#ifdef TSRM_WIN32
|
||||
if (j < 0 || j + len - i >= MAXPATHLEN-1) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
if (save) {
|
||||
@@ -1158,7 +1127,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
}
|
||||
#else
|
||||
if (j < 0 || j + len - i >= MAXPATHLEN-1) {
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
memcpy(path+j, tmp+i, len-i+1);
|
||||
@@ -1171,7 +1140,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
realpath_cache_add(tmp, len, path, j, directory, *t TSRMLS_CC);
|
||||
}
|
||||
|
||||
free_alloca(tmp, use_heap);
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return j;
|
||||
}
|
||||
}
|
||||
@@ -1190,7 +1159,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
int add_slash;
|
||||
void *tmp;
|
||||
|
||||
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
|
||||
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
|
||||
#ifdef TSRM_WIN32
|
||||
# if _MSC_VER < 1300
|
||||
errno = EINVAL;
|
||||
@@ -1347,7 +1316,7 @@ verify:
|
||||
CWD_STATE_COPY(&old_state, state);
|
||||
state->cwd_length = path_length;
|
||||
|
||||
tmp = erealloc(state->cwd, state->cwd_length+1);
|
||||
tmp = realloc(state->cwd, state->cwd_length+1);
|
||||
if (tmp == NULL) {
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
@@ -1367,7 +1336,7 @@ verify:
|
||||
}
|
||||
} else {
|
||||
state->cwd_length = path_length;
|
||||
tmp = erealloc(state->cwd, state->cwd_length+1);
|
||||
tmp = realloc(state->cwd, state->cwd_length+1);
|
||||
if (tmp == NULL) {
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Out of memory\n");
|
||||
@@ -1398,7 +1367,7 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
|
||||
int length = strlen(path);
|
||||
char *temp;
|
||||
int retval;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
TSRM_ALLOCA_FLAG(use_heap)
|
||||
|
||||
if (length == 0) {
|
||||
return 1; /* Can't cd to empty string */
|
||||
@@ -1415,14 +1384,14 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
|
||||
if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
|
||||
length++;
|
||||
}
|
||||
temp = (char *) do_alloca(length+1, use_heap);
|
||||
temp = (char *) tsrm_do_alloca(length+1, use_heap);
|
||||
memcpy(temp, path, length);
|
||||
temp[length] = 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Changing directory to %s\n", temp);
|
||||
#endif
|
||||
retval = p_chdir(temp TSRMLS_CC);
|
||||
free_alloca(temp, use_heap);
|
||||
tsrm_free_alloca(temp, use_heap);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1435,7 +1404,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
|
||||
|
||||
/* realpath("") returns CWD */
|
||||
if (!*path) {
|
||||
new_state.cwd = (char*)emalloc(1);
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
if (new_state.cwd == NULL) {
|
||||
retval = NULL;
|
||||
goto end;
|
||||
@@ -1448,7 +1417,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
|
||||
} else if (!IS_ABSOLUTE_PATH(path, strlen(path))) {
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
} else {
|
||||
new_state.cwd = (char*)emalloc(1);
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
if (new_state.cwd == NULL) {
|
||||
retval = NULL;
|
||||
goto end;
|
||||
@@ -1505,14 +1474,13 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f = fopen(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1524,7 +1492,7 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1534,7 +1502,7 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
|
||||
ret = access(new_state.cwd, mode);
|
||||
#endif
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1597,7 +1565,7 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1607,7 +1575,7 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /
|
||||
ret = utime(new_state.cwd, buf);
|
||||
#endif
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1620,13 +1588,13 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = chmod(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1639,7 +1607,7 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1653,7 +1621,7 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
|
||||
ret = chown(new_state.cwd, owner, group);
|
||||
}
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1666,7 +1634,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1682,7 +1650,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
|
||||
} else {
|
||||
f = open(new_state.cwd, flags);
|
||||
}
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1694,18 +1662,18 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
f = creat(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
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;
|
||||
@@ -1713,15 +1681,15 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /
|
||||
|
||||
CWD_STATE_COPY(&old_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&old_state);
|
||||
CWD_STATE_FREE(&old_state);
|
||||
return -1;
|
||||
}
|
||||
oldname = old_state.cwd;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&old_state);
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&old_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
newname = new_state.cwd;
|
||||
@@ -1735,8 +1703,8 @@ CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /
|
||||
retval = rename(oldname, newname);
|
||||
#endif
|
||||
|
||||
CWD_STATE_FREE_ERR(&old_state);
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&old_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -1749,13 +1717,13 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = php_sys_stat(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1767,13 +1735,13 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ *
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = php_sys_lstat(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1785,13 +1753,13 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = unlink(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1803,7 +1771,7 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1812,7 +1780,7 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */
|
||||
#else
|
||||
retval = mkdir(new_state.cwd, mode);
|
||||
#endif
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1824,13 +1792,13 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = rmdir(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1846,13 +1814,13 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = opendir(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1896,7 +1864,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
|
||||
#else /* Unix */
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t command_length;
|
||||
int command_length;
|
||||
int dir_length, extra = 0;
|
||||
char *command_line;
|
||||
char *ptr, *dir;
|
||||
@@ -1914,7 +1882,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
|
||||
dir_length = CWDG(cwd).cwd_length;
|
||||
dir = CWDG(cwd).cwd;
|
||||
|
||||
ptr = command_line = (char *) emalloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1);
|
||||
ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1);
|
||||
if (!command_line) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1948,7 +1916,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
|
||||
memcpy(ptr, command, command_length+1);
|
||||
retval = popen(command_line, type);
|
||||
|
||||
efree(command_line);
|
||||
free(command_line);
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1961,7 +1929,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
|
||||
|
||||
/* realpath("") returns CWD */
|
||||
if (!*path) {
|
||||
new_state.cwd = (char*)emalloc(1);
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
if (new_state.cwd == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1972,10 +1940,10 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
|
||||
}
|
||||
} else if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
|
||||
VCWD_GETCWD(cwd, MAXPATHLEN)) {
|
||||
new_state.cwd = estrdup(cwd);
|
||||
new_state.cwd = strdup(cwd);
|
||||
new_state.cwd_length = strlen(cwd);
|
||||
} else {
|
||||
new_state.cwd = (char*)emalloc(1);
|
||||
new_state.cwd = (char*)malloc(1);
|
||||
if (new_state.cwd == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1984,7 +1952,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
|
||||
}
|
||||
|
||||
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) {
|
||||
efree(new_state.cwd);
|
||||
free(new_state.cwd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1992,7 +1960,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
|
||||
int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
|
||||
memcpy(real_path, new_state.cwd, copy_len);
|
||||
real_path[copy_len] = '\0';
|
||||
efree(new_state.cwd);
|
||||
free(new_state.cwd);
|
||||
return real_path;
|
||||
} else {
|
||||
return new_state.cwd;
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
@@ -151,8 +151,6 @@ typedef int (*verify_path_func)(const cwd_state *);
|
||||
|
||||
CWD_API void virtual_cwd_startup(void);
|
||||
CWD_API void virtual_cwd_shutdown(void);
|
||||
CWD_API int virtual_cwd_activate(TSRMLS_D);
|
||||
CWD_API int virtual_cwd_deactivate(TSRMLS_D);
|
||||
CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC);
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC);
|
||||
CWD_API int virtual_chdir(const char *path TSRMLS_DC);
|
||||
@@ -163,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);
|
||||
+4
-20
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
@@ -32,7 +32,7 @@
|
||||
#ifdef TSRM_WIN32
|
||||
#include <Sddl.h>
|
||||
#include "tsrm_win32.h"
|
||||
#include "zend_virtual_cwd.h"
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
|
||||
#ifdef ZTS
|
||||
static ts_rsrc_id win32_globals_id;
|
||||
@@ -616,12 +616,6 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -660,27 +654,17 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->descriptor->shm_atime = time(NULL);
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
return shm->addr;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| 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 |
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
$Id$
|
||||
|
||||
PHP 5.6 UPGRADE NOTES
|
||||
PHP 5.5 UPGRADE NOTES
|
||||
|
||||
1. Backward Incompatible Changes
|
||||
2. New Features
|
||||
3. Changes in SAPI modules
|
||||
4. Deprecated Functionality
|
||||
5. Changed Functions
|
||||
6. New Functions
|
||||
7. New Classes and Interfaces
|
||||
8. Removed Extensions
|
||||
9. Other Changes to Extensions
|
||||
10. New Global Constants
|
||||
11. Changes to INI File Handling
|
||||
1. Backward Incompatible Changes
|
||||
2. New Features
|
||||
2. Changes in SAPI modules
|
||||
3. Deprecated Functionality
|
||||
4. Changed Functions
|
||||
5. New Functions
|
||||
6. New Classes and Interfaces
|
||||
7. Removed Extensions
|
||||
8. Other Changes to Extensions
|
||||
9. New Global Constants
|
||||
10. Changes to INI File Handling
|
||||
11. Windows Support
|
||||
12. Other Changes
|
||||
|
||||
|
||||
@@ -20,505 +21,461 @@ PHP 5.6 UPGRADE NOTES
|
||||
1. Backward Incompatible Changes
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
By fixing bug #66015 it is no longer possible to overwrite keys in static scalar
|
||||
arrays. Quick example to illustrate:
|
||||
class Test {
|
||||
const FIRST = 1;
|
||||
public $array = array(
|
||||
self::FIRST => 'first',
|
||||
'second',
|
||||
'third'
|
||||
);
|
||||
}
|
||||
Test::$array will have as expected three array keys (1, 2, 3) and no longer
|
||||
two (0, 1). self::FIRST will no longer overwrite 'third' having key 1 then,
|
||||
but will mark the beginning of indexing.
|
||||
- Dropped Windows XP and 2003 support. (Pierre)
|
||||
|
||||
- JSON:
|
||||
json_decode() no longer accepts non-lowercase variants of lone JSON true,
|
||||
false or null values. For example, True or FALSE will now cause json_decode to
|
||||
return NULL and set an error value you can fetch with json_last_error().
|
||||
This affects JSON texts consisting solely of true, false or null. Text
|
||||
containing non-lowercase values inside JSON arrays or objects has never been
|
||||
accepted.
|
||||
- All internal case insensitivity handling for class, function and constant
|
||||
names is done according to ASCII rules. Current locale settings are ignored.
|
||||
|
||||
- OpenSSL:
|
||||
To prevent man-in-the-middle attacks against encrypted transfers client
|
||||
streams now verify peer certificates by default. Previous versions
|
||||
required users to manually enable peer verification. As a result of this
|
||||
change, existing code using ssl:// or tls:// stream wrappers (e.g.
|
||||
file_get_contents(), fsockopen(), stream_socket_client()) may no longer
|
||||
connect successfully without manually disabling peer verification via the
|
||||
stream context's "verify_peer" setting. Encrypted transfers delegate to
|
||||
operating system certificate stores by default if not overridden via the
|
||||
new openssl.cafile and openssl.cafile ini directives or via call-time SSL
|
||||
context options, so most users should be unaffected by this transparent
|
||||
security enhancement. (https://wiki.php.net/rfc/tls-peer-verification)
|
||||
- self, parent & static keywords now are always case-insensitive (see bug
|
||||
#60833).
|
||||
|
||||
- Mcrypt:
|
||||
The mcrypt_encrypt(), mcrypt_decrypt() and mcrypt_{MODE}() functions no
|
||||
longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
|
||||
required if the used block cipher mode requires it.
|
||||
|
||||
- cURL:
|
||||
Uploads using the @file syntax are now unsupported by default.
|
||||
- Removed Logo GUIDs: php_logo_guid(), php_egg_logo_guid(),
|
||||
php_real_logo_guid() and zend_logo_guid()
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
|
||||
- Added constant scalar expressions syntax.
|
||||
(https://wiki.php.net/rfc/const_scalar_exprs)
|
||||
- Support list in foreach. (Laruence)
|
||||
(http://php.net/foreach#control-structures.foreach.list,
|
||||
http://wiki.php.net/rfc/foreachlist)
|
||||
|
||||
- Added dedicated syntax for variadic functions.
|
||||
(https://wiki.php.net/rfc/variadics)
|
||||
- Support "finally" keyword. (Laruence)
|
||||
(http://php.net/exceptions, http://wiki.php.net/rfc/finally)
|
||||
|
||||
- Added support for argument unpacking to complement the variadic syntax.
|
||||
(https://wiki.php.net/rfc/argument_unpacking)
|
||||
- Support constant array/string dereferencing. (Laruence)
|
||||
(http://php.net/manual/en/language.types.array.php,
|
||||
https://wiki.php.net/rfc/constdereference)
|
||||
|
||||
- Added an exponentiation operator (**).
|
||||
(https://wiki.php.net/rfc/pow-operator)
|
||||
- Add support for using empty() on the result of function calls and
|
||||
other expressions. Thus it is now possible to write empty(getArray()),
|
||||
for example. (http://php.net/manual/en/function.empty.php,
|
||||
https://wiki.php.net/rfc/empty_isset_exprs)
|
||||
|
||||
- Added unified default encoding. default_charset=UTF-8 and functions/extensions
|
||||
use encoding settings honor default_charset.
|
||||
- Added generators.
|
||||
(http://php.net/generators, https://wiki.php.net/rfc/generators)
|
||||
|
||||
- The php://input stream is now re-usable and can be used concurrently with
|
||||
enable_post_data_reading=0.
|
||||
- ClassName::class syntax returning full class name for a class as a
|
||||
string constant. (http://php.net/oop5.basic,
|
||||
https://wiki.php.net/rfc/class_name_scalars)
|
||||
|
||||
- Added use function and use const.
|
||||
(https://wiki.php.net/rfc/use_function)
|
||||
- Added support for non-scalar Iterator keys in foreach.
|
||||
(http://php.net/manual/en/control-structures.foreach.php,
|
||||
https://wiki.php.net/rfc/foreach-non-scalar-keys).
|
||||
|
||||
- Added a function for timing attack safe string comparison
|
||||
(https://wiki.php.net/rfc/timing_attack)
|
||||
- Bundled Zend OPcache extension to improve performance
|
||||
(http://php.net/manual/en/book.opcache.php,
|
||||
https://wiki.php.net/rfc/optimizerplus)
|
||||
|
||||
- Added the __debugInfo() magic method to allow userland classes to implement
|
||||
the get_debug_info API previously available only to extensions.
|
||||
(https://wiki.php.net/rfc/debug-info)
|
||||
|
||||
- Added gost-crypto (CryptoPro S-box) hash algorithm.
|
||||
|
||||
- Stream wrappers verify peer certificates and host names by default in
|
||||
encrypted client streams.
|
||||
|
||||
- Added openssl certificate fingerprint support (inclusive stream context
|
||||
option).
|
||||
|
||||
- Added support for SAN x509 extension matching when verifing host names in
|
||||
encrypted streams.
|
||||
|
||||
- Added a range of new SSL context options for improved encrypted stream
|
||||
server security (https://wiki.php.net/rfc/improved-tls-defaults):
|
||||
|
||||
. "honor_cipher_order" allows servers to prioritize cipher suites of their
|
||||
choosing when negotiating SSL/TLS handshakes.
|
||||
. "single_ecdh_use" and "single_dh_use" allow for improved forward
|
||||
secrecy in encrypted stream servers.
|
||||
. "dh_param" allows specification of pre-generated key generation
|
||||
parameters when negotiating ephemeral DHE ciphers in stream servers.
|
||||
. "ecdh_curve" allows stream servers to specify which curve to use when
|
||||
negotiating ephemeral ECDHE ciphers (defaults to NIST P-256).
|
||||
. "rsa_key_size" SSL context option gives stream servers control
|
||||
over the key size (in bits) used when negotiating RSA ciphers.
|
||||
. "capture_session_meta" if specified stores an array of data describing
|
||||
the TLS session's protocol/cipher in the "session_meta" SSL context key.
|
||||
|
||||
- Added automatic mitigation against client-initated TLS renegotiation DoS
|
||||
attacks in encrypted server streams. Renegotiation limiting may be
|
||||
customized via three new SSL context options:
|
||||
|
||||
. "reneg_limit" (number of allowed renegotiations per time window)
|
||||
. "reneg_window" (renegotiation time window in seconds)
|
||||
. "reneg_limit_callback" (optional notification callback on limiting)
|
||||
|
||||
- Encrypted TLS servers now support the server name indication (SNI) TLS
|
||||
extension via the new "SNI_server_certs" SSL context option.
|
||||
|
||||
- Added "crypto_method" SSL context option for use in encrypted streams.
|
||||
|
||||
- Added "peer_name" SSL context option to better reflect peer certificate
|
||||
name matching using SAN extension (replaces deprecated "CN_match").
|
||||
|
||||
- Added stream wrapper support when specifying "cafile" SSL context paths.
|
||||
|
||||
- Independent peer cert and peer name validation is now available via a new
|
||||
boolean "verify_peer_name" SSL context option. This option is enabled by
|
||||
default in encrypted client streams.
|
||||
|
||||
- Added protocol-specific tlsv1.0://, tlsv1.1:// and tlsv1.2:// encryption
|
||||
stream wrappers. tls:// wrapper now supports TLSv1.1 and TLSv1.2 (previously
|
||||
only supported TLSv1).
|
||||
|
||||
- Stream crypto method specification now accepts flags instead of values
|
||||
allowing support for multiple discrete protocols in a given stream.
|
||||
|
||||
- PostgreSQL database connections may now be established asynchronously using
|
||||
new constants and polling functions in ext/pgsql.
|
||||
|
||||
- Non-blocking read/write query behavior now optionally available in database
|
||||
operations using the ext/pgsql extension.
|
||||
- Added a simplified password hashing API
|
||||
(http://php.net/password, https://wiki.php.net/rfc/password_hash)
|
||||
|
||||
========================================
|
||||
3. Changes in SAPI modules
|
||||
2. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
- Added phpdbg SAPI.
|
||||
(https://wiki.php.net/rfc/phpdbg)
|
||||
- Support for changing the process's title in CLI/CLI-Server
|
||||
SAPIs. (Keyur)
|
||||
(http://php.net/manual/en/function.cli-set-process-title.php,
|
||||
http://php.net/manual/en/function.cli-get-process-title.php,
|
||||
https://wiki.php.net/rfc/cli_process_title)
|
||||
|
||||
- Support for FPM workers changing the apparmor profile through the pool configuration.
|
||||
(https://wiki.php.net/rfc/fpm_change_hat)
|
||||
|
||||
- Support for several XML MIME types in the built-in CLI server. For static
|
||||
files with extensions .xml, .xsl, .xsd the Content-Type header
|
||||
application/xml is now sent automatically.
|
||||
- Support for systemd in php-fpm: Add --with-fpm-systemd option to
|
||||
report health to systemd, and add systemd_interval option to
|
||||
configure this. The service can now use Type=notify in the systemd
|
||||
unit file. (Remi)
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
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
|
||||
- The original MySQL extension is now deprecated and will generate
|
||||
deprecation warnings when connecting to a database through
|
||||
mysql_connect(), mysql_pconnect() or by establishing an implicit
|
||||
connection. Use MySQLi or PDO instead.
|
||||
|
||||
- The "CN_match" and "SNI_server_name" SSL context options are deprecated in
|
||||
favor of the new "peer_name" option. Name verification now checks certificate
|
||||
SAN names as well as the CN field and the specific name fields are deprecated
|
||||
to avoid confusion. Their use triggers E_DEPRECATED but continues to work as
|
||||
before. If specified, the specific values take precedence over the general
|
||||
"peer_name" value.
|
||||
- The preg_replace /e modifier is now deprecated. Use
|
||||
preg_replace_callback instead.
|
||||
(https://wiki.php.net/rfc/remove_preg_replace_eval_modifier)
|
||||
|
||||
- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
|
||||
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
|
||||
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
|
||||
deprecated. Use IntlDateFormatter::setTimeZone() or
|
||||
datefmt_set_timezone() instead.
|
||||
|
||||
- Deprecated INIs: Following INIs are deprecated in favour of new
|
||||
internal_encoding/input_encoding/output_encoding. Refer to "Changes to
|
||||
encodings in PHP 5.6" in "11. Other Changes" section for more details.
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
mbstring.http_input
|
||||
mbstring.http_output
|
||||
mbstring.internal_encoding
|
||||
- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw
|
||||
E_DEPRECATED. Their use was already previously discouraged in the
|
||||
documentation, but that predated the existence of E_DEPRECATED.
|
||||
|
||||
========================================
|
||||
5. Changed Functions
|
||||
4. Changed Functions
|
||||
========================================
|
||||
|
||||
- cURL:
|
||||
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
|
||||
do not work unless it is explicitly set to false.
|
||||
- pack()/unpack() had the following changes, which bring it more in
|
||||
line with Perl's behavior: - Implemented format character "Z": NULL
|
||||
padded string, with trailing NULL bytes removed. - Changed format
|
||||
character "a": this no longer removes trailing NULL bytes. -
|
||||
Changed format character "A": all trailing ASCII whitespace is now
|
||||
removed (defined as spaces, tabs, \r, \n and NULL).
|
||||
|
||||
curl_setopt() now supports the following nullable settings (>= 5.5.11):
|
||||
. CURLOPT_CUSTOMREQUEST
|
||||
. CURLOPT_FTPPORT
|
||||
. CURLOPT_RANGE
|
||||
. CURLOPT_FTP_ACCOUNT
|
||||
. CURLOPT_RTSP_SESSION_ID
|
||||
. CURLOPT_KRBLEVEL
|
||||
. CURLOPT_KRB4LEVEL
|
||||
- MessageFormatter::format() and related functions now accepted named
|
||||
arguments and mixed numeric/named arguments in ICU 4.8+.
|
||||
|
||||
curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 5.6.25)
|
||||
- MessageFormatter::format() and related functions now don't error out
|
||||
when an insufficient argument count is provided. Instead, the
|
||||
placeholders will remain unsubstituted.
|
||||
|
||||
- Strings:
|
||||
substr_compare() now allows $length to be zero.
|
||||
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
|
||||
- MessageFormatter::parse() and MessageFormat::format() (and their
|
||||
static equivalents) now don't throw away better than second
|
||||
precision in the arguments.
|
||||
|
||||
- Crypt:
|
||||
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
|
||||
See: https://wiki.php.net/rfc/crypt_function_salt
|
||||
- IntlDateFormatter::__construct and datefmt_create() now accept for
|
||||
the $timezone argument time zone identifiers, IntlTimeZone objects,
|
||||
DateTimeZone objects and NULL. It used to accept only time zone
|
||||
identifiers and NULL. Invalid time zone identifiers are no longer
|
||||
accepted. Empty strings are no longer accepted.
|
||||
|
||||
- Mcrypt:
|
||||
The $source parameter of mcrypt_create_iv() now defaults to
|
||||
MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
|
||||
- The default time zone used in IntlDateFormatter::__construct and
|
||||
datefmt_create() (when the corresponding argument is not passed or
|
||||
NULL is passed) is now the one given by date_default_timezone_get(),
|
||||
not the default ICU time zone.
|
||||
|
||||
- OpenSSL:
|
||||
The $crypto_type parameter is now optional in stream_socket_enable_crypto()
|
||||
if the stream's SSL context specifies the new "crypto_type" option. The
|
||||
crypto method from the context is used as a fallback if no crypto method is
|
||||
specified at call-time.
|
||||
- The time zone passed to the IntlDateFormatter is ignored if it is
|
||||
NULL and if the calendar passed is an IntlCalendar object -- in this
|
||||
case, the IntlCalendar's time zone will be used instead. Otherwise,
|
||||
the time zone specified in the $timezone argument is used
|
||||
instead. This does not affect old code, as IntlCalendar was
|
||||
introduced in this version.
|
||||
|
||||
- Reflection:
|
||||
ReflectionClass::newInstanceWithoutConstructor previously didn't allow the
|
||||
instantiation of any internal class which used custom object storage
|
||||
(overriding the default create_object handler), this was changed to only
|
||||
reject the instantiation of such classes if the class is also marked as
|
||||
final.
|
||||
- IntlDateFormatter::__construct and datefmt_create() now accept for
|
||||
the $calendar argument also IntlCalendar objects.
|
||||
|
||||
- XMLReader:
|
||||
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
|
||||
the attribute could not be found, just like XMLReader::getAttribute.
|
||||
- IntlDateFormatter::getCalendar() and datefmt_get_calendar() return
|
||||
false if the IntlDateFormatter was set up with an IntlCalendar
|
||||
instead of the constants
|
||||
IntlDateFormatter::GREGORIAN/TRADITIONAL. IntlCalendar did not exist
|
||||
before this version.
|
||||
|
||||
- Pgsql:
|
||||
pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
|
||||
The following functions no longer block until query write completion if the
|
||||
socket stream underlying a database connection is set to non-blocking mode:
|
||||
. pg_send_execute()
|
||||
. pg_send_prepare()
|
||||
. pg_send_query()
|
||||
. pg_send_query_params()
|
||||
- IntlDateFormatter::setCalendar() and datefmt_set_calendar() now also
|
||||
accept an IntlCalendar object, in which case its time zone is
|
||||
taken. Passing a constant is still allowed, and still keeps the time
|
||||
zone.
|
||||
|
||||
- unserialize:
|
||||
Manipulated serialization strings for objects implementing Serializable by
|
||||
replacing "C:" with "O:" at the start will now produce an error.
|
||||
- IntlDateFormatter::format() and datefmt_format() now also accept an
|
||||
IntlCalendar object for formatting.
|
||||
|
||||
- parse_ini_file():
|
||||
- parse_ini_string():
|
||||
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
|
||||
For PHP >= 5.6.1
|
||||
- set_error_handler(NULL) can now be used to reset the error handler.
|
||||
Furthermore both set_error_handler(NULL) and
|
||||
set_exception_handler(NULL) will now return the previously defined
|
||||
error/exception handler. Previously bool(true) was returned.
|
||||
|
||||
- JSON:
|
||||
Added JSON_PRESERVE_ZERO_FRACTION option (PHP >= 5.6.5)
|
||||
- setcookie(), setrawcookie() and ext/session now send Max-Age headers
|
||||
alongside Expires headers. (see
|
||||
https://wiki.php.net/rfc/cookie_max-age)
|
||||
|
||||
- curl_setopt now accepts new option CURLOPT_SAFE_UPLOAD and CURLFile
|
||||
object for safer file uploads (see
|
||||
https://wiki.php.net/rfc/curl-file-upload)
|
||||
|
||||
- Functions in the socket extension now do not emit warnings when the
|
||||
errno is EAGAIN, EWOULDBLOCK or EINPROGRESS.
|
||||
|
||||
- Since 5.5.2, spl_autoload_functions() returns different names for
|
||||
different lambda functions registered via spl_autoload_register().
|
||||
|
||||
- Since 5.5.3, DOMDocument::schemaValidateSource() and
|
||||
DOMDocument::schemaValidate() accept flag parameter. Only flag
|
||||
available now is LIBXML_SCHEMA_CREATE. Default is 0.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- Datetime:
|
||||
Added DatePeriod::getStartDate(), DatePeriod::getEndDate(), DatePeriod::getDateInterval() in 5.6.5.
|
||||
|
||||
- GMP:
|
||||
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
|
||||
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
|
||||
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
|
||||
Added gmp_random_range() and gmp_random_bits() in PHP 5.6.3.
|
||||
|
||||
- Hash
|
||||
Added hash_equals($known_string, $user_string)
|
||||
|
||||
- OpenSSL:
|
||||
Added string openssl_x509_fingerprint($x509, $type, $binary).
|
||||
Added string openssl_spki_new($private_key, $challenge, $algorithm)
|
||||
Added bool openssl_spki_verify($spkac)
|
||||
Added string openssl_spki_export($spkac)
|
||||
Added string openssl_spki_export_challenge($spkac)
|
||||
Added array openssl_get_cert_locations()
|
||||
|
||||
- LDAP:
|
||||
Added ldap_escape($value, $ignore = "", $flags = 0).
|
||||
Added ldap_modify_batch($link_identifier, $dn, $modifications) described in
|
||||
https://wiki.php.net/rfc/ldap_modify_batch.
|
||||
|
||||
- Pgsql:
|
||||
Added pg_socket($connection) to allow async connections and non-blocking IO
|
||||
Added pg_connect_poll($connection) for establishing async connections
|
||||
Added pg_consume_input($connection) for non-blocking query result consumption
|
||||
Added pg_flush($connection) for non-blocking query write completion
|
||||
|
||||
- PDO_pgsql
|
||||
Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
|
||||
Added PDO::pgsqlGetPid()
|
||||
|
||||
- Reflection
|
||||
Added ReflectionFunction::isVariadic() and ReflectionParameter::isVariadic().
|
||||
|
||||
- SPL
|
||||
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
|
||||
|
||||
- Zip:
|
||||
Added ZipArchive::setPassword($password)
|
||||
|
||||
========================================
|
||||
7. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
8. Removed Extensions
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
9. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
- cURL:
|
||||
- The following constants have been removed as they are now marked "obsolete"
|
||||
in the underlying library and never had any effect to begin with:
|
||||
. CURLOPT_CLOSEPOLICY
|
||||
. CURLCLOSEPOLICY_CALLBACK
|
||||
. CURLCLOSEPOLICY_LEAST_RECENTLY_USED
|
||||
. CURLCLOSEPOLICY_LEAST_TRAFFIC
|
||||
. CURLCLOSEPOLICY_OLDEST
|
||||
. CURLCLOSEPOLICY_SLOWEST
|
||||
|
||||
- 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.
|
||||
- Multi-row OCI_RETURN_LOB queries require fewer "round trips" to the database.
|
||||
- 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.
|
||||
|
||||
- OpenSSL:
|
||||
- The "SNI_enabled" SSL stream context option is now set to TRUE by default
|
||||
if supported by the underlying openssl library.
|
||||
|
||||
- PCRE:
|
||||
- The information collected by the (*MARK) backtracking control verb is now
|
||||
collected into the "MARK" index of the $matches array for preg_match(),
|
||||
preg_match_all() and preg_replace_callback().
|
||||
|
||||
- Pgsql:
|
||||
- pg_insert()/pg_select()/pg_update()/pg_delete()/pg_meta_data()/pg_convert()
|
||||
are no longer EXPERIMENTAL
|
||||
- Added PGSQL_DML_ESCAPE option for pg_insert()/pg_select()/pg_update()/pg_delete()
|
||||
that simply escapes all supplied parameters. These functions can be as fast as
|
||||
native query. Unvalidated data(Unknown data types) is passed as string.
|
||||
JSON/Array/etc are supported both PGSQL_DML_ESCAPE and pg_convert() as string.
|
||||
- pg_select() returns PostgreSQL query resource when query is executed.
|
||||
- Added extended flag parameter for pg_meta_data(). pg_meta_data() always
|
||||
returns "is enum" attribute.
|
||||
- The new pg_socket() function returns a socket stream with no behavior other
|
||||
than to allow IO-readiness polling on a DB connection socket. Calling
|
||||
stream_set_blocking() on its result enables non-blocking behavior.
|
||||
- Passing the new PGSQL_CONNECT_ASYNC flag to pg_connect() allows applications
|
||||
to poll for IO readiness via pg_connect_poll() and establish connections
|
||||
asynchronously.
|
||||
|
||||
- PDO_pgsql:
|
||||
- Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
|
||||
without preparing them, while still passing parameters separately from
|
||||
the command text using PQexecParams.
|
||||
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
|
||||
as described in https://bugs.php.net/bug.php?id=42614.
|
||||
|
||||
- DOM:
|
||||
- DOMNode::textContent is now a writeable property. (>= 5.6.1)
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
- CURL:
|
||||
CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8)
|
||||
|
||||
- GD:
|
||||
IMG_WEBP (>= 5.6.25)
|
||||
|
||||
- LDAP:
|
||||
LDAP_ESCAPE_FILTER int(1)
|
||||
LDAP_ESCAPE_DN int(2)
|
||||
|
||||
- Pgsql:
|
||||
PGSQL_DML_ESCAPE int(4096)
|
||||
PGSQL_CONNECT_ASYNC
|
||||
PGSQL_CONNECTION_STARTED
|
||||
PGSQL_CONNECTION_MADE
|
||||
PGSQL_CONNECTION_AWAITING_RESPONSE
|
||||
PGSQL_CONNECTION_AUTH_OK
|
||||
PGSQL_CONNECTION_SSL_STARTUP
|
||||
PGSQL_CONNECTION_SETENV
|
||||
PGSQL_POLLING_FAILED
|
||||
PGSQL_POLLING_READING
|
||||
PGSQL_POLLING_WRITING
|
||||
PGSQL_POLLING_OK
|
||||
PGSQL_POLLING_ACTIVE
|
||||
|
||||
- OpenSSL:
|
||||
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT int(9)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT int(17)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT int(33)
|
||||
STREAM_CRYPTO_METHOD_ANY_CLIENT int(63)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_0_SERVER int(8)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_1_SERVER int(16)
|
||||
STREAM_CRYPTO_METHOD_TLSv1_2_SERVER int(32)
|
||||
STREAM_CRYPTO_METHOD_ANY_SERVER int(62)
|
||||
OPENSSL_DEFAULT_STREAM_CIPHERS string
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
5. New Functions
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
Changed always_populate_raw_post_data to throw a deprecation warning when
|
||||
enabled and to recognize the value -1 for never populating the global
|
||||
$HTTP_RAW_POST_DATA variable, which will be default in future PHP versions.
|
||||
|
||||
default_charset is set to UTF-8. It was empty previously. default_charset
|
||||
is used where it is applicable. Iconv/Mbstring/htmlentities/htmlspecialchars/
|
||||
html_entity_decode use default_charset as default encoding.
|
||||
|
||||
internal_encoding/input_encoding/output_encoding is added for encoding
|
||||
handling modules. Refer to "Changes to encodings in PHP 5.6" in "11. Other Changes"
|
||||
section for more details.
|
||||
- array_column()
|
||||
- boolval()
|
||||
- password_get_info()
|
||||
- password_hash()
|
||||
- password_needs_rehash()
|
||||
- password_verify()
|
||||
|
||||
- cURL:
|
||||
If the new openssl.cafile ini directive is specified ext/curl will give the
|
||||
openssl path precedence over its own curl.cainfo directive.
|
||||
- curl_file_create
|
||||
|
||||
- OpenSSL:
|
||||
openssl.cafile and openssl.capath ini directives have been added to allow
|
||||
global CA default specification as necessary.
|
||||
- GD
|
||||
- imageflip
|
||||
- imagecrop
|
||||
- imagecropauto
|
||||
- imagesetinterpolation
|
||||
- imageaffine
|
||||
- imageaffinematrixget
|
||||
- imageaffinematrixconcat
|
||||
- imagescale
|
||||
|
||||
- Hash:
|
||||
- hash_pbkdf2()
|
||||
|
||||
- Intl:
|
||||
- datefmt_format_object()
|
||||
- datefmt_get_calendar_object()
|
||||
- datefmt_get_timezone()
|
||||
- datefmt_set_timezone()
|
||||
- datefmt_get_calendar_object()
|
||||
- intlcal_create_instance()
|
||||
- intlcal_get_keyword_values_for_locale()
|
||||
- intlcal_get_now()
|
||||
- intlcal_get_available_locales()
|
||||
- intlcal_get()
|
||||
- intlcal_get_time()
|
||||
- intlcal_set_time()
|
||||
- intlcal_add()
|
||||
- intlcal_set_time_zone()
|
||||
- intlcal_after()
|
||||
- intlcal_before()
|
||||
- intlcal_set()
|
||||
- intlcal_roll()
|
||||
- intlcal_clear()
|
||||
- intlcal_field_difference()
|
||||
- intlcal_get_actual_maximum()
|
||||
- intlcal_get_actual_minimum()
|
||||
- intlcal_get_day_of_week_type()
|
||||
- intlcal_get_first_day_of_week()
|
||||
- intlcal_get_greatest_minimum()
|
||||
- intlcal_get_least_maximum()
|
||||
- intlcal_get_locale()
|
||||
- intlcal_get_maximum()
|
||||
- intlcal_get_minimal_days_in_first_week()
|
||||
- intlcal_get_minimum()
|
||||
- intlcal_get_time_zone()
|
||||
- intlcal_get_type()
|
||||
- intlcal_get_weekend_transition()
|
||||
- intlcal_in_daylight_time()
|
||||
- intlcal_is_equivalent_to()
|
||||
- intlcal_is_lenient()
|
||||
- intlcal_is_set()
|
||||
- intlcal_is_weekend()
|
||||
- intlcal_set_first_day_of_week()
|
||||
- intlcal_set_lenient()
|
||||
- intlcal_equals()
|
||||
- intlcal_get_repeated_wall_time_option()
|
||||
- intlcal_get_skipped_wall_time_option()
|
||||
- intlcal_set_repeated_wall_time_option()
|
||||
- intlcal_set_skipped_wall_time_option()
|
||||
- intlcal_from_date_time()
|
||||
- intlcal_to_date_time()
|
||||
- intlcal_get_error_code()
|
||||
- intlcal_get_error_message()
|
||||
- intlgregcal_create_instance()
|
||||
- intlgregcal_set_gregorian_change()
|
||||
- intlgregcal_get_gregorian_change()
|
||||
- intlgregcal_is_leap_year()
|
||||
- intltz_create_time_zone()
|
||||
- intltz_create_default()
|
||||
- intltz_get_id()
|
||||
- intltz_get_gmt()
|
||||
- intltz_get_unknown()
|
||||
- intltz_create_enumeration()
|
||||
- intltz_count_equivalent_ids()
|
||||
- intltz_create_time_zone_id_enumeration()
|
||||
- intltz_get_canonical_id()
|
||||
- intltz_get_region()
|
||||
- intltz_get_tz_data_version()
|
||||
- intltz_get_equivalent_id()
|
||||
- intltz_use_daylight_time()
|
||||
- intltz_get_offset()
|
||||
- intltz_get_raw_offset()
|
||||
- intltz_has_same_rules()
|
||||
- intltz_get_display_name()
|
||||
- intltz_get_dst_savings()
|
||||
- intltz_from_date_time_zone()
|
||||
- intltz_to_date_time_zone()
|
||||
- intltz_get_error_code()
|
||||
- intltz_get_error_message()
|
||||
|
||||
- IntlDateFormatter::formatObject()
|
||||
- IntlDateFormatter::getCalendarObject()
|
||||
- IntlDateFormatter::getTimeZone()
|
||||
- IntlDateFormatter::setTimeZone()
|
||||
|
||||
- Sockets:
|
||||
- socket_sendmsg()
|
||||
- socket_recvmsg()
|
||||
- socket_cmsg_space()
|
||||
|
||||
- SPL:
|
||||
- SplFixedArray::__wakeup()
|
||||
- SplDoublyLinkedList::add()
|
||||
- RecursiveTreeIterator::getPostfix() (5.5.2)
|
||||
- RecursiveTreeIterator::setPostfix() (5.5.2)
|
||||
|
||||
- Zend OPcache:
|
||||
- opcache_get_configuration()
|
||||
- opcache_get_status()
|
||||
- opcache_reset()
|
||||
|
||||
========================================
|
||||
6. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
- Intl:
|
||||
- IntlCalendar
|
||||
- IntlGregorianCalendar
|
||||
- IntlTimeZone
|
||||
- IntlBreakIterator
|
||||
- IntlRuleBasedBreakIterator
|
||||
- IntlCodePointBreakIterator
|
||||
- UConverter
|
||||
|
||||
- cURL:
|
||||
- CURLFile
|
||||
|
||||
========================================
|
||||
7. Removed Extensions
|
||||
========================================
|
||||
|
||||
None
|
||||
|
||||
========================================
|
||||
8. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
- Intl:
|
||||
- This extension now requires ICU 4.0+.
|
||||
|
||||
========================================
|
||||
9. New Global Constants
|
||||
========================================
|
||||
|
||||
- mysqli:
|
||||
- Added MYSQLI_SERVER_PUBLIC_KEY constant to be used with mysqli_options()
|
||||
|
||||
- cURL:
|
||||
- Added CURLOPT_SAFE_UPLOAD to be used with curl_setopt().
|
||||
- Added CURL_WRAPPERS_ENABLED to reflect --with-curlwrappers.
|
||||
|
||||
- GD
|
||||
- Added constants for imageflip:
|
||||
. IMG_FLIP_HORIZONTAL
|
||||
. IMG_FLIP_VERTICAL
|
||||
. IMG_FLIP_BOTH
|
||||
- Added constants for imagecrop
|
||||
. IMG_CROP_DEFAULT
|
||||
. IMG_CROP_TRANSPARENT
|
||||
. IMG_CROP_BLACK
|
||||
. IMG_CROP_WHITE
|
||||
. IMG_CROP_SIDES
|
||||
. IMG_CROP_THRESHOLD
|
||||
- Added constants for imagesetinterpolation, used by imagescale
|
||||
imagerotate and imageaffine:
|
||||
. IMG_BELL
|
||||
. IMG_BESSEL
|
||||
. IMG_BILINEAR_FIXED
|
||||
. IMG_BICUBIC
|
||||
. IMG_BICUBIC_FIXED
|
||||
. IMG_BLACKMAN
|
||||
. IMG_BOX
|
||||
. IMG_BSPLINE
|
||||
. IMG_CATMULLROM
|
||||
. IMG_GAUSSIAN
|
||||
. IMG_GENERALIZED_CUBIC
|
||||
. IMG_HERMITE
|
||||
. IMG_HAMMING
|
||||
. IMG_HANNING
|
||||
. IMG_MITCHELL
|
||||
. IMG_POWER
|
||||
. IMG_QUADRATIC
|
||||
. IMG_SINC
|
||||
. IMG_NEAREST_NEIGHBOUR
|
||||
. IMG_WEIGHTED4
|
||||
. IMG_TRIANGLE
|
||||
- Added constants for imageaffinematrixget
|
||||
. IMG_AFFINE_TRANSLATE
|
||||
. IMG_AFFINE_SCALE
|
||||
. IMG_AFFINE_ROTATE
|
||||
. IMG_AFFINE_SHEAR_HORIZONTAL
|
||||
. IMG_AFFINE_SHEAR_VERTICAL
|
||||
|
||||
========================================
|
||||
10. Changes to INI File Handling
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
- Added sys_temp_dir INI directive, for specifying temporary
|
||||
directory.
|
||||
|
||||
- Intl:
|
||||
- Added intl.use_exceptions INI directive, which controls what
|
||||
happens when global errors are set together with intl.error_level.
|
||||
|
||||
- MSSQL:
|
||||
- mssql.compatability_mode renamed to mssql.compatibility_mode in 5.5.2,
|
||||
old directive still supported for BC reasons.
|
||||
|
||||
- mysqlnd:
|
||||
- Added mysqlnd.sha256_server_public_key INI PERDIR setting that
|
||||
affects all APIs which use(are built) for mysqlnd. This allows
|
||||
ext/mysqli to be used with the new auth protocol, although at
|
||||
coarser level.
|
||||
|
||||
- Sessions:
|
||||
- Added session.use_strict_mode in 5.5.3, which prevents session
|
||||
fixation attacks and session collisions.
|
||||
See also https://wiki.php.net/rfc/strict_sessions
|
||||
|
||||
- Zend OPcache (See http://php.net/manual/en/book.opcache.php)
|
||||
- Added the following directives:
|
||||
- opcache.enable (default "1")
|
||||
- opcache.memory_consumption (default "64")
|
||||
- opcache.interned_strings_buffer (default "4")
|
||||
- opcache.max_accelerated_files (default "2000")
|
||||
- opcache.max_wasted_percentage (default "5")
|
||||
- opcache.use_cwd (default "1")
|
||||
- opcache.validate_timestamps (default "1")
|
||||
- opcache.revalidate_freq (default "2")
|
||||
- opcache.revalidate_path (default "0")
|
||||
- opcache.save_comments (default "1")
|
||||
- opcache.load_comments (default "1")
|
||||
- opcache.fast_shutdown (default "0")
|
||||
- opcache.enable_file_override (default "0")
|
||||
- opcache.optimization_level (default "0xffffffff")
|
||||
- opcache.inherited_hack (default "1")
|
||||
- opcache.blacklist_filename (default "")
|
||||
- opcache.max_file_size (default "0")
|
||||
- opcache.consistency_checks (default "0")
|
||||
- opcache.force_restart_timeout (default "180")
|
||||
- opcache.error_log (default "" which means stderr)
|
||||
- opcache.log_verbosity_level (default "1")
|
||||
- opcache.preferred_memory_model (default "")
|
||||
- opcache.protect_memory (default "0")
|
||||
- opcache.mmap_base (Windows-only)
|
||||
|
||||
========================================
|
||||
11. Windows Support
|
||||
========================================
|
||||
|
||||
- The Apache 2.4 handler is supported as of PHP 5.5.0
|
||||
|
||||
- OPcache: Errors like 'unable to reattach to base address' could
|
||||
happen in many common setups. It is due to some technical and
|
||||
design restriction in the engine and could not be fixed easily
|
||||
before 5.5.0 was released.
|
||||
|
||||
A possible fix is to tweak the opcache.mmap_base INI setting by
|
||||
forcing the first address to be tried.
|
||||
|
||||
For x86 version, the following addreses can be tried:
|
||||
. 0x20000000, 0x21000000, 0x30000000, 0x31000000, 0x50000000
|
||||
and for x64 (still experimental):
|
||||
. 0x0000100000000000, 0x0000200000000000, 0x0000300000000000, 0x0000700000000000
|
||||
|
||||
========================================
|
||||
12. Other Changes
|
||||
========================================
|
||||
|
||||
- File upload:
|
||||
Uploads equal or greater than 2GB in size are now accepted.
|
||||
- If the APC or WinCache user cache APIs were used before, consider
|
||||
these alternatives for PHP 5.5:
|
||||
|
||||
- HTTP stream wrapper:
|
||||
HTTP 1.1 requests now include a Connection: close header unless explicitly
|
||||
overridden by setting a Connection header via the header context option.
|
||||
|
||||
- PDO_pgsql
|
||||
A libpq version providing PQexecParams, PQprepare, PQescapeStringConn,
|
||||
PQescapeByteaConn is now required. According to the release notes that means
|
||||
8.0.8+ or 8.1.4+.
|
||||
|
||||
- Zip:
|
||||
New --with-libzip option allow to use system libzip. Version > 0.11 required,
|
||||
Version >= 0.11.2 recommended for all features.
|
||||
|
||||
- Changes to encodings in PHP 5.6
|
||||
The default value of default_charset is now UTF-8 when it is not
|
||||
explicitly set in php.ini
|
||||
|
||||
The following php.ini parameters were added:
|
||||
internal_encoding
|
||||
input_encoding
|
||||
output_encoding
|
||||
|
||||
The values of the following php.ini parameters have become empty in
|
||||
PHP 5.6 (previously they were all ISO-8859-1)
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
|
||||
Changes were made to character set handling in:
|
||||
- the iconv and mbstring extensions,
|
||||
- and htmlentities(), htmlspecialchars(), html_entity_decode() functions
|
||||
|
||||
The precedence for these is now:
|
||||
|
||||
default_charset < internal/input/output_encoding < (mbstring.* || iconv.*) < function parameter
|
||||
|
||||
For example, the easiest way to use the UTF-8 encoding is to set
|
||||
default_charset=UTF-8 and leave the following php.ini parameters
|
||||
|
||||
empty:
|
||||
|
||||
iconv.input_encoding
|
||||
iconv.output_encoding
|
||||
iconv.internal_encoding
|
||||
mbstring.http_input
|
||||
mbstring.http_output
|
||||
mbstring.internal_encoding
|
||||
internal_encoding
|
||||
input_encoding
|
||||
output_encoding
|
||||
|
||||
The mb_regex_encoding() default setting is changed from EUC-JP to UTF-8.
|
||||
- APCu
|
||||
- all supported OSes: http://pecl.php.net/package/APCu
|
||||
- Windows: http://windows.php.net/downloads/pecl/releases/apcu/
|
||||
|
||||
- WinCache, Windows only: http://pecl.php.net/package/WinCache
|
||||
+80
-185
@@ -1,19 +1,13 @@
|
||||
$Id$
|
||||
|
||||
PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
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
|
||||
c. POST data handling
|
||||
d. Arginfo changes
|
||||
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
|
||||
f. empty strings are interned
|
||||
g. Additional str_* APIs
|
||||
h. Addition of zend_hash_reindex
|
||||
i. Addition of zend_hash_splice
|
||||
j. Unserialization of manipulated object strings
|
||||
k. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
|
||||
a. Executor changes
|
||||
b. Streams pooling API
|
||||
c. Lowercasing and locales
|
||||
d. zend_qsort_r
|
||||
e. get_current_key
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -24,202 +18,103 @@ PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Addition of do_operation and compare object handlers
|
||||
a. Executor changes
|
||||
|
||||
Two new object handlers have been added:
|
||||
* extensions can't override zend_execute() any more, they should override
|
||||
zend_execute_ex() instead. The EG(current_execute_data) is already
|
||||
initialized in zend_execute_ex(), so for compatibility extensions
|
||||
may need to use EG(current_execute_data)->prev_execute_data instead.
|
||||
* removed EG(arg_types_stack), EX(fbc), EX(called_scope), EX(current_object)
|
||||
* added op_array->nested_calls. It's calculated at compile time.
|
||||
* added EX(call_slots). It is an array to store information about syntaticaly
|
||||
nested calls (e.g. foo(bar())). It's preallocated together with execute_data.
|
||||
* added EX(call) - pointer to a current calling function. Actually an
|
||||
element of EX(call_slots)
|
||||
* opcodes INIT_METHOD_CALL, ZEND_INIT_STATIC_METHOD_CALL,
|
||||
ZEND_INIT_FCALL_BY_NAME, ZEND_INIT_NS_FCALL_BY_NAME use result.num as
|
||||
an index in EX(call_slots)
|
||||
* opcode ZEND_NEW uses extended_vallue as an index in EX(call_slots)
|
||||
* opcoes ZEND_DO_FCALL and ZEND_DO_FCALL_BY_NAME use op2.num as
|
||||
an index in EX(call_slots)
|
||||
* added op_array->used_stack. It's calculated at compile time and the
|
||||
corresponding stack space is preallocated together with execute_data.
|
||||
ZEND_SEND* and ZEND_DO_FCALL* don't need to check for stack overflow
|
||||
anymore.
|
||||
* Removed execute_data->Ts field. The VM temporary variables always allocated
|
||||
immediately before execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->Ts). Compiler
|
||||
stores new offsets in op_array->opcodes[*].op?.num. You can use macros
|
||||
EX_TMP_VAR() and EX_TMP_VAR_NUM() to access temp_variable by offset or
|
||||
number. You can convert number to offset using EX_TMP_VAR_NUM(0, num) or
|
||||
offset to number (EX_TMP_VAR_NUM(0,0)-EX_TMP_VAR(0,offset)).
|
||||
* Removed execute_data->CVs field. The VM compiled variables always allocated
|
||||
immediately after execute_data structure. Now they are accessed by offset
|
||||
from the execute_data base pointer (instead of execute_data->CVs). You can
|
||||
use macros EX_CV_NUM() to access compiled variables by number.
|
||||
|
||||
do_operation:
|
||||
typedef int (*zend_object_do_operation_t)(
|
||||
zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC
|
||||
);
|
||||
b. Streams pooling API
|
||||
|
||||
compare:
|
||||
typedef int (*zend_object_compare_zvals_t)(
|
||||
zval *result, zval *op1, zval *op2 TSRMLS_DC
|
||||
);
|
||||
The streams pooling API has been removed. The following functions no longer
|
||||
exist:
|
||||
|
||||
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.
|
||||
PHPAPI int php_stream_context_get_link(php_stream_context *context,
|
||||
const char *hostent, php_stream **stream);
|
||||
PHPAPI int php_stream_context_set_link(php_stream_context *context,
|
||||
const char *hostent, php_stream *stream);
|
||||
PHPAPI int php_stream_context_del_link(php_stream_context *context,
|
||||
php_stream *stream);
|
||||
|
||||
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.
|
||||
c. Lowercasing and locales
|
||||
|
||||
Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
|
||||
The lowercasing functions in zend_operators.c were split into those that do
|
||||
lowercasing according to locale rules and those that do ASCII lowercasing.
|
||||
ASCII:
|
||||
|
||||
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
|
||||
zend_str_tolower_copy
|
||||
zend_str_tolower_dup
|
||||
zend_str_tolower
|
||||
zend_binary_strcasecmp
|
||||
zend_binary_strncasecmp
|
||||
|
||||
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:
|
||||
Locale-based:
|
||||
zend_binary_strncasecmp_l
|
||||
zend_binary_strcasecmp_l
|
||||
zend_binary_zval_strcasecmp
|
||||
zend_binary_zval_strncasecmp
|
||||
string_compare_function_ex
|
||||
string_case_compare_function
|
||||
|
||||
RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
|
||||
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
|
||||
Internal engine lowercasing will be using ASCII-only rules. User-facing functions,
|
||||
such as strcasecmp, will be using locale rules.
|
||||
|
||||
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.
|
||||
|
||||
c. POST data handling
|
||||
|
||||
The sapi_request_info's members post_data, post_data_len and raw_post_data as
|
||||
well as raw_post_data_len have been replaced with a temp PHP stream
|
||||
request_body.
|
||||
|
||||
The recommended way to access raw POST data is to open and use a php://input
|
||||
stream wrapper. It is safe to be used concurrently and more than once.
|
||||
Two new functions - zend_binary_strncasecmp_l and zend_binary_strcasecmp_l - added as
|
||||
locale-based counterparts to zend_binary_strcasecmp and zend_binary_strncasecmp.
|
||||
|
||||
d. Arginfo changes
|
||||
d. zend_qsort_r
|
||||
|
||||
The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and
|
||||
ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored.
|
||||
Added the function zend_qsort_r():
|
||||
|
||||
Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():
|
||||
typedef int (*compare_r_func_t)(const void *, const void * TSRMLS_DC, void *);
|
||||
void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC);
|
||||
|
||||
ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */
|
||||
ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */
|
||||
ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name)
|
||||
/* pass rest by prefer-ref */
|
||||
The extra argument it has (relatively to zend_qsort()) is passed to the
|
||||
comparison function.
|
||||
|
||||
ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.
|
||||
e. get_current_key
|
||||
|
||||
The following changes were applied to the zend_arg_info struct:
|
||||
The signature of the get_current_key iteration handler has been changed to:
|
||||
|
||||
typedef struct _zend_arg_info {
|
||||
const char *class_name;
|
||||
zend_uint class_name_len;
|
||||
zend_uchar type_hint;
|
||||
+ zend_uchar pass_by_reference;
|
||||
zend_bool allow_null;
|
||||
- zend_bool pass_by_reference;
|
||||
+ zend_bool is_variadic;
|
||||
} zend_arg_info;
|
||||
void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
|
||||
|
||||
The following changes were applied to the zend_internal_function_info struct:
|
||||
|
||||
typedef struct _zend_internal_function_info {
|
||||
zend_uint required_num_args;
|
||||
zend_uchar _type_hint;
|
||||
zend_bool return_reference;
|
||||
- zend_bool pass_rest_by_reference;
|
||||
+ zend_bool _allow_null;
|
||||
+ zend_bool _is_variadic;
|
||||
} zend_internal_function_info;
|
||||
|
||||
The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(),
|
||||
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
|
||||
that the argument passed to them is a zend_function* and that it is non-NULL.
|
||||
|
||||
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
|
||||
|
||||
Memory allocation is now managed by emalloc/efree instead of malloc/free.
|
||||
|
||||
f. empty strings are interned
|
||||
|
||||
String created using STR_EMPTY_ALLOC() are now interned.
|
||||
convert_to_string use STR_EMPTY_ALLOC() for zval when IS_NULL.
|
||||
str_efree() shoud be preferred as efree() on such strings can cause memory
|
||||
corruption.
|
||||
|
||||
g. Additional str_* APIs
|
||||
|
||||
In addition to the previously existing str_free() and str_efree() macros, the
|
||||
following macros have been introduced to simplify dealing with potentially
|
||||
interned strings:
|
||||
|
||||
str_efree_rel(str) - efree_rel() if not interned
|
||||
str_erealloc(str, new_len) - erealloc() or emalloc+memcpy if interned
|
||||
str_estrndup(str, len) - estrndup() if not interned
|
||||
str_strndup(str, len) - zend_strndup() if not interned
|
||||
str_hash(str, len) - INTERNED_HASH(str) if interned,
|
||||
zend_hash_func(str, len+1) otherwise
|
||||
|
||||
h. Addition of zend_hash_reindex
|
||||
|
||||
A zend_hash_reindex() function with the following prototype has been added:
|
||||
|
||||
void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
|
||||
|
||||
If only_integer_keys==0, this function will change all keys to be continuous,
|
||||
zero-based integers in hash order. If only_integer_keys==1 the same will be
|
||||
done only for keys that were already integers previously, while leaving
|
||||
string keys alone.
|
||||
|
||||
i. Addition of zend_hash_splice
|
||||
|
||||
A zend_hash_splice() macro with the following prototype has been added:
|
||||
|
||||
void zend_hash_splice(
|
||||
HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
|
||||
uint offset, uint length,
|
||||
void **list, uint list_count, HashTable *removed
|
||||
);
|
||||
|
||||
This function performs an in-place splice operation on a hashtable:
|
||||
|
||||
The elements between offset and offset+length are removed and the elements in
|
||||
list[list_count] are inserted in their place. The removed elements can be
|
||||
optionally collected into a hashtable.
|
||||
|
||||
This operation reindexes the hashtable, i.e. integer keys will be zero-based
|
||||
and sequential, while string keys stay intact. The same applies to the
|
||||
elements inserted into the removed HT.
|
||||
|
||||
As a side-effect of this addition the signature of the php_splice() function
|
||||
changed:
|
||||
|
||||
void php_splice(
|
||||
HashTable *ht, zend_uint offset, zend_uint length,
|
||||
zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
|
||||
)
|
||||
|
||||
This function now directly forwards to zend_hash_splice(), resets the
|
||||
IAP of ht (for compatibility with the previous implementation) and resets
|
||||
CVs if the passed hashtable is the global symbol table.
|
||||
|
||||
j. Unserialization of manipulated object strings
|
||||
|
||||
Strings requiring unserialization of objects are now explicitly checked
|
||||
whether the object they contain implements the Serializable interface.
|
||||
This solves the situation where manipulated strings could be passed for
|
||||
objects using Serializable to disallow serialization. An object
|
||||
implementing Serializable will always start with "C:" in the serialized
|
||||
string, all other objects are represented with starting "O:". Objects
|
||||
implementing Serializable to disable serialization using
|
||||
zend_class_unserialize_deny and zend_class_serialize_deny, when
|
||||
instantiated from the serializer with a manipulated "O:" string at the
|
||||
start, will most likely be defectively initialized. This is now
|
||||
fixed at the appropriate place by checking for the presence of the
|
||||
serialize callback in the class entry.
|
||||
|
||||
k. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
|
||||
|
||||
These two #defines disappeared. Instead we have now IS_CONSTANT_AST which
|
||||
covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the
|
||||
hack for marking zvals as constant index with IS_CONSTANT_INDEX is now
|
||||
superfluous and so removed.
|
||||
Please note that IS_CONSTANT_AST now has the same value than
|
||||
IS_CONSTANT_ARRAY had.
|
||||
The key should be written into the zval* using the ZVAL_* macros.
|
||||
|
||||
========================
|
||||
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
|
||||
- The configure option --enable-static-analyze isn't available anymore.
|
||||
The new option was introduced --with-analyzer.
|
||||
- It is possible to disable PGO for single extensions, to do that
|
||||
define a global variable PHP_MYMODULE_PGO evaluating to false
|
||||
inside config.w32
|
||||
- Drop Windows XP and 2003 support.
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ libZend_la_SOURCES=\
|
||||
zend_ini_parser.y zend_ini_scanner.l \
|
||||
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
|
||||
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
|
||||
zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \
|
||||
@@ -18,7 +18,7 @@ libZend_la_SOURCES=\
|
||||
zend_default_classes.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c \
|
||||
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
|
||||
zend_generators.c zend_virtual_cwd.c zend_ast.c
|
||||
zend_generators.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
|
||||
+3
-3
@@ -9,11 +9,11 @@ Modified: 2001-09-17
|
||||
1. Background/Need
|
||||
==================
|
||||
|
||||
Many internal functions of PHP will reject parameters because of their
|
||||
Many internal function of PHP will reject parameters because of their
|
||||
type (the array and variable function come to mind). For userland
|
||||
this is not an easy task as there is no uniform way to do it. An
|
||||
addition to the engine for requiring loose types would allow
|
||||
developers to know that the data passed to their functions are of the
|
||||
delevopers to know that the data passed to their functions is of the
|
||||
correct type and reduce the need for duplicating the same code in
|
||||
every function to check for the type of data.
|
||||
|
||||
@@ -57,7 +57,7 @@ function foo (array $var){
|
||||
===========
|
||||
|
||||
Mis-matches in type should be reported as fatal errors and should halt
|
||||
the execution of a script as that function cannot be run and code
|
||||
the execution of a script as that function can not be run and code
|
||||
following could not reliably run.
|
||||
|
||||
|
||||
|
||||
@@ -119,10 +119,6 @@ SOURCE=.\zend_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ast.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_builtin_functions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -265,14 +261,6 @@ SOURCE=.\zend_ts_hash.c
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_vm_opcodes.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_virtual_cwd.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
||||
@@ -140,10 +140,6 @@ SOURCE=.\zend_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ast.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -295,10 +291,6 @@ SOURCE=.\zend_ts_hash.c
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_vm_opcodes.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
||||
+10
-19
@@ -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="3.0"
|
||||
# we only support certain bison versions
|
||||
bison_version_list="2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7"
|
||||
|
||||
# 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;"
|
||||
;;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67468 (Segfault in highlight_file()/highlight_string())
|
||||
--SKIPIF--
|
||||
<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
highlight_string("<?php __CLASS__;", true);
|
||||
echo "done";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -1,110 +0,0 @@
|
||||
--TEST--
|
||||
Basic argument unpacking
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
|
||||
function test2($arg1, $arg2, $arg3 = null) {
|
||||
var_dump($arg1, $arg2, $arg3);
|
||||
}
|
||||
|
||||
function getArray($array) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
function arrayGen($array) {
|
||||
foreach ($array as $element) {
|
||||
yield $element;
|
||||
}
|
||||
}
|
||||
|
||||
$array = [1, 2, 3];
|
||||
|
||||
test(...[]);
|
||||
test(...[1, 2, 3]);
|
||||
test(...$array);
|
||||
test(...getArray([1, 2, 3]));
|
||||
test(...arrayGen([]));
|
||||
test(...arrayGen([1, 2, 3]));
|
||||
|
||||
test(1, ...[2, 3], ...[4, 5]);
|
||||
test(1, ...getArray([2, 3]), ...arrayGen([4, 5]));
|
||||
|
||||
test2(...[1, 2]);
|
||||
test2(...[1, 2, 3]);
|
||||
test2(...[1], ...[], ...[], ...[2, 3], ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
int(1)
|
||||
int(2)
|
||||
NULL
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,145 +0,0 @@
|
||||
--TEST--
|
||||
Argument unpacking with by-ref arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function test1(&...$args) {
|
||||
foreach ($args as &$arg) {
|
||||
$arg++;
|
||||
}
|
||||
}
|
||||
|
||||
test1(...[1, 2, 3]);
|
||||
|
||||
$array = [1, 2, 3];
|
||||
test1(...$array);
|
||||
var_dump($array);
|
||||
|
||||
$array1 = [1, 2]; $array2 = [3, 4];
|
||||
test1(...$array1, ...$array2);
|
||||
var_dump($array1, $array2);
|
||||
|
||||
function test2($val1, &$ref1, $val2, &$ref2) {
|
||||
$ref1++;
|
||||
$ref2++;
|
||||
}
|
||||
|
||||
$array = [0, 0, 0, 0];
|
||||
test2(...$array);
|
||||
var_dump($array);
|
||||
|
||||
$array1 = [1, 2]; $array2 = [4, 5];
|
||||
test1(...$array1, ...$array2);
|
||||
var_dump($array1, $array2);
|
||||
|
||||
$a = $b = $c = $d = 0;
|
||||
$array = [0, 0, 0, 0];
|
||||
|
||||
test2($a, ...$array);
|
||||
var_dump($a, $array);
|
||||
|
||||
test2($a, $b, ...$array);
|
||||
var_dump($a, $b, $array);
|
||||
|
||||
test2($a, $b, $c, ...$array);
|
||||
var_dump($a, $b, $c, $array);
|
||||
|
||||
test2($a, $b, $c, $d, ...$array);
|
||||
var_dump($a, $b, $c, $d, $array);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(0)
|
||||
[3]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(5)
|
||||
[1]=>
|
||||
int(6)
|
||||
}
|
||||
int(0)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(0)
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(1)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
int(0)
|
||||
int(3)
|
||||
int(0)
|
||||
int(1)
|
||||
array(4) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(1)
|
||||
[3]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Unpack arguments for dynamic call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$fn = function(...$args) {
|
||||
var_dump($args);
|
||||
};
|
||||
|
||||
$fn(...[]);
|
||||
$fn(...[1, 2, 3]);
|
||||
$fn(1, ...[2, 3], ...[], ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Argument unpacking with internal functions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arrays = [
|
||||
[1, 2, 3],
|
||||
[4, 5, 6],
|
||||
[7, 8, 9],
|
||||
];
|
||||
var_dump(array_map(null, ...$arrays));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(4)
|
||||
[2]=>
|
||||
int(7)
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(8)
|
||||
}
|
||||
[2]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(6)
|
||||
[2]=>
|
||||
int(9)
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
--TEST--
|
||||
Only arrays and Traversables can be unpacked
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
|
||||
test(...null);
|
||||
test(...42);
|
||||
test(...new stdClass);
|
||||
|
||||
test(1, 2, 3, ..."foo", ...[4, 5]);
|
||||
test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
|
||||
Warning: Only arrays and Traversables can be unpacked in %s on line %d
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Argument unpacking with many arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function fn(...$args) {
|
||||
var_dump(count($args));
|
||||
}
|
||||
|
||||
$array = array_fill(0, 10000, 42);
|
||||
fn(...$array, ...$array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(20000)
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Unpack arguments for method calls
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public function test(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
|
||||
public static function test2(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo;
|
||||
Foo::test2(1, 2, ...[3, 4], ...[], ...[5]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Unpack arguments for new expression
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public function __construct(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
}
|
||||
|
||||
new Foo(...[]);
|
||||
new Foo(...[1, 2, 3]);
|
||||
new Foo(...[1], ...[], ...[2, 3]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Positional arguments cannot be used after argument unpacking
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(...[1, 2, 3], 4);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use positional argument after argument unpacking in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Argument unpacking does not work with string keys (forward compatibility for named args)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
var_dump($errstr);
|
||||
});
|
||||
|
||||
var_dump(...[1, 2, "foo" => 3, 4]);
|
||||
var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(36) "Cannot unpack array with string keys"
|
||||
int(1)
|
||||
int(2)
|
||||
string(42) "Cannot unpack Traversable with string keys"
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Traversables that throw exceptions are properly handled during argument unpack
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(...$args) {
|
||||
var_dump($args);
|
||||
}
|
||||
|
||||
class Foo implements IteratorAggregate {
|
||||
public function getIterator() {
|
||||
throw new Exception('getIterator');
|
||||
}
|
||||
}
|
||||
|
||||
function gen() {
|
||||
yield 1;
|
||||
yield 2;
|
||||
throw new Exception('gen');
|
||||
}
|
||||
|
||||
try {
|
||||
test(1, 2, ...new Foo, ...[3, 4]);
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
try {
|
||||
test(1, 2, ...gen(), ...[3, 4]);
|
||||
} catch (Exception $e) { var_dump($e->getMessage()); }
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(11) "getIterator"
|
||||
string(3) "gen"
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Traversables cannot be unpacked into by-reference parameters
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($val1, $val2, $val3, &$ref) {
|
||||
$ref = 42;
|
||||
}
|
||||
|
||||
function gen($array) {
|
||||
foreach ($array as $element) {
|
||||
yield $element;
|
||||
}
|
||||
}
|
||||
|
||||
test(1, 2, 3, $b, ...gen([4, 5, 6]));
|
||||
var_dump($b);
|
||||
|
||||
test(...gen([1, 2, 3, 4]));
|
||||
test(1, 2, ...gen([3, 4]));
|
||||
test(...gen([1, 2]), ...gen([3, 4]));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(42)
|
||||
|
||||
Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
|
||||
|
||||
Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
|
||||
|
||||
Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Next free element may overflow in array literals
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = PHP_INT_MAX;
|
||||
$array = [$i => 42, new stdClass];
|
||||
var_dump($array);
|
||||
|
||||
const FOO = [PHP_INT_MAX => 42, "foo"];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
Bug #30820 (static member conflict with $this->member silently ignored)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
opcache.optimization_level=0
|
||||
--FILE--
|
||||
<?php
|
||||
class Blah {
|
||||
|
||||
@@ -24,6 +24,6 @@ Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on l
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: wrapper->stream_eof()
|
||||
#1 %s(%d): feof(Resource id #%d)
|
||||
#1 %s(%d): feof(Resource id #6)
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #43201 (Crash on using uninitialized vals and __get/__set)
|
||||
Bug #43201 (Crash on using unitialized vals and __get/__set)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60598 (cli/apache sapi segfault on objects manipulation)
|
||||
--FILE--
|
||||
<?php
|
||||
define('OBJECT_COUNT', 10000);
|
||||
|
||||
$containers = array();
|
||||
|
||||
class Object {
|
||||
protected $_guid = 0;
|
||||
public function __construct() {
|
||||
global $containers;
|
||||
$this->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
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #63336 (invalid E_NOTICE error occur)
|
||||
--XFAIL--
|
||||
Bug is not fixed yet
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_NOTICE );
|
||||
@@ -16,7 +18,7 @@ class Child extends Base {
|
||||
public function bar($var, $more=self::DUMMY) { return true; }
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = TEST, $more = NULL) in %sbug63336.php on line %d
|
||||
--EXPECT--
|
||||
Strict Standards: Declaration of Child::foo() should be compatible with Base::foo($var = '123', $more = NULL) in %sbug63336.php on line %d
|
||||
|
||||
Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($more = self::DUMMY) in %sbug63336.php on line %d
|
||||
Strict Standards: Declaration of Child::bar() should be compatible with Base::bar($var, $more = 'XXX') in %sbug63336.php on line %d
|
||||
@@ -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--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
class bad
|
||||
{
|
||||
private $_private = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_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"
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64979 (Wrong behavior of static variables in closure generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function new_closure_gen() {
|
||||
return function() {
|
||||
static $foo = 0;
|
||||
yield ++$foo;
|
||||
};
|
||||
}
|
||||
|
||||
$closure1 = new_closure_gen();
|
||||
$closure2 = new_closure_gen();
|
||||
|
||||
$gen1 = $closure1();
|
||||
$gen2 = $closure1();
|
||||
$gen3 = $closure2();
|
||||
|
||||
foreach (array($gen1, $gen2, $gen3) as $gen) {
|
||||
foreach ($gen as $val) {
|
||||
var_dump($val);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65322: compile time errors won't trigger auto loading
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
var_dump($class);
|
||||
class B {}
|
||||
});
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
new B;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
string(1) "B"
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65419 (Inside trait, self::class != __CLASS__)
|
||||
--FILE--
|
||||
<?php
|
||||
trait abc
|
||||
{
|
||||
static function def()
|
||||
{
|
||||
echo self::class, "\n";
|
||||
echo __CLASS__, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class ghi
|
||||
{
|
||||
use abc;
|
||||
}
|
||||
|
||||
ghi::def();
|
||||
?>
|
||||
--EXPECTF--
|
||||
ghi
|
||||
ghi
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65579 (Using traits with get_class_methods causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait ParentTrait {
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
trait ChildTrait {
|
||||
use ParentTrait {
|
||||
testMethod as testMethodFromParentTrait;
|
||||
}
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
class TestClass {
|
||||
use ChildTrait;
|
||||
}
|
||||
|
||||
$obj = new TestClass();
|
||||
var_dump(get_class_methods($obj));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(10) "testMethod"
|
||||
[1]=>
|
||||
string(25) "testmethodfromparenttrait"
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
--TEST--
|
||||
Fixed Bug #65784 (Segfault with finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo1() {
|
||||
try {
|
||||
throw new Exception("not catch");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
$foo = foo1();
|
||||
var_dump($foo);
|
||||
} catch (Exception $e) {
|
||||
do {
|
||||
var_dump($e->getMessage());
|
||||
} while ($e = $e->getPrevious());
|
||||
}
|
||||
|
||||
function foo2() {
|
||||
try {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
$foo = foo2();
|
||||
var_dump($foo);
|
||||
|
||||
function foo3() {
|
||||
try {
|
||||
throw new Exception("not catched");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new NotExists();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$bar = foo3();
|
||||
--EXPECTF--
|
||||
string(9) "not catch"
|
||||
NULL
|
||||
|
||||
Fatal error: Class 'NotExists' not found in %sbug65784.php on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65911 (scope resolution operator - strange behavior with $this)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {}
|
||||
|
||||
class B
|
||||
{
|
||||
public function go()
|
||||
{
|
||||
$this->foo = 'bar';
|
||||
echo A::$this->foo; // should not output 'bar'
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new B();
|
||||
$obj->go();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: A::$this in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65969 (Chain assignment with T_LIST failure)
|
||||
--FILE--
|
||||
<?php
|
||||
$obj = new stdClass;
|
||||
list($a,$b) = $obj->prop = [1,2];
|
||||
var_dump($a,$b);
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66015 (wrong array indexing in class's static property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
const FIRST = 1;
|
||||
const SECOND = 2;
|
||||
const THIRD = 3;
|
||||
|
||||
protected static $array = [
|
||||
self::FIRST => 'first',
|
||||
'second',
|
||||
'third'
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
var_export(self::$array);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
array (
|
||||
1 => 'first',
|
||||
2 => 'second',
|
||||
3 => 'third',
|
||||
)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66218 zend_register_functions breaks reflection
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_SAPI != "cli") die("skip CLI only test");
|
||||
if (!function_exists("dl")) die("skip need dl");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$tab = get_extension_funcs("standard");
|
||||
$fcts = array("dl");
|
||||
foreach ($fcts as $fct) {
|
||||
if (in_array($fct, $tab)) {
|
||||
echo "$fct Ok\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
dl Ok
|
||||
Done
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66252 (Problems in AST evaluation invalidating valid parent:: reference)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
const HW = "this is A";
|
||||
}
|
||||
class B extends A {
|
||||
const BHW = parent::HW . " extended by B";
|
||||
}
|
||||
const C = B::BHW;
|
||||
echo C, "\n";
|
||||
--EXPECT--
|
||||
this is A extended by B
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66286: Incorrect object comparison with inheritance
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class first {
|
||||
protected $someArray = array();
|
||||
}
|
||||
|
||||
class second extends first {
|
||||
protected $someArray = array();
|
||||
protected $someValue = null;
|
||||
|
||||
public function __construct($someValue) {
|
||||
$this->someValue = $someValue;
|
||||
}
|
||||
}
|
||||
|
||||
$objFirst = new second('123');
|
||||
$objSecond = new second('321');
|
||||
|
||||
var_dump ($objFirst == $objSecond);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66608 (Incorrect behavior with nested "finally" blocks)
|
||||
--FILE--
|
||||
<?php
|
||||
function bar() {
|
||||
try {
|
||||
echo "1\n";
|
||||
try {
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "2\n";
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception ("");
|
||||
} catch (Exception $ab) {
|
||||
echo "3\n";
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
echo "4\n";
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "5\n";
|
||||
}
|
||||
}
|
||||
echo "6\n";
|
||||
try {
|
||||
} finally {
|
||||
while (1) {
|
||||
try {
|
||||
echo "7\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "8\n";
|
||||
}
|
||||
echo "bad";
|
||||
}
|
||||
echo "9\n";
|
||||
while (1) {
|
||||
try {
|
||||
throw new Exception("");
|
||||
} catch(Exception $e) {
|
||||
echo "10\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "11\n";
|
||||
}
|
||||
echo "bak\n";
|
||||
}
|
||||
}
|
||||
echo "12\n";
|
||||
}
|
||||
echo "13\n";
|
||||
}
|
||||
bar();
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66609 (php crashes with __get() and ++ operator in some cases)
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = new Bar;
|
||||
$foo = new Foo;
|
||||
class Bar {
|
||||
public function __get($x) {
|
||||
global $foo;
|
||||
return $foo->foo;
|
||||
}
|
||||
}
|
||||
class Foo {
|
||||
public function __get($x) {
|
||||
global $bar;
|
||||
return $bar->bar;
|
||||
}
|
||||
}
|
||||
$foo->blah += 1; //crash
|
||||
++$foo->blah; //crash
|
||||
$foo->blah++; //crash
|
||||
$foo->blah--; //crash
|
||||
--$foo->blah; //crash
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
|
||||
okey
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66660 (Composer.phar install/update fails)
|
||||
--STDIN--
|
||||
<?php __CLASS__ ?>
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents(__DIR__."/bug66660.tmp.php", "<?php __CLASS__ ?>");
|
||||
echo php_strip_whitespace(__DIR__."/bug66660.tmp.php");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php unlink(__DIR__."/bug66660.tmp.php"); ?>
|
||||
--EXPECT--
|
||||
<?php __CLASS__ ?>
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67111: Memory leak when using "continue 2" inside two foreach loops
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array1 = [1, 2, 3];
|
||||
$array2 = [1, 2, 3];
|
||||
|
||||
foreach ($array1 as $x) {
|
||||
foreach ($array2 as $y) {
|
||||
echo "$x.$y\n";
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1.1
|
||||
2.1
|
||||
3.1
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67169: array_splice all elements, then []= gives wrong index
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = array('a', 'b');
|
||||
array_splice($array, 0, 2);
|
||||
$array[] = 'c';
|
||||
var_dump($array);
|
||||
|
||||
$array = array('a', 'b');
|
||||
array_shift($array);
|
||||
array_shift($array);
|
||||
$array[] = 'c';
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
|
||||
--FILE--
|
||||
<?php
|
||||
function crash()
|
||||
{
|
||||
$notDefined[$i] = 'test';
|
||||
}
|
||||
|
||||
function error_handler() { return false; }
|
||||
|
||||
set_error_handler('error_handler');
|
||||
crash();
|
||||
echo "made it once\n";
|
||||
crash();
|
||||
echo "ok\n";
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
made it once
|
||||
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
ok
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
|
||||
--INI--
|
||||
report_memleaks=1
|
||||
--FILE--
|
||||
<?php
|
||||
class FooBar {
|
||||
const bar = ["bar" => 3]["bar"];
|
||||
}
|
||||
echo "okey";
|
||||
--EXPECTF--
|
||||
okey
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
class a {
|
||||
public function test($arg = c::TESTCONSTANT) {
|
||||
echo __METHOD__ . "($arg)\n";
|
||||
}
|
||||
|
||||
static public function staticTest() {
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
class b extends a {
|
||||
public function test() {
|
||||
echo __METHOD__ . "()\n";
|
||||
parent::test();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
bug67436: Autoloader isn't called if user defined error handler is present
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
}, error_reporting());
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECT--
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
bug67436: E_STRICT instead of custom error handler
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
class c {
|
||||
const TESTCONSTANT = "c::TESTCONSTANT";
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function id($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function &ref_id(&$x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$c = 'c';
|
||||
$array = ['a', 'b', $c];
|
||||
|
||||
foreach(id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
foreach(ref_id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "aq"
|
||||
[1]=>
|
||||
string(2) "bq"
|
||||
[2]=>
|
||||
&string(2) "cq"
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67938: Segfault when extending interface method with variadic
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface TestInterface {
|
||||
public function foo();
|
||||
public function bar(array $bar);
|
||||
}
|
||||
|
||||
class Test implements TestInterface {
|
||||
public function foo(...$args) {
|
||||
echo __METHOD__, "\n";
|
||||
}
|
||||
public function bar(array $bar, ...$args) {
|
||||
echo __METHOD__, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->foo();
|
||||
$obj->bar([]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Test::foo
|
||||
Test::bar
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67985 - Last used array index not copied to new array at assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = ['zero', 'one', 'two'];
|
||||
unset($a[2]);
|
||||
$b = $a;
|
||||
$a[] = 'three';
|
||||
$b[] = 'three';
|
||||
|
||||
var_dump($a === $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
$obj = new stdClass;
|
||||
$obj->test = 'meow';
|
||||
return true;
|
||||
});
|
||||
|
||||
$a = new stdClass;
|
||||
$a->undefined .= 'test';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["undefined"]=>
|
||||
string(4) "test"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68370 "unset($this)" can make the program crash
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
public function test() {
|
||||
unset($this);
|
||||
return get_defined_vars();
|
||||
}
|
||||
}
|
||||
$c = new C();
|
||||
$x = $c->test();
|
||||
print_r($x);
|
||||
unset($c, $x);
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68446 (Array constant not accepted for array parameter default)
|
||||
--FILE--
|
||||
<?php
|
||||
const FOO = [1];
|
||||
const BAR = null;
|
||||
|
||||
function a(array $a = FOO) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
function b(array $b = BAR) {
|
||||
var_dump($b);
|
||||
}
|
||||
|
||||
b(null);
|
||||
b([]);
|
||||
b();
|
||||
a([]);
|
||||
a();
|
||||
a(null);
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
array(0) {
|
||||
}
|
||||
NULL
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68652 (segmentation fault in destructor)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Bar::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Foo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$foo = new Foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Bar::$instance in %sbug68652.php on line %d
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
#69017 (Fail to push to the empty array with the constant value defined in class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class c1
|
||||
{
|
||||
const ZERO = 0;
|
||||
const ONE = 1;
|
||||
const MAX = PHP_INT_MAX;
|
||||
public static $a1 = array(self::ONE => 'one');
|
||||
public static $a2 = array(self::ZERO => 'zero');
|
||||
public static $a3 = array(self::MAX => 'zero');
|
||||
}
|
||||
|
||||
|
||||
c1::$a1[] = 1;
|
||||
c1::$a2[] = 1;
|
||||
c1::$a3[] = 1;
|
||||
|
||||
var_dump(c1::$a1);
|
||||
var_dump(c1::$a2);
|
||||
var_dump(c1::$a3);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "one"
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "zero"
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[%d]=>
|
||||
string(4) "zero"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69174 (leaks when unused inner class use traits precedence)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
class C1 {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof T2;
|
||||
T1::bar insteadof T2;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public static function __callStatic($method, $args) {}
|
||||
public function __call($method, $args) {}
|
||||
}
|
||||
|
||||
function do_throw() { throw new Exception; }
|
||||
|
||||
try {
|
||||
Test::foo(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
try {
|
||||
(new Test)->bar(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$f = function () {};
|
||||
$f->__invoke(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$t = new Test;
|
||||
$f->__invoke($t->bar(Test::foo(do_throw())));
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$gen1 = gen();
|
||||
$gen2 = (object) $gen1;
|
||||
|
||||
foreach ($gen1 as $v1) {
|
||||
foreach ($gen2 as $v2) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
unset($gen1);
|
||||
foreach ($gen2 as $v) { var_dump($v); }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator (2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$gen = function() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$iter = new IteratorIterator($gen());
|
||||
$ngen = $iter->getInnerIterator();
|
||||
|
||||
var_dump(iterator_to_array($ngen, false));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69420 (Invalid read in zend_std_get_method)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
protected function test() {
|
||||
echo "okey";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class A {
|
||||
protected function test() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
use T;
|
||||
public function foo() {
|
||||
$this->test();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$b = new B();
|
||||
$b->foo();
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69467 (Wrong checked for the interface by using Trait)
|
||||
--FILE--
|
||||
<?php
|
||||
interface Baz {
|
||||
public function bad();
|
||||
}
|
||||
|
||||
trait Bar{
|
||||
protected function bad(){}
|
||||
}
|
||||
|
||||
class Foo implements Baz{
|
||||
use Bar;
|
||||
}
|
||||
|
||||
$test = new Foo();
|
||||
var_dump($test instanceof Baz);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Bar::bad() must be public (as in class Baz) in %sbug69467.php on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69537 (__debugInfo with empty string for key gives error)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
public function __debugInfo(){
|
||||
return ['' => 1];
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(new Foo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(Foo)#%d (%d) {
|
||||
[""]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Loaded 100 of 3890 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user