mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7c3d28e89 | ||
|
|
28ce2acb7a |
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,13 +22,7 @@ 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
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
|
||||
+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 TEST_PHP_EXECUTABLE=./sapi/cli/php
|
||||
|
||||
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 -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
|
||||
+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
|
||||
-----------------------------------
|
||||
|
||||
+5
-17
@@ -147,7 +147,7 @@ STATUS: Working
|
||||
COMMENT: Tested on phpts and isapi versions
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysql
|
||||
PRIMARY MAINTAINER: Zak Greant <zak@mysql.com>, Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Zak Greant <zak@mysql.com>, Georg Richter <georg@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -158,7 +158,7 @@ STATUS: Working
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysqlnd
|
||||
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3
|
||||
@@ -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
|
||||
@@ -1819,7 +1819,7 @@ Installation
|
||||
set of HTTP headers. The headers it did return are:
|
||||
10. Windows: I've followed all the instructions, but still can't get
|
||||
PHP and IIS to work together!
|
||||
11. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get
|
||||
11. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get
|
||||
the following error: Security Alert! PHP CGI cannot be accessed
|
||||
directly..
|
||||
12. How do I know if my php.ini is being found and read? It seems like
|
||||
@@ -2007,7 +2007,7 @@ cgi error:
|
||||
And for IIS4 you need to tell it that PHP is a script engine.
|
||||
Also, you will want to read this faq.
|
||||
|
||||
When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get the
|
||||
When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get the
|
||||
following error: Security Alert! PHP CGI cannot be accessed
|
||||
directly..
|
||||
You must set the cgi.force_redirect directive to 0. It defaults
|
||||
|
||||
@@ -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 \*.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; \
|
||||
|
||||
+4
-13
@@ -10,7 +10,7 @@ all: $(all_targets)
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@echo
|
||||
|
||||
|
||||
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
|
||||
|
||||
build-binaries: $(PHP_BINARIES)
|
||||
@@ -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"`; \
|
||||
@@ -115,19 +115,10 @@ clean:
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php5.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
|
||||
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
|
||||
rm -f ext/phar/phar.phar ext/phar/phar.php
|
||||
if test "$(srcdir)" != "$(builddir)"; then \
|
||||
rm -f ext/phar/phar/phar.inc; \
|
||||
fi
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
@@ -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
-18
@@ -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,14 @@ 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. It allows for larger
|
||||
enhancements.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.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 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 current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
@@ -62,22 +60,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
|
||||
|
||||
@@ -28,22 +28,11 @@ Both functions return SUCCESS or FAILURE depending on the result.
|
||||
The auto-conversions are performed as necessary. Arrays, objects, and
|
||||
resources cannot be auto-converted.
|
||||
|
||||
PHP 5.5 includes a new function:
|
||||
|
||||
int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);
|
||||
|
||||
This function behaves like zend_parse_parameters_ex() except that instead of
|
||||
reading the arguments from the stack, it receives a single zval to convert
|
||||
(passed with double indirection). The passed zval may be changed in place as
|
||||
part of the conversion process.
|
||||
|
||||
See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse_parameter
|
||||
|
||||
|
||||
Type specifiers
|
||||
---------------
|
||||
The following list shows the type specifier, its meaning and the parameter
|
||||
types that need to be passed by address. All passed parameters are set
|
||||
types that need to be passed by address. All passed paramaters are set
|
||||
if the PHP parameter is non optional and untouched if optional and the
|
||||
parameter is not present. The only exception is O where the zend_class_entry*
|
||||
has to be provided on input and is used to verify the PHP parameter is an
|
||||
@@ -76,13 +65,9 @@ Type specifiers
|
||||
will not be touched by the parsing function if they are not
|
||||
passed to it.
|
||||
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
|
||||
! - the parameter it follows can be of specified type or NULL. If NULL is
|
||||
passed and the output for such type is a pointer, then the output
|
||||
pointer is set to a native NULL pointer.
|
||||
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
|
||||
passed after the corresponding bool*, long* or double* arguments,
|
||||
respectively. A non-zero value will be written to the zend_bool iif a
|
||||
PHP NULL is passed.
|
||||
! - the parameter it follows can be of specified type or NULL (applies
|
||||
to all specifiers except for 'b', 'l', and 'd'). If NULL is passed, the
|
||||
results pointer is set to NULL as well.
|
||||
|
||||
|
||||
Note on 64bit compatibility
|
||||
|
||||
@@ -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
|
||||
|
||||
+77
-119
@@ -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,49 +47,33 @@ 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 two tarballs (one gz and one bz2).
|
||||
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
9. Copy those two 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.
|
||||
|
||||
@@ -113,10 +86,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 +105,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 +118,59 @@ 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;
|
||||
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
|
||||
12. Commit those two tarballs to Git (php-distributions.git)
|
||||
|
||||
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.
|
||||
|
||||
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 +183,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 +210,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 +230,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 +251,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 +268,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.
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to 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);
|
||||
+7
-25
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -631,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->info = info_handle;
|
||||
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (NULL != shm->descriptor && created) {
|
||||
if (created) {
|
||||
shm->descriptor->shm_perm.key = key;
|
||||
shm->descriptor->shm_segsz = size;
|
||||
shm->descriptor->shm_ctime = time(NULL);
|
||||
@@ -645,10 +639,8 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0;
|
||||
}
|
||||
|
||||
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
|
||||
if (NULL != shm->segment) {
|
||||
CloseHandle(shm->segment);
|
||||
}
|
||||
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) {
|
||||
CloseHandle(shm->segment);
|
||||
UnmapViewOfFile(shm->descriptor);
|
||||
CloseHandle(shm->info);
|
||||
return -1;
|
||||
@@ -660,27 +652,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
|
||||
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,286 @@ 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.
|
||||
- Drop Windows XP and 2003 support. (Pierre)
|
||||
- All internal case insensitivity handling for class, function and constant
|
||||
names is done according to ASCII rules, current locale settings are ignored.
|
||||
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
|
||||
zend_logo_guid() have been removed
|
||||
- Removal of Logo GUIDs
|
||||
|
||||
- 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.
|
||||
|
||||
- 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)
|
||||
|
||||
- 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.
|
||||
- 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.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
|
||||
- Added constant scalar expressions syntax.
|
||||
(https://wiki.php.net/rfc/const_scalar_exprs)
|
||||
|
||||
- Added dedicated syntax for variadic functions.
|
||||
(https://wiki.php.net/rfc/variadics)
|
||||
|
||||
- Added support for argument unpacking to complement the variadic syntax.
|
||||
(https://wiki.php.net/rfc/argument_unpacking)
|
||||
|
||||
- Added an exponentiation operator (**).
|
||||
(https://wiki.php.net/rfc/pow-operator)
|
||||
|
||||
- Added unified default encoding. default_charset=UTF-8 and functions/extensions
|
||||
use encoding settings honor default_charset.
|
||||
|
||||
- The php://input stream is now re-usable and can be used concurrently with
|
||||
enable_post_data_reading=0.
|
||||
|
||||
- Added use function and use const.
|
||||
(https://wiki.php.net/rfc/use_function)
|
||||
|
||||
- Added a function for timing attack safe string comparison
|
||||
(https://wiki.php.net/rfc/timing_attack)
|
||||
|
||||
- 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.
|
||||
- Support list in foreach. (Laruence)
|
||||
(wiki.php.net/rfc/foreachlist)
|
||||
- Support finally keyword. (Laruence)
|
||||
(wiki.php.net/rfc/finally)
|
||||
- Support constant array/string dereferencing. (Laruence)
|
||||
(https://wiki.php.net/rfc/constdereference)
|
||||
- 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. (https://wiki.php.net/rfc/empty_isset_exprs)
|
||||
- Added generators.
|
||||
(https://wiki.php.net/rfc/generators)
|
||||
|
||||
========================================
|
||||
3. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
- Added phpdbg SAPI.
|
||||
(https://wiki.php.net/rfc/phpdbg)
|
||||
|
||||
- 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.
|
||||
|
||||
========================================
|
||||
4. 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 "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.
|
||||
|
||||
- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
|
||||
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
|
||||
|
||||
- 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
|
||||
|
||||
========================================
|
||||
5. 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.
|
||||
|
||||
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
|
||||
|
||||
curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 5.6.25)
|
||||
|
||||
- Strings:
|
||||
substr_compare() now allows $length to be zero.
|
||||
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
|
||||
|
||||
- Crypt:
|
||||
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
|
||||
See: https://wiki.php.net/rfc/crypt_function_salt
|
||||
|
||||
- Mcrypt:
|
||||
The $source parameter of mcrypt_create_iv() now defaults to
|
||||
MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
|
||||
|
||||
- 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.
|
||||
|
||||
- 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.
|
||||
|
||||
- XMLReader:
|
||||
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
|
||||
the attribute could not be found, just like XMLReader::getAttribute.
|
||||
|
||||
- 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()
|
||||
|
||||
- unserialize:
|
||||
Manipulated serialization strings for objects implementing Serializable by
|
||||
replacing "C:" with "O:" at the start will now produce an error.
|
||||
|
||||
- parse_ini_file():
|
||||
- parse_ini_string():
|
||||
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
|
||||
For PHP >= 5.6.1
|
||||
|
||||
- JSON:
|
||||
Added JSON_PRESERVE_ZERO_FRACTION option (PHP >= 5.6.5)
|
||||
|
||||
========================================
|
||||
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
|
||||
2. Changes in SAPI modules
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
8. Removed Extensions
|
||||
3. Deprecated Functionality
|
||||
========================================
|
||||
|
||||
- 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 preg_replace /e modifier is now deprecated. Use
|
||||
preg_replace_callback instead.
|
||||
(https://wiki.php.net/rfc/remove_preg_replace_eval_modifier)
|
||||
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
|
||||
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
|
||||
instead.
|
||||
- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw
|
||||
E_DEPRECATED. Their use was already previously discouraged in the docs,
|
||||
but that predated the existence of E_DEPRECATED.
|
||||
|
||||
========================================
|
||||
9. Other Changes to Extensions
|
||||
4. Changed Functions
|
||||
========================================
|
||||
|
||||
- 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)
|
||||
- pack()/unpack() had the following changes, which bring it more in line
|
||||
with Perl's behavior:
|
||||
- Implemented format character "Z": NUL-padded string
|
||||
- "a" now does not remove trailing NUL characters on unpack() anymore
|
||||
- "A" will now strip all trailing ASCII whitespace on unpack() (it used to
|
||||
remove only trailing spaces).
|
||||
- MessageFormatter::format() and related functions now accepted named arguments
|
||||
and mixed numeric/named arguments in ICU 4.8+.
|
||||
- MessageFormatter::format() and related functions now don't error out when
|
||||
an insufficient argument count is provided. Instead, the placeholders will
|
||||
remain unsubstituted.
|
||||
- MessageFormatter::parse() and MessageFormat::format() (and their static
|
||||
equivalents) now don't throw away better than second precision in the
|
||||
arguments.
|
||||
- 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. Emptry strings are
|
||||
no longer accepted.
|
||||
- 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.
|
||||
- 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.
|
||||
- IntlDateFormatter::__construct and datefmt_create() now accept for the
|
||||
$calendar argument also IntlCalendar objects.
|
||||
- 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.
|
||||
- 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.
|
||||
- IntlDateFormatter::format() and datefmt_format() now also accept an
|
||||
IntlCalendar object for formatting.
|
||||
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
|
||||
zend_logo_guid() have been removed
|
||||
- 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.
|
||||
|
||||
========================================
|
||||
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.
|
||||
- boolval()
|
||||
- password_get_info()
|
||||
- password_hash()
|
||||
- password_needs_rehash()
|
||||
- password_verify()
|
||||
|
||||
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.
|
||||
- Hash:
|
||||
- hash_pbkdf2()
|
||||
|
||||
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.
|
||||
- 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()
|
||||
|
||||
- cURL:
|
||||
If the new openssl.cafile ini directive is specified ext/curl will give the
|
||||
openssl path precedence over its own curl.cainfo directive.
|
||||
- IntlDateFormatter::formatObject()
|
||||
- IntlDateFormatter::getCalendarObject()
|
||||
- IntlDateFormatter::getTimeZone()
|
||||
- IntlDateFormatter::setTimeZone()
|
||||
|
||||
- SPL:
|
||||
- SplFixedArray::__wakeup()
|
||||
|
||||
========================================
|
||||
6. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
- Intl:
|
||||
- IntlCalendar
|
||||
- IntlGregorianCalendar
|
||||
- IntlTimeZone
|
||||
- IntlBreakIterator
|
||||
- IntlRuleBasedBreakIterator
|
||||
- IntlCodePointBreakIterator
|
||||
|
||||
========================================
|
||||
7. Removed Extensions
|
||||
========================================
|
||||
|
||||
|
||||
========================================
|
||||
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()
|
||||
|
||||
========================================
|
||||
10. Changes to INI File Handling
|
||||
========================================
|
||||
|
||||
- Intl:
|
||||
- Added intl.use_exceptions INI directive, which controls what happens when
|
||||
global errors are set together with intl.error_level.
|
||||
|
||||
- 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.
|
||||
|
||||
========================================
|
||||
11. Windows Support
|
||||
========================================
|
||||
|
||||
- Apache 2.4 handler is supported as of PHP 5.5.0
|
||||
|
||||
- OpenSSL:
|
||||
openssl.cafile and openssl.capath ini directives have been added to allow
|
||||
global CA default specification as necessary.
|
||||
|
||||
========================================
|
||||
12. Other Changes
|
||||
========================================
|
||||
|
||||
- File upload:
|
||||
Uploads equal or greater than 2GB in size are now accepted.
|
||||
|
||||
- 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.
|
||||
|
||||
- Logo GUIDs will no longer work
|
||||
+35
-195
@@ -1,19 +1,10 @@
|
||||
$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. Streams pooling API
|
||||
b. Lowercasing and locales
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -24,202 +15,51 @@ PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Addition of do_operation and compare object handlers
|
||||
a. Streams pooling API
|
||||
|
||||
Two new object handlers have been added:
|
||||
The streams pooling API has been removed. The following functions no longer
|
||||
exist:
|
||||
|
||||
do_operation:
|
||||
typedef int (*zend_object_do_operation_t)(
|
||||
zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC
|
||||
);
|
||||
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);
|
||||
|
||||
compare:
|
||||
typedef int (*zend_object_compare_zvals_t)(
|
||||
zval *result, zval *op1, zval *op2 TSRMLS_DC
|
||||
);
|
||||
b. Lowercasing and locales
|
||||
|
||||
The first handler is used to overload arithmetic operations. The first
|
||||
argument specifies the opcode of the operator, result is the target zval,
|
||||
op1 the first operand and op2 the second operand. For unary operations
|
||||
op2 is NULL. If the handler returns FAILURE PHP falls back to the default
|
||||
behavior for the operation.
|
||||
The lowercasing functions in zend_operators.c were split into those that do
|
||||
lowercasing according to locale rules and those that do ASCII lowercasing.
|
||||
ASCII:
|
||||
|
||||
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.
|
||||
zend_str_tolower_copy
|
||||
zend_str_tolower_dup
|
||||
zend_str_tolower
|
||||
zend_binary_strcasecmp
|
||||
zend_binary_strncasecmp
|
||||
|
||||
Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
|
||||
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
|
||||
|
||||
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
|
||||
Internal engine lowercasing will be using ASCII-only rules. User-facing functions,
|
||||
such as strcasecmp, will be using locale rules.
|
||||
|
||||
The return_value_ptr argument to internal functions is now always set.
|
||||
Previously it was only available for functions returning by-reference.
|
||||
return_value_ptr can now be used to return zvals without copying them.
|
||||
For this purpose two new macros are provided:
|
||||
|
||||
RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
|
||||
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
|
||||
|
||||
The macros behave similarly to the non-FAST variants with copy=1 and
|
||||
dtor=0, but will try to return the zval without making a copy by utilizing
|
||||
return_value_ptr.
|
||||
|
||||
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.
|
||||
|
||||
d. Arginfo changes
|
||||
|
||||
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.
|
||||
|
||||
Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():
|
||||
|
||||
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 */
|
||||
|
||||
ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.
|
||||
|
||||
The following changes were applied to the zend_arg_info struct:
|
||||
|
||||
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;
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
========================
|
||||
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@
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading
|
||||
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
|
||||
code execution (with specialized executor and direct threading execution
|
||||
method). As in most PHP applications raw execution speed isn't the limiting
|
||||
factor but system calls and database calls are, your mileage with this patch
|
||||
factor but system calls and database callls are, your mileage with this patch
|
||||
will vary.
|
||||
|
||||
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can
|
||||
|
||||
+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.
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
|
||||
that of other object-oriented languages, such as Java: When the
|
||||
last reference to an object is destroyed the object's
|
||||
destructor, which is a class method name __destruct() that
|
||||
receives no parameters, is called before the object is freed
|
||||
recieves no parameters, is called before the object is freed
|
||||
from memory.
|
||||
|
||||
Example:
|
||||
@@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0
|
||||
(supports breakpoints, expression evaluation, step-in/over,
|
||||
function call backtrace, and more).
|
||||
|
||||
The Zend Engine claims 100% compatibility with the engine of PHP
|
||||
The Zend Engine claims 100% compatability with the engine of PHP
|
||||
3.0, and is shamelessly lying about it. Here's why:
|
||||
|
||||
* Static variable initializers only accept scalar values
|
||||
@@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0
|
||||
printed the letter { and the contents of the variable $somevar in
|
||||
PHP 3.0), it will result in a parse error with the Zend Engine.
|
||||
In this case, you would have to change the code to print
|
||||
"\{$somevar"; This incompatibility is due to the full variable
|
||||
"\{$somevar"; This incompatability is due to the full variable
|
||||
reference within quoted strings feature added in the Zend
|
||||
Engine.
|
||||
@@ -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="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
@@ -17,27 +12,23 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
bison_version=none
|
||||
if test "$YACC"; then
|
||||
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
|
||||
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
|
||||
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
|
||||
php_cv_bison_version=invalid
|
||||
if test -n "$bison_version_vars"; then
|
||||
set $bison_version_vars
|
||||
bison_version="${1}.${2}"
|
||||
bison_version_num="`expr ${1} \* 100 + ${2}`"
|
||||
if test $bison_version_num -ge $bison_version_min; then
|
||||
php_cv_bison_version="$bison_version (ok)"
|
||||
for bison_check_version in $bison_version_exclude; do
|
||||
if test "$bison_version" = "$bison_check_version"; then
|
||||
php_cv_bison_version=invalid
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
for bison_check_version in $bison_version_list; do
|
||||
if test "$bison_version" = "$bison_check_version"; then
|
||||
php_cv_bison_version="$bison_check_version (ok)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
fi
|
||||
case $php_cv_bison_version in
|
||||
""|invalid[)]
|
||||
bison_msg="This bison version is not supported for regeneration of the Zend/PHP parsers (found: $bison_version, min: $bison_version_min, excluded: $bison_version_exclude)."
|
||||
bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found: $bison_version)."
|
||||
AC_MSG_WARN([$bison_msg])
|
||||
YACC="exit 0;"
|
||||
;;
|
||||
|
||||
+1
-1
@@ -357,7 +357,7 @@ var_dump($global_var);
|
||||
test_unset3();
|
||||
var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arguments can be tested
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
|
||||
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
|
||||
|
||||
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
|
||||
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #32428 (The @ warning error suppression operator is broken)
|
||||
Bug #32428 (The @ warning error supression operator is broken)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = @$not_exists;
|
||||
|
||||
@@ -64,8 +64,6 @@ print "\nDone\n";
|
||||
--EXPECTF--
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: %s in %s on line 6
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists('memory_get_usage')) die('memory_get_usage() not installed'); ?>
|
||||
--INI--
|
||||
opcache.enable_cli=0
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
|
||||
@@ -13,8 +13,10 @@ function eh()
|
||||
set_error_handler("eh");
|
||||
$a = $empty($b);
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:%d
|
||||
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
|
||||
Stack trace:
|
||||
#0 %sbug51394.php(%d): eh(8, 'Undefined varia%s', '%s', %d, Array)
|
||||
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug51394.php on line %d
|
||||
thrown in %sbug51394.php on line 4
|
||||
|
||||
Fatal error: Function name must be a string in %sbug51394.php on line 9
|
||||
@@ -35,30 +35,18 @@ Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 9
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined property: stdClass::$b in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 11
|
||||
|
||||
Warning: Creating default object from empty value in %sbug52041.php on line 11
|
||||
|
||||
Notice: Undefined property: stdClass::$b in %sbug52041.php on line 11
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
--TEST--
|
||||
Bug #55156 (ReflectionClass::getDocComment() returns comment even though the class has none)
|
||||
--INI--
|
||||
opcache.save_comments=1
|
||||
opcache.load_comments=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@ Bug #60536 (Traits Segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait T { private $x = 0; }
|
||||
class X {
|
||||
class X {
|
||||
use T;
|
||||
}
|
||||
class Y extends X {
|
||||
use T;
|
||||
function x() {
|
||||
return ++$this->x;
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
class Z extends Y {
|
||||
function z() {
|
||||
return ++$this->x;
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
$a = new Z();
|
||||
@@ -22,6 +22,4 @@ $a->x();
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Notice: Undefined property: Z::$x in %s on line 14
|
||||
DONE
|
||||
@@ -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,10 +1,9 @@
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('./test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60833 (self, parent, static behave inconsistently case-sensitive)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
static $x = "A";
|
||||
function testit() {
|
||||
$this->v1 = new sELF;
|
||||
$this->v2 = new SELF;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
static $x = "B";
|
||||
function testit() {
|
||||
PARENT::testit();
|
||||
$this->v3 = new sELF;
|
||||
$this->v4 = new PARENT;
|
||||
$this->v4 = STATIC::$x;
|
||||
}
|
||||
}
|
||||
$t = new B();
|
||||
$t->testit();
|
||||
var_dump($t);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(B)#%d (4) {
|
||||
["v1"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["v2"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["v3"]=>
|
||||
object(B)#%d (0) {
|
||||
}
|
||||
["v4"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61025 (__invoke() visibility not honored)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Interface InvokeAble {
|
||||
static function __invoke();
|
||||
}
|
||||
|
||||
class Bar {
|
||||
private function __invoke() {
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
|
||||
$b = new Bar;
|
||||
echo $b();
|
||||
|
||||
echo $b->__invoke();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
|
||||
|
||||
Warning: The magic method __invoke() must have public visibility and cannot be static in %sbug61025.php on line %d
|
||||
Bar
|
||||
Fatal error: Call to private method Bar::__invoke() from context '' in %sbug61025.php on line %d
|
||||
@@ -17,16 +17,18 @@ $undefined->foo();
|
||||
--EXPECTF--
|
||||
Error handler called (Undefined variable: undefined)
|
||||
|
||||
Fatal error: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:%d
|
||||
Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
|
||||
Stack trace:
|
||||
#0 %sbug61767.php(%d): {closure}(%s, 'Undefined varia...', '%s', %d, Array)
|
||||
#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
|
||||
#1 {main}
|
||||
thrown in %sbug61767.php on line %d
|
||||
thrown in %sbug61767.php on line 13
|
||||
|
||||
Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
|
||||
Shutting down
|
||||
Array
|
||||
(
|
||||
[type] => 1
|
||||
[message] => %a
|
||||
[message] => Call to a member function foo() on a non-object
|
||||
[file] => %sbug61767.php
|
||||
[line] => %d
|
||||
[line] => 13
|
||||
)
|
||||
@@ -9,8 +9,6 @@ function add_points($player, $points) {
|
||||
add_points(NULL, 2);
|
||||
--EXPECTF--
|
||||
Warning: Creating default object from empty value in %sbug62005.php on line %d
|
||||
|
||||
Notice: Undefined property: stdClass::$energy in %sbug62005.php on line 3
|
||||
stdClass Object
|
||||
(
|
||||
[energy] => 2
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62343 (Show class_alias In get_declared_classes())
|
||||
--FILE--
|
||||
<?php
|
||||
class a { }
|
||||
class_alias("a", "b");
|
||||
$c = get_declared_classes();
|
||||
var_dump(end($c));
|
||||
var_dump(prev($c));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "b"
|
||||
string(1) "a"
|
||||
@@ -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,74 +0,0 @@
|
||||
--TEST--
|
||||
Test script to verify that magic methods should be called only once when accessing an unset property.
|
||||
--CREDITS--
|
||||
Marco Pivetta <ocramius@gmail.com>
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public $publicProperty;
|
||||
protected $protectedProperty;
|
||||
private $privateProperty;
|
||||
|
||||
public function __construct() {
|
||||
unset(
|
||||
$this->publicProperty,
|
||||
$this->protectedProperty,
|
||||
$this->privateProperty
|
||||
);
|
||||
}
|
||||
|
||||
function __get($name) {
|
||||
echo '__get ' . $name . "\n";
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
function __set($name, $value) {
|
||||
echo '__set ' . $name . "\n";
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
function __isset($name) {
|
||||
echo '__isset ' . $name . "\n";
|
||||
return isset($this->$name);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
$test->nonExisting;
|
||||
$test->publicProperty;
|
||||
$test->protectedProperty;
|
||||
$test->privateProperty;
|
||||
isset($test->nonExisting);
|
||||
isset($test->publicProperty);
|
||||
isset($test->protectedProperty);
|
||||
isset($test->privateProperty);
|
||||
$test->nonExisting = 'value';
|
||||
$test->publicProperty = 'value';
|
||||
$test->protectedProperty = 'value';
|
||||
$test->privateProperty = 'value';
|
||||
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
__get nonExisting
|
||||
|
||||
Notice: Undefined property: Test::$nonExisting in %s on line %d
|
||||
__get publicProperty
|
||||
|
||||
Notice: Undefined property: Test::$publicProperty in %s on line %d
|
||||
__get protectedProperty
|
||||
|
||||
Notice: Undefined property: Test::$protectedProperty in %s on line %d
|
||||
__get privateProperty
|
||||
|
||||
Notice: Undefined property: Test::$privateProperty in %s on line %d
|
||||
__isset nonExisting
|
||||
__isset publicProperty
|
||||
__isset protectedProperty
|
||||
__isset privateProperty
|
||||
__set nonExisting
|
||||
__set publicProperty
|
||||
__set protectedProperty
|
||||
__set privateProperty
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63976 (Parent class incorrectly using child constant in class property)
|
||||
--FILE--
|
||||
<?php
|
||||
if (1) {
|
||||
class Foo {
|
||||
const TABLE = "foo";
|
||||
public $table = self::TABLE;
|
||||
}
|
||||
}
|
||||
if (1) {
|
||||
class Bar extends Foo {
|
||||
const TABLE = "bar";
|
||||
}
|
||||
}
|
||||
$bar = new Bar();
|
||||
var_dump($bar->table);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
protected $protectedProperty;
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
var_dump(isset($test->protectedProperty));
|
||||
var_dump(isset($test->protectedProperty->foo));
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64135 (Exceptions from set_error_handler are not always propagated)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function exception_error_handler() {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
set_error_handler("exception_error_handler");
|
||||
try {
|
||||
$undefined->undefined();
|
||||
} catch(Exception $e) {
|
||||
echo "Exception is thrown";
|
||||
}
|
||||
--EXPECT--
|
||||
Exception is thrown
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (get_class_methods() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
}
|
||||
}
|
||||
print_r(get_class_methods("A"));
|
||||
print_r(get_class_methods("B"));
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Bmethod
|
||||
[1] => t2method
|
||||
)
|
||||
@@ -1,58 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T1;
|
||||
public function test() { $this->backtrace(); }
|
||||
}
|
||||
|
||||
class B {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
}
|
||||
|
||||
trait T1 {
|
||||
protected function backtrace() {
|
||||
$b = new B();
|
||||
$b->Bmethod();
|
||||
}
|
||||
}
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
|
||||
}
|
||||
}
|
||||
$a = new A();
|
||||
$a->test();
|
||||
|
||||
$c = new C();
|
||||
$c->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %sbug64239_2.php
|
||||
[line] => %d
|
||||
[function] => Bmethod
|
||||
[class] => B
|
||||
[type] => ->
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$a->Bmethod();
|
||||
$a->t2method();
|
||||
|
||||
$c = new C();
|
||||
$c->Bmethod();
|
||||
$c->t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
#0 C->Bmethod() called at [%sbug64239_3.php:%d]
|
||||
#0 A->t2method() called at [%sbug64239_3.php:%d]
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64239 (debug_print_backtrace() changed behavior)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
use T2 { t2method as Bmethod; }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
public static function Bmethod() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public static function t2method() {
|
||||
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
|
||||
}
|
||||
}
|
||||
|
||||
A::Bmethod();
|
||||
A::t2method();
|
||||
|
||||
C::Bmethod();
|
||||
C::t2method();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
#0 C::Bmethod() called at [%sbug64239_4.php:%d]
|
||||
#0 A::t2method() called at [%sbug64239_4.php:%d]
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64354 (Unserialize array of objects whose class can't be autoloaded fail)
|
||||
--FILE--
|
||||
<?php
|
||||
class B implements Serializable {
|
||||
public function serialize() {
|
||||
throw new Exception("serialize");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function unserialize($data) {
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(new B);
|
||||
|
||||
try {
|
||||
serialize($data);
|
||||
} catch (Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(9) "serialize"
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64417 (BC break: ArrayAccess::&offsetGet() in a trait causes fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait aa {
|
||||
private $container = array();
|
||||
public function offsetSet($offset, $value) {
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
public function &offsetGet($offset) {
|
||||
$result = null;
|
||||
if (isset($this->container[$offset])) {
|
||||
$result = &$this->container[$offset];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
class obj implements ArrayAccess {
|
||||
use aa;
|
||||
}
|
||||
|
||||
$o = new obj;
|
||||
$o['x'] = 1;
|
||||
++$o['x'];
|
||||
echo $o['x'], "\n";
|
||||
--EXPECT--
|
||||
2
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($unused = null, $unused = null, $arg = array()) {
|
||||
return 1;
|
||||
}
|
||||
foo();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64555: Array key within interned string gets wrong hash value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
protected $unsetme = 1;
|
||||
protected $keepme = 2;
|
||||
|
||||
public function test() {
|
||||
$a = get_object_vars($this);
|
||||
|
||||
foreach ($a as $k => $v) {
|
||||
if ($k == 'unsetme') {
|
||||
echo "Unsetting: $k\n";
|
||||
unset($a[$k]);
|
||||
} else if ($k == 'keepme') {
|
||||
echo "Changing: $k\n";
|
||||
$a[$k] = 42;
|
||||
$a['keepme'] = 43;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump($a, array_keys($a));
|
||||
}
|
||||
}
|
||||
|
||||
$f = new Foo;
|
||||
$f->test();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Unsetting: unsetme
|
||||
Changing: keepme
|
||||
array(1) {
|
||||
["keepme"]=>
|
||||
int(43)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(6) "keepme"
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $err) { var_dump($err); });
|
||||
|
||||
function x($s) { $s['a'] = 1; };
|
||||
$y = '1';
|
||||
x($y);
|
||||
print_r($y);
|
||||
--EXPECTF--
|
||||
string(25) "Illegal string offset 'a'"
|
||||
1
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64660 (Segfault on memory exhaustion within function definition)
|
||||
--FILE--
|
||||
<?php
|
||||
function a() {
|
||||
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[Line truncated
|
||||
}
|
||||
echo "Done\n";
|
||||
--EXPECTF--
|
||||
|
||||
Parse error: memory exhausted in %s on line %d
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64677 (execution operator `` stealing surrounding arguments)
|
||||
--FILE--
|
||||
<?PHP
|
||||
class cat {
|
||||
public function show_output($prepend, $output = '') {
|
||||
}
|
||||
}
|
||||
$cat = new cat();
|
||||
$cat->show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec
|
||||
$cat->show_output('Files: ', `cd .`); // this causes a segmentation fault
|
||||
$cat->show_output(`cd .`); // this causes a segmentation fault
|
||||
|
||||
function show_outputa($prepend, $output) {
|
||||
echo "Okey";
|
||||
}
|
||||
show_outputa('Files: ', `cd .`); // this works as expected
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Okey
|
||||
@@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64720 (SegFault on zend_deactivate)
|
||||
--FILE--
|
||||
<?php
|
||||
class Stat {
|
||||
private static $requests;
|
||||
public static function getInstance() {
|
||||
if (!isset(self::$requests[1])) {
|
||||
self::$requests[1] = new self();
|
||||
}
|
||||
return self::$requests[1];
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
unset(self::$requests[1]);
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
Stat::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Error {
|
||||
private $trace;
|
||||
public function __construct() {
|
||||
$this->trace = debug_backtrace(1);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function __destruct() {
|
||||
Stat::getInstance();
|
||||
new Error();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
new Error();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$bar->test();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->message = NULL;
|
||||
$this->string = NULL;
|
||||
$this->code = array();
|
||||
$this->line = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in %s:0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a extends exception {
|
||||
public function __construct() {
|
||||
$this->line = array();
|
||||
$this->file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
throw new a;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'a' in :0
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in Unknown on line %d
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
Loaded 100 of 4713 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user