mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45e4e84c90 |
No files matched your search
@@ -27,8 +27,6 @@ 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
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
*.tgz
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
*.tar.gz.asc
|
||||
*.tar.bz2.asc
|
||||
*.tar.xz.asc
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
@@ -100,8 +96,6 @@ stamp-h.in
|
||||
scan_makefile_in.awk
|
||||
TSRM/tsrm_config.h
|
||||
Zend/zend_config.h
|
||||
Zend/zend_dtrace_gen.h
|
||||
Zend/zend_dtrace_gen.hbak
|
||||
Zend/zend_ini_parser.c
|
||||
Zend/zend_ini_parser.h
|
||||
Zend/zend_ini_parser.output
|
||||
|
||||
+7
-44
@@ -1,46 +1,9 @@
|
||||
language: c
|
||||
language: php
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /^PHP-5\.3.*/
|
||||
- /^PHP-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
|
||||
|
||||
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
|
||||
|
||||
before_install:
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
# Setup Extensions
|
||||
- . ./travis/ext/mysql/setup.sh
|
||||
- . ./travis/ext/mysqli/setup.sh
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./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" --show-diff --set-timeout 120
|
||||
email: false
|
||||
+2
-8
@@ -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
|
||||
@@ -444,12 +444,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
|
||||
|
||||
@@ -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 - 2015 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ $(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
|
||||
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
|
||||
|
||||
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
|
||||
|
||||
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
|
||||
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@@ -18,6 +18,6 @@ $(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
|
||||
|
||||
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
|
||||
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
|
||||
|
||||
$(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
|
||||
+8
-22
@@ -3,8 +3,6 @@
|
||||
# LCOV
|
||||
#
|
||||
|
||||
LCOV_INCLUDE="."
|
||||
|
||||
lcov: lcov-html
|
||||
|
||||
lcov-test: lcov-clean-data test
|
||||
@@ -14,7 +12,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' | uniq` ;\
|
||||
for x in $$files; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
@@ -41,26 +39,14 @@ php_lcov.info: lcov-test
|
||||
if test -f "$(top_builddir)/$$y.c"; then \
|
||||
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
|
||||
fi; \
|
||||
if test -f "$$x.gcno"; then \
|
||||
cp $$x.gcno lcov_data/$$y.gcno ; \
|
||||
fi; \
|
||||
if test -f "$$x.gcda"; then \
|
||||
cp $$x.gcda lcov_data/$$y.gcda ; \
|
||||
fi; \
|
||||
if test -f "$$x.da"; then \
|
||||
cp $$x.da lcov_data/$$y.da ; \
|
||||
fi; \
|
||||
if test -f "$$x.bb"; then \
|
||||
cp $$x.bb lcov_data/$$y.bb ; \
|
||||
fi; \
|
||||
if test -f "$$x.bbg"; then \
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
test -f "$$x.gcno" && cp $$x.gcno lcov_data/$$y.gcno ; \
|
||||
test -f "$$x.gcda" && cp $$x.gcda lcov_data/$$y.gcda ; \
|
||||
test -f "$$x.da" && cp $$x.da lcov_data/$$y.da ; \
|
||||
test -f "$$x.bb" && cp $$x.bb lcov_data/$$y.bb ; \
|
||||
test -f "$$x.bbg" && cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
done
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
test -d lcov_data/$$dir && rm -rf lcov_data/$$dir ; \
|
||||
done
|
||||
@echo
|
||||
@echo "Generating $@"
|
||||
|
||||
+4
-14
@@ -86,7 +86,7 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
|
||||
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
|
||||
|
||||
test: all
|
||||
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
@@ -102,9 +102,7 @@ test: all
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
|
||||
TEST_RESULT_EXIT_CODE=$$?; \
|
||||
rm $(top_builddir)/tmp-php.ini; \
|
||||
exit $$TEST_RESULT_EXIT_CODE; \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
@@ -115,19 +113,11 @@ 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/*
|
||||
find . -name \*.1 | xargs rm -f
|
||||
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/mysqlnd/php_mysqlnd_config.h
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
|
||||
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
|
||||
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 Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
+6
-6
@@ -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.
|
||||
|
||||
@@ -48,11 +48,11 @@ Currently we have the following branches in use::
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is an old
|
||||
stable version and is open for security fixes only.
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.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.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
@@ -67,7 +67,7 @@ Currently we have the following branches in use::
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.6) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) 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.
|
||||
|
||||
@@ -28,17 +28,6 @@ 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
|
||||
---------------
|
||||
@@ -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
|
||||
|
||||
+29
-53
@@ -11,27 +11,17 @@ 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.
|
||||
|
||||
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
|
||||
|
||||
5. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/
|
||||
4. 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.
|
||||
|
||||
6. Verify the tags to be extra sure everything was tagged properly.
|
||||
5. 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 +48,47 @@ 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) from the main branch.
|
||||
|
||||
5. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
4. 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"``
|
||||
|
||||
6. Compile and make test, with and without ZTS, using the right Bison version
|
||||
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)
|
||||
|
||||
7. Check ./sapi/cli/php -v output for version matching.
|
||||
6. 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``.
|
||||
7. 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.:
|
||||
8. Tag the repository release branch 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``
|
||||
9. 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 :
|
||||
10. Push the changes to the main repo, the tag, the main branch and the release branch :
|
||||
``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
|
||||
11. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
12. Copy those tarballs (scp, rsync) to downloads.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.
|
||||
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
13. 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
|
||||
14. 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.
|
||||
|
||||
@@ -156,8 +144,7 @@ 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.
|
||||
|
||||
3. Commit those changes. Ensure the tests at https://travis-ci.org/php/php-src/builds are
|
||||
still passing.
|
||||
3. Commit those changes
|
||||
|
||||
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
@@ -167,7 +154,7 @@ credits files in ext/standard.
|
||||
|
||||
6. Check ./sapi/cli/php -v output for version matching.
|
||||
|
||||
7. tag the repository with the version f.e. "``git tag -u YOURKEYID -s php-5.4.1``"
|
||||
7. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
|
||||
|
||||
8. Push the tag f.e. "``git push origin php-5.4.1``"
|
||||
|
||||
@@ -196,11 +183,11 @@ last commit id to web/php.git, then, mirrors will now sync
|
||||
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`` to create the release file (releases/x_y_z.php)
|
||||
The release announcement file should list in detail security fixes and
|
||||
changes in behavior (whether due to a bug fix or not).
|
||||
|
||||
b. In case multiple PHP minor versions are in active development you have
|
||||
to manually copy the old information to include/releases.inc
|
||||
@@ -213,18 +200,15 @@ 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.
|
||||
3. Update phpweb/include/releases.php with the old release info
|
||||
(updates the download archives)
|
||||
|
||||
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
|
||||
(prepare for next RC)
|
||||
@@ -269,9 +253,6 @@ to upgrade.
|
||||
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 +269,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 +286,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.
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
------------------
|
||||
Failed tests usually indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automatically submit a test summary to our QA workflow
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
Please do *not* submit a failed test as a bug or ask for help on why
|
||||
it failed on your system without providing substantial backup information
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
The PHP Interpreter
|
||||
===================
|
||||
|
||||
This is the github mirror of the official PHP repository located at
|
||||
http://git.php.net.
|
||||
|
||||
[](http://travis-ci.org/php/php-src)
|
||||
|
||||
Pull Requests
|
||||
=============
|
||||
PHP accepts pull requests via github. Discussions are done on github, but
|
||||
depending on the topic can also be relayed to the official PHP developer
|
||||
mailinglist internals@lists.php.net.
|
||||
|
||||
New features require an RFC and must be accepted by the developers.
|
||||
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
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.
|
||||
|
||||
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
|
||||
|
||||
After removing magic quotes, the get_magic_quotes_gpc function caused
|
||||
a deprecate warning. get_magic_quotes_gpc can be used to detected
|
||||
the magic_quotes behavior and therefore should not raise a warning at any
|
||||
time. The patch removes this warning
|
||||
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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 |
|
||||
@@ -251,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 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 |
|
||||
|
||||
+178
-92
@@ -3,12 +3,16 @@ $Id$
|
||||
UPGRADE NOTES - PHP X.Y
|
||||
|
||||
1. Internal API changes
|
||||
a. Executor changes
|
||||
b. Streams pooling API
|
||||
c. Lowercasing and locales
|
||||
d. zend_qsort_r
|
||||
e. get_current_key
|
||||
f. unserialization of manipulated object strings
|
||||
a. virtual_file_ex
|
||||
b. stat/lstat support
|
||||
c. readlink support
|
||||
d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...)
|
||||
e. Zend\zend_fast_cache.h has been removed
|
||||
f. streams that enclose private streams
|
||||
g. leak_variable
|
||||
h. API Signature changes
|
||||
i. new TSRM function expand_filepath_with_mode
|
||||
j. unserialization of manipulated object strings
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -19,118 +23,200 @@ UPGRADE NOTES - PHP X.Y
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
a. Executor changes
|
||||
a. virtual_file_ex
|
||||
|
||||
* 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.
|
||||
virtual_file_ex takes now a TSRM context as last parameter:
|
||||
CWD_API int virtual_file_ex(cwd_state *state, const char *path,
|
||||
verify_path_func verify_path, int use_realpath TSRLS_DC);
|
||||
|
||||
b. Streams pooling API
|
||||
|
||||
The streams pooling API has been removed. The following functions no longer
|
||||
exist:
|
||||
b. stat/lstat support
|
||||
|
||||
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);
|
||||
lstat is now available on all platforms. On unix-like platform
|
||||
php_sys_lstat is an alias to lstat (when avaible). On Windows it is now
|
||||
available using php_sys_lstat. php_sys_stat and php_sys_lstat usage is recommended
|
||||
instead of calling lstat directly, to ensure portability.
|
||||
|
||||
c. Lowercasing and locales
|
||||
|
||||
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:
|
||||
c. readlink support
|
||||
|
||||
zend_str_tolower_copy
|
||||
zend_str_tolower_dup
|
||||
zend_str_tolower
|
||||
zend_binary_strcasecmp
|
||||
zend_binary_strncasecmp
|
||||
readlink is now available on all platforms. On unix-like platform
|
||||
php_sys_readlink is an alias to readlink (when avaible). On Windows it is now
|
||||
available using php_sys_readlink. php_sys_readlink usage is recommended
|
||||
instead of calling readlink directly, to ensure portability.
|
||||
|
||||
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
|
||||
|
||||
Internal engine lowercasing will be using ASCII-only rules. User-facing functions,
|
||||
such as strcasecmp, will be using locale rules.
|
||||
d. layout of some core ZE structures (zend_op_array, zend_class_entry, ...)
|
||||
|
||||
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.
|
||||
. zend_function.pass_rest_by_reference is replaced by
|
||||
ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
|
||||
. zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
|
||||
in zend_function.fn_flags
|
||||
. zend_arg_info.required_num_args removed. it was needed only for internal
|
||||
functions. Now the first arg_info for internal function (which has special
|
||||
meaning) is represented by zend_internal_function_info structure.
|
||||
. zend_op_array.size, size_var, size_literal, current_brk_cont,
|
||||
backpatch_count moved into CG(context), because they are used only during
|
||||
compilation.
|
||||
. zend_op_array.start_op is moved into EG(start_op), because it's used
|
||||
only for 'interactive' execution of single top-level op-array.
|
||||
. zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
|
||||
zend_op_array.fn_flags.
|
||||
. op_array.vars array is trimmed (reallocated) during pass_two.
|
||||
. zend_class_entry.constants_updated is replaced by
|
||||
ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
|
||||
. the size of zend_class_entry is reduced by sharing the same memory space
|
||||
by different information for internal and user classes.
|
||||
See zend_class_inttry.info union.
|
||||
|
||||
|
||||
d. zend_qsort_r
|
||||
e. Zend\zend_fast_cache.h
|
||||
|
||||
Added the function zend_qsort_r():
|
||||
It should not have been used anymore since php5, but now this header has
|
||||
been removed. The following macros are not available anymore:
|
||||
|
||||
typedef int (*compare_r_func_t)(const void *, const void * TSRMLS_DC, void *);
|
||||
void zend_qsort_r(void *base, size_t nmemb, size_t siz, compare_r_func_t compare, void *arg TSRMLS_DC);
|
||||
ZEND_FAST_ALLOC(p, type, fc_type)
|
||||
ZEND_FAST_FREE(p, fc_type)
|
||||
ZEND_FAST_ALLOC_REL(p, type, fc_type)
|
||||
ZEND_FAST_FREE_REL(p, fc_type)
|
||||
|
||||
The extra argument it has (relatively to zend_qsort()) is passed to the
|
||||
comparison function.
|
||||
Use emalloc, emalloc_rel, efree or efree_rel instead.
|
||||
|
||||
e. get_current_key
|
||||
|
||||
The signature of the get_current_key iteration handler has been changed to:
|
||||
f. Streams that enclose private streams
|
||||
|
||||
void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
|
||||
Some streams, like the temp:// stream, may enclose private streams. If the
|
||||
outer stream leaks due to a programming error or is not exposed through a
|
||||
zval (and therefore is not deleted when all the zvals are gone), it will
|
||||
be destroyed on shutdown.
|
||||
The problem is that the outer usually wants itself to close the inner stream,
|
||||
so that it may do any other shutdown action that requires the inner stream to
|
||||
be live (e.g. commit data to it). If the outer stream is exposed through a
|
||||
zval and the inner one isn't, this is not a problem because the outer stream
|
||||
will be freed when the zval is destroyed, which happens before the resources
|
||||
are destroyed on shutdown.
|
||||
On resource list shutdown, the cleanup happens in reverse order of resource
|
||||
creation, so if the inner stream was created in the opener of the outer stream,
|
||||
it will be destroyed first.
|
||||
The following functions were added to the streams API to force a predictable
|
||||
destruction order:
|
||||
|
||||
The key should be written into the zval* using the ZVAL_* macros.
|
||||
PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);
|
||||
#define php_stream_free_enclosed(stream_enclosed, close_options)
|
||||
PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC);
|
||||
|
||||
f. unserialization of manipulated object strings
|
||||
Additionally, the following member was added to php_stream:
|
||||
|
||||
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.
|
||||
struct _php_stream *enclosing_stream;
|
||||
|
||||
and the following macro was added:
|
||||
|
||||
#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32
|
||||
|
||||
The function php_stream_encloses declares the first stream encloses the second.
|
||||
This has the effect that, when the inner stream is closed from a resource
|
||||
destructor it will abort and try to free its enclosing stream instead.
|
||||
To prevent this from happening when the inner stream is freed from the outer
|
||||
stream, the macro php_stream_free_enclosed should be used instead of
|
||||
php_stream_free/php_stream_close/php_stream_pclose, or the flag
|
||||
PHP_STREAM_FREE_IGNORE_ENCLOSING should be directly passed to php_stream_free.
|
||||
The outer stream cannot abstain, in its close callback, from closing the inner
|
||||
stream or clear the enclosing_stream pointer in its enclosed stream by calling
|
||||
php_stream_encloses with the 2nd argument NULL. If this is not done, there will
|
||||
be problems, so observe this requirement when using php_stream_encloses.
|
||||
|
||||
|
||||
g. leak_variable
|
||||
|
||||
The function leak_variable(variable [, leak_data]) was added. It is only
|
||||
available on debug builds. It increments the refcount of a zval or, if the
|
||||
second argument is true and the variable is either an object or a resource
|
||||
it increments the refcounts of those objects instead.
|
||||
|
||||
|
||||
h. API Signature changes
|
||||
|
||||
. zend_list_insert
|
||||
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
|
||||
call: zend_list_insert(a, SOMETYPE TSRMLS_CC);
|
||||
NB: If zend_list_insert is used to register a resource,
|
||||
ZEND_REGISTER_RESOURCE could be used instead.
|
||||
|
||||
. php_le_stream_context(TSRMLS_C)
|
||||
PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
|
||||
call: context = php_stream_context_alloc(TSRMLS_C);
|
||||
|
||||
. php_stream_context_alloc
|
||||
PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D);
|
||||
call: context = php_stream_context_alloc(TSRMLS_C);
|
||||
|
||||
. sapi_get_request_time(TSRMLS_D);
|
||||
SAPI_API double sapi_get_request_time(TSRMLS_D);
|
||||
|
||||
. sapi_register_default_post_reader
|
||||
SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC);
|
||||
|
||||
. sapi_register_treat_data
|
||||
SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC);
|
||||
|
||||
. sapi_register_input_filter
|
||||
SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
|
||||
|
||||
. tsrm_win32_access
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC);
|
||||
|
||||
. popen_ex (win32)
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
|
||||
|
||||
. php_get_current_user
|
||||
PHPAPI php_get_current_user(TSRMLS_D)
|
||||
Call: char *user = php_get_current_user(TSRMLS_C);
|
||||
|
||||
. php_idate
|
||||
PHPAPI php_idate(char format, time_t ts, int localtime TSRMLS_DC)
|
||||
Call: int ret = php_idate(format, ts, localtime TSRMLS_CC)
|
||||
|
||||
. php_escape_html_entities
|
||||
(size_t parameters were ints, previous "quote_style" (now flags) has expanded meaning)
|
||||
PHPAPI char *php_escape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
|
||||
|
||||
. php_escape_html_entities_ex
|
||||
PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC);
|
||||
|
||||
. php_unescape_html_entities
|
||||
PHPAPI char *php_unescape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC);
|
||||
|
||||
i.
|
||||
PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC);
|
||||
expand_filepath_with_mode lets define how realpath will behave, using one of the existing mode: CWD_EXPAND , CWD_FILEPATH or CWD_REALPATH.
|
||||
|
||||
j.
|
||||
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.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
========================
|
||||
|
||||
a. Unix build system changes
|
||||
-
|
||||
|
||||
- Changes in SAPI module build:
|
||||
. When adding new binary SAPI (executable, like CLI/CGI/FPM) use CLI config.m4 and Makefile.frag files as templates and replace CLI/cli with your SAPI name.
|
||||
|
||||
- New macros:
|
||||
. PHP_INIT_DTRACE(providerdesc, header-file, sources [, module])
|
||||
|
||||
|
||||
b. Windows build system changes
|
||||
- Drop Windows XP and 2003 support.
|
||||
-
|
||||
|
||||
+3
-4
@@ -17,8 +17,7 @@ libZend_la_SOURCES=\
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c \
|
||||
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_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
@@ -32,7 +31,7 @@ zend_ini_scanner.lo: zend_ini_parser.h
|
||||
# Language parser/scanner rules
|
||||
|
||||
zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l
|
||||
|
||||
zend_language_parser.h: zend_language_parser.c
|
||||
zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@@ -44,7 +43,7 @@ zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
|
||||
|
||||
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l
|
||||
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l
|
||||
|
||||
zend_ini_parser.h: zend_ini_parser.c
|
||||
|
||||
|
||||
@@ -159,10 +159,6 @@ SOURCE=.\zend_float.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -185,10 +185,6 @@ SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7"
|
||||
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 2.6.4"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Bug #18556 (Setting locale to 'tr_TR' lowercases class names)
|
||||
--FILE--
|
||||
<?php
|
||||
$g_lang = 'tr_TR';
|
||||
putenv("LANG=$g_lang");
|
||||
setlocale(LC_ALL, $g_lang);
|
||||
|
||||
class InfoBlob {
|
||||
var $foo;
|
||||
function InfoBlob() {
|
||||
$this->foo = "Foo";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Instantiating an infoBlob with a lowercase i\n";
|
||||
$foobar = new infoBlob();
|
||||
echo $foobar->foo;
|
||||
echo "\nInstantiating an InfoBlob with an uppercase I\n";
|
||||
$foobar = new InfoBlob();
|
||||
echo $foobar->foo;
|
||||
echo "\n";
|
||||
setlocale(LC_ALL, "tr_TR.utf8");
|
||||
foreach(get_declared_classes() as $class)
|
||||
{
|
||||
if(!class_exists($class))
|
||||
echo "$class No Longer Exists!\n";
|
||||
|
||||
}
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Instantiating an infoBlob with a lowercase i
|
||||
Foo
|
||||
Instantiating an InfoBlob with an uppercase I
|
||||
Foo
|
||||
Done.
|
||||
@@ -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,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60738 Allow 'set_error_handler' to handle NULL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(set_error_handler(
|
||||
function() { echo 'Intercepted error!', "\n"; }
|
||||
));
|
||||
|
||||
trigger_error('Error!');
|
||||
|
||||
var_dump(set_error_handler(null));
|
||||
|
||||
trigger_error('Error!');
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
Intercepted error!
|
||||
object(Closure)#1 (0) {
|
||||
}
|
||||
|
||||
Notice: Error! in %s on line %d
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60738 Allow 'set_error_handler' to handle NULL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(set_exception_handler(
|
||||
function() { echo 'Intercepted exception!', "\n"; }
|
||||
));
|
||||
|
||||
var_dump(set_exception_handler(null));
|
||||
|
||||
throw new Exception('Exception!');
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
object(Closure)#1 (0) {
|
||||
}
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' with message 'Exception!' in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #61681: Malformed grammar
|
||||
--FILE--
|
||||
<?php
|
||||
$la = "ooxx";
|
||||
|
||||
echo "${substr('laruence', 0, 2)}";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ooxx
|
||||
@@ -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,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62991 (Segfault with generator and closure)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test( array $array )
|
||||
{
|
||||
$closure = function() use ( $array ) {
|
||||
print_r( $array );
|
||||
yield "hi";
|
||||
};
|
||||
return $closure();
|
||||
}
|
||||
|
||||
function test2( array $array )
|
||||
{
|
||||
$closure = function() use ( $array ) {
|
||||
print_r( $array );
|
||||
yield "hi";
|
||||
};
|
||||
return $closure; // if you return the $closure and call it outside this function it works.
|
||||
}
|
||||
|
||||
$generator = test(array( 1, 2, 3 ) );
|
||||
foreach($generator as $something) {
|
||||
}
|
||||
|
||||
$generator = test2(array( 1, 2, 3 ) );
|
||||
foreach($generator() as $something) {
|
||||
}
|
||||
|
||||
|
||||
$generator = test2(array( 1, 2, 3 ) );
|
||||
|
||||
echo "okey\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
okey
|
||||
@@ -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,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63741 (Crash when autoloading from spl)
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents(dirname(__FILE__)."/bug63741.tmp.php",
|
||||
<<<'EOT'
|
||||
<?php
|
||||
if (isset($autoloading))
|
||||
{
|
||||
class ClassToLoad
|
||||
{
|
||||
static function func ()
|
||||
{
|
||||
print "OK!\n";
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
class autoloader
|
||||
{
|
||||
static function autoload($classname)
|
||||
{
|
||||
print "autoloading...\n";
|
||||
$autoloading = true;
|
||||
include __FILE__;
|
||||
}
|
||||
}
|
||||
|
||||
spl_autoload_register(["autoloader", "autoload"]);
|
||||
|
||||
function start()
|
||||
{
|
||||
ClassToLoad::func();
|
||||
}
|
||||
|
||||
start();
|
||||
}
|
||||
?>
|
||||
EOT
|
||||
);
|
||||
|
||||
include dirname(__FILE__)."/bug63741.tmp.php";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?>
|
||||
--EXPECT--
|
||||
autoloading...
|
||||
OK!
|
||||
@@ -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,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,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,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #64979 (Wrong behavior of static variables in closure generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function new_closure_gen() {
|
||||
return function() {
|
||||
static $foo = 0;
|
||||
yield ++$foo;
|
||||
};
|
||||
}
|
||||
|
||||
$closure1 = new_closure_gen();
|
||||
$closure2 = new_closure_gen();
|
||||
|
||||
$gen1 = $closure1();
|
||||
$gen2 = $closure1();
|
||||
$gen3 = $closure2();
|
||||
|
||||
foreach (array($gen1, $gen2, $gen3) as $gen) {
|
||||
foreach ($gen as $val) {
|
||||
var_dump($val);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65051: count() off by one inside unset()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public $array;
|
||||
|
||||
public function __destruct() {
|
||||
var_dump(count($this->array[0]));
|
||||
var_dump($this->array[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$array = [[new Foo]];
|
||||
$array[0][0]->array =& $array;
|
||||
unset($array[0][0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65419 (Inside trait, self::class != __CLASS__)
|
||||
--FILE--
|
||||
<?php
|
||||
trait abc
|
||||
{
|
||||
static function def()
|
||||
{
|
||||
echo self::class, "\n";
|
||||
echo __CLASS__, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class ghi
|
||||
{
|
||||
use abc;
|
||||
}
|
||||
|
||||
ghi::def();
|
||||
?>
|
||||
--EXPECTF--
|
||||
ghi
|
||||
ghi
|
||||
@@ -1,62 +0,0 @@
|
||||
--TEST--
|
||||
Fixed Bug #65784 (Segfault with finally)
|
||||
--XFAIL--
|
||||
This bug is not fixed in 5.5 due to ABI BC
|
||||
--FILE--
|
||||
<?php
|
||||
function foo1() {
|
||||
try {
|
||||
throw new Exception("not catch");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
$foo = foo1();
|
||||
var_dump($foo);
|
||||
} catch (Exception $e) {
|
||||
do {
|
||||
var_dump($e->getMessage());
|
||||
} while ($e = $e->getPrevious());
|
||||
}
|
||||
|
||||
function foo2() {
|
||||
try {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception("catched");
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
$foo = foo2();
|
||||
var_dump($foo);
|
||||
|
||||
function foo3() {
|
||||
try {
|
||||
throw new Exception("not catched");
|
||||
return true;
|
||||
} finally {
|
||||
try {
|
||||
throw new NotExists();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$bar = foo3();
|
||||
--EXPECTF--
|
||||
string(9) "not catch"
|
||||
NULL
|
||||
|
||||
Fatal error: Class 'NotExists' not found in %sbug65784.php on line %d
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66608 (Incorrect behavior with nested "finally" blocks)
|
||||
--FILE--
|
||||
<?php
|
||||
function bar() {
|
||||
try {
|
||||
echo "1\n";
|
||||
try {
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "2\n";
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception ("");
|
||||
} catch (Exception $ab) {
|
||||
echo "3\n";
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
echo "4\n";
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "5\n";
|
||||
}
|
||||
}
|
||||
echo "6\n";
|
||||
try {
|
||||
} finally {
|
||||
while (1) {
|
||||
try {
|
||||
echo "7\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "8\n";
|
||||
}
|
||||
echo "bad";
|
||||
}
|
||||
echo "9\n";
|
||||
while (1) {
|
||||
try {
|
||||
throw new Exception("");
|
||||
} catch(Exception $e) {
|
||||
echo "10\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "11\n";
|
||||
}
|
||||
echo "bak\n";
|
||||
}
|
||||
}
|
||||
echo "12\n";
|
||||
}
|
||||
echo "13\n";
|
||||
}
|
||||
bar();
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66609 (php crashes with __get() and ++ operator in some cases)
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = new Bar;
|
||||
$foo = new Foo;
|
||||
class Bar {
|
||||
public function __get($x) {
|
||||
global $foo;
|
||||
return $foo->foo;
|
||||
}
|
||||
}
|
||||
class Foo {
|
||||
public function __get($x) {
|
||||
global $bar;
|
||||
return $bar->bar;
|
||||
}
|
||||
}
|
||||
$foo->blah += 1; //crash
|
||||
++$foo->blah; //crash
|
||||
$foo->blah++; //crash
|
||||
$foo->blah--; //crash
|
||||
--$foo->blah; //crash
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
|
||||
okey
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67111: Memory leak when using "continue 2" inside two foreach loops
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array1 = [1, 2, 3];
|
||||
$array2 = [1, 2, 3];
|
||||
|
||||
foreach ($array1 as $x) {
|
||||
foreach ($array2 as $y) {
|
||||
echo "$x.$y\n";
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1.1
|
||||
2.1
|
||||
3.1
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67314 (Segmentation fault in gc_remove_zval_from_buffer)
|
||||
--FILE--
|
||||
<?php
|
||||
function crash()
|
||||
{
|
||||
$notDefined[$i] = 'test';
|
||||
}
|
||||
|
||||
function error_handler() { return false; }
|
||||
|
||||
set_error_handler('error_handler');
|
||||
crash();
|
||||
echo "made it once\n";
|
||||
crash();
|
||||
echo "ok\n";
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
made it once
|
||||
|
||||
Notice: Undefined variable: i in %sbug67314.php on line 4
|
||||
ok
|
||||
@@ -2,14 +2,14 @@
|
||||
bug67436: Autoloader isn't called if user defined error handler is present
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
error_reporting=
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
require_once ($classname . '.php');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ error_reporting=-1
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
require_once ($classname . '.php');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function id($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function &ref_id(&$x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$c = 'c';
|
||||
$array = ['a', 'b', $c];
|
||||
|
||||
foreach(id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
foreach(ref_id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "aq"
|
||||
[1]=>
|
||||
string(2) "bq"
|
||||
[2]=>
|
||||
&string(2) "cq"
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
$obj = new stdClass;
|
||||
$obj->test = 'meow';
|
||||
return true;
|
||||
});
|
||||
|
||||
$a = new stdClass;
|
||||
$a->undefined .= 'test';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["undefined"]=>
|
||||
string(4) "test"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68370 "unset($this)" can make the program crash
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
public function test() {
|
||||
unset($this);
|
||||
return get_defined_vars();
|
||||
}
|
||||
}
|
||||
$c = new C();
|
||||
$x = $c->test();
|
||||
print_r($x);
|
||||
unset($c, $x);
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68652 (segmentation fault in destructor)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Bar::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
|
||||
private static $instance;
|
||||
public static function getInstance() {
|
||||
if (isset(self::$instance)) {
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance = new self();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Foo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$foo = new Foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: Bar::$instance in %sbug68652.php on line %d
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
#69017 (Fail to push to the empty array with the constant value defined in class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class c1
|
||||
{
|
||||
const ZERO = 0;
|
||||
const ONE = 1;
|
||||
const MAX = PHP_INT_MAX;
|
||||
public static $a1 = array(self::ONE => 'one');
|
||||
public static $a2 = array(self::ZERO => 'zero');
|
||||
public static $a3 = array(self::MAX => 'zero');
|
||||
}
|
||||
|
||||
|
||||
c1::$a1[] = 1;
|
||||
c1::$a2[] = 1;
|
||||
c1::$a3[] = 1;
|
||||
|
||||
var_dump(c1::$a1);
|
||||
var_dump(c1::$a2);
|
||||
var_dump(c1::$a3);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "one"
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "zero"
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[%d]=>
|
||||
string(4) "zero"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69174 (leaks when unused inner class use traits precedence)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
class C1 {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof T2;
|
||||
T1::bar insteadof T2;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public static function __callStatic($method, $args) {}
|
||||
public function __call($method, $args) {}
|
||||
}
|
||||
|
||||
function do_throw() { throw new Exception; }
|
||||
|
||||
try {
|
||||
Test::foo(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
try {
|
||||
(new Test)->bar(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$f = function () {};
|
||||
$f->__invoke(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$t = new Test;
|
||||
$f->__invoke($t->bar(Test::foo(do_throw())));
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$gen1 = gen();
|
||||
$gen2 = (object) $gen1;
|
||||
|
||||
foreach ($gen1 as $v1) {
|
||||
foreach ($gen2 as $v2) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
unset($gen1);
|
||||
foreach ($gen2 as $v) { var_dump($v); }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator (2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$gen = function() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$iter = new IteratorIterator($gen());
|
||||
$ngen = $iter->getInnerIterator();
|
||||
|
||||
var_dump(iterator_to_array($ngen, false));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69420 (Invalid read in zend_std_get_method)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
protected function test() {
|
||||
echo "okey";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class A {
|
||||
protected function test() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
use T;
|
||||
public function foo() {
|
||||
$this->test();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$b = new B();
|
||||
$b->foo();
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69467 (Wrong checked for the interface by using Trait)
|
||||
--FILE--
|
||||
<?php
|
||||
interface Baz {
|
||||
public function bad();
|
||||
}
|
||||
|
||||
trait Bar{
|
||||
protected function bad(){}
|
||||
}
|
||||
|
||||
class Foo implements Baz{
|
||||
use Bar;
|
||||
}
|
||||
|
||||
$test = new Foo();
|
||||
var_dump($test instanceof Baz);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Bar::bad() must be public (as in class Baz) in %sbug69467.php on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69551 - parse_ini_file() and parse_ini_string() segmentation fault
|
||||
--FILE--
|
||||
<?php
|
||||
$ini = <<<INI
|
||||
[Network.eth0]
|
||||
SubnetMask = "
|
||||
"
|
||||
INI;
|
||||
$settings = parse_ini_string($ini, false, INI_SCANNER_RAW);
|
||||
var_dump($settings);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected '"' in Unknown on line %d
|
||||
in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69732 (can induce segmentation fault with basic php code)
|
||||
--FILE--
|
||||
<?php
|
||||
class wpq {
|
||||
private $unreferenced;
|
||||
|
||||
public function __get($name) {
|
||||
return $this->$name . "XXX";
|
||||
}
|
||||
}
|
||||
|
||||
function ret_assoc() {
|
||||
$x = "XXX";
|
||||
return array('foo' => 'bar', $x);
|
||||
}
|
||||
|
||||
$wpq = new wpq;
|
||||
$wpq->interesting =& ret_assoc();
|
||||
$x = $wpq->interesting;
|
||||
printf("%s\n", $x);
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: wpq::$interesting in %sbug69732.php on line 6
|
||||
|
||||
Notice: Indirect modification of overloaded property wpq::$interesting has no effect in %sbug69732.php on line 16
|
||||
|
||||
Strict Standards: Only variables should be assigned by reference in %sbug69732.php on line 16
|
||||
|
||||
Notice: Undefined property: wpq::$interesting in %sbug69732.php on line 6
|
||||
XXX
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69892: Different arrays compare indentical due to integer key truncation
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump([0 => 0] === [0x100000000 => 0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -1,9 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
|
||||
--FILE--
|
||||
<?php
|
||||
unserialize('O:12:"DateInterval":1:{s:4:"days";O:9:"Exception":7:{s:10:"'."\0".'*'."\0".'message";s:1:"x";s:17:"'."\0".'Exception'."\0".'string";s:1:"A";s:7:"'."\0".'*'."\0".'code";i:0;s:7:"'."\0".'*'."\0".'file";s:1:"a";s:7:"'."\0".'*'."\0".'line";i:1337;s:16:"'."\0".'Exception'."\0".'trace";a:0:{}s:19:"'."\0".'Exception'."\0".'previous";O:8:"stdClass":0:{}}}');
|
||||
?>
|
||||
OK
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (basic test)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($throw = FALSE) {
|
||||
try {
|
||||
echo "try\n";
|
||||
if ($throw) {
|
||||
throw new Exception("ex");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "catch\n";
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
}
|
||||
|
||||
echo "end\n";
|
||||
}
|
||||
|
||||
foo();
|
||||
echo "\n";
|
||||
foo(true);
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
finally
|
||||
end
|
||||
|
||||
try
|
||||
catch
|
||||
finally
|
||||
end
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (basic test with return)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
try {
|
||||
echo "try\n";
|
||||
return 1;
|
||||
} catch (Exception $e) {
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
var_dump(foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
finally
|
||||
int(1)
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (with multi-returns)
|
||||
--FILE--
|
||||
<?php
|
||||
function dummy($msg) {
|
||||
var_dump($msg);
|
||||
}
|
||||
|
||||
function foo ($a) {
|
||||
try {
|
||||
dummy("try");
|
||||
return $a;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
} finally {
|
||||
dummy("finally");
|
||||
return "finally";
|
||||
}
|
||||
return "end";
|
||||
}
|
||||
|
||||
function &bar($a) {
|
||||
try {
|
||||
echo "try\n";
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $e) {
|
||||
} finally {
|
||||
return $a;
|
||||
}
|
||||
return ($c = "end");
|
||||
}
|
||||
var_dump(foo("para"));
|
||||
var_dump(bar("para"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "try"
|
||||
string(7) "finally"
|
||||
string(7) "finally"
|
||||
try
|
||||
string(4) "para"
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (nesting try-catch-finally)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function throw_exception($msg) {
|
||||
throw new Exception($msg);
|
||||
}
|
||||
|
||||
function foo (&$ex) {
|
||||
try {
|
||||
echo "1";
|
||||
try {
|
||||
echo "2";
|
||||
throw_exception("try");
|
||||
} catch (Exception $e) {
|
||||
echo "3";
|
||||
throw_exception("catch");
|
||||
} finally {
|
||||
echo "4";
|
||||
throw_exception("finally");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$ex = $e;
|
||||
echo "3";
|
||||
} finally {
|
||||
echo "2";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
var_dump(foo($ex));
|
||||
|
||||
do {
|
||||
var_dump($ex->getMessage());
|
||||
} while ($ex = $ex->getPrevious());
|
||||
?>
|
||||
--EXPECT--
|
||||
123432int(1)
|
||||
string(7) "finally"
|
||||
string(5) "catch"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (with multi-returns and exception)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($a) {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (PdoException $e) {
|
||||
die("error");
|
||||
} catch (Exception $e) {
|
||||
return 2;
|
||||
} finally {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
var_dump(foo("para"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(3)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Try catch finally (re-throw exception in catch block)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo ($a) {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $e) {
|
||||
var_dump($a);
|
||||
throw $e;
|
||||
} finally {
|
||||
var_dump("finally");
|
||||
return "return";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(foo("para"));
|
||||
} catch (Exception $e) {
|
||||
"caught exception" . PHP_EOL;
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "para"
|
||||
string(7) "finally"
|
||||
string(6) "return"
|
||||
@@ -1,77 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
// compile time constants
|
||||
const A = self::class;
|
||||
const B = Two::class;
|
||||
}
|
||||
class Two extends One {
|
||||
public static function run() {
|
||||
var_dump(self::class); // self compile time lookup
|
||||
var_dump(static::class); // runtime lookup
|
||||
var_dump(parent::class); // runtime lookup
|
||||
var_dump(Baz::class); // default compile time lookup
|
||||
}
|
||||
}
|
||||
class Three extends Two {
|
||||
// compile time static lookups
|
||||
public static function checkCompileTime(
|
||||
$one = self::class,
|
||||
$two = Baz::class,
|
||||
$three = One::A,
|
||||
$four = self::B
|
||||
) {
|
||||
var_dump($one, $two, $three, $four);
|
||||
}
|
||||
}
|
||||
echo "In NS\n";
|
||||
var_dump(Moo::CLASS); // resolve in namespace
|
||||
}
|
||||
|
||||
namespace {
|
||||
use Bee\Bop as Moo,
|
||||
Foo\Bar\One;
|
||||
echo "Top\n";
|
||||
var_dump(One::class); // resolve from use
|
||||
var_dump(Boo::class); // resolve in global namespace
|
||||
var_dump(Moo::CLASS); // resolve from use as
|
||||
var_dump(\Moo::Class); // resolve fully qualified
|
||||
$class = One::class; // assign class as scalar to var
|
||||
$x = new $class; // create new class from original scalar assignment
|
||||
var_dump($x);
|
||||
Foo\Bar\Two::run(); // resolve runtime lookups
|
||||
echo "Parent\n";
|
||||
Foo\Bar\Three::run(); // resolve runtime lookups with inheritance
|
||||
echo "Compile Check\n";
|
||||
Foo\Bar\Three::checkCompileTime();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
In NS
|
||||
string(11) "Foo\Bar\Moo"
|
||||
Top
|
||||
string(11) "Foo\Bar\One"
|
||||
string(3) "Boo"
|
||||
string(7) "Bee\Bop"
|
||||
string(3) "Moo"
|
||||
object(Foo\Bar\One)#1 (0) {
|
||||
}
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
Parent
|
||||
string(11) "Foo\Bar\Two"
|
||||
string(13) "Foo\Bar\Three"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
Compile Check
|
||||
string(13) "Foo\Bar\Three"
|
||||
string(11) "Foo\Bar\Baz"
|
||||
string(11) "Foo\Bar\One"
|
||||
string(11) "Foo\Bar\Two"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static in class constant
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
const Baz = static::class;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: static::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in class constant
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
const Baz = parent::class;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: parent::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static in method signature
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
public function baz($x = static::class) {}
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: static::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in method signature
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
class One {
|
||||
public function baz($x = parent::class) {}
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: parent::class cannot be used for compile-time class name resolution in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using static non class context
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = static::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot access static::class when no class scope is active in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
class name as scalar from ::class keyword error using parent in non class context
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = parent::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot access parent::class when no class scope is active in %s on line %d
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Closure 047: Use in preg_replace_callback() using variables by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function replace_variables($text, $params) {
|
||||
|
||||
preg_replace_callback( '/(\?)/', function($matches) use (&$params, &$text) {
|
||||
|
||||
$text = preg_replace( '/(\?)/', array_shift( $params ), $text, 1 );
|
||||
|
||||
}, $text );
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
echo replace_variables('a=?', array('0')) . "\n";
|
||||
echo replace_variables('a=?, b=?', array('0', '1')) . "\n";
|
||||
echo replace_variables('a=?, b=?, c=?', array('0', '1', '2')) . "\n";
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
a=0
|
||||
a=0, b=1
|
||||
a=0, b=1, c=2
|
||||
Done
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Closure 048: Use in preg_replace_callback() using variables by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function replace_variables($text, $params) {
|
||||
|
||||
$c = function($matches) use (&$params, &$text) {
|
||||
$text = preg_replace( '/(\?)/', array_shift( $params ), $text, 1 );
|
||||
};
|
||||
|
||||
preg_replace_callback( '/(\?)/', $c, $text );
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
echo replace_variables('a=?', array('0')) . "\n";
|
||||
echo replace_variables('a=?, b=?', array('0', '1')) . "\n";
|
||||
echo replace_variables('a=?, b=?, c=?', array('0', '1', '2')) . "\n";
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
a=0
|
||||
a=0, b=1
|
||||
a=0, b=1, c=2
|
||||
Done
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 049: static::class in static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = static function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
|
||||
var_dump($b->foo());
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 050: static::class in non-static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 051: static::class in static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = static function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 052: static::class in non-static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 053: self::class in static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = static function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 054: self::class in non-static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 055: self::class in static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = static function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 056: self::class in non-static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Const array deference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump(array(1, 2, 3, 4,) [3]);
|
||||
var_dump(array(1, 2, 3, 4,) ['foo']);
|
||||
var_dump(array(array(1,2,3), array(4, 5, 6))[1][2]);
|
||||
|
||||
foreach (array(array(1, 2, 3))[0] as $var) {
|
||||
echo $var;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(4)
|
||||
|
||||
Notice: Undefined index: foo in %sconst_dereference_001.php on line %d
|
||||
NULL
|
||||
int(6)
|
||||
123
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Const string dereference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump("foobar"[3]);
|
||||
var_dump("foobar"[2][0]);
|
||||
var_dump("foobar"["foo"]["bar"]);
|
||||
|
||||
--EXPECTF--
|
||||
string(1) "b"
|
||||
string(1) "o"
|
||||
|
||||
Warning: Illegal string offset 'foo' in %sconst_dereference_002.php on line %d
|
||||
|
||||
Warning: Illegal string offset 'bar' in %sconst_dereference_002.php on line %d
|
||||
string(1) "f"
|
||||
Loaded 100 of 2700 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user