mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41f6096ab2 | ||
|
|
0d89265a69 |
No files matched your search
@@ -23,8 +23,6 @@ sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt 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
|
||||
|
||||
@@ -96,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
|
||||
|
||||
+4
-27
@@ -1,32 +1,9 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
branches:
|
||||
except:
|
||||
- /^PHP-5\.3.*/
|
||||
- /^PHP-5\.4.*/
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
env:
|
||||
global:
|
||||
- MYSQL_TEST_HOST=127.0.0.1
|
||||
- MYSQL_TEST_USER=travis
|
||||
- PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test"
|
||||
- PDO_MYSQL_TEST_USER=travis
|
||||
- PDO_MYSQL_TEST_PASS=
|
||||
- PDO_MYSQL_TEST_HOST=127.0.0.1
|
||||
matrix:
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
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
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -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 - 2012 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) | 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 $@"
|
||||
|
||||
+3
-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,10 @@ clean:
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php5.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/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
|
||||
|
||||
@@ -1,51 +1,50 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
31 Oct 2013, PHP 5.5.6RC1
|
||||
31 Oct 2013, PHP 5.4.22 RC1
|
||||
|
||||
- Core:
|
||||
. Improved performance of array_merge() and func_get_args() by eliminating
|
||||
useless copying. (Dmitry)
|
||||
. Fixed bug #65939 (Space before ";" breaks php.ini parsing).
|
||||
(brainstorm at nopcode dot org)
|
||||
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
|
||||
(Bob Weinand)
|
||||
|
||||
- OPcache
|
||||
. Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris)
|
||||
- CLI server:
|
||||
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
|
||||
encoding). (Felipe)
|
||||
|
||||
- Exif:
|
||||
. Fixed crash on unknown encoding. (Draal)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
|
||||
|
||||
- ODBC
|
||||
. Fixed bug #65950 (Field name truncation if the field name is bigger than
|
||||
. Fixed bug #65950 (Field name truncation if the field name is bigger than
|
||||
32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
|
||||
(Mike)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #64760 (var_export() does not use full precision for floating-point
|
||||
numbers) (Yasuo)
|
||||
|
||||
- XMLReader:
|
||||
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
|
||||
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
|
||||
|
||||
17 Oct 2013, PHP 5.5.5
|
||||
|
||||
17 Oct 2013, PHP 5.4.21
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64979 (Wrong behavior of static variables in closure generators).
|
||||
(Nikita)
|
||||
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
|
||||
. Fixed bug #65821 (By-ref foreach on property access of string offset
|
||||
segfaults). (Nikita)
|
||||
. Fixed bug #65936 (dangling context pointer causes crash). (Tony)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65633 (built-in server treat some http headers as
|
||||
case-sensitive). (Adam)
|
||||
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
|
||||
encoding). (Felipe)
|
||||
. Added application/pdf to PHP CLI Web Server mime types (Chris Jones)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
|
||||
message). (Boro Sitnikovski)
|
||||
. Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime).
|
||||
(Boro Sitnikovski)
|
||||
. Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work).
|
||||
(Boro Sitnikovski)
|
||||
|
||||
- DBA extension:
|
||||
. Fixed bug #65708 (dba functions cast $key param to string in-place,
|
||||
@@ -56,161 +55,67 @@ PHP NEWS
|
||||
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
|
||||
(Syra)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
|
||||
|
||||
- GD
|
||||
. Ensure that the defined interpolation method is used with the generic
|
||||
scaling methods. (Pierre)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
|
||||
imap). (ryotakatsuki at gmail dot com)
|
||||
|
||||
- OPcache:
|
||||
. Fixed issue #115 (path issue when using phar). (Laruence)
|
||||
. Added support for GNU Hurd. (Svante Signell)
|
||||
. Added function opcache_compile_file() to load PHP scripts into cache
|
||||
without execution. (Julien)
|
||||
. Fixed bug #65845 (Error when Zend Opcache Optimizer is fully enabled).
|
||||
(Dmitry)
|
||||
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
|
||||
(Laruence)
|
||||
. Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry)
|
||||
. Fixed issue #135 (segfault in interned strings if initial memory is too
|
||||
low). (Julien)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
|
||||
(Mike)
|
||||
|
||||
- SPL:
|
||||
. Fix bug #64782 (SplFileObject constructor make $context optional / give it
|
||||
a default value). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #61548 (content-type must appear at the end of headers for 201
|
||||
Location to work in http). (Mike)
|
||||
|
||||
- XMLReader:
|
||||
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
|
||||
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
|
||||
|
||||
- Build system:
|
||||
. Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
|
||||
(Mike, Raphael Geissert)
|
||||
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
|
||||
gzencode())). (Mike)
|
||||
|
||||
|
||||
19 Sep 2013, PHP 5.5.4
|
||||
19 Sep 2013, PHP 5.4.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
|
||||
(Laruence)
|
||||
. Improved fputcsv() to allow specifying escape character.
|
||||
. Fixed bug #65579 (Using traits with get_class_methods causes segfault).
|
||||
(Adam)
|
||||
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
|
||||
DTRACE_FUNCTION_*). (Chris Jones)
|
||||
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
|
||||
spaces). (Michael M Slusarz)
|
||||
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
|
||||
. Fixed bug #65470 (Segmentation fault in zend_error() with
|
||||
. Fixed bug #65470 (Segmentation fault in zend_error() with
|
||||
--enable-dtrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
|
||||
fails). (Laruence)
|
||||
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
|
||||
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
|
||||
limited case). (Arpad)
|
||||
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
|
||||
. Improved fix for bug #63186 (compile failure on netbsd). (Matteo)
|
||||
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #61759 (class_alias() should accept classes with leading
|
||||
backslashes). (Julien)
|
||||
. Fixed bug #46311 (Pointer aliasing issue results in miscompile on gcc4.4).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
|
||||
. Cherry-picked some DTrace build commits (allowing builds on Linux,
|
||||
bug #62691, and bug #63706) from PHP 5.5 branch
|
||||
. Fixed bug #61268 (--enable-dtrace leads make to clobber
|
||||
Zend/zend_dtrace.d) (Chris Jones)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #65458 (curl memory leak). (Adam)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
|
||||
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
|
||||
by some delimiters). (Valentin Logvinskiy, Stas).
|
||||
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
|
||||
by AddressSanitizer). (Remi).
|
||||
|
||||
- OPCache:
|
||||
. Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4).
|
||||
(Terry Ellison)
|
||||
|
||||
- Openssl:
|
||||
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
|
||||
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
|
||||
some cases). (Mark Jones)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64953 (Postgres prepared statement positional parameter
|
||||
casting). (Mike)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #65475 (Session ID is not initialized properly when strict session
|
||||
is enabled). (Yasuo)
|
||||
. Fixed bug #51127/#65359 Request #25630/#43980/#54383 (Added php_serialize
|
||||
session serialize handler that uses plain serialize()). (Yasuo)
|
||||
|
||||
- Standard:
|
||||
. Fix issue with return types of password API helper functions. Found via
|
||||
static analysis by cjones. (Anthony Ferrara)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #65391 (Unable to send vary header user-agent when
|
||||
ob_start('ob_gzhandler') is called) (Mike)
|
||||
|
||||
22 Aug 2013, PHP 5.5.3
|
||||
|
||||
- Openssl:
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
|
||||
15 Aug 2013, PHP 5.5.2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
|
||||
fails). (Laruence)
|
||||
. Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was
|
||||
erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey
|
||||
avp200681 gmail com).
|
||||
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
|
||||
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
|
||||
limited case). (Arpad)
|
||||
. Fixed bug #62691 (solaris sed has no -i switch). (Chris Jones)
|
||||
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
|
||||
. Fixed bug #61268 (--enable-dtrace leads make to clobber
|
||||
Zend/zend_dtrace.d) (Chris Jones)
|
||||
|
||||
- DOM:
|
||||
. Added flags option to DOMDocument::schemaValidate() and
|
||||
DOMDocument::schemaValidateSource(). Added LIBXML_SCHEMA_CREATE flag.
|
||||
(Chris Wright)
|
||||
|
||||
- OPcache:
|
||||
. Added opcache.restrict_api configuration directive that may limit
|
||||
usage of OPcache API functions only to particular script(s). (Dmitry)
|
||||
. Added support for glob symbols in blacklist entries (?, *, **).
|
||||
(Terry Elison, Dmitry)
|
||||
. Fixed bug #65338 (Enabling both php_opcache and php_wincache AVs on
|
||||
shutdown). (Dmitry)
|
||||
|
||||
- Openssl:
|
||||
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
|
||||
(Christian Heimes)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #65299 (pdo mysql parsing errors). (Johannes)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
|
||||
/pg_delete()/pg_insert()). (Yasuo)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
|
||||
some specific contents). (Stas)
|
||||
|
||||
- Sessions:
|
||||
. Implemented strict sessions RFC (https://wiki.php.net/rfc/strict_sessions)
|
||||
which protects against session fixation attacks and session collisions.
|
||||
(CVE-2011-4718). (Yasuo Ohgaki)
|
||||
. Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at
|
||||
gmail dot com)
|
||||
. Fixed bug #50308 (session id not appended properly for empty anchor tags).
|
||||
(Arpad)
|
||||
. Fixed possible buffer overflow under Windows. Note: Not a security fix.
|
||||
(Yasuo)
|
||||
. Changed session.auto_start to PHP_INI_PERDIR. (Yasuo)
|
||||
@@ -220,530 +125,193 @@ PHP NEWS
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence)
|
||||
. Added RecursiveTreeIterator setPostfix and getPostifx methods. (Joshua
|
||||
Thijssen)
|
||||
. Fixed bug #61697 (spl_autoload_functions returns lambda functions
|
||||
incorrectly). (Laruence)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #65268 (select() implementation uses outdated tick API). (Anatol)
|
||||
- PDO:
|
||||
. Fixed bug #64953 (Postgres prepared statement positional parameter
|
||||
casting). (Mike)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
|
||||
some specific contents). (Stas)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed bug #65336 (pg_escape_literal/identifier() scilently returns false).
|
||||
. Fixed bug #65336 (pg_escape_literal/identifier() silently returns false).
|
||||
(Yasuo)
|
||||
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
|
||||
/pg_delete()/pg_insert()). (Yasuo)
|
||||
|
||||
18 Jul 2013, PHP 5.5.1
|
||||
- Zlib:
|
||||
. Fixed bug #65391 (Unable to send vary header user-agent when
|
||||
ob_start('ob_gzhandler') is called) (Mike)
|
||||
|
||||
22 Aug 2013, PHP 5.4.19
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64503 (Compilation fails with error: conflicting types for
|
||||
'zendparse'). (Laruence)
|
||||
|
||||
- Openssl:
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
|
||||
15 Aug 2013, PHP 5.4.18
|
||||
|
||||
- Core:
|
||||
. Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was
|
||||
erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey
|
||||
avp200681 gmail com).
|
||||
. Fixed bug #65254 (Exception not catchable when exception thrown in autoload
|
||||
with a namespace). (Laruence)
|
||||
. Fixed bug #65088 (Generated configure script is malformed on OpenBSD).
|
||||
(Adam)
|
||||
. Fixed bug #65108 (is_callable() triggers Fatal Error).
|
||||
(David Soria Parra, Laruence)
|
||||
. Fixed bug #65035 (yield / exit segfault). (Nikita)
|
||||
. Fixed bug #65161 (Generator + autoload + syntax error = segfault). (Nikita)
|
||||
. hex2bin() raises E_WARNING for invalid hex string. (Yasuo)
|
||||
. Fixed bug #65088 (Generated configure script is malformed on OpenBSD).
|
||||
(Adam)
|
||||
. Fixed bug #62964 (Possible XSS on "Registered stream filters" info).
|
||||
(david at nnucomputerwhiz dot com)
|
||||
. Fixed bug #62672 (Error on serialize of ArrayObject). (Lior Kaplan)
|
||||
. Fixed bug #62475 (variant_* functions causes crash when null given as an
|
||||
argument). (Felipe)
|
||||
. Fixed bug #60732 (php_error_docref links to invalid pages). (Jakub Vrana)
|
||||
. Fixed bug #65226 (chroot() does not get enabled). (Anatol)
|
||||
|
||||
- OPcache
|
||||
. Fixed bug #64827 (Segfault in zval_mark_grey (zend_gc.c)). (Laruence)
|
||||
. OPcache must be compatible with LiteSpeed SAPI (Dmitry)
|
||||
|
||||
- CGI:
|
||||
. Fixed Bug #65143 (Missing php-cgi man page). (Remi)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65066 (Cli server not responsive when responding with 422 http
|
||||
status code). (Adam)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #62665 (curl.cainfo doesn't appear in php.ini). (Lior Kaplan)
|
||||
|
||||
- DateTime
|
||||
. Fixed fug #65184 (strftime() returns insufficient-length string under
|
||||
multibyte locales). (Anatol)
|
||||
- FPM:
|
||||
. Fixed bug #63983 (enabling FPM borks compile on FreeBSD).
|
||||
(chibisuke at web dot de, Felipe)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #65228 (FTPs memory leak with SSL).
|
||||
(marco dot beierer at mbsecurity dot ch)
|
||||
|
||||
- GMP:
|
||||
. Fixed bug #65227 (Memory leak in gmp_cmp second parameter). (Felipe)
|
||||
|
||||
- GD
|
||||
. Fixed #65070 (bgcolor does not use the same format as the input image with
|
||||
imagerotate). (Pierre)
|
||||
. Fixed Bug #65060 (imagecreatefrom... crashes with user streams). (Remi)
|
||||
. Fixed Bug #65084 (imagecreatefromjpeg fails with URL). (Remi)
|
||||
. Fix gdImageCreateFromWebpCtx and use same logic to load WebP image
|
||||
that other formats. (Remi)
|
||||
- Imap:
|
||||
. Fixed bug #64467 (Segmentation fault after imap_reopen failure).
|
||||
(askalski at gmail dot com)
|
||||
|
||||
- Intl:
|
||||
. Add IntlCalendar::setMinimalDaysInFirstWeek()/
|
||||
intlcal_set_minimal_days_in_first_week().
|
||||
. Fixed trailing space in name of constant IntlCalendar::FIELD_FIELD_COUNT.
|
||||
- Intl:
|
||||
. Fixed bug #62759 (Buggy grapheme_substr() on edge case). (Stas)
|
||||
. Fixed bug #61860 (Offsets may be wrong for grapheme_stri* functions).
|
||||
(Stas)
|
||||
|
||||
- OCI8:
|
||||
. Bump PECL package info version check to allow PECL installs with PHP 5.5+
|
||||
- mysqlnd:
|
||||
. Fixed segfault in mysqlnd when doing long prepare. (Andrey)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #61387 (NULL valued anonymous column causes segfault in
|
||||
odbc_fetch_array). (Brandon Kirsch)
|
||||
|
||||
- Openssl:
|
||||
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
|
||||
(Christian Heimes)
|
||||
|
||||
- PDO:
|
||||
. Allowed PDO_OCI to compile with Oracle Database 12c client libraries.
|
||||
(Chris Jones)
|
||||
|
||||
- Pgsql
|
||||
. pg_unescape_bytea() raises E_WARNING for invalid inputs. (Yasuo)
|
||||
- PDO_dblib:
|
||||
. Fixed bug #65219 (PDO/dblib not working anymore ("use dbName" not sent)).
|
||||
(Stanley Sufficool)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed meta data retrieve when OID is larger than 2^31. (Yasuo)
|
||||
|
||||
- Phar:
|
||||
. Fixed Bug #65142 (Missing phar man page). (Remi)
|
||||
|
||||
- Session:
|
||||
. Added optional create_sid() argument to session_set_save_handler(),
|
||||
SessionHandler and new SessionIdInterface. (Leigh, Arpad)
|
||||
- Session
|
||||
. Fixed bug #62535 ($_SESSION[$key]["cancel_upload"] doesn't work as
|
||||
documented). (Arpad)
|
||||
. Fixed bug #35703 (when session_name("123") consist only digits,
|
||||
should warning). (Yasuo)
|
||||
. Fixed bug #49175 (mod_files.sh does not support hash bits). Patch by
|
||||
oorza2k5 at gmail dot com (Yasuo)
|
||||
|
||||
- Sockets:
|
||||
. Implemented FR #63472 (Setting SO_BINDTODEVICE with socket_set_option).
|
||||
. Implemented FR #63472 (Setting SO_BINDTODEVICE with socket_set_option).
|
||||
(Damjan Cvetko)
|
||||
. Allowed specifying paths in the abstract namespace for the functions
|
||||
socket_bind(), socket_connect() and socket_sendmsg(). (Gustavo)
|
||||
. Fixed bug #65260 (sendmsg() ancillary data construction for SCM_RIGHTS is
|
||||
faulty). (Gustavo)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #65136 (RecursiveDirectoryIterator segfault). (Laruence)
|
||||
. Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator
|
||||
/Spl(Temp)FileObject ctor twice). (Laruence)
|
||||
. Fixed bug #60560 (SplFixedArray un-/serialize, getSize(), count() return 0,
|
||||
keys are strings). (Adam)
|
||||
|
||||
- CGI/FastCGI SAPI:
|
||||
. Added PHP_FCGI_BACKLOG, overrides the default listen backlog. (Arnaud Le
|
||||
Blanc)
|
||||
- XML:
|
||||
. Fixed bug #65236 (heap corruption in xml parser, CVE-2013-4113). (Rob)
|
||||
|
||||
20 Jun 2013, PHP 5.5.0
|
||||
04 Jul 2013, PHP 5.4.17
|
||||
|
||||
- Core:
|
||||
. Added Zend Opcache extension and enable building it by default.
|
||||
More details here: https://wiki.php.net/rfc/optimizerplus. (Dmitry)
|
||||
. Added generators and coroutines (https://wiki.php.net/rfc/generators).
|
||||
(Nikita Popov)
|
||||
. Added "finally" keyword (https://wiki.php.net/rfc/finally). (Laruence)
|
||||
. Added simplified password hashing API
|
||||
(https://wiki.php.net/rfc/password_hash). (Anthony Ferrara)
|
||||
. Added support for constant array/string dereferencing. (Laruence)
|
||||
. Added array_column function which returns a column in a multidimensional
|
||||
array. https://wiki.php.net/rfc/array_column. (Ben Ramsey)
|
||||
. Added boolval(). (Jille Timmermans)
|
||||
. Added "Z" option to pack/unpack. (Gustavo)
|
||||
. Added Generator::throw() method. (Nikita Popov)
|
||||
. Added Class Name Resolution As Scalar Via "class" Keyword.
|
||||
(Ralph Schindler, Nikita Popov, Lars)
|
||||
. Added optional second argument for assert() to specify custom message. Patch
|
||||
by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
|
||||
. Added support for using empty() on the result of function calls and
|
||||
other expressions (https://wiki.php.net/rfc/empty_isset_exprs).
|
||||
(Nikita Popov)
|
||||
. Added support for non-scalar Iterator keys in foreach
|
||||
(https://wiki.php.net/rfc/foreach-non-scalar-keys). (Nikita Popov)
|
||||
. Added support for list in foreach (https://wiki.php.net/rfc/foreachlist).
|
||||
(Laruence)
|
||||
. Added support for changing the process's title in CLI/CLI-Server SAPIs.
|
||||
The implementation is more robust that the proctitle PECL module. More
|
||||
details here: https://wiki.php.net/rfc/cli_process_title. (Keyur)
|
||||
. Added ARMv7/v8 versions of various Zend arithmetic functions that are
|
||||
implemented using inline assembler (Ard Biesheuvel)
|
||||
. Added systemtap support by enabling systemtap compatible dtrace probes on
|
||||
linux. (David Soria Parra)
|
||||
. Optimized access to temporary and compiled VM variables. 8% less memory
|
||||
reads. (Dmitry)
|
||||
. The VM stacks for passing function arguments and syntaticaly nested calls
|
||||
were merged into a single stack. The stack size needed for op_array
|
||||
execution is calculated at compile time and preallocated at once. As result
|
||||
all the stack push operatins don't require checks for stack overflow
|
||||
any more. (Dmitry)
|
||||
. Improve set_exception_handler while doing reset. (Laruence)
|
||||
. Return previous handler when passing NULL to set_error_handler and
|
||||
set_exception_handler. (Nikita Popov)
|
||||
. Remove php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(),
|
||||
zend_logo_guid(). (Adnrew Faulds)
|
||||
. Drop Windows XP and 2003 support. (Pierre)
|
||||
. Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell)
|
||||
. Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
|
||||
(Laruence, Nikita Popov)
|
||||
. Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik).
|
||||
. Implemented FR #46487 (Dereferencing process-handles no longer waits on
|
||||
those processes). (Jille Timmermans)
|
||||
. Fixed bug #65051 (count() off by one inside unset()). (Nikita)
|
||||
. Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence)
|
||||
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
|
||||
. Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
|
||||
. Fixed bug #64936 (doc comments picked up from previous scanner run). (Stas,
|
||||
Jonathan Oddy)
|
||||
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
|
||||
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
|
||||
CVE 2013-2110). (Stas)
|
||||
. Fixed bug #64853 (Use of no longer available ini directives causes crash
|
||||
on TS build). (Anatol)
|
||||
. Fixed bug #64821 (Custom Exceptions crash when internal properties overridden).
|
||||
(Anatol)
|
||||
. Fixed bug #64720 (SegFault on zend_deactivate). (Dmitry)
|
||||
. Fixed bug #64677 (execution operator `` stealing surrounding arguments).
|
||||
. Fixed bug #64660 (Segfault on memory exhaustion within function definition).
|
||||
(Stas, reported by Juha Kylmänen)
|
||||
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
|
||||
segfault). (Laruence)
|
||||
. Fixed bug #64565 (copy doesn't report failure on partial copy). (Remi)
|
||||
. Fixed bug #64555 (foreach no longer copies keys if they are interned).
|
||||
(Nikita Popov)
|
||||
. Fixed bugs #47675 and #64577 (fd leak on Solaris)
|
||||
. Fixed bug #64544 (Valgrind warnings after using putenv). (Laruence)
|
||||
. Fixed bug #64515 (Memoryleak when using the same variablename 2times in
|
||||
function declaration). (Laruence)
|
||||
. Fixed bug #64503 (Compilation fails with error: conflicting types for
|
||||
'zendparse'). (Laruence)
|
||||
. Fixed bug #64239 (Debug backtrace changed behavior since 5.4.10 or 5.4.11).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #64523, allow XOR in php.ini. (Dejan Marjanovic, Lars)
|
||||
. Fixed bug #64354 (Unserialize array of objects whose class can't
|
||||
be autoloaded fail). (Laruence)
|
||||
. Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).
|
||||
(Anatol)
|
||||
. Fixed bug #64166 (quoted-printable-encode stream filter incorrectly
|
||||
. Fixed bug #64166 (quoted-printable-encode stream filter incorrectly
|
||||
discarding whitespace). (Michael M Slusarz)
|
||||
(Laruence)
|
||||
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
|
||||
. Fixed bug #64135 (Exceptions from set_error_handler are not always
|
||||
propagated). (Laruence)
|
||||
. Fixed bug #63980 (object members get trimmed by zero bytes). (Laruence)
|
||||
. Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick)
|
||||
. Fixed bug #63830 (Segfault on undefined function call in nested generator).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #63822 (Crash when using closures with ArrayAccess).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence)
|
||||
. Fixed bug #61038 (unpack("a5", "str\0\0") does not work as expected).
|
||||
(srgoogleguy, Gustavo)
|
||||
. Fixed bug #61025 (__invoke() visibility not honored). (Laruence)
|
||||
. Fixed bug #60833 (self, parent, static behave inconsistently
|
||||
case-sensitive). (Stas, mario at include-once dot org)
|
||||
. Fixed Bug #52126: timestamp for mail.log (Martin Jansen, Lars)
|
||||
. Fixed bug #49348 (Uninitialized ++$foo->bar; does not cause a notice).
|
||||
(Stas)
|
||||
. Fixed Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars)
|
||||
. Fixed bug #18556 (Engine uses locale rules to handle class names). (Stas)
|
||||
. Fix undefined behavior when converting double variables to integers.
|
||||
The double is now always rounded towards zero, the remainder of its division
|
||||
by 2^32 or 2^64 (depending on sizeof(long)) is calculated and it's made
|
||||
signed assuming a two's complement representation. (Gustavo)
|
||||
. Drop support for bison < 2.4 when building PHP from GIT source.
|
||||
(Laruence)
|
||||
|
||||
- Apache2 Handler SAPI:
|
||||
. Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)
|
||||
. Fixed bug #54254 (cal_from_jd returns month = 6 when there is only one Adar)
|
||||
(Stas, Eitan Mosenkis)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
|
||||
|
||||
- CURL:
|
||||
. Remove curl stream wrappers. (Pierrick)
|
||||
. Implemented FR #46439 - added CURLFile for safer file uploads.
|
||||
(Stas)
|
||||
. Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
|
||||
CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
|
||||
CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
|
||||
CURLOPT_FTP_ACCOUNT, CURLOPT_COOKIELIST, CURLOPT_IGNORE_CONTENT_LENGTH,
|
||||
CURLOPT_CONNECT_ONLY, CURLOPT_LOCALPORT, CURLOPT_LOCALPORTRANGE,
|
||||
CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPT_SSL_SESSIONID_CACHE,
|
||||
CURLOPT_FTP_SSL_CCC, CURLOPT_HTTP_CONTENT_DECODING,
|
||||
CURLOPT_HTTP_TRANSFER_DECODING, CURLOPT_PROXY_TRANSFER_MODE,
|
||||
CURLOPT_ADDRESS_SCOPE, CURLOPT_CRLFILE, CURLOPT_ISSUERCERT,
|
||||
CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_PROXYUSERNAME,
|
||||
CURLOPT_PROXYPASSWORD, CURLOPT_NOPROXY, CURLOPT_SOCKS5_GSSAPI_NEC,
|
||||
CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPT_TFTP_BLKSIZE,
|
||||
CURLOPT_SSH_KNOWNHOSTS, CURLOPT_FTP_USE_PRET, CURLOPT_MAIL_FROM,
|
||||
CURLOPT_MAIL_RCPT, CURLOPT_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_SERVER_CSEQ,
|
||||
CURLOPT_RTSP_SESSION_ID, CURLOPT_RTSP_STREAM_URI, CURLOPT_RTSP_TRANSPORT,
|
||||
CURLOPT_RTSP_REQUEST, CURLOPT_RESOLVE, CURLOPT_ACCEPT_ENCODING,
|
||||
CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
|
||||
(Pierrick)
|
||||
. Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
|
||||
still exists for backward compatibility but is doing nothing). (Pierrick)
|
||||
. Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)
|
||||
|
||||
- DateTime
|
||||
. Added DateTimeImmutable - a variant of DateTime that only returns the
|
||||
modified state instead of changing itself. (Derick)
|
||||
. Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror
|
||||
curl_pause, curl_reset, curl_share_close, curl_share_init,
|
||||
curl_share_setopt curl_strerror and curl_unescape. (Pierrick)
|
||||
. Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION,
|
||||
CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE,
|
||||
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick)
|
||||
. Fixed bug #64825 (Invalid free when unserializing DateTimeZone).
|
||||
(Anatol)
|
||||
. Fixed bug #64359 (strftime crash with VS2012). (Anatol)
|
||||
. Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol)
|
||||
. Fixed bug #61642 (modify("+5 weekdays") returns Sunday).
|
||||
(Dmitri Iouchtchenko)
|
||||
. Fixed bug #60774 (DateInterval::format("%a") is always zero when an
|
||||
interval is created using the createFromDateString method) (Lonny
|
||||
Kapelushnik, Derick)
|
||||
. Fixed bug #54567 (DateTimeZone serialize/unserialize) (Lonny
|
||||
Kapelushnik, Derick)
|
||||
- DateTime:
|
||||
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
|
||||
(Gustavo, Derick, Anatol)
|
||||
|
||||
- dba:
|
||||
. Bug #62489: dba_insert not working as expected.
|
||||
(marc-bennewitz at arcor dot de, Lars)
|
||||
|
||||
- Filter:
|
||||
. Implemented FR #49180 - added MAC address validation. (Martin)
|
||||
|
||||
- Fileinfo:
|
||||
. Upgraded libmagic to 5.14. (Anatol)
|
||||
. Fixed bug #64830 (mimetype detection segfaults on mp3 file). (Anatol)
|
||||
. Fixed bug #63590 (Different results in TS and NTS under Windows).
|
||||
(Anatoliy)
|
||||
. Fixed bug #63248 (Load multiple magic files from a directory under Windows).
|
||||
(Anatoliy)
|
||||
|
||||
- FPM:
|
||||
. Add --with-fpm-systemd option to report health to systemd, and
|
||||
systemd_interval option to configure this. The service can now use
|
||||
Type=notify in the systemd unit file. (Remi)
|
||||
. Ignore QUERY_STRING when sent in SCRIPT_FILENAME. (Remi)
|
||||
. Log a warning when a syscall fails. (Remi)
|
||||
. Implemented FR #64764 (add support for FPM init.d script). (Lior Kaplan)
|
||||
. Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi)
|
||||
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
|
||||
. Fixed some possible memory or resource leaks and possible null dereference
|
||||
detected by code coverity scan. (Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed Bug #64962 (imagerotate produces corrupted image). (Remi)
|
||||
. Fixed Bug #64961 (segfault in imagesetinterpolation). (Remi)
|
||||
. Fix build with system libgd >= 2.1 which is now the minimal
|
||||
version required (as build with previous version is broken).
|
||||
No change when bundled libgd is used. (Ondrej Sury, Remi)
|
||||
|
||||
- Hash:
|
||||
. Added support for PBKDF2 via hash_pbkdf2(). (Anthony Ferrara)
|
||||
. Fixed Bug #64745 (hash_pbkdf2() truncates data when using default length
|
||||
and hex output). (Anthony Ferrara)
|
||||
|
||||
- Intl:
|
||||
. Added UConverter wrapper.
|
||||
. The intl extension now requires ICU 4.0+.
|
||||
. Added intl.use_exceptions INI directive, which controls what happens when
|
||||
global errors are set together with intl.error_level. (Gustavo)
|
||||
. MessageFormatter::format() and related functions now accepted named
|
||||
arguments and mixed numeric/named arguments in ICU 4.8+. (Gustavo)
|
||||
. MessageFormatter::format() and related functions now don't error out when
|
||||
an insufficient argument count is provided. Instead, the placeholders will
|
||||
remain unsubstituted. (Gustavo)
|
||||
. MessageFormatter::parse() and MessageFormat::format() (and their static
|
||||
equivalents) don't throw away better than second precision in the arguments.
|
||||
(Gustavo)
|
||||
. IntlDateFormatter::__construct and datefmt_create() now accept for the
|
||||
$timezone argument time zone identifiers, IntlTimeZone objects, DateTimeZone
|
||||
objects and NULL. (Gustavo)
|
||||
. IntlDateFormatter::__construct and datefmt_create() no longer accept invalid
|
||||
timezone identifiers or empty strings. (Gustavo)
|
||||
. The default time zone used in IntlDateFormatter::__construct and
|
||||
datefmt_create() (when the corresponding argument is not passed or NULL is
|
||||
passed) is now the one given by date_default_timezone_get(), not the
|
||||
default ICU time zone. (Gustavo)
|
||||
. The time zone passed to the IntlDateFormatter is ignored if it is NULL and
|
||||
if the calendar passed is an IntlCalendar object -- in this case, the
|
||||
IntlCalendar's time zone will be used instead. Otherwise, the time zone
|
||||
specified in the $timezone argument is used instead. This does not affect
|
||||
old code, as IntlCalendar was introduced in this version. (Gustavo)
|
||||
. IntlDateFormatter::__construct and datefmt_create() now accept for the
|
||||
$calendar argument also IntlCalendar objects. (Gustavo)
|
||||
. IntlDateFormatter::getCalendar() and datefmt_get_calendar() return false
|
||||
if the IntlDateFormatter was set up with an IntlCalendar instead of the
|
||||
constants IntlDateFormatter::GREGORIAN/TRADITIONAL. IntlCalendar did not
|
||||
exist before this version. (Gustavo)
|
||||
. IntlDateFormatter::setCalendar() and datefmt_set_calendar() now also accept
|
||||
an IntlCalendar object, in which case its time zone is taken. Passing a
|
||||
constant is still allowed, and still keeps the time zone. (Gustavo)
|
||||
. IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
|
||||
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
|
||||
instead. (Gustavo)
|
||||
. IntlDateFormatter::format() and datefmt_format() now also accept an
|
||||
IntlCalendar object for formatting. (Gustavo)
|
||||
. Added the classes: IntlCalendar, IntlGregorianCalendar, IntlTimeZone,
|
||||
IntlBreakIterator, IntlRuleBasedBreakIterator and
|
||||
IntlCodePointBreakIterator. (Gustavo)
|
||||
. Added the functions: intlcal_get_keyword_values_for_locale(),
|
||||
intlcal_get_now(), intlcal_get_available_locales(), intlcal_get(),
|
||||
intlcal_get_time(), intlcal_set_time(), intlcal_add(),
|
||||
intlcal_set_time_zone(), intlcal_after(), intlcal_before(), intlcal_set(),
|
||||
intlcal_roll(), intlcal_clear(), intlcal_field_difference(),
|
||||
intlcal_get_actual_maximum(), intlcal_get_actual_minimum(),
|
||||
intlcal_get_day_of_week_type(), intlcal_get_first_day_of_week(),
|
||||
intlcal_get_greatest_minimum(), intlcal_get_least_maximum(),
|
||||
intlcal_get_locale(), intlcal_get_maximum(),
|
||||
intlcal_get_minimal_days_in_first_week(), intlcal_get_minimum(),
|
||||
intlcal_get_time_zone(), intlcal_get_type(),
|
||||
intlcal_get_weekend_transition(), intlcal_in_daylight_time(),
|
||||
intlcal_is_equivalent_to(), intlcal_is_lenient(), intlcal_is_set(),
|
||||
intlcal_is_weekend(), intlcal_set_first_day_of_week(),
|
||||
intlcal_set_lenient(), intlcal_equals(),
|
||||
intlcal_get_repeated_wall_time_option(),
|
||||
intlcal_get_skipped_wall_time_option(),
|
||||
intlcal_set_repeated_wall_time_option(),
|
||||
intlcal_set_skipped_wall_time_option(), intlcal_from_date_time(),
|
||||
intlcal_to_date_time(), intlcal_get_error_code(),
|
||||
intlcal_get_error_message(), intlgregcal_create_instance(),
|
||||
intlgregcal_set_gregorian_change(), intlgregcal_get_gregorian_change() and
|
||||
intlgregcal_is_leap_year(). (Gustavo)
|
||||
. Added the functions: intltz_create_time_zone(), intltz_create_default(),
|
||||
intltz_get_id(), intltz_get_gmt(), intltz_get_unknown(),
|
||||
intltz_create_enumeration(), intltz_count_equivalent_ids(),
|
||||
intltz_create_time_zone_id_enumeration(), intltz_get_canonical_id(),
|
||||
intltz_get_region(), intltz_get_tz_data_version(),
|
||||
intltz_get_equivalent_id(), intltz_use_daylight_time(), intltz_get_offset(),
|
||||
intltz_get_raw_offset(), intltz_has_same_rules(), intltz_get_display_name(),
|
||||
intltz_get_dst_savings(), intltz_from_date_time_zone(),
|
||||
intltz_to_date_time_zone(), intltz_get_error_code(),
|
||||
intltz_get_error_message(). (Gustavo)
|
||||
. Added the methods: IntlDateFormatter::formatObject(),
|
||||
IntlDateFormatter::getCalendarObject(), IntlDateFormatter::getTimeZone(),
|
||||
IntlDateFormatter::setTimeZone(). (Gustavo)
|
||||
. Added the functions: datefmt_format_object(), datefmt_get_calendar_object(),
|
||||
datefmt_get_timezone(), datefmt_set_timezone(),
|
||||
datefmt_get_calendar_object(), intlcal_create_instance(). (Gustavo)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #64769 (mbstring PHPTs crash on Windows x64). (Anatol)
|
||||
|
||||
- MCrypt
|
||||
. mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw
|
||||
E_DEPRECATED. (GoogleGuy)
|
||||
|
||||
- mysql
|
||||
. This extension is now deprecated, and deprecation warnings will be generated
|
||||
when connections are established to databases via mysql_connect(),
|
||||
mysql_pconnect(), or through implicit connection: use MySQLi or PDO_MySQL
|
||||
instead (https://wiki.php.net/rfc/mysql_deprecation). (Adam)
|
||||
. Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql.
|
||||
Known for stability problems. (Andrey)
|
||||
. Added support for SHA256 authentication available with MySQL 5.6.6+.
|
||||
(Andrey)
|
||||
|
||||
- mysqli:
|
||||
. Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented
|
||||
all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT
|
||||
and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their
|
||||
respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey)
|
||||
. Added mysqli_savepoint(), mysqli_release_savepoint(). (Andrey)
|
||||
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
|
||||
pointer has closed). (Laruence)
|
||||
. Fixed bug #64394 (MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS undeclared when
|
||||
using Connector/C). (Andrey)
|
||||
|
||||
- mysqlnd
|
||||
. Add new begin_transaction() call to the connection object. Implemented all
|
||||
options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT
|
||||
and ROLLBACK. (Andrey)
|
||||
. Added mysqlnd_savepoint(), mysqlnd_release_savepoint(). (Andrey)
|
||||
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
|
||||
for stmt->param_bind). (Andrey)
|
||||
. Fixed return value of mysqli_stmt_affected_rows() in the time after
|
||||
prepare() and before execute(). (Andrey)
|
||||
|
||||
- PCRE:
|
||||
. Merged PCRE 8.32. (Anatol)
|
||||
. Deprecated the /e modifier
|
||||
(https://wiki.php.net/rfc/remove_preg_replace_eval_modifier). (Nikita Popov)
|
||||
. Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy)
|
||||
. Implemented FR #64764 (add support for FPM init.d script). (Lior Kaplan)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to
|
||||
the same db server). (Laruence)
|
||||
|
||||
- PDO_DBlib:
|
||||
. Fixed bug #63638 (Cannot connect to SQL Server 2008 with PDO dblib).
|
||||
. Fixed bug #63638 (Cannot connect to SQL Server 2008 with PDO dblib).
|
||||
(Stanley Sufficool)
|
||||
. Fixed bug #64338 (pdo_dblib can't connect to Azure SQL). (Stanley
|
||||
. Fixed bug #64338 (pdo_dblib can't connect to Azure SQL). (Stanley
|
||||
Sufficool)
|
||||
. Fixed bug #64808 (FreeTDS PDO getColumnMeta on a prepared but not executed
|
||||
. Fixed bug #64808 (FreeTDS PDO getColumnMeta on a prepared but not executed
|
||||
statement crashes). (Stanley Sufficool)
|
||||
|
||||
- PDO_firebird:
|
||||
. Fixed bug #64037 (Firebird return wrong value for numeric field).
|
||||
(Matheus Degiovani, Matteo)
|
||||
. Fixed bug #62024 (Cannot insert second row with null using parametrized
|
||||
query). (patch by james@kenjim.com, Matheus Degiovani, Matteo)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #48724 (getColumnMeta() doesn't return native_type for BIT,
|
||||
TINYINT and YEAR). (Antony, Daniel Beardsley)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #48724 (getColumnMeta() doesn't return native_type for BIT,
|
||||
TINYINT and YEAR). (Antony, Daniel Beardsley)
|
||||
|
||||
- pgsql:
|
||||
. Added pg_escape_literal() and pg_escape_identifier() (Yasuo)
|
||||
. Bug #46408: Locale number format settings can cause pg_query_params to
|
||||
break with numerics. (asmecher, Lars)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
. Fixed bug #64609 (pg_convert enum type support). (Matteo)
|
||||
. Fixed bug #65015 (pg_send_query does not flush send buffer)
|
||||
patch submitted by: adam at vektah dot net (Yasuo)
|
||||
|
||||
- Readline:
|
||||
. Implement FR #55694 (Expose additional readline variable to prevent
|
||||
. Implement FR #55694 (Expose additional readline variable to prevent
|
||||
default filename completion). (Hartmel)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #64007 (There is an ability to create instance of Generator by
|
||||
hand). (Laruence)
|
||||
|
||||
- Sockets:
|
||||
. Added recvmsg() and sendmsg() wrappers. (Gustavo)
|
||||
See https://wiki.php.net/rfc/sendrecvmsg
|
||||
. Fixed bug #64508 (Fails to build with --disable-ipv6). (Gustavo)
|
||||
. Fixed bug #64287 (sendmsg/recvmsg shutdown handler causes segfault).
|
||||
(Gustavo)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on
|
||||
64-bits systems). (Laruence)
|
||||
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
|
||||
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
|
||||
(patch by kriss@krizalys.com, Laruence)
|
||||
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended).
|
||||
(Nikita Popov)
|
||||
. Fix bug #60560 (SplFixedArray un-/serialize, getSize(), count() return 0,
|
||||
keys are strings). (Adam)
|
||||
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
|
||||
(Mike Willbanks)
|
||||
. Implement FR #48358 (Add SplDoublyLinkedList::add() to insert an element
|
||||
at a given offset). (Mark Baker, David Soria Parra)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #64765 (Some IPv6 addresses get interpreted wrong).
|
||||
(Boris Lytochkin)
|
||||
. Fixed bug #64159 (Truncated snmpget). (Boris Lytochkin)
|
||||
. Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin)
|
||||
. Fixed bug #61981 (OO API, walk: $suffix_as_key is not working correctly).
|
||||
(Boris Lytochkin)
|
||||
|
||||
- SOAP:
|
||||
. Added SoapClient constructor option 'ssl_method' to specify ssl method.
|
||||
(Eric Iversen)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #64770 (stream_select() fails with pipes returned by proc_open()
|
||||
on Windows x64). (Anatol)
|
||||
. Fixed Windows x64 version of stream_socket_pair() and improved error
|
||||
handling. (Anatol Belski)
|
||||
|
||||
- Tokenizer:
|
||||
. Fixed bug #60097 (token_get_all fails to lex nested heredoc). (Nikita Popov)
|
||||
|
||||
- Zip:
|
||||
. Upgraded libzip to 0.10.1 (Anatoliy)
|
||||
. Bug #64452 (Zip crash intermittently). (Anatol)
|
||||
. Fixed bug #64342 (ZipArchive::addFile() has to check for file existence).
|
||||
(Anatol)
|
||||
|
||||
06 Jun 2013, PHP 5.4.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
|
||||
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
|
||||
CVE 2013-2110). (Stas)
|
||||
. Fixed bug #64853 (Use of no longer available ini directives causes crash on
|
||||
TS build). (Anatol)
|
||||
@@ -768,7 +336,7 @@ PHP NEWS
|
||||
Type=notify in the systemd unit file. (Remi)
|
||||
|
||||
- MySQLi
|
||||
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
|
||||
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
|
||||
pointer has closed). (Laruence)
|
||||
|
||||
- Phar
|
||||
@@ -885,9 +453,6 @@ PHP NEWS
|
||||
. Disabled external entities loading (CVE-2013-1643, CVE-2013-1824).
|
||||
(Dmitry)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
|
||||
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -64,10 +64,9 @@ Do not use abbreviations for alpha and beta.
|
||||
``git push --tags origin HEAD``
|
||||
|
||||
8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz,bz2 and xz). Make sure you use the same GNU Bison
|
||||
version as snaps. Recent bison version are known to break ZTS.
|
||||
and build two tarballs (one gz and one bz2).
|
||||
|
||||
9. Copy those three tarballs to www.php.net, in your homedir there should be a
|
||||
9. Copy those two tarballs to www.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick.
|
||||
|
||||
@@ -78,9 +77,6 @@ f.e. http://downloads.php.net/derick/
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be placed into the same directory as the source snapshots.
|
||||
|
||||
12. Notify the documentation team if documentations for new features are
|
||||
not yet available but a stable release is imminent.
|
||||
|
||||
Getting the non stable release (alpha/beta/RC) announced
|
||||
--------------------------------------------------------
|
||||
|
||||
@@ -177,9 +173,6 @@ those are made, they should be committed to SVN too.
|
||||
15. When making a final release, also remind the PHP Windows development team
|
||||
(internals-win@lists.php.net) to prepare the installer packages for Win32.
|
||||
|
||||
16. Make sure proper documentation exists for all new features/changes.
|
||||
Coordinate the release with the PHP Documentation team.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
+165
-78
@@ -3,11 +3,15 @@ $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
|
||||
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
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -18,103 +22,186 @@ 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);
|
||||
|
||||
Additionally, the following member was added to php_stream:
|
||||
|
||||
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.
|
||||
|
||||
========================
|
||||
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
|
||||
|
||||
@@ -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,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,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,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"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Const array deference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
var_dump([1, 2, 3, 4,][3]);
|
||||
var_dump([1, 2, 3, 4]['foo']);
|
||||
var_dump([array(1,2,3), [4, 5, 6]][1][2]);
|
||||
|
||||
foreach (array([1, 2, 3])[0] as $var) {
|
||||
echo $var;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(4)
|
||||
|
||||
Notice: Undefined index: foo in %sconst_dereference_003.php on line %d
|
||||
NULL
|
||||
int(6)
|
||||
123
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
zend_dval_to_lval preserves low bits (32 bit long)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 4)
|
||||
die("skip for machines with 32-bit longs");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* test doubles around -4e21 */
|
||||
$values = [
|
||||
-4000000000000001048576.,
|
||||
-4000000000000000524288.,
|
||||
-4000000000000000000000.,
|
||||
-3999999999999999475712.,
|
||||
-3999999999999998951424.,
|
||||
];
|
||||
/* see if we're rounding negative numbers right */
|
||||
$values[] = -2147483649.8;
|
||||
|
||||
foreach ($values as $v) {
|
||||
var_dump((int)$v);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(-2056257536)
|
||||
int(-2055733248)
|
||||
int(-2055208960)
|
||||
int(-2054684672)
|
||||
int(-2054160384)
|
||||
int(2147483647)
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
zend_dval_to_lval preserves low bits (64 bit long)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 8)
|
||||
die("skip for machines with 64-bit longs");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* test doubles around -4e21 */
|
||||
$values = [
|
||||
-4000000000000001048576.,
|
||||
-4000000000000000524288.,
|
||||
-4000000000000000000000.,
|
||||
-3999999999999999475712.,
|
||||
-3999999999999998951424.,
|
||||
];
|
||||
|
||||
foreach ($values as $v) {
|
||||
var_dump((int)$v);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2943463994971652096)
|
||||
int(2943463994972176384)
|
||||
int(2943463994972700672)
|
||||
int(2943463994973224960)
|
||||
int(2943463994973749248)
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
empty() with arbitrary expressions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function getEmptyArray() { return []; }
|
||||
function getNonEmptyArray() { return [1, 2, 3]; }
|
||||
|
||||
var_dump(empty([]));
|
||||
var_dump(empty([1, 2, 3]));
|
||||
|
||||
var_dump(empty(getEmptyArray()));
|
||||
var_dump(empty(getNonEmptyArray()));
|
||||
|
||||
var_dump(empty([] + []));
|
||||
var_dump(empty([1, 2, 3] + []));
|
||||
|
||||
var_dump(empty("string"));
|
||||
var_dump(empty(""));
|
||||
var_dump(empty(true));
|
||||
var_dump(empty(false));
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
errmsg: cannot create references to temp array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach (array(1,2,3) as $k=>&$v) {
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot create references to elements of a temporary array expression in %s on line %d
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Exceptions before fatal error
|
||||
--FILE--
|
||||
<?php
|
||||
function exception_error_handler($code, $msg) {
|
||||
throw new Exception($msg);
|
||||
}
|
||||
|
||||
set_error_handler("exception_error_handler");
|
||||
|
||||
try {
|
||||
$foo->a();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
new $foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
throw $foo;
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$foo::b();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$b = clone $foo;
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
class b {
|
||||
}
|
||||
|
||||
try {
|
||||
b::$foo();
|
||||
} catch(Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
string(23) "Undefined variable: foo"
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
foreach with list syntax
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach(array(array(1,2), array(3,4)) as list($a, $b)) {
|
||||
var_dump($a . $b);
|
||||
}
|
||||
|
||||
$array = array(
|
||||
array('a', 'b'),
|
||||
array('c', 'd'),
|
||||
);
|
||||
|
||||
foreach ($array as list($a, $b)) {
|
||||
var_dump($a . $b);
|
||||
}
|
||||
|
||||
|
||||
$multi = array(
|
||||
array(array(1,2), array(3,4)),
|
||||
array(array(5,6), array(7,8)),
|
||||
);
|
||||
|
||||
foreach ($multi as list(list($a, $b), list($c, $d))) {
|
||||
var_dump($a . $b . $c . $d);
|
||||
}
|
||||
|
||||
foreach ($multi as $key => list(list($a, $b), list($c, $d))) {
|
||||
var_dump($key . $a . $b . $c . $d);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "12"
|
||||
string(2) "34"
|
||||
string(2) "ab"
|
||||
string(2) "cd"
|
||||
string(4) "1234"
|
||||
string(4) "5678"
|
||||
string(5) "01234"
|
||||
string(5) "15678"
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
foreach with freak lists
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach (array(array(1,2), array(3,4)) as list($a, )) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as list(list(), $a)) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(3)
|
||||
string(1) "b"
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
|
||||
string(0) ""
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sforeach_list_002.php on line %d
|
||||
string(0) ""
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
foreach with list key
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as list($key) => list(list(), $a)) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use list as key element in %sforeach_list_003.php on line %d
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
foreach with empty list
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [['a', 'b'], 'c', 'd'];
|
||||
|
||||
foreach($array as $key => list()) {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use empty list in %sforeach_list_004.php on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Temporary array expressions can be iterated by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 'a';
|
||||
$b = 'b';
|
||||
|
||||
foreach ([&$a, &$b] as &$value) {
|
||||
$value .= '-foo';
|
||||
}
|
||||
|
||||
var_dump($a, $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "a-foo"
|
||||
string(5) "b-foo"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Generator keys are auto-incrementing by default
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 'foo';
|
||||
yield 'bar';
|
||||
yield 5 => 'rab';
|
||||
yield 'oof';
|
||||
}
|
||||
|
||||
foreach (gen() as $k => $v) {
|
||||
echo $k, ' => ', $v, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0 => foo
|
||||
1 => bar
|
||||
5 => rab
|
||||
6 => oof
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Printing the stack trace in a generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function f1() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
|
||||
function f2($arg1, $arg2) {
|
||||
f1();
|
||||
yield; // force generator
|
||||
}
|
||||
|
||||
function f3($gen) {
|
||||
$gen->rewind(); // trigger run
|
||||
}
|
||||
|
||||
$gen = f2('foo', 'bar');
|
||||
f3($gen);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 f1() called at [%s:%d]
|
||||
#1 f2(foo, bar)
|
||||
#2 Generator->rewind() called at [%s:%d]
|
||||
#3 f3(Generator Object ()) called at [%s:%d]
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63066 (Calling an undefined method in a generator results in a seg fault)
|
||||
--FILE--
|
||||
<?php
|
||||
function gen($o)
|
||||
{
|
||||
yield 'foo';
|
||||
$o->fatalError();
|
||||
}
|
||||
|
||||
foreach(gen(new stdClass()) as $value)
|
||||
echo $value, "\n";
|
||||
--EXPECTF--
|
||||
foo
|
||||
|
||||
Fatal error: Call to undefined method stdClass::fatalError() in %sbug63066.php on line 5
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65035: yield / exit segfault
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
fn();
|
||||
yield;
|
||||
}
|
||||
|
||||
function fn() {
|
||||
exit('Done');
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->current();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65161: Generator + autoload + syntax error = segfault
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function autoload() {
|
||||
foo();
|
||||
}
|
||||
spl_autoload_register('autoload');
|
||||
|
||||
function testGenerator() {
|
||||
new SyntaxError('param');
|
||||
yield;
|
||||
}
|
||||
|
||||
foreach (testGenerator() as $i);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Call to undefined function foo() in %s on line %d
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Generators cannot be cloned
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
clone $gen;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Trying to clone an uncloneable object of class Generator in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
It's possible to invoke a generator dynamically
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen($foo, $bar) {
|
||||
yield $foo;
|
||||
yield $bar;
|
||||
}
|
||||
|
||||
$gen = call_user_func('gen', 'bar', 'foo');
|
||||
foreach ($gen as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
string(3) "foo"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Generators cannot return values (even before yield)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
return $foo;
|
||||
yield;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Generators cannot return values using "return" in %s on line 4
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Generators cannot return values
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
return $abc;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Generators cannot return values using "return" in %s on line 5
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
The Generator class cannot be extended
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ExtendedGenerator extends Generator { }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class ExtendedGenerator may not inherit from final class (Generator) in %s on line %d
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
It's not possible to directly instantiate the Generator class
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
new Generator;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Catchable fatal error: The "Generator" class is reserved for internal use and cannot be manually instantiated in %s on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Non-ref generators cannot be iterated by-ref
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$gen = gen();
|
||||
foreach ($gen as &$value) { }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'You can only iterate a generator by-reference if it declared that it yields by-reference' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unknown()
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
It is not possible to resume an already running generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$gen = yield;
|
||||
$gen->next();
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->send($gen);
|
||||
$gen->next();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot resume an already running generator in %s on line %d
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Generators can't be serialized or unserialized
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() { yield; }
|
||||
|
||||
$gen = gen();
|
||||
|
||||
try {
|
||||
serialize($gen);
|
||||
} catch (Exception $e) {
|
||||
echo $e, "\n\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(unserialize('O:9:"Generator":0:{}'));
|
||||
} catch (Exception $e) {
|
||||
echo $e, "\n\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(unserialize('C:9:"Generator":0:{}'));
|
||||
} catch (Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
exception 'Exception' with message 'Serialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): serialize(Object(Generator))
|
||||
#1 {main}
|
||||
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: Generator->__wakeup()
|
||||
#1 %s(%d): unserialize('O:9:"Generator"...')
|
||||
#2 {main}
|
||||
|
||||
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): unserialize('C:9:"Generator"...')
|
||||
#1 {main}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
A notice is thrown when yielding a constant value by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &gen() {
|
||||
yield "foo";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
var_dump($gen->current());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be yielded by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
yield cannot be used in a finally block when the generator is force-closed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "before yield in finally\n";
|
||||
yield;
|
||||
echo "after yield in finally\n";
|
||||
}
|
||||
|
||||
echo "after finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before yield
|
||||
before yield in finally
|
||||
|
||||
Fatal error: Cannot yield from finally in a force-closed generator in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Yielding the result of a non-ref function call throw a notice
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo() {
|
||||
return "bar";
|
||||
}
|
||||
|
||||
function &gen() {
|
||||
yield foo();
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
var_dump($gen->current());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be yielded by reference in %s on line %d
|
||||
string(3) "bar"
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Yield cannot be used outside of functions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
yield "Test";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: The "yield" expression can only be used inside a function in %s on line %d
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Creating an infinite fibonacci list using a generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function fib() {
|
||||
list($a, $b) = [1, 1];
|
||||
while (true) {
|
||||
yield $b;
|
||||
list($a, $b) = [$b, $a + $b];
|
||||
}
|
||||
}
|
||||
|
||||
foreach (fib() as $n) {
|
||||
if ($n > 1000) break;
|
||||
|
||||
var_dump($n);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(5)
|
||||
int(8)
|
||||
int(13)
|
||||
int(21)
|
||||
int(34)
|
||||
int(55)
|
||||
int(89)
|
||||
int(144)
|
||||
int(233)
|
||||
int(377)
|
||||
int(610)
|
||||
int(987)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
finally is run even if a generator is closed mid-execution
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "finally run\n";
|
||||
}
|
||||
echo "code after finally\n";
|
||||
} finally {
|
||||
echo "second finally run\n";
|
||||
}
|
||||
echo "code after second finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
before yield
|
||||
finally run
|
||||
second finally run
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
try { return } finally { return } in generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
try {
|
||||
echo "before return\n";
|
||||
return;
|
||||
echo "after return\n";
|
||||
} finally {
|
||||
echo "before return in inner finally\n";
|
||||
return;
|
||||
echo "after return in inner finally\n";
|
||||
}
|
||||
} finally {
|
||||
echo "outer finally run\n";
|
||||
}
|
||||
|
||||
echo "code after finally\n";
|
||||
|
||||
yield; // force generator
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind(); // force run
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before return
|
||||
before return in inner finally
|
||||
outer finally run
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
try { return } finally { yield }
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($f, $t) {
|
||||
for ($i = $f; $i <= $t; $i++) {
|
||||
try {
|
||||
return;
|
||||
} finally {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (foo(1, 5) as $x) {
|
||||
echo $x, "\n";
|
||||
}
|
||||
--EXPECT--
|
||||
1
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
finally is run on object dtor, not free
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
yield;
|
||||
} finally {
|
||||
var_dump($_GET);
|
||||
}
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
|
||||
set_error_handler(function() use($gen) {});
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
try { throw } finally { yield }
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($f, $t) {
|
||||
for ($i = $f; $i <= $t; $i++) {
|
||||
try {
|
||||
throw new Exception;
|
||||
} finally {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (foo(1, 5) as $x) {
|
||||
echo $x, "\n";
|
||||
}
|
||||
--EXPECTF--
|
||||
1
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): foo(1, 5)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
try { yield } finally { return }
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($f, $t) {
|
||||
for ($i = $f; $i <= $t; $i++) {
|
||||
try {
|
||||
yield $i;
|
||||
} finally {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (foo(1, 5) as $x) {
|
||||
echo $x, "\n";
|
||||
}
|
||||
--EXPECT--
|
||||
1
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
try { yield } finally { throw }
|
||||
--FILE--
|
||||
<?php
|
||||
function foo($f, $t) {
|
||||
for ($i = $f; $i <= $t; $i++) {
|
||||
try {
|
||||
yield $i;
|
||||
} finally {
|
||||
throw new Exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (foo(1, 5) as $x) {
|
||||
echo $x, "\n";
|
||||
}
|
||||
--EXPECTF--
|
||||
1
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): foo(1, 5)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Try { yield } finally { yield }
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo() {
|
||||
try {
|
||||
echo "1";
|
||||
yield "2";
|
||||
echo "3";
|
||||
} finally {
|
||||
echo "4";
|
||||
yield "5";
|
||||
echo "6";
|
||||
}
|
||||
echo "7";
|
||||
}
|
||||
foreach (foo() as $x) {
|
||||
echo $x;
|
||||
}
|
||||
--EXPECT--
|
||||
1234567
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
func_get_args() can be used inside generator functions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
var_dump(func_get_args());
|
||||
yield; // trigger generator
|
||||
}
|
||||
|
||||
$gen = gen("foo", "bar");
|
||||
$gen->rewind();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(3) "foo"
|
||||
[1]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Closures can be generators
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$genFactory = function() {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
};
|
||||
|
||||
foreach ($genFactory() as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Non-static closures can be generators
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function getGenFactory() {
|
||||
return function() {
|
||||
yield $this;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$genFactory = (new Test)->getGenFactory();
|
||||
var_dump($genFactory()->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Generators work properly in MultipleIterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen1() {
|
||||
yield 'a';
|
||||
yield 'aa';
|
||||
}
|
||||
|
||||
function gen2() {
|
||||
yield 'b';
|
||||
yield 'bb';
|
||||
}
|
||||
|
||||
$it = new MultipleIterator;
|
||||
$it->attachIterator(gen1());
|
||||
$it->attachIterator(gen2());
|
||||
|
||||
foreach ($it as $values) {
|
||||
var_dump($values);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(2) "aa"
|
||||
[1]=>
|
||||
string(2) "bb"
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Methods can be generators
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test implements IteratorAggregate {
|
||||
protected $data;
|
||||
|
||||
public function __construct(array $data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getIterator() {
|
||||
foreach ($this->data as $value) {
|
||||
yield $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test(['foo', 'bar', 'baz']);
|
||||
foreach ($test as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
string(3) "bar"
|
||||
string(3) "baz"
|
||||
Loaded 100 of 1490 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user