mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-17 14:06:38 +00:00
Compare commits
126
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44261554e2 | ||
|
|
1cd9bf1b91 | ||
|
|
e70bbee4d5 | ||
|
|
d5591791bc | ||
|
|
650a934c29 | ||
|
|
f3e782585a | ||
|
|
30d2e1ddf6 | ||
|
|
122d3583ee | ||
|
|
beb0118357 | ||
|
|
0e9d95d447 | ||
|
|
b2698c09fd | ||
|
|
d3340d41a7 | ||
|
|
da769e6c1d | ||
|
|
43cc33b6f2 | ||
|
|
1ca0576665 | ||
|
|
675e3b0daa | ||
|
|
8ffb75d21e | ||
|
|
ef916d7774 | ||
|
|
a1da67e846 | ||
|
|
994869f966 | ||
|
|
9fddc2285f | ||
|
|
3d4ab24d98 | ||
|
|
a8682814f3 | ||
|
|
7d51db88d0 | ||
|
|
d915ce7452 | ||
|
|
ba2f4f923d | ||
|
|
1f9405a525 | ||
|
|
289c6be23d | ||
|
|
ca5eda4467 | ||
|
|
66aa6d05d6 | ||
|
|
65ca56c2fe | ||
|
|
f1bb004062 | ||
|
|
f06bee27f0 | ||
|
|
e1a9c54427 | ||
|
|
9bef1ff30e | ||
|
|
b136310d53 | ||
|
|
1d94c46fe8 | ||
|
|
2d996f80c2 | ||
|
|
11063bfdf5 | ||
|
|
ef06baa1bf | ||
|
|
fe7efe346c | ||
|
|
07804e2482 | ||
|
|
9907c0e3e8 | ||
|
|
a10aaa35e9 | ||
|
|
295b7bb34d | ||
|
|
9e16810a3d | ||
|
|
67ec39e86b | ||
|
|
227cca88c7 | ||
|
|
979052f70b | ||
|
|
56b859b607 | ||
|
|
0b9c4463b7 | ||
|
|
d464de88e2 | ||
|
|
639d24ee08 | ||
|
|
4db44d2205 | ||
|
|
39ff9ec3ec | ||
|
|
a7584fbbe3 | ||
|
|
f5edfecaec | ||
|
|
14c843fd88 | ||
|
|
25dfc9457d | ||
|
|
3cdecf365b | ||
|
|
9202398a35 | ||
|
|
4c8a92f913 | ||
|
|
fd45079159 | ||
|
|
65a2bc180e | ||
|
|
bbe65b07d7 | ||
|
|
7fb35c0d05 | ||
|
|
5cdc02daef | ||
|
|
2ed5e109c7 | ||
|
|
c760ca2743 | ||
|
|
5ec9dbfad6 | ||
|
|
bd7a8c3b55 | ||
|
|
822d0f17fe | ||
|
|
7620f18599 | ||
|
|
aca44dde04 | ||
|
|
fa919a4891 | ||
|
|
f37142f337 | ||
|
|
8a017aff9f | ||
|
|
b6b58d3958 | ||
|
|
7ed7e0e304 | ||
|
|
59cd709602 | ||
|
|
e08d410d98 | ||
|
|
f599aa59c3 | ||
|
|
a033ab55f3 | ||
|
|
20d70b186b | ||
|
|
ec64f45282 | ||
|
|
e75a645121 | ||
|
|
5be6666b3b | ||
|
|
7f2ad54e02 | ||
|
|
ff708d0f50 | ||
|
|
2c0c185700 | ||
|
|
ca46cf3de5 | ||
|
|
dc4fdaa861 | ||
|
|
a617a56cfd | ||
|
|
e31a3f01d9 | ||
|
|
c44d80de9e | ||
|
|
23441ef90c | ||
|
|
0e26c0d93e | ||
|
|
8137470f63 | ||
|
|
96107ed2ca | ||
|
|
f61ee70de6 | ||
|
|
927580e795 | ||
|
|
acaa7fd01d | ||
|
|
3e8a63f409 | ||
|
|
415bd9115f | ||
|
|
a0638f421b | ||
|
|
2c37c7203c | ||
|
|
f3fab11089 | ||
|
|
3bbeb4a368 | ||
|
|
42a4264f8e | ||
|
|
c8a83ccbb7 | ||
|
|
ba11bd5dcf | ||
|
|
95c9768107 | ||
|
|
7cf2a0e138 | ||
|
|
b99cab1921 | ||
|
|
5ceb13932c | ||
|
|
9e84cce858 | ||
|
|
92b59f81d0 | ||
|
|
c73740afec | ||
|
|
cec7da17ec | ||
|
|
db03563e2d | ||
|
|
df23567639 | ||
|
|
92feaf1b39 | ||
|
|
0d91dea9d3 | ||
|
|
db569a3dc4 | ||
|
|
f25081724b | ||
|
|
8d662076c4 |
No files matched your search
@@ -73,12 +73,6 @@ PRIMARY MAINTAINER: Edin Kadribasic <edink@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: isapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
|
||||
@@ -716,6 +716,14 @@ CGI environment and recommended modifications in php.ini
|
||||
the web server not from the administration server. Use the command
|
||||
line as root user and start it manually - you will see there are no
|
||||
CGI-like environment variables.
|
||||
|
||||
Simply change your scripts to get CGI variables in the correct way for
|
||||
PHP 4.x by using the superglobal $_SERVER. If you have older scripts
|
||||
which use $HTTP_HOST, etc., you should turn on register_globals in
|
||||
php.ini and change the variable order too (important: remove "E" from
|
||||
it, because you do not need the environment here):
|
||||
variables_order = "GPCS"
|
||||
register_globals = On
|
||||
__________________________________________________________________
|
||||
|
||||
Special use for error pages or self-made directory listings (PHP >= 4.3.3)
|
||||
@@ -1524,7 +1532,7 @@ The configuration file
|
||||
; Boolean values can be set to either:
|
||||
; true, on, yes
|
||||
; or false, off, no, none
|
||||
html_errors = off
|
||||
register_globals = off
|
||||
track_errors = yes
|
||||
|
||||
; you can enclose strings in double-quotes
|
||||
@@ -1584,11 +1592,15 @@ Running PHP as an Apache module
|
||||
Example 6-2. Apache configuration example
|
||||
<IfModule mod_php5.c>
|
||||
php_value include_path ".:/usr/local/lib/php"
|
||||
php_admin_flag engine on
|
||||
php_admin_flag safe_mode on
|
||||
</IfModule>
|
||||
<IfModule mod_php4.c>
|
||||
php_value include_path ".:/usr/local/lib/php"
|
||||
php_admin_flag engine on
|
||||
php_admin_flag safe_mode on
|
||||
</IfModule>
|
||||
<IfModule mod_php3.c>
|
||||
php3_include_path ".:/usr/local/lib/php"
|
||||
php3_safe_mode on
|
||||
</IfModule>
|
||||
|
||||
Caution
|
||||
|
||||
+6
-11
@@ -1,8 +1,3 @@
|
||||
#
|
||||
# Lemon
|
||||
#
|
||||
lemon: lemon.c
|
||||
$(CC) -o $@ -Wall $?
|
||||
|
||||
#
|
||||
# Zend
|
||||
@@ -12,17 +7,17 @@ $(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: lemon $(srcdir)/zend_language_parser.y
|
||||
$(LEMON) $(LEMON_FLAGS) $(srcdir)/zend_language_parser.y || test $$? -eq 2
|
||||
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
|
||||
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
|
||||
|
||||
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
|
||||
$(srcdir)/zend_ini_parser.c: lemon $(srcdir)/zend_ini_parser.y
|
||||
@$(LEMON) $(LEMON_FLAGS) $(srcdir)/zend_ini_parser.y
|
||||
$(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
|
||||
+19
-4
@@ -5,7 +5,24 @@
|
||||
|
||||
lcov: lcov-html
|
||||
|
||||
lcov-test: lcov-clean-data test
|
||||
lcov-test: all
|
||||
@echo "Running test suite"
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
php_lcov.info: lcov-test
|
||||
@echo "Generating data for $@"
|
||||
@@ -44,7 +61,7 @@ php_lcov.info: lcov-test
|
||||
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 \
|
||||
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
test -d lcov_data/$$dir && rm -rf lcov_data/$$dir ; \
|
||||
done
|
||||
@echo
|
||||
@@ -60,5 +77,3 @@ lcov-clean:
|
||||
rm -rf lcov_data/
|
||||
rm -rf lcov_html/
|
||||
|
||||
lcov-clean-data:
|
||||
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
|
||||
+2
-3
@@ -1,4 +1,3 @@
|
||||
LEMON = $(top_srcdir)/lemon
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
@@ -80,7 +79,7 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
|
||||
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
|
||||
done; \
|
||||
fi`
|
||||
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
|
||||
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(define_syslog_variables|register_(globals|long_arrays)?|safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
|
||||
|
||||
test: all
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
@@ -112,7 +111,7 @@ clean:
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile lemon 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
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
@@ -1,194 +1,20 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 201?, PHP 5.3.99
|
||||
- Upgraded bundled sqlite to version 3.6.23.1. (Ilia)
|
||||
- Upgraded bundled PCRE to version 8.10. (Ilia)
|
||||
|
||||
- Added caches to eliminate repeatable run-time bindings of functions, classes,
|
||||
constants, methods and properties (Dmitry)
|
||||
- Added a number of small performance tweaks and optimizations (Dmitry)
|
||||
. ZEND_RECV now always has IS_CV as its result
|
||||
. ZEND_CATCH now has to be used only with constant class names
|
||||
. ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order
|
||||
. ZEND_RETURN is splitted into two new instructions ZEND_RETURN and
|
||||
ZEND_RETURN_BY_REF
|
||||
. optimized access to global constants using values with pre-calculated
|
||||
hash_values from litersls table
|
||||
. optimized access to static properties using executor specialization.
|
||||
A constant class name may be used as a direct operand of ZEND_FETCH_*
|
||||
instruction without previous ZEND_FETCH_CLASS.
|
||||
. eliminated unnecessary iterations during request startup/shutdown
|
||||
. zend_stack initialization is delayed before the actual usage
|
||||
- Added concept of interned strings. All strings constants known at compile
|
||||
time are allocated in a single copy and never changed. (Dmitry)
|
||||
- Added an optimization which saves memory and emalloc/efree calls for empty
|
||||
HashTables (Stas, Dmitry)
|
||||
|
||||
- Added array dereferencing support. (Felipe)
|
||||
- Added DTrace support. (David Soria Parra)
|
||||
- Added Tokyo Cabinet abstract DB support to ext/dba. (Michael Maclean)
|
||||
- Added Jenkins's one-at-a-time hash support to ext/hash. (Martin Jansen)
|
||||
- Added FNV-1 hash support to ext/hash. (Michael Maclean)
|
||||
- Added ReflectionExtension::isTemporary() and
|
||||
ReflectionExtension::isPersistent(). (Johannes)
|
||||
- Added ReflectionZendExtension class. (Johannes)
|
||||
- Added ReflectionClass::isCloneable(). (Felipe)
|
||||
- Added command line option --rz to CLI. (Johannes)
|
||||
- Added closure $this support back. (Stas)
|
||||
- Added SplObjectStorage::getHash() hook. (Etienne)
|
||||
- Added JsonSerializable interface (Sara)
|
||||
- Added JSON_BIGINT_AS_STRING, extended json_decode() sig with $options. (Sara)
|
||||
- Added support for storing upload progress feedback in session data. (Arnaud)
|
||||
- Added support for CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE.
|
||||
FR #51815. (Pierrick)
|
||||
- Added iterator support in MySQLi. mysqli_result implements Traversable.
|
||||
(Andrey, Johannes)
|
||||
- Added scalar typehinting. (Ilia, Derick)
|
||||
- Added support for JSON_NUMERIC_CHECK option in json_encode() that converts
|
||||
numeric strings to integers. (Ilia)
|
||||
- Added support for object references in recursive serialize() calls. FR #36424.
|
||||
(Mike)
|
||||
- Added Berkeley DB 5 support to the DBA extension (Johannes, Chris Jones)
|
||||
|
||||
- default_charset if not specified is now UTF-8 instead of ISO-8859-1. (Rasmus)
|
||||
|
||||
- Changed the structure of op_array.opcodes. The constant values are moved from
|
||||
opcode operands into a separate literal table. (Dmitry)
|
||||
- Changed session.entropy_file to default to /dev/urandom or /dev/arandom if
|
||||
either is present at compile time. (Rasmus)
|
||||
|
||||
- Improved CLI Interactive readline shell (Johannes)
|
||||
. Added cli.pager ini setting to set a pager for output.
|
||||
. Added cli.prompt ini settingto configure the shell prompt.
|
||||
. Added shortcut #inisetting=value to change ini settings at run-time.
|
||||
. Don't terminate shell on fatal errors.
|
||||
- Improved ext/zlib: re-implemented non-file related functionality. (Mike)
|
||||
- Improved output layer. See README.NEW-OUTPUT-API for internals. (Mike)
|
||||
|
||||
- Removed legacy features:
|
||||
. allow_call_time_pass_reference. (Pierrick)
|
||||
. define_syslog_variables ini option and its associated function. (Kalle)
|
||||
. highlight.bg ini option. (Kalle)
|
||||
. import_request_variables(). (Kalle)
|
||||
. register_globals. (Kalle)
|
||||
. register_long_arrays ini option. (Kalle)
|
||||
. Safe mode. (Kalle)
|
||||
. Session bug compatibility mode (session.bug_compat42 and
|
||||
session.bug_compat_warn ini options). (Kalle)
|
||||
. session_is_registered(), session_register() and session_unregister()
|
||||
functions. (Kalle)
|
||||
. y2k_compliance ini option. (Kalle)
|
||||
|
||||
- Implemented FR #51295 (SQLite3::busyTimeout not existing). (Mark)
|
||||
- Implemented FR #48632 (OpenSSL AES support). (yonas dot y
|
||||
at gmail dot com, Pierre)
|
||||
- Implemented FR #42060 (Add paged Results support). (ando@OpenLDAP.org,
|
||||
iarenuno@eteo.mondragon.edu, jeanseb@au-fil-du.net, remy.saissy@gmail.com)
|
||||
|
||||
- Fixed PDO objects binary incompatibility. (Dmitry)
|
||||
|
||||
- Fixed bug #52211 (iconv() returns part of string on error). (Felipe)
|
||||
|
||||
|
||||
?? ??? 20??, PHP 5.3.3
|
||||
- Upgraded bundled PCRE to version 8.01. (Ilia)
|
||||
|
||||
- Added stream filter support to mcrypt extension (ported from
|
||||
mcrypt_filter). (Stas)
|
||||
- Added full_special_chars filter to ext/filter (Rasmus)
|
||||
|
||||
- Fixed a NULL pointer dereference when processing invalid XML-RPC
|
||||
requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
|
||||
|
||||
- Fixed bug #51338 (URL-Rewriter is still enabled if use_only_cookies is
|
||||
on). (Ilia, j dot jeising at gmail dot com)
|
||||
- Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
|
||||
- Fixed bug #51257 (CURL_VERSION_LARGEFILE incorrectly used after libcurl
|
||||
version 7.10.1). (aron dot ujvari at microsec dot hu)
|
||||
- Fixed bug #51242 (Empty mysql.default_port does not default to 3306 anymore,
|
||||
but 0). (Adam)
|
||||
- Fixed bug #51237 (milter SAPI crash on startup). (igmar at palsenberg dot com)
|
||||
- Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia,
|
||||
alexr at oplot dot com)
|
||||
- Fixed bug #51190 (ftp_put() returns false when transfer was successful).
|
||||
(Ilia)
|
||||
- Fixed bug #51176 (Static calling in non-static method behaves like $this->).
|
||||
(Felipe)
|
||||
- Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when
|
||||
an invalid option is provided). (Ilia)
|
||||
- Fixed bug #51096 ('last day' and 'first day' are handled incorrectly when
|
||||
parsing date strings). (Derick)
|
||||
- Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
|
||||
- Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris Jones)
|
||||
- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).
|
||||
(Raphael Geissert)
|
||||
- Fixed bug #50999 (unaligned memory access in dba_fetch()). (Felipe)
|
||||
- Fixed bug #50810 (property_exists does not work for private). (Felipe)
|
||||
- Fixed bug #50731 (Inconsistent namespaces sent to functions registered with
|
||||
spl_autoload_register). (Felipe)
|
||||
- Fixed bug #50555 (DateTime::sub() allows 'relative' time modifications). (Derick)
|
||||
- Fixed bug #50392 (date_create_from_format enforces 6 digits for 'u' format
|
||||
character). (Derick)
|
||||
- Fixed bug #50383 (Exceptions thrown in __call / __callStatic do not include
|
||||
file and line in trace). (Felipe)
|
||||
- Fixed bug #50358 (Compile failure compiling ext/phar/util.lo). (Felipe)
|
||||
- Fixed bug #49778 (DateInterval::format("%a") is always zero when an interval
|
||||
is created from an ISO string). (Derick)
|
||||
- Fixed bug #49429 (odbc_autocommit doesn't work). (Felipe)
|
||||
- Fixed bug #49059 (DateTime::diff() repeats previous sub() operation).
|
||||
(yoarvi@gmail.com, Derick)
|
||||
- Fixed bug #48902 (Timezone database fallback map is outdated). (Derick)
|
||||
- Fixed bug #46111 (Some timezone identifiers can not be parsed). (Derick)
|
||||
|
||||
|
||||
?? ??? 20??, PHP 5.3.2
|
||||
12 Feb 2010, PHP 5.3.2 RC 2
|
||||
- Upgraded bundled sqlite to version 3.6.22. (Ilia)
|
||||
- Upgraded bundled libmagic to version 5.03. (Mikko)
|
||||
- Upgraded bundled PCRE to version 8.00. (Scott)
|
||||
|
||||
- Changed gmp_strval() to use full range from 2 to 62, and -2 to -36. FR #50283
|
||||
(David Soria Parra)
|
||||
- Changed "post_max_size" php.ini directive to allow unlimited post size by
|
||||
setting it to 0. (Rasmus)
|
||||
- Changed tidyNode class to disallow manual node creation. (Pierrick)
|
||||
- Improved LCG entropy. (Rasmus, Samy Kamkar)
|
||||
|
||||
- Removed automatic file descriptor unlocking happening on shutdown and/or
|
||||
stream close (on all OSes). (Tony, Ilia)
|
||||
- Reverted fix for bug #49521 (PDO fetchObject sets values before calling
|
||||
constructor). (Pierrick, Johannes)
|
||||
|
||||
- Added libpng 1.4.0 support. (Pierre)
|
||||
- Added support for DISABLE_AUTHENTICATOR for imap_open. (Pierre)
|
||||
- Added missing host validation for HTTP urls inside FILTER_VALIDATE_URL.
|
||||
(Ilia)
|
||||
- Added stream_resolve_include_path(). (Mikko)
|
||||
- Added INTERNALDATE support to imap_append. (nick at mailtrust dot com)
|
||||
- Added support for SHA-256 and SHA-512 to php's crypt. (Pierre)
|
||||
- Added realpath_cache_size() and realpath_cache_get() functions. (Stas)
|
||||
- Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. (Ilia)
|
||||
- Added protection for $_SESSION from interrupt corruption and improved
|
||||
"session.save_path" check. (Stas)
|
||||
- Added LIBXML_PARSEHUGE constant to override the maximum text size of a
|
||||
single text node when using libxml2.7.3+. (Kalle)
|
||||
- Added ReflectionMethod::setAccessible() for invoking non-public methods
|
||||
through the Reflection API. (Sebastian)
|
||||
- Added Collator::getSortKey for intl extension. (Stas)
|
||||
- Added support for CURLOPT_POSTREDIR. FR #49571. (Sriram Natarajan)
|
||||
- Added support for CURLOPT_CERTINFO. FR #49253.
|
||||
(Linus Nielsen Feltzing <linus@haxx.se>)
|
||||
- Added client-side server name indication support in openssl. (Arnaud)
|
||||
|
||||
- Improved crypt support for edge cases (UFC compatibility). (Solar Designer,
|
||||
Joey, Pierre)
|
||||
- Improved fix for bug #50006 (Segfault caused by uksort()). (Stas)
|
||||
|
||||
- Fixed crypt's blowfish sanity check of the "setting" string, to reject iteration
|
||||
counts encoded as 36 through 39. (Solar Designer, Joey, Pierre)
|
||||
- Fixed mysqlnd hang when queries exactly 16777214 bytes long are sent. (Andrey)
|
||||
- Fixed incorrect decoding of 5-byte BIT sequences in mysqlnd. (Andrey)
|
||||
- Fixed error_log() to be binary safe when using message_type 3. (Jani)
|
||||
- Fixed unnecessary invocation of setitimer when timeouts have been disabled.
|
||||
(Arvind Srinivasan)
|
||||
- Fixed memory leak in extension loading when an error occurs on Windows.
|
||||
(Pierre)
|
||||
- Fixed safe_mode validation inside tempnam() when the directory path does
|
||||
not end with a /). (Martin Jansen)
|
||||
- Fixed a possible open_basedir/safe_mode bypass in session extension
|
||||
@@ -203,7 +29,6 @@ PHP NEWS
|
||||
- Fixed memory leak in the realpath cache on Windows. (Pierre)
|
||||
- Fixed memory leak in zip_close. (Pierre)
|
||||
|
||||
- Fixed bug #51059 (crypt crashes when invalid salt are given). (Pierre)
|
||||
- Fixed bug #50952 (allow underscore _ in constants parsed in php.ini files).
|
||||
(Jani)
|
||||
- Fixed bug #50940 (Custom content-length set incorrectly in Apache SAPIs).
|
||||
@@ -259,6 +84,46 @@ PHP NEWS
|
||||
- Fixed bug #44827 (define() allows :: in constant names). (Ilia)
|
||||
- Fixed bug #44098 (imap_utf8() returns only capital letters).
|
||||
(steffen at dislabs dot de, Pierre)
|
||||
|
||||
22 Dec 2009, PHP 5.3.2 RC 1
|
||||
- Upgraded bundled sqlite to version 3.6.21. (Ilia)
|
||||
- Upgraded bundled PCRE to version 8.00. (Scott)
|
||||
|
||||
- Changed gmp_strval() to use full range from 2 to 62, and -2 to -36. FR #50283
|
||||
(David Soria Parra)
|
||||
- Changed "post_max_size" php.ini directive to allow unlimited post size by
|
||||
setting it to 0. (Rasmus)
|
||||
- Changed tidyNode class to disallow manual node creation. (Pierrick)
|
||||
|
||||
- Removed automatic file descriptor unlocking happening on shutdown and/or
|
||||
stream close (on all OSes). (Tony, Ilia)
|
||||
|
||||
- Added INTERNALDATE support to imap_append. (nick at mailtrust dot com)
|
||||
- Added support for SHA-256 and SHA-512 to php's crypt. (Pierre)
|
||||
- Added realpath_cache_size() and realpath_cache_get() functions. (Stas)
|
||||
- Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. (Ilia)
|
||||
- Added protection for $_SESSION from interrupt corruption and improved
|
||||
"session.save_path" check. (Stas)
|
||||
- Added LIBXML_PARSEHUGE constant to override the maximum text size of a
|
||||
single text node when using libxml2.7.3+. (Kalle)
|
||||
- Added ReflectionMethod::setAccessible() for invoking non-public methods
|
||||
through the Reflection API. (Sebastian)
|
||||
- Added Collator::getSortKey for intl extension. (Stas)
|
||||
- Added support for CURLOPT_POSTREDIR. FR #49571. (Sriram Natarajan)
|
||||
- Added support for CURLOPT_CERTINFO. FR #49253.
|
||||
(Linus Nielsen Feltzing <linus@haxx.se>)
|
||||
- Added client-side server name indication support in openssl. (Arnaud)
|
||||
|
||||
- Improved fix for bug #50006 (Segfault caused by uksort()). (Stas)
|
||||
|
||||
- Fixed mysqlnd hang when queries exactly 16777214 bytes long are sent. (Andrey)
|
||||
- Fixed incorrect decoding of 5-byte BIT sequences in mysqlnd. (Andrey)
|
||||
- Fixed error_log() to be binary safe when using message_type 3. (Jani)
|
||||
- Fixed unnecessary invocation of setitimer when timeouts have been disabled.
|
||||
(Arvind Srinivasan)
|
||||
- Fixed memory leak in extension loading when an error occurs on Windows.
|
||||
(Pierre)
|
||||
|
||||
- Fixed bug #50558 (Broken object model when extending tidy). (Pierrick)
|
||||
- Fixed bug #50540 (Crash while running ldap_next_reference test cases).
|
||||
(Sriram)
|
||||
@@ -352,7 +217,6 @@ PHP NEWS
|
||||
ini variables). (Jani)
|
||||
- Fixed bug #49660 (libxml 2.7.3+ limits text nodes to 10MB). (Felipe)
|
||||
- Fixed bug #49647 (DOMUserData does not exist). (Rob)
|
||||
- Fixed bug #49600 (imageTTFText text shifted right). (Takeshi Abe)
|
||||
- Fixed bug #49521 (PDO fetchObject sets values before calling constructor).
|
||||
(Pierrick)
|
||||
- Fixed bug #49472 (Constants defined in Interfaces can be overridden).
|
||||
@@ -372,7 +236,6 @@ PHP NEWS
|
||||
- Fixed bug #34852 (Failure in odbc_exec() using oracle-supplied odbc
|
||||
driver). (tim dot tassonis at trivadis dot com)
|
||||
|
||||
|
||||
19 Nov 2009, PHP 5.3.1
|
||||
- Upgraded bundled sqlite to version 3.6.19. (Scott)
|
||||
- Updated timezone database to version 2009.17 (2009q). (Derick)
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
$Id: README.NEW-OUTPUT-API 219039 2006-08-30 07:39:09Z mike $
|
||||
|
||||
|
||||
API adjustment to the old output control code:
|
||||
|
||||
Everything now resides beneath the php_output namespace,
|
||||
and there's an API call for every output handler op.
|
||||
|
||||
Checking output control layers status:
|
||||
// Using OG()
|
||||
php_output_get_status(TSRMLS_C);
|
||||
|
||||
Starting the default output handler:
|
||||
// php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
|
||||
php_output_start_default(TSRMLS_C);
|
||||
|
||||
Starting an user handler by zval:
|
||||
// php_start_ob_buffer(zhandler, chunk_size, erase TSRMLS_CC);
|
||||
php_output_start_user(zhandler, chunk_size, flags TSRMLS_CC);
|
||||
|
||||
Starting an internal handler whithout context:
|
||||
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase TSRMLS_CC);
|
||||
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags TSRMLS_CC);
|
||||
|
||||
Starting an internal handler with context:
|
||||
// not possible with old API
|
||||
php_output_handler *h;
|
||||
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags TSRMLS_CC);
|
||||
php_output_handler_set_context(h, my_context, my_context_dtor);
|
||||
php_output_handler_start(h TSRMLS_CC);
|
||||
|
||||
Testing whether a certain output handler has already been started:
|
||||
// php_ob_handler_used("output handler name" TSRMLS_CC);
|
||||
php_output_handler_started(handler_name, handler_name_len TSRMLS_CC);
|
||||
|
||||
Flushing one output buffer:
|
||||
// php_ob_end_buffer(1, 1 TSRMLS_CC);
|
||||
php_output_flush(TSRMLS_C);
|
||||
|
||||
Flushing all output buffers:
|
||||
// not possible with old API
|
||||
php_output_flush_all(TSRMLS_C);
|
||||
|
||||
Cleaning one output buffer:
|
||||
// php_ob_end_buffer(0, 1 TSRMLS_CC);
|
||||
php_output_clean(TSRMLS_C);
|
||||
|
||||
Cleaning all output buffers:
|
||||
// not possible with old API
|
||||
php_output_clean_all(TSRMLS_C);
|
||||
|
||||
Discarding one output buffer:
|
||||
// php_ob_end_buffer(0, 0 TSRMLS_CC);
|
||||
php_output_discard(TSRMLS_C);
|
||||
|
||||
Discarding all output buffers:
|
||||
// php_ob_end_buffers(0 TSRMLS_CC);
|
||||
php_output_discard_all(TSRMLS_C);
|
||||
|
||||
Stopping (and dropping) one output buffer:
|
||||
// php_ob_end_buffer(1, 0 TSRMLS_CC)
|
||||
php_output_end(TSRMLS_C);
|
||||
|
||||
Stopping (and dropping) all output buffers:
|
||||
// php_ob_end_buffers(1, 0 TSRMLS_CC);
|
||||
php_output_end_all(TSRMLS_C);
|
||||
|
||||
Retrieving output buffers contents:
|
||||
// php_ob_get_buffer(zstring TSRMLS_CC);
|
||||
php_output_get_contents(zstring TSRMLS_CC);
|
||||
|
||||
Retrieving output buffers length:
|
||||
// php_ob_get_length(zlength TSRMLS_CC);
|
||||
php_output_get_length(zlength TSRMLS_CC);
|
||||
|
||||
Retrieving output buffering level:
|
||||
// OG(nesting_level);
|
||||
php_output_get_level(TSRMLS_C);
|
||||
|
||||
Issue a warning because of an output handler conflict:
|
||||
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name" TSRMLS_CC);
|
||||
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len TSRMLS_CC);
|
||||
|
||||
Registering a conflict checking function, which will be checked prior starting the handler:
|
||||
// not possible with old API, unless hardcoding into output.c
|
||||
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
|
||||
|
||||
Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler:
|
||||
// not possible with old API
|
||||
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
|
||||
|
||||
Facilitating a context from within an output handler callable with ob_start():
|
||||
// not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr TSRMLS_CC);
|
||||
|
||||
Disabling of the output handler by itself:
|
||||
//not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL TSRMLS_CC);
|
||||
|
||||
Marking an output handler immutable by itself because of irreversibility of its operation:
|
||||
// not possible with old API
|
||||
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
|
||||
|
||||
Restarting the output handler because of a CLEAN operation:
|
||||
// not possible with old API
|
||||
if (flags & PHP_OUTPUT_HANDLER_CLEAN) { ... }
|
||||
|
||||
Recognizing by the output handler itself if it gets discarded:
|
||||
// not possible with old API
|
||||
if ((flags & PHP_OUTPUT_HANDLER_CLEAN) && (flags & PHP_OUTPUT_HANDLER_FINAL)) { ... }
|
||||
|
||||
|
||||
Output handler hooks
|
||||
|
||||
The output handler can change its abilities at runtime. Eg. the gz handler can
|
||||
remove the CLEANABLE and REMOVABLE bits when the first output has passed through it;
|
||||
or handlers implemented in C to be used with ob_start() can contain a non-global
|
||||
context:
|
||||
PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ
|
||||
pass a void*** pointer as second arg to receive the address of a pointer
|
||||
pointer to the opaque field of the output handler context
|
||||
PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS
|
||||
pass a int* pointer as second arg to receive the flags set for the output handler
|
||||
PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL
|
||||
pass a int* pointer as second arg to receive the level of this output handler
|
||||
(starts with 0)
|
||||
PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE
|
||||
the second arg is ignored; marks the output handler to be neither cleanable
|
||||
nor removable
|
||||
PHP_OUTPUT_HANDLER_HOOK_DISABLE
|
||||
the second arg is ignored; marks the output handler as disabled
|
||||
|
||||
|
||||
Open questions
|
||||
|
||||
Should the userland API be adjusted and unified?
|
||||
|
||||
Many bits of the manual (and very first implementation) do not comply
|
||||
with the behaviour of the current (to be obsoleted) code, thus should
|
||||
the manual or the behaviour be adjusted?
|
||||
|
||||
END
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
QNX4 Installation Notes
|
||||
-----------------------
|
||||
|
||||
NOTE: General installation instructions are in the INSTALL file
|
||||
|
||||
|
||||
1. To compile and test PHP3 you have to grab, compile and install:
|
||||
- GNU dbm library or another db library;
|
||||
- GNU bison (1.25 or later; 1.25 tested);
|
||||
- GNU flex (any version supporting -o and -P options; 2.5.4 tested);
|
||||
- GNU diffutils (any version supporting -w option; 2.7 tested);
|
||||
|
||||
2. To use CVS version you may need also:
|
||||
- GNU CVS (1.9 tested);
|
||||
- GNU autoconf (2.12 tested);
|
||||
- GNU m4 (1.3 or later preferable; 1.4 tested);
|
||||
|
||||
3. To run configure define -lunix in command line:
|
||||
LDFLAGS=-lunix ./configure
|
||||
|
||||
4. To use Sybase SQL Anywhere define ODBC_QNX and CUSTOM_ODBC_LIBS in
|
||||
command line and run configure with --with-custom-odbc:
|
||||
CFLAGS=-DODBC_QNX LDFLAGS=-lunix CUSTOM_ODBC_LIBS="-ldblib -lodbc" ./configure --with-custom-odbc=/usr/lib/sqlany50
|
||||
If you have SQL Anywhere version 5.5.00, then you have to add
|
||||
CFLAGS=-DSQLANY_BUG
|
||||
to workaround its SQLFreeEnv() bug. Other versions has not been tested,
|
||||
so try without this flag first.
|
||||
|
||||
5. To build the Apache module, you may have to hardcode an include path for
|
||||
alloc.h in your Apache base directory:
|
||||
- APACHE_DIRECTORY/src/httpd.h:
|
||||
change #include "alloc.h"
|
||||
to #include "APACHE_DIRECTORY/src/alloc.h"
|
||||
Unless you want to use system regex library, you have to hardcode also
|
||||
a path to regex.h:
|
||||
- APACHE_DIRECTORY/src/conf.h:
|
||||
change #include <regex.h>
|
||||
to #include "APACHE_DIRECTORY/src/regex/regex.h"
|
||||
I don't know so far why this required for QNX, may be it is Watcom
|
||||
compiler problem.
|
||||
|
||||
If you building Apache module with SQL Anywhere support, you'll get
|
||||
symbol conflict with BOOL. It is defined in Apache (httpd.h) and in
|
||||
SQL Anywhere (odbc.h). This has nothing to do with PHP, so you have to
|
||||
fix it yourself someway.
|
||||
|
||||
6. With above precautions, it should compile as is and pass regression
|
||||
tests completely:
|
||||
make
|
||||
make check
|
||||
make install
|
||||
|
||||
Don't bother me unless you really sure you made that all but it
|
||||
still doesn't work.
|
||||
|
||||
June 28, 1998
|
||||
Igor Kovalenko -- owl@infomarket.ru
|
||||
+84
-130
@@ -1,134 +1,61 @@
|
||||
Submitting Enhancements and Patches to PHP
|
||||
==========================================
|
||||
Submitting Patches to PHP
|
||||
=========================
|
||||
|
||||
This document describes how to submit an enhancement or patch for PHP.
|
||||
It's easy!
|
||||
This document describes how to submit a patch for PHP. Creating a
|
||||
patch for PHP is easy!
|
||||
|
||||
You don't need any login accounts or special access to download,
|
||||
build, debug and begin submitting PHP, PECL or PEAR code, tests or
|
||||
documentation. Once you've followed this README and had several
|
||||
patches accepted, commit privileges are often quickly granted.
|
||||
build, debug and begin submitting PHP code, tests or documentation for
|
||||
inclusion in PHP. Once you've followed this README and had several
|
||||
patches accepted, PHP commit privileges are often quickly granted.
|
||||
|
||||
An excellent article to read first is:
|
||||
http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
|
||||
|
||||
|
||||
Online Forums
|
||||
-------------
|
||||
There are several IRC channels where PHP developers are often
|
||||
available to discuss questions. They include #php.pecl, #php.doc and
|
||||
#pear on the EFNet network and #php-dev-win on FreeNode.
|
||||
Prework
|
||||
-------
|
||||
If you are fixing broken functionality then create a bug or identify
|
||||
an existing bug at http://bugs.php.net/. This can be used to track
|
||||
the patch progress and prevent your changes getting lost in the PHP
|
||||
mail archives.
|
||||
|
||||
If your code change is large then first discuss it with the extension
|
||||
maintainer and/or a development mail list. Extension maintainers can
|
||||
be found in the EXTENSIONS file in the PHP source. Use the
|
||||
internals@lists.php.net mail list to discuss changes to the base PHP
|
||||
code. Use pecl-dev@lists.php.net for changes to code that is only
|
||||
available from PECL (http://pecl.php.net/). Use pear-dev@lists.php.net
|
||||
for PEAR modules (http://pear.php.net/). Mail list subscription is
|
||||
explained on http://www.php.net/mailing-lists.php.
|
||||
|
||||
PHP Patches
|
||||
-----------
|
||||
If you are fixing broken functionality in PHP C source code first
|
||||
create a bug or identify an existing bug at http://bugs.php.net/. A
|
||||
bug can be used to track the patch progress and prevent your changes
|
||||
getting lost in the PHP mail archives.
|
||||
|
||||
If your change is large then create a Request For Comment (RFC) page
|
||||
on http://wiki.php.net/rfc, discuss it with the extension maintainer,
|
||||
and discuss it on the development mail list internals@lists.php.net.
|
||||
RFC Wiki accounts can be requested on
|
||||
http://wiki.php.net/start?do=register. PHP extension maintainers can
|
||||
be found in the EXTENSIONS file in the PHP source. Mail list
|
||||
subscription is explained on http://www.php.net/mailing-lists.php.
|
||||
|
||||
Information on PHP internal C functions is at
|
||||
http://www.php.net/internals, though this is considered incomplete.
|
||||
Various external resources can be found on the web. A standard
|
||||
printed reference is the book "Extending and Embedding PHP" by Sara
|
||||
Golemon.
|
||||
|
||||
Attach the patch to the PHP bug and consider sending a notification
|
||||
email about the change to internals@lists.php.net. Also CC the
|
||||
extension maintainer. Explain what has been changed by your patch.
|
||||
Test scripts should be included.
|
||||
|
||||
Please make the mail subject prefix "[PATCH]". If attaching a patch,
|
||||
ensure it has a file extension of ".txt". This is because only MIME
|
||||
attachments of type 'text/*' are accepted.
|
||||
|
||||
|
||||
PHP Documentation Patches
|
||||
-------------------------
|
||||
If you are fixing incorrect PHP documentation first create a bug or
|
||||
identify an existing bug at http://bugs.php.net/. A bug can be used
|
||||
to track the patch progress and prevent your changes getting lost in
|
||||
the PHP mail archives.
|
||||
|
||||
If your change is large, then first discuss it with the mail list
|
||||
phpdoc@lists.php.net. Subscription is explained on
|
||||
http://www.php.net/mailing-lists.php.
|
||||
|
||||
Information on contributing to PHP documentation is at
|
||||
http://php.net/dochowto and http://wiki.php.net/doc/howto
|
||||
|
||||
Attach the patch to the PHP bug and consider sending a notification
|
||||
email about the change to phpdoc@lists.php.net. Explain what has been
|
||||
fixed/added/changed by your patch.
|
||||
|
||||
Please make the mail subject prefix "[PATCH]". Include the bug id(s)
|
||||
which can be closed by your patch. If attaching a patch, ensure it
|
||||
has a file extension of ".txt". This is because only MIME attachments
|
||||
of type 'text/*' are accepted.
|
||||
|
||||
|
||||
PECL Extension Patches: http://pecl.php.net/
|
||||
--------------------------------------------
|
||||
If you are fixing broken functionality in a PECL extension then create
|
||||
a bug or identify an existing bug at http://pecl.php.net/bugs/. A bug
|
||||
can be used to track the patch progress and prevent your changes
|
||||
getting lost in the PHP mail archives.
|
||||
|
||||
If your change is large then create a Request For Comment (RFC) page
|
||||
on http://wiki.php.net/rfc, discuss it with the extension maintainer,
|
||||
and discuss it on the development mail list pecl-dev@lists.php.net.
|
||||
PECL mail list subscription is explained on
|
||||
http://pecl.php.net/support.php. RFC Wiki accounts can be requested
|
||||
If a PHP or PECL patch affects user-functionality or makes significant
|
||||
internal changes then create a simple RFC on http://wiki.php.net/rfc
|
||||
before starting discussion. This RFC can be used for initial
|
||||
discussion and later for documentation. Wiki accounts can be requested
|
||||
on http://wiki.php.net/start?do=register
|
||||
|
||||
Information on PHP internal C functions is at
|
||||
http://www.php.net/internals, though this is considered incomplete.
|
||||
Various external resources can be found on the web. A standard
|
||||
printed reference is the book "Extending and Embedding PHP" by Sara
|
||||
Golemon.
|
||||
|
||||
Update any open bugs and add a link to the source of your patch. Send
|
||||
the patch or pointer to the bug to pecl-dev@lists.php.net. Also CC
|
||||
the extension maintainer. Explain what has been changed by your
|
||||
patch. Test scripts should be included.
|
||||
|
||||
Please make the mail subject prefix "[PATCH] ...". Include the patch
|
||||
as an attachment with a file extension of ".txt". This is because
|
||||
only MIME attachments of type 'text/*' are accepted.
|
||||
There are several IRC channels where PHP developers are often
|
||||
available to discuss questions. They include #php.pecl on the EFNet
|
||||
network and #php-dev-win on FreeNode.
|
||||
|
||||
|
||||
PEAR Package Patches: http://pear.php.net/
|
||||
------------------------------------------
|
||||
Information on contributing to PEAR is available at
|
||||
http://pear.php.net/manual/en/developers-newmaint.php and
|
||||
http://pear.php.net/manual/en/guide-developers.php
|
||||
|
||||
|
||||
How to create your PHP, PHP Documentation or PECL patch
|
||||
-------------------------------------------------------
|
||||
PHP and PECL use Subversion (SVN) for revision control. Read
|
||||
How to create your patch
|
||||
------------------------
|
||||
PHP uses Subversion (SVN) for revision control. Read
|
||||
http://www.php.net/svn.php for help on using SVN to get and build PHP
|
||||
source code. We recommend using a Sparse Directory checkout described
|
||||
in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
|
||||
source code. We recommend using a Sparse Directory checkout described
|
||||
in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
|
||||
http://svnbook.red-bean.com.
|
||||
|
||||
Generally we ask that bug fix patches work on the current stable PHP
|
||||
development branches and on "trunk". New PHP features only need to
|
||||
work on "trunk".
|
||||
Generally we ask that patches work on the current stable PHP
|
||||
development branch and on "trunk".
|
||||
|
||||
Read CODING_STANDARDS before you start working.
|
||||
|
||||
After modifying the source see README.TESTING and
|
||||
http://qa.php.net/write-test.php for how to test. Submitting test
|
||||
scripts helps us to understand what functionality has changed. It is
|
||||
http://qa.php.net/write-test.php for how to test. Submitting test
|
||||
scripts helps us to understand what functionality has changed. It is
|
||||
important for the stability and maintainability of PHP that tests are
|
||||
comprehensive.
|
||||
|
||||
@@ -140,43 +67,70 @@ For ease of review and later troubleshooting, submit individual
|
||||
patches for each bug or feature.
|
||||
|
||||
|
||||
Checklist for submitting your PHP or PECL code patch
|
||||
----------------------------------------------------
|
||||
Checklist for submitting your patch
|
||||
-----------------------------------
|
||||
- Update SVN source just before running your final 'diff' and
|
||||
before testing.
|
||||
- Add in-line comments and/or have external documentation ready.
|
||||
Use only "/* */" style comments, not "//".
|
||||
- Create test scripts for use with "make test".
|
||||
- Run "make test" to check your patch doesn't break other features.
|
||||
- Rebuild PHP with --enable-debug (which will show some kinds of
|
||||
memory errors) and check the PHP and web server error logs after
|
||||
running your PHP tests.
|
||||
- Rebuild PHP with --enable-maintainer-zts to check your patch
|
||||
compiles on multi-threaded web servers.
|
||||
running the PHP tests.
|
||||
- Rebuild PHP with --enable-maintainer-zts to check your patch compiles
|
||||
on multi-threaded web servers.
|
||||
- Create test scripts for use with "make test".
|
||||
- Add in-line comments and/or have external documentation ready.
|
||||
- Review the patch once more just before submitting it.
|
||||
|
||||
|
||||
What happens after submitting your PHP, PHP Documentation or PECL patch
|
||||
-----------------------------------------------------------------------
|
||||
Where to send your patch
|
||||
------------------------
|
||||
If you are patching PHP C source then email the patch to
|
||||
internals@lists.php.net
|
||||
|
||||
If you patching a PECL extension then send the patch to
|
||||
pecl-dev@lists.php.net
|
||||
|
||||
If you are patching PEAR then send the patch to
|
||||
pear-dev@lists.php.net
|
||||
|
||||
The mail can be CC'd to the extension maintainer (see EXTENSIONS).
|
||||
|
||||
Please make the subject prefix "[PATCH]".
|
||||
|
||||
Include the patch as an attachment. Note: only MIME attachments of
|
||||
type 'text/*' are accepted. The easiest way to accomplish this is to
|
||||
make the file extension '.txt'.
|
||||
|
||||
Explain what has been fixed/added/changed by your patch. Test scripts
|
||||
should be included in the email.
|
||||
|
||||
Include the bug id(s) which can be closed by your patch.
|
||||
|
||||
Finally, update any open bugs and add a link to the source of your
|
||||
patch.
|
||||
|
||||
|
||||
What happens after you submit your patch
|
||||
----------------------------------------
|
||||
If your patch is easy to review and obviously has no side-effects,
|
||||
it might be committed relatively quickly.
|
||||
|
||||
Because PHP is a volunteer-driven effort more complex patches will
|
||||
require patience on your side. If you do not receive feedback in a
|
||||
few days, consider resubmitting the patch. Before doing this think
|
||||
about these questions:
|
||||
require patience on your side. If you do not receive feedback in a few
|
||||
days, consider resubmitting the patch. Before doing this think about
|
||||
these questions:
|
||||
|
||||
- Did I send the patch to the right mail list?
|
||||
- Did I review the mail list archives to see if these kind of
|
||||
changes had been discussed before?
|
||||
- Did I explain my patch clearly?
|
||||
- Is my patch too hard to review? Because of what factors?
|
||||
- Is my patch too hard to review? Because of which factors?
|
||||
- Are there any unwanted white space changes?
|
||||
|
||||
|
||||
What happens when your PHP or PECL patch is applied
|
||||
---------------------------------------------------
|
||||
Your name will likely be included in the SVN commit log. If your
|
||||
patch affects end users, a brief description and your name might be
|
||||
added to the NEWS file.
|
||||
What happens when your patch is applied
|
||||
---------------------------------------
|
||||
Your name will be included together with your email address in the SVN
|
||||
commit log. If your patch affects end users, a brief description
|
||||
and your name might be added to the NEWS file.
|
||||
|
||||
Thank you for patching PHP!
|
||||
+17
-5
@@ -19,7 +19,9 @@ A simple implementation might look like the following. This stores the
|
||||
original raw user data and adds a my_get_raw() function while the normal
|
||||
$_POST, $_GET and $_COOKIE arrays are only populated with stripped
|
||||
data. In this simple example all I am doing is calling strip_tags() on
|
||||
the data.
|
||||
the data. If register_globals is turned on, the default globals that
|
||||
are created will be stripped ($foo) while a $RAW_foo is created with the
|
||||
original user input.
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(my_input_filter)
|
||||
zval *post_array;
|
||||
@@ -153,6 +155,8 @@ PHP_FUNCTION(my_get_raw)
|
||||
int var_len;
|
||||
zval **tmp;
|
||||
zval *array_ptr = NULL;
|
||||
HashTable *hash_ptr;
|
||||
char *raw_var;
|
||||
|
||||
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
|
||||
return;
|
||||
@@ -170,15 +174,23 @@ PHP_FUNCTION(my_get_raw)
|
||||
break;
|
||||
}
|
||||
|
||||
if(!array_ptr) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if(!array_ptr) RETURN_FALSE;
|
||||
|
||||
if(zend_hash_find(HASH_OF(array_ptr), var, var_len+5, (void **)&tmp) == SUCCESS) {
|
||||
/*
|
||||
* I'm changing the variable name here because when running with register_globals on,
|
||||
* the variable will end up in the global symbol table
|
||||
*/
|
||||
raw_var = emalloc(var_len+5); /* RAW_ and a \0 */
|
||||
strcpy(raw_var, "RAW_");
|
||||
strlcat(raw_var,var,var_len+5);
|
||||
hash_ptr = HASH_OF(array_ptr);
|
||||
|
||||
if(zend_hash_find(hash_ptr, raw_var, var_len+5, (void **)&tmp) == SUCCESS) {
|
||||
*return_value = **tmp;
|
||||
zval_copy_ctor(return_value);
|
||||
} else {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
efree(raw_var);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
Things to do or at least think about doing in the future. Name in
|
||||
parenthesis means that person has taken on this project.
|
||||
|
||||
Zend
|
||||
----
|
||||
* Allow foreach ($array as $k => list($a, $b)) syntax for multi
|
||||
dimensional arrays.
|
||||
* Look at replacing c-lib call tolower().
|
||||
* Make hash API functions work with HASH_OF() to save time.
|
||||
* Native large number support (probably with GNU GMP)
|
||||
* Const'ify APIs. Right now, many functions leave parameters untouched,
|
||||
but don't declare those as const. This makes interaction with other
|
||||
interfaces difficult which pass const parameters to us.
|
||||
|
||||
|
||||
global
|
||||
------
|
||||
* Make sure that all ZTS globals get destructed. Most ts_allocate_id()
|
||||
calls should have a dtor entry.
|
||||
* on some platforms unimplemented function will just do nothing
|
||||
(e.g. symlink) they should print a warning or not even be defined!
|
||||
(DONE ?)
|
||||
* --enable-all in configure. (--enable-shared=max ...)
|
||||
* make configure print out a summary when it's done (like XEmacs)
|
||||
* replace standard functions which work on static data with
|
||||
reentrancy-safe functions (DONE?).
|
||||
* make SAPI conform to CGI/1.1. Currently, all SAPI modules
|
||||
define REMOTE_ADDR etc. themselves and reach only various level
|
||||
of compliance.
|
||||
* see what functions might need to be changed to use HashPosition, so
|
||||
that the internal array pointer is not affected.
|
||||
* Move most extensions and PEAR packages out of the PHP CVS tree,
|
||||
include them again during release packaging.
|
||||
|
||||
Other
|
||||
* use thread-safe resolver functions (either require BIND 8 or adns).
|
||||
* implement javadoc based function docs template system.
|
||||
* provide optional IPv6 support (seems to be done?).
|
||||
* find a better way to implement script timeouts. SIGVTALRM is used
|
||||
by some POSIX threads implementations (i.e. OpenBSD) and is not
|
||||
available in ZTS mode.
|
||||
* Implement flush feature suitable for nested output buffers.
|
||||
|
||||
Streams
|
||||
-------
|
||||
* Route filestat.c through the wrapper layer; isolate the statcache code
|
||||
so that it is independent of php functions and can be applied to any
|
||||
stream/path.
|
||||
* Implement generalized connection pool for stated protocols such as
|
||||
ftp and http/1.1 (using keep-alive) to avoid having to negotiate
|
||||
new command/request stream for each subsequent call; Possibly store
|
||||
resources in contexts (creating a default context if necessary) to
|
||||
allow segmentation of connection pools.
|
||||
* Add a method to take ownership of the memory buffer in memory streams so
|
||||
that generating string values for zvals doesn't require an estrdup.
|
||||
* bundle and use curl lib for fopen wrapper.
|
||||
|
||||
documentation
|
||||
-------------
|
||||
* Add remarks in the documentation which functions are not implemented
|
||||
on win32.
|
||||
* Add remarks in the documentation which functions are not binary-safe.
|
||||
* Update curl documentation (DONE?)
|
||||
* Add developer documentation.
|
||||
* Add detailed documentation for Java extension.
|
||||
|
||||
ext/curl
|
||||
--------
|
||||
* Have a warning scheme for when people use unsupported features.
|
||||
|
||||
ext/oci8
|
||||
--------
|
||||
* All OCIFetch*() functions should return 0 for no more data and false on
|
||||
error.
|
||||
* Have a flag that trims trailing spaces from CHAR fields on retrieval.
|
||||
* Make allow_call_time_pass_reference=Off working.
|
||||
* For additional todo information, see oci8.c, in ext/oci8
|
||||
|
||||
ext/odbc
|
||||
--------
|
||||
For PHP 4.3.0:
|
||||
* update all php_error calls to php_error_docref where valid
|
||||
* integrate EXPERIMENTAL ODBC update for use in PHP 5.0, use for
|
||||
testing purposes only.
|
||||
|
||||
For PHP 5.0.0
|
||||
* Activate EXPERIMENTAL ODBC codebase update
|
||||
|
||||
ext/pcre
|
||||
--------
|
||||
* Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe
|
||||
|
||||
ext/pcntl
|
||||
---------
|
||||
* Change internal callback handler to use TICKS
|
||||
* Remove all zend_extension code
|
||||
* Add object callback support to pcntl_signal()
|
||||
|
||||
ext/session
|
||||
-----------
|
||||
For PHP 4.3.0:
|
||||
* session_abort() to abort session. ie: Do not save session data.
|
||||
* Allow unset($_SESSION) or unset($HTTP_SESSION_VARS) to unset
|
||||
session vars regardless of register_globals setting.
|
||||
|
||||
Other:
|
||||
* Maybe implement finer-grained session variables that could be
|
||||
locked individually.
|
||||
* Write a network-transparent storage back-end with fallover
|
||||
facilities
|
||||
* Provide a callback facility which is executed upon encountering
|
||||
an unknown class name during deserialization
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
* Add a version number to data serialized via serialize().
|
||||
* Possibly modify parsing of GPC data to automatically create arrays if
|
||||
variable name is seen more than once.
|
||||
* Implement regex-cache for url-functions.
|
||||
* Move socket related functions to fsock.c.
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
* See if we can support the remaining data types:
|
||||
binary
|
||||
|
||||
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
|
||||
(Andrei)
|
||||
|
||||
* implement wddx_packet_as_javascript(). (Andrei)
|
||||
|
||||
other cool stuff
|
||||
----------------
|
||||
* PVM extension
|
||||
|
||||
vim:et:sw=4:ts=4
|
||||
@@ -0,0 +1,4 @@
|
||||
Zend Engine
|
||||
-----------
|
||||
- Look at making zend_constant value member be a zval* instead of zval. (Andi)
|
||||
- Implement inheritance rules for type hints. (Marcus)
|
||||
@@ -0,0 +1,89 @@
|
||||
Component: Zend Engine 2
|
||||
|
||||
Important stuff to finish: PPP members/PPP methods,
|
||||
support of overloaded extensions, possibly differentiate
|
||||
between class and namespace as discussed with Stig in
|
||||
Germany.
|
||||
Responsibility: Zeev, Andi, Stas
|
||||
Time frame: Couple of months for first part and extensions will be
|
||||
ongoing while PHP is being fixed.
|
||||
Things to leave for later versions: Native aggregation
|
||||
support, accessing static members via object and not class.
|
||||
|
||||
|
||||
Component: Aggregation
|
||||
Responsibility: Andi, Stig?
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: Redesign of API Versioning
|
||||
Responsibility: ?
|
||||
Time frame: 1 month
|
||||
|
||||
|
||||
Component: Thread Safety
|
||||
Identify the extensions that are not thread safe by design
|
||||
or due to dependant libraries and identify them as such.
|
||||
If possible try to resolve thread safety issue via code
|
||||
improvements (if php code or patches will be accepted by
|
||||
library maintainers). For situations where thread safety
|
||||
cannot easily be acheived a flag in the extension API is
|
||||
set so PHP can identify non-thread safe extensions. These
|
||||
extensions will not be loaded in a ZTS compiled binary
|
||||
(unless it is cli/cgi).
|
||||
|
||||
Responsibility: ?
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: SAPI
|
||||
Environment variables defined in the CGI spec need to be
|
||||
verified in each SAPI module that they conform to the CGI
|
||||
spec correctly. If they do not, the SAPI module needs to
|
||||
fix the variable prior to script execution. Having this
|
||||
conformity will aid in having PHP scripts run correctly
|
||||
under different sapi modules.
|
||||
|
||||
Responsibility: Shane Caraveo & each sapi module owner
|
||||
Timeframe: ? (but shouldn't be much effort, most modules are probably ok)
|
||||
|
||||
|
||||
Component: RPC Abstraction Layer
|
||||
Porting java, com, dotnet, xmlrpc, corba, soap and python, srm
|
||||
(are there more ?) to work with the new oo api and preferably
|
||||
by using ext/rpc.
|
||||
Responsibility: Harald
|
||||
Time frame: 2 months (but i have to wait for a few engine features first)
|
||||
|
||||
|
||||
Component: OO Extensions
|
||||
Each OO extension has to be revised and rewritten to fit into
|
||||
the new OO model. We should decide which extensions are a must
|
||||
to have for the release and which can be ported by the maintainer
|
||||
later as a separate pecl release.
|
||||
A list of extensions to be extended that have to be investigated:
|
||||
* browscap
|
||||
* aggregate
|
||||
* all *sql extensions (*_fetch_object)
|
||||
* domxml (seems like christian is rewriting it anyways)
|
||||
* ming
|
||||
Responsibility: Harald (, extension maintainers)
|
||||
|
||||
|
||||
Component: Abstract Data Types (ADT)
|
||||
Responsibility: Sterling, Harald
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: Test Suite
|
||||
Extending the test suite with atleast a test for every
|
||||
function in an extension that doesn't require external
|
||||
resources. Also developing an automated test thing which
|
||||
cvs ups's, compiles and tests the build on a daily base on
|
||||
as much platforms/extensions as possible.
|
||||
|
||||
The test suite will also be extended to support threaded
|
||||
testing and testing for differing sapi modules (via http
|
||||
calls or other methods).
|
||||
Reponsibility: Derick (, extension maintainers)
|
||||
Time frame: 3 months
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2010, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1999-2010, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
// vim:ft=javascript
|
||||
// $Id$
|
||||
|
||||
if (CHECK_HEADER_ADD_INCLUDE("NewAPIs.h", "CFLAGS_PHP", php_usual_include_suspects)) {
|
||||
// Need to add the flag directly, since TSRM doesn't include the config
|
||||
// header
|
||||
ADD_FLAG("CFLAGS_PHP", "/DHAVE_NEWAPIS_H=1");
|
||||
}
|
||||
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c tsrm_win32.c");
|
||||
|
||||
@@ -298,19 +298,19 @@ static int php_is_file_ok(const cwd_state *state) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state);
|
||||
cwd_g->realpath_cache_size = 0;
|
||||
cwd_g->realpath_cache_size_limit = REALPATH_CACHE_SIZE;
|
||||
cwd_g->realpath_cache_ttl = REALPATH_CACHE_TTL;
|
||||
memset(cwd_g->realpath_cache, 0, sizeof(cwd_g->realpath_cache));
|
||||
CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state);
|
||||
cwd_globals->realpath_cache_size = 0;
|
||||
cwd_globals->realpath_cache_size_limit = REALPATH_CACHE_SIZE;
|
||||
cwd_globals->realpath_cache_ttl = REALPATH_CACHE_TTL;
|
||||
memset(cwd_globals->realpath_cache, 0, sizeof(cwd_globals->realpath_cache));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
CWD_STATE_FREE(&cwd_g->cwd);
|
||||
CWD_STATE_FREE(&cwd_globals->cwd);
|
||||
realpath_cache_clean(TSRMLS_C);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1525,7 +1525,6 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
|
||||
/* rename on windows will fail if newname already exists.
|
||||
MoveFileEx has to be used */
|
||||
#ifdef TSRM_WIN32
|
||||
/* MoveFileEx returns 0 on failure, other way 'round for this function */
|
||||
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0;
|
||||
#else
|
||||
retval = rename(oldname, newname);
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken)
|
||||
PSID *ppsid = &sid;
|
||||
DWORD sid_len;
|
||||
PSID pResultSid = NULL;
|
||||
|
||||
|
||||
/* Get the actual size of the TokenUser structure */
|
||||
if (!GetTokenInformation(
|
||||
hToken, TokenUser, (LPVOID) pTokenUser, 0, &dwLength)) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
$Id$
|
||||
|
||||
UPGRADE NOTES - PHP X.Y
|
||||
UPGRADE NOTES - PHP 5.3
|
||||
|
||||
1. Changes made to default configuration
|
||||
2. Reserved words and classes
|
||||
3. Changes made to existing functions
|
||||
4. Changes made to existing methods
|
||||
5. Changes made to existing classes
|
||||
6. Deprecated
|
||||
1. Reserved words and classes
|
||||
2. Changes made to existing functions
|
||||
3. Changes made to existing methods
|
||||
4. Changes made to existing classes
|
||||
5. Deprecated
|
||||
6. Undeprecated
|
||||
7. Extensions:
|
||||
a. moved out to PECL and actively maintained there
|
||||
b. no longer maintained
|
||||
@@ -17,7 +17,7 @@ UPGRADE NOTES - PHP X.Y
|
||||
9. Changes in INI directives
|
||||
10. Syntax additions
|
||||
11. Windows support
|
||||
12. New in PHP X.Y:
|
||||
12. New in PHP 5.3:
|
||||
a. New libraries
|
||||
b. New extensions
|
||||
c. New stream wrappers
|
||||
@@ -27,223 +27,642 @@ UPGRADE NOTES - PHP X.Y
|
||||
g. New classes
|
||||
h. New methods
|
||||
i. New class constants
|
||||
j. New hash algorithms
|
||||
|
||||
|
||||
========================================
|
||||
1. Changes made to default configuration
|
||||
========================================
|
||||
|
||||
- The default_charset setting now defaults to UTF-8.
|
||||
It was ISO-88590-1 before, so if you were relying
|
||||
on the default, you will need to add:
|
||||
|
||||
default_charset = iso-8859-1
|
||||
|
||||
to your php.ini to preserve pre-PHPX.Y behavior.
|
||||
|
||||
- We now check at compile time if /dev/urandom or /dev/arandom
|
||||
are present to provide non-blocking entropy to session id
|
||||
generation. If either is present, session.entropy_file
|
||||
now defaults to that file and session.entropy_length defaults
|
||||
to 32. If you do not want extra entropy for your session ids
|
||||
for some reason, add:
|
||||
|
||||
session.entropy_file=
|
||||
session.entropy_length=0
|
||||
|
||||
to your php.ini to preserve pre-PHPX.Y behavior.
|
||||
|
||||
- Deprecated ini directives will now throw an E_CORE_WARNING's
|
||||
instead of the previous E_WARNING's.
|
||||
|
||||
The following directives are marked as deprecated:
|
||||
- magic_quotes_gpc
|
||||
- magic_quotes_runtime
|
||||
- magic_quotes_sybase
|
||||
|
||||
- The following directives, which indicates a removed feature
|
||||
in PHP will now throw an E_CORE_ERROR upon startup like the
|
||||
deprecation warnings.
|
||||
|
||||
The following directives are no longer available:
|
||||
- allow_call_time_pass_reference
|
||||
- define_syslog_variables
|
||||
- highlight.bg
|
||||
- register_globals
|
||||
- register_long_arrays
|
||||
- safe_mode
|
||||
- safe_mode_gid
|
||||
- safe_mode_include_dir
|
||||
- safe_mode_exec_dir
|
||||
- safe_mode_allowed_env_vars
|
||||
- safe_mode_protected_env_vars
|
||||
- zend.ze1_compatibility_mode
|
||||
|
||||
=============================
|
||||
2. Reserved words and classes
|
||||
1. Reserved words and classes
|
||||
=============================
|
||||
|
||||
-
|
||||
- **namespace** and **goto** are now reserved keywords.
|
||||
|
||||
- **Closure** is now a reserved class. (Used by lambda and closure.)
|
||||
|
||||
=====================================
|
||||
3. Changes made to existing functions
|
||||
2. Changes made to existing functions
|
||||
=====================================
|
||||
|
||||
-
|
||||
- The HTTP stream wrapper now considers all status codes from 200 to 399 to be
|
||||
successful.
|
||||
|
||||
- The array functions natsort(), natcasesort(), usort(), uasort(), uksort(),
|
||||
array_flip(), and array_unique() no longer accept objects passed as arguments.
|
||||
If you need to use them to access an object's properties, you must cast the
|
||||
object to an array first.
|
||||
|
||||
- var_dump() output now includes private object members.
|
||||
|
||||
- session_start() now returns FALSE when the session startup fails.
|
||||
|
||||
- property_exists() now checks the existence of a property independent of
|
||||
accessibility (like method_exists()).
|
||||
|
||||
- The $initial parameter for array_reduce can now be of any type.
|
||||
|
||||
- clearstatcache() no longer clears the realpath cache by default.
|
||||
|
||||
- realpath() is no longer system-dependent and works identically on all
|
||||
platforms.
|
||||
|
||||
- call_user_func() now propagates $this even if the callee is the parent class.
|
||||
|
||||
- The filesystem functions opendir(), scandir(), and dir() now use the default
|
||||
context if no context argument is passed.
|
||||
|
||||
- The behaviour of functions with by-reference parameters called by value has
|
||||
changed. Where previously the function would accept the by-value argument, a
|
||||
warning is now emitted and all by-ref parameters are set to NULL.
|
||||
|
||||
- There is now native support for the following math functions: asinh(),
|
||||
acosh(), atanh(), log1p(), and expm1().
|
||||
|
||||
- In the GD extension, there is now pixelation support available through
|
||||
the imagefilter() function.
|
||||
|
||||
- crypt() now has Blowfish and extended DES support, and crypt() features are
|
||||
now 100% portable. PHP has its own internal crypt implementation which drops
|
||||
into place when system support for crypt or crypt_r() is not found.
|
||||
|
||||
- get_cfg_var() is now able to return "array" INI options.
|
||||
|
||||
- Stream wrappers can now be used by the include_path INI directive.
|
||||
|
||||
- These functions now take new parameters:
|
||||
clearstatcache(): $clear_realpath_cache and $filename.
|
||||
copy(): $context
|
||||
fgetcsv(): $escape
|
||||
ini_get_all(): $details
|
||||
json_encode(): $options
|
||||
json_decode(): $depth
|
||||
nl2br(): $is_xhtml
|
||||
parse_ini_file(): $scanner_mode
|
||||
round(): $mode
|
||||
stream_context_create(): $params
|
||||
strstr(), stristr(): $before_needle
|
||||
sybase_connect(): $new
|
||||
|
||||
- And new mode option for fopen: 'n' (O_NONBLOCK)
|
||||
|
||||
- The new mysqlnd library necessitates using MySQL's newer 41-byte password
|
||||
format. Continued use of the old 16 byte passwords will cause mysql_connect()
|
||||
and other related functions to produce the following error message:
|
||||
"mysqlnd cannot connect to MySQL 4.1+ using old authentication"
|
||||
|
||||
- The dl() function is now disabled by default, and only available under the
|
||||
cli, cgi, and embed SAPIs.
|
||||
|
||||
- mail() now supports the logging of sent mail.
|
||||
|
||||
- stream_select(), stream_set_blocking(), stream_set_timeout(), and
|
||||
stream_set_write_buffer() now work with user-space stream wrappers.
|
||||
|
||||
- getopt() accepts "long options" now on all platforms.
|
||||
Optional values and using = as a separator for short options are now
|
||||
supported.
|
||||
|
||||
|
||||
===================================
|
||||
4. Changes made to existing methods
|
||||
3. Changes made to existing methods
|
||||
===================================
|
||||
|
||||
-
|
||||
- The magic methods __get(), __set(), __isset(), __unset(), and __call() should
|
||||
always be public and can no longer be static. Method signatures are enforced.
|
||||
|
||||
- The __call() magic method is now invoked on access to private and protected
|
||||
methods.
|
||||
|
||||
- The __toString() magic method can no longer accept arguments.
|
||||
|
||||
- There is a new magic method, __callStatic().
|
||||
|
||||
- Internal count() vs. count_elements() handler resolution rules have changed.
|
||||
(This could potentially break custom PHP extensions.)
|
||||
|
||||
- The trailing / has been removed from SplFileInfo and other related directory
|
||||
classes.
|
||||
|
||||
- SplFileInfo::getpathinfo() now returns information about the path name.
|
||||
|
||||
- There are new parameters in:
|
||||
Exception::__construct(): $previous
|
||||
|
||||
===================================
|
||||
5. Changes made to existing classes
|
||||
4. Changes made to existing classes
|
||||
===================================
|
||||
|
||||
-
|
||||
- SplObjectStorage now has ArrayAccess support. It is also now possible to
|
||||
store associative information with objects in SplObjectStorage.
|
||||
|
||||
=============
|
||||
6. Deprecated
|
||||
5. Deprecated
|
||||
=============
|
||||
|
||||
-
|
||||
- define_syslog_variables() is deprecated.
|
||||
|
||||
==========
|
||||
7. Removed
|
||||
==========
|
||||
- set_socket_blocking() is deprecated.
|
||||
|
||||
a. removed features
|
||||
- call_user_method() and call_user_method_array() are now deprecated. Use
|
||||
call_user_func() and call_user_func_array() instead.
|
||||
|
||||
- register_globals
|
||||
- register_long_arrays
|
||||
- Safe mode
|
||||
- Session extension bug compatibility mode
|
||||
- y2k_compliance mode
|
||||
- dl() is deprecated.
|
||||
|
||||
b. removed ini directives
|
||||
- The set_magic_quotes_runtime() function is now deprecated.
|
||||
|
||||
- define_syslog_variables
|
||||
- register_globals
|
||||
- register_long_arrays
|
||||
- safe_mode
|
||||
- safe_mode_gid
|
||||
- safe_mode_include_dir
|
||||
- safe_mode_exec_dir
|
||||
- safe_mode_allowed_env_vars
|
||||
- safe_mode_protected_env_vars
|
||||
- session.bug_compat42
|
||||
- session.bug_compat_warn
|
||||
- y2k_compliance
|
||||
- mysql_listtables(), mysql_dropdb(), mysql_createdb(), mysql_list_tables(),
|
||||
mysql_drop_db(), and mysql_create_db() are now deprecated.
|
||||
|
||||
c. removed functions
|
||||
- All ereg functions are now deprecated and emit E_DEPRECATED errors:
|
||||
sql_regcase(), spliti(), split(), ereg_replace(), eregi(),
|
||||
ereg_replace(), and ereg().
|
||||
Use the PCRE family of functions (preg_*()) instead.
|
||||
|
||||
- define_syslog_variables()
|
||||
- import_request_variables()
|
||||
- session_is_registered()
|
||||
- session_register()
|
||||
- session_unregister()
|
||||
- mcrypt_generic_end() is deprecated.
|
||||
|
||||
=============
|
||||
8. Extensions
|
||||
=============
|
||||
- mysql_db_query() is deprecated.
|
||||
|
||||
- mysql_escape_string() is deprecated.
|
||||
|
||||
- session_register(), session_unregister(), and session_is_registered() are now
|
||||
deprecated. Use the $_SESSION superglobal array instead.
|
||||
|
||||
- Comments starting with '#' are now deprecated in .INI files.
|
||||
|
||||
- The following INI directives will now emit an E_DEPRECATED warning
|
||||
upon startup if they are activated:
|
||||
|
||||
- define_syslog_variables
|
||||
- register_globals
|
||||
- register_long_arrays
|
||||
- safe_mode
|
||||
- magic_quotes_gpc
|
||||
- magic_quotes_runtime
|
||||
- magic_quotes_sybase
|
||||
|
||||
- The is_dst parameter to mktime() is deprecated.
|
||||
|
||||
- Assigning the return value of "new" by reference is deprecated
|
||||
|
||||
- Call-time pass-by-reference has been deprecated
|
||||
|
||||
- Usage of {} to access string offsets is deprecated
|
||||
|
||||
- Passing locale category name as string to setlocale() is deprecated.
|
||||
|
||||
===============
|
||||
6. Undeprecated
|
||||
===============
|
||||
|
||||
- By popular request, is_a() is no longer deprecated.
|
||||
|
||||
==============
|
||||
7. Extensions:
|
||||
==============
|
||||
|
||||
a. moved out to PECL and actively maintained there
|
||||
|
||||
-
|
||||
- fdf
|
||||
- ming
|
||||
- ncurses
|
||||
|
||||
b. no longer maintained
|
||||
|
||||
-
|
||||
- dbase
|
||||
- fbsql
|
||||
- msql
|
||||
- sybase (use sybase_ct, which is still in PHP core)
|
||||
- mhash (hash has full BC layer)
|
||||
- mime_magic (use fileinfo, has full BC layer)
|
||||
|
||||
c. with changed behaviour
|
||||
|
||||
- The session extension now can hook into the file upload feature
|
||||
in order to provide upload progress information through session
|
||||
variables.
|
||||
- dns: dns_check_record() will now return an extra "entries" index,
|
||||
containing the TXT elements.
|
||||
|
||||
- datetime: date/time functions will no longer use the TZ environment
|
||||
variable to guess which timezone should be used.
|
||||
|
||||
- cURL now supports SSH
|
||||
|
||||
- hash: The SHA-224 and salsa hash algorithms are now supported.
|
||||
|
||||
- mbstring: Now supports CP850 encoding.
|
||||
|
||||
- oci8: Database Resident Connection Pooling (DRCP) and Fast Application
|
||||
Notification (FAN) are now supported.
|
||||
|
||||
Oracle External Authentication is now supported (except on Windows).
|
||||
|
||||
The oci8 function oci_bind_by_name() now supports SQLT_AFC (aka the
|
||||
CHAR datatype).
|
||||
|
||||
Calling oci_close() on a persistent connection, or when the variable
|
||||
that references a persistent connection goes out of scope, will now
|
||||
trigger a roll back of an uncommitted transaction. To avoid unexpected
|
||||
behavior explicitly issue a commit or roll back as needed. The old
|
||||
behavior can be enabled with the INI directive
|
||||
oci8.old_oci_close_semantics.
|
||||
|
||||
- openssl: OpenSSL digest and cipher functions are now supported.
|
||||
It is also now possible to access the internal values of DSA, RSA and
|
||||
DH keys.
|
||||
|
||||
- session: Sessions will no longer store session-files in "/tmp" when
|
||||
open_basedir restrictions apply, unless "/tmp" is explicitly added to
|
||||
the list of allowed paths.
|
||||
|
||||
- SOAP: Now supports sending user-supplied HTTP headers.
|
||||
|
||||
- MySQLi: Now supports persistent connections by prepending the hostname
|
||||
with "p:".
|
||||
|
||||
d. no longer possible to disable
|
||||
|
||||
-
|
||||
- PCRE
|
||||
- Reflection
|
||||
- SPL
|
||||
|
||||
==========================
|
||||
9. Changes in SAPI support
|
||||
8. Changes in SAPI support
|
||||
==========================
|
||||
|
||||
-
|
||||
- A new "litespeed" SAPI is now available.
|
||||
|
||||
=============================
|
||||
10. Changes in INI directives
|
||||
=============================
|
||||
- FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES
|
||||
for more details.
|
||||
|
||||
- A new CGI SAPI option, -T, can be used to measure execution time of a script
|
||||
repeated several times.
|
||||
|
||||
- CGI/FastCGI now has support for .htaccess style user-defined php.ini files.
|
||||
See the new user_ini.filename and user_ini.cache_ttl INI directives.
|
||||
|
||||
============================
|
||||
9. Changes in INI directives
|
||||
============================
|
||||
|
||||
- zend_extension_debug and zend_extension_ts have been removed. Always use the
|
||||
zend_extension directive to load Zend Extensions.
|
||||
|
||||
- zend.ze1_compatibility_mode has been removed. If this INI directive is set to
|
||||
on, then an E_ERROR is emitted at startup.
|
||||
|
||||
- There is now support for special sections: [PATH=/opt/httpd/www.example.com/]
|
||||
and [HOST=www.example.com]. Directives set in these sections cannot be
|
||||
overridden by user-defined INI files or at runtime.
|
||||
|
||||
- Added mbstring.http_output_conv_mimetype. This directive specifies the
|
||||
regex pattern of content types for which mb_output_handler() is activated.
|
||||
|
||||
- It is now possible to use the full path to load modules using the "extension"
|
||||
directive.
|
||||
|
||||
- "INI variables" can now be used almost anywhere in a php.ini file.
|
||||
|
||||
- It is now possible to use alphanumeric or variable indices in INI option
|
||||
arrays.
|
||||
|
||||
- open_basedir is now PHP_INI_ALL
|
||||
|
||||
- Runtime tightening of open_basedir restrictions is now possible.
|
||||
|
||||
- The default value of session.use_only_cookies has changed to "1".
|
||||
|
||||
- The default value of oci8.default_prefetch has been changed from 10 to 100.
|
||||
|
||||
- A new directive, request_order, controls the behavior of $_REQUEST
|
||||
independently of variables_order.
|
||||
|
||||
- New INI directives:
|
||||
- mail.add_x_header
|
||||
- user_ini.filename
|
||||
- user_ini.cache_ttl
|
||||
- exit_on_timeout
|
||||
- mysqli.allow_persistent
|
||||
- mysqli.default_host
|
||||
- mysqli.default_socket
|
||||
- mysqli.allow_local_infile
|
||||
- mysqli.cache_size
|
||||
- oci8.connection_class
|
||||
- oci8.events
|
||||
- pdo_mysql.default_socket
|
||||
- pdo_mysql.cache_size
|
||||
- sqlite3.extension_dir
|
||||
- mysql.default_socket
|
||||
- mysql.allow_local_infile
|
||||
- mysql.cache_size
|
||||
- mysqlnd.collect_statistics
|
||||
- mysqlnd.collect_memory_statistics
|
||||
- mysqlnd.net_cmd_buffer_size
|
||||
- mysqlnd.net_read_buffer_size
|
||||
- mysqlnd.log_mask
|
||||
|
||||
- Added session.upload_progress.enabled, session.upload_progress.cleanup,
|
||||
session.upload_progress.prefix, session.upload_progress.name,
|
||||
session.upload_progress.freq, session.upload_progress.min_freq.
|
||||
|
||||
====================
|
||||
11. Syntax additions
|
||||
10. Syntax additions
|
||||
====================
|
||||
|
||||
- Array dereferencing.
|
||||
e.g.
|
||||
foo()[0]
|
||||
$foo->bar()[0]
|
||||
- NOWDOC: Similar to HEREDOC, but with single quotes:
|
||||
|
||||
<<<'LABEL' ...
|
||||
|
||||
Static HEREDOCs can be used to initialize static variables and class members
|
||||
or constants:
|
||||
|
||||
static $foo = <<<LABEL
|
||||
No variables here...
|
||||
LABEL;
|
||||
|
||||
- HEREDOC now supports wrapping the identifier with double-quotes, to complement
|
||||
the NOWDOC syntax:
|
||||
|
||||
<<<"LABEL" ...
|
||||
|
||||
- The ?: operator has been introduced:
|
||||
|
||||
var_dump(0 ?: 'Hello!');
|
||||
|
||||
- Namespaces were added:
|
||||
|
||||
namespace my\name;
|
||||
$obj = new \my\name\MyClass;
|
||||
|
||||
- Dynamic access to static methods is now possible:
|
||||
|
||||
$foo::myFunc();
|
||||
|
||||
- Exceptions can now be nested:
|
||||
|
||||
class MyCustomException extends Exception {}
|
||||
try {
|
||||
throw new MyCustomException("Something happend", 112);
|
||||
} catch(Exception $e) {
|
||||
throw new InvalidArgumentException("You are doing it wrong!", 911, $e);
|
||||
}
|
||||
|
||||
- Exceptions can now be handled in destructors.
|
||||
|
||||
- A garbage collector has been added and is enabled by default.
|
||||
|
||||
===================
|
||||
12. Windows support
|
||||
11. Windows support
|
||||
===================
|
||||
|
||||
-
|
||||
- The minimum Windows version is now Windows 2000. (Windows 98, ME and NT4 are
|
||||
no longer supported).
|
||||
|
||||
- PHP Windows binaries target i586 or later. i386 and i486 are not supported.
|
||||
|
||||
- Support for the IIS SAPI has been dropped. Use the FastCGI SAPI instead
|
||||
(available for IIS5 and later)). FastCGI is the recommended way to use PHP
|
||||
with IIS (see http://php.iis.net/).
|
||||
|
||||
- A new build is available based on the latest Visual C++ Compiler (VC9).
|
||||
Its use is recommended with FastCGI or CLI. Apache's Windows binaries are not
|
||||
compatible with VC9; however, you can use Apache Lounge's build
|
||||
(http://apachelounge.com).
|
||||
|
||||
- The x64 binaries are for experimental usage only. They are not meant to be
|
||||
used in production.
|
||||
|
||||
- A new site is available to download Windows releases as well as Windows-only
|
||||
releases: http://windows.php.net. Windows-specific releases will be made to
|
||||
fix security issues in the bundled libraries (libpng, openssl, etc.). Please
|
||||
note that this site does not replace the main PHP site as a source of PHP
|
||||
news, resources, or documentation.
|
||||
|
||||
- Windows support has been added for the following functions: getopt(),
|
||||
imagecolorclosesthwb(), mcrypt_create_iv(), inet_ntop(), inet_pton(),
|
||||
getmxrr(), checkdnsrr(), dns_get_record(), linkinfo(), readlink(),
|
||||
symlink(), link(), fnmatch(), stream_socket_pair(), time_nanosleep(),
|
||||
time_sleep_until(), and socket_create_pair().
|
||||
|
||||
- Crypt supports now all available algorithms on Windows (blowfish included).
|
||||
|
||||
- Improved portability of stat(), touch(), filemtime(), filesize() and related
|
||||
functions (100% portable for the available data).
|
||||
|
||||
- It is now possible to create hard links on Windows using the link() function,
|
||||
and symbolic links using the symlink() function. Hard links are available
|
||||
as of Windows 2000 and symbolic links as of Windows Vista.
|
||||
|
||||
- The PDO_OCI php_pdo_oci8.dll library (for use with Oracle version 8 client
|
||||
libraries) is no longer being built. Instead, use php_pdo_oci.dll (note no
|
||||
'8') with Oracle 10 or 11 client libraries. Connection to other database
|
||||
versions is still supported.
|
||||
|
||||
- For the OCI8 extension, a new library php_oci8_11g.dll is available in
|
||||
addition to php_oci8.dll. Only one can be enabled at any time. Use
|
||||
php_oci8.dll with Oracle 10.2 client libraries. Use php_oci8_11g.dll with
|
||||
Oracle 11 client libraries. Connection to other database versions is still
|
||||
supported.
|
||||
|
||||
- Firebird and SNMP support are no longer available on Windows. Firebird support
|
||||
may be reintroduced in the future.
|
||||
|
||||
===================
|
||||
13. New in PHP X.Y:
|
||||
12. New in PHP 5.3:
|
||||
===================
|
||||
|
||||
a. New libraries
|
||||
|
||||
-
|
||||
- mysqlnd is a new core library shipped with PHP. It is a PHP-specific
|
||||
replacement for libmysql and is recommended for all installations for
|
||||
increased performance.
|
||||
|
||||
b. New extensions
|
||||
|
||||
-
|
||||
- enchant
|
||||
- fileinfo (replaces mime_magic)
|
||||
- intl
|
||||
- Phar
|
||||
- SQLite3
|
||||
|
||||
c. New stream wrappers
|
||||
|
||||
-
|
||||
- glob:// stream wrapper
|
||||
- phar:// stream wrapper for accessing phar archives
|
||||
|
||||
d. New stream filters
|
||||
|
||||
-
|
||||
- "dechunk" (HTTP/1.1 chunked transfer encoding)
|
||||
- The bz2.decompress filter now supports concatenation
|
||||
|
||||
e. New functions
|
||||
|
||||
- Core:
|
||||
- Core: gc_collect_cycles()
|
||||
gc_enabled()
|
||||
gc_enable()
|
||||
gc_disable()
|
||||
class_alias()
|
||||
get_called_class()
|
||||
forward_static_call()
|
||||
forward_static_call_array()
|
||||
str_getcsv()
|
||||
quoted_printable_encode()
|
||||
lcfirst()
|
||||
- Array: array_replace()
|
||||
array_replace_recursive()
|
||||
- Date: date_add()
|
||||
date_sub()
|
||||
date_diff()
|
||||
date_parse_from_format()
|
||||
date_create_from_format()
|
||||
date_get_last_errors()
|
||||
timezone_version_get()
|
||||
- INI: parse_ini_string()
|
||||
- GMP: gmp_testbit()
|
||||
- Hash: hash_copy()
|
||||
- IMAP: imap_gc()
|
||||
imap_utf8_to_mutf7()
|
||||
imap_mutf7_to_utf8()
|
||||
- JSON: json_last_error()
|
||||
- libxml: libxml_disable_entity_loader
|
||||
- MySQLi: mysqli_fetch_all()
|
||||
mysqli_get_connection_stats()
|
||||
mysqli_poll()
|
||||
mysqli_reap_async_query()
|
||||
- Network: gethostname()
|
||||
header_remove()
|
||||
- OpenSSL: openssl_random_pseudo_bytes()
|
||||
- PCNTL: pcntl_signal_dispatch()
|
||||
pcntl_sigprocmask()
|
||||
pcntl_sigwaitinfo()
|
||||
pcntl_sigtimedwait()
|
||||
- PCRE: preg_filter()
|
||||
- SHM: msg_queue_exists()
|
||||
shm_has_var()
|
||||
- Streams: stream_supports_lock()
|
||||
stream_context_set_default()
|
||||
stream_context_get_params()
|
||||
- Userspace stream wrappers:
|
||||
stream_cast()
|
||||
stream_set_options()
|
||||
|
||||
f. New global constants
|
||||
|
||||
- Core:
|
||||
- get_declared_traits()
|
||||
- Core: E_DEPRECATED
|
||||
E_USER_DEPRECATED
|
||||
__DIR__
|
||||
__NAMESPACE__
|
||||
PHP_MAXPATHLEN
|
||||
PHP_WINDOWS_VERSION_MAJOR
|
||||
PHP_WINDOWS_VERSION_MINOR
|
||||
PHP_WINDOWS_VERSION_BUILD
|
||||
PHP_WINDOWS_VERSION_PLATFORM
|
||||
PHP_WINDOWS_VERSION_SP_MAJOR
|
||||
PHP_WINDOWS_VERSION_SP_MINOR
|
||||
PHP_WINDOWS_VERSION_SUITEMASK
|
||||
PHP_WINDOWS_VERSION_PRODUCTTYPE
|
||||
PHP_WINDOWS_NT_DOMAIN_CONTROLLER
|
||||
PHP_WINDOWS_NT_SERVER
|
||||
PHP_WINDOWS_NT_WORKSTATION
|
||||
- INI: INI_SCANNER_NORMAL
|
||||
INI_SCANNER_RAW
|
||||
- cURL CURLOPT_PROGRESSFUNCTION
|
||||
- GD: IMG_FILTER_PIXELATE
|
||||
- JSON: JSON_ERROR_NONE
|
||||
JSON_ERROR_DEPTH
|
||||
JSON_ERROR_STATE_MISMATCH
|
||||
JSON_ERROR_CTRL_CHAR
|
||||
JSON_ERROR_SYNTAX
|
||||
JSON_FORCE_OBJECT
|
||||
JSON_HEX_TAG
|
||||
JSON_HEX_AMP
|
||||
JSON_HEX_APOS
|
||||
JSON_HEX_QUOT
|
||||
- LDAP: LDAP_OPT_NETWORK_TIMEOUT
|
||||
- libxml: LIBXML_LOADED_VERSION
|
||||
- PCRE: PREG_BAD_UTF8_OFFSET_ERROR
|
||||
- PCNTL: SIG_BLOCK
|
||||
SIG_UNBLOCK
|
||||
SIG_SETMASK
|
||||
SI_USER
|
||||
SI_NOINFO
|
||||
SI_KERNEL
|
||||
SI_QUEUE
|
||||
SI_TIMER
|
||||
SI_MESGQ
|
||||
SI_ASYNCIO
|
||||
SI_SIGIO
|
||||
SI_TKILL
|
||||
CLD_EXITED
|
||||
CLD_KILLED
|
||||
CLD_DUMPED
|
||||
CLD_TRAPPED
|
||||
CLD_STOPPED
|
||||
CLD_CONTINUED
|
||||
TRAP_BRKPT
|
||||
TRAP_TRACE
|
||||
POLL_IN
|
||||
POLL_OUT
|
||||
POLL_MSG
|
||||
POLL_ERR
|
||||
POLL_PRI
|
||||
POLL_HUP
|
||||
ILL_ILLOPC
|
||||
ILL_ILLOPN
|
||||
ILL_ILLADR
|
||||
ILL_ILLTRP
|
||||
ILL_PRVOPC
|
||||
ILL_PRVREG
|
||||
ILL_COPROC
|
||||
ILL_BADSTK
|
||||
FPE_INTDIV
|
||||
FPE_INTOVF
|
||||
FPE_FLTDIV
|
||||
FPE_FLTOVF
|
||||
FPE_FLTUND
|
||||
FPE_FLTRES
|
||||
FPE_FLTINV
|
||||
FPE_FLTSUB
|
||||
SEGV_MAPERR
|
||||
SEGV_ACCERR
|
||||
BUS_ADRALN
|
||||
BUS_ADRERR
|
||||
BUS_OBJERR
|
||||
|
||||
g. New classes
|
||||
|
||||
- Reflection:
|
||||
- ReflectionZendExtension
|
||||
- Date: DateInterval
|
||||
DatePeriod
|
||||
- Phar: Phar
|
||||
PharData
|
||||
PharFileInfo
|
||||
PharException
|
||||
- SPL SplDoublyLinkedList
|
||||
SplStack
|
||||
SplQueue
|
||||
SplHeap
|
||||
SplMinHeap
|
||||
SplMaxHeap
|
||||
SplPriorityQueue
|
||||
SplFixedArray
|
||||
FilesystemIterator
|
||||
GlobIterator
|
||||
RecursiveTreeIterator
|
||||
MultipleIterator
|
||||
|
||||
h. New methods
|
||||
|
||||
- Reflection:
|
||||
- ReflectionClass::isCloneable()
|
||||
- ReflectionClass::getTraits()
|
||||
- ReflectionClass::getTraitNames()
|
||||
- ReflectionClass::getTraitAliases()
|
||||
- Date: DateTime::diff()
|
||||
DateTime::add()
|
||||
DateTime::sub()
|
||||
DateTime::createFromFormat()
|
||||
DateTime::getLastErrors()
|
||||
- DOM: DOMNode::getLineNo()
|
||||
- Exception: Exception::getPrevious()
|
||||
- PDO_Firebird: PDO::setAttribute()
|
||||
- Reflection: ReflectionProperty::setAccessible()
|
||||
ReflectionFunction::inNamespace()
|
||||
ReflectionFunction::getNamespaceName()
|
||||
ReflectionFunction::getShortName()
|
||||
ReflectionClass::inNamespace()
|
||||
ReflectionClass::getNamespaceName()
|
||||
ReflectionClass::getShortName()
|
||||
- SPL SplObjectStorage::addAll()
|
||||
SplObjectStorage::removeAll()
|
||||
- XSL: XSLTProcessor::setProfiling()
|
||||
|
||||
i. New class constants
|
||||
|
||||
-
|
||||
|
||||
j. New Hash algorithms
|
||||
|
||||
- fnv132
|
||||
- fnv164
|
||||
- joaat
|
||||
- PDO_Firebird: PDO::FB_ATTR_DATE_FORMAT
|
||||
PDO::FB_ATTR_TIME_FORMAT
|
||||
PDO::FB_ATTR_TIMESTAMP_FORMAT
|
||||
+5
-6
@@ -17,7 +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_strtod.c zend_closures.c zend_float.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
@@ -31,20 +31,19 @@ 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
|
||||
$(LEMON) $(LEMON_FLAGS) $(srcdir)/zend_language_parser.y || test $$? -eq 2
|
||||
|
||||
$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c
|
||||
|
||||
# INI parser/scanner rules
|
||||
|
||||
zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
|
||||
$(LEMON) $(LEMON_FLAGS) $(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
|
||||
|
||||
|
||||
@@ -243,10 +243,6 @@ SOURCE=.\zend_stream.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_string.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -415,10 +411,6 @@ SOURCE=.\zend_stream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_string.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -419,11 +419,4 @@ if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(whether /dev/arandom exists)
|
||||
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
|
||||
AC_DEFINE([HAVE_DEV_ARANDOM], 1, [Define if the target system has /dev/arandom device])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
@@ -273,10 +273,6 @@ SOURCE=.\zend_stream.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_string.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -449,10 +445,6 @@ SOURCE=.\zend_stream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_string.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -2,6 +2,39 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
bison_version=none
|
||||
if test "$YACC"; then
|
||||
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
|
||||
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
|
||||
php_cv_bison_version=invalid
|
||||
if test -n "$bison_version_vars"; then
|
||||
set $bison_version_vars
|
||||
bison_version="${1}.${2}"
|
||||
for bison_check_version in $bison_version_list; do
|
||||
if test "$bison_version" = "$bison_check_version"; then
|
||||
php_cv_bison_version="$bison_check_version (ok)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
fi
|
||||
case $php_cv_bison_version in
|
||||
""|invalid[)]
|
||||
bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found: $bison_version)."
|
||||
AC_MSG_WARN([$bison_msg])
|
||||
YACC="exit 0;"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([ZEND_FP_EXCEPT],[
|
||||
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
|
||||
AC_TRY_COMPILE([
|
||||
|
||||
@@ -3,6 +3,7 @@ if (function_exists("date_default_timezone_set")) {
|
||||
date_default_timezone_set("UTC");
|
||||
}
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
function simple() {
|
||||
$a = 0;
|
||||
for ($i = 0; $i < 1000000; $i++)
|
||||
|
||||
@@ -1,285 +0,0 @@
|
||||
<?php
|
||||
|
||||
function hallo() {
|
||||
}
|
||||
|
||||
function simpleucall($n) {
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
hallo();
|
||||
}
|
||||
|
||||
function simpleudcall($n) {
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
hallo2();
|
||||
}
|
||||
|
||||
function hallo2() {
|
||||
}
|
||||
|
||||
function simpleicall($n) {
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
func_num_args();
|
||||
}
|
||||
|
||||
class Foo {
|
||||
static $a = 0;
|
||||
public $b = 0;
|
||||
const TEST = 0;
|
||||
|
||||
static function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = self::$a;
|
||||
}
|
||||
}
|
||||
|
||||
static function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function f() {
|
||||
}
|
||||
|
||||
static function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::f();
|
||||
}
|
||||
}
|
||||
|
||||
function read_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function write_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function assign_add_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b += 2;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
++$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
--$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function post_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b++;
|
||||
}
|
||||
}
|
||||
|
||||
function post_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b--;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function g() {
|
||||
}
|
||||
|
||||
function call($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->g();
|
||||
}
|
||||
}
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this::TEST;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = Foo::$a;
|
||||
}
|
||||
}
|
||||
|
||||
function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::f();
|
||||
}
|
||||
}
|
||||
|
||||
function create_object($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = new Foo();
|
||||
}
|
||||
}
|
||||
|
||||
define('TEST', null);
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = TEST;
|
||||
}
|
||||
}
|
||||
|
||||
/*****/
|
||||
|
||||
function empty_loop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
}
|
||||
}
|
||||
|
||||
function getmicrotime()
|
||||
{
|
||||
$t = gettimeofday();
|
||||
return ($t['sec'] + $t['usec'] / 1000000);
|
||||
}
|
||||
|
||||
function start_test()
|
||||
{
|
||||
ob_start();
|
||||
return getmicrotime();
|
||||
}
|
||||
|
||||
function end_test($start, $name, $overhead = null)
|
||||
{
|
||||
global $total;
|
||||
global $last_time;
|
||||
$end = getmicrotime();
|
||||
ob_end_clean();
|
||||
$last_time = $end-$start;
|
||||
$total += $last_time;
|
||||
$num = number_format($last_time,3);
|
||||
$pad = str_repeat(" ", 24-strlen($name)-strlen($num));
|
||||
if (is_null($overhead)) {
|
||||
echo $name.$pad.$num."\n";
|
||||
} else {
|
||||
$num2 = number_format($last_time - $overhead,3);
|
||||
echo $name.$pad.$num." ".$num2."\n";
|
||||
}
|
||||
ob_start();
|
||||
return getmicrotime();
|
||||
}
|
||||
|
||||
function total()
|
||||
{
|
||||
global $total;
|
||||
$pad = str_repeat("-", 24);
|
||||
echo $pad."\n";
|
||||
$num = number_format($total,3);
|
||||
$pad = str_repeat(" ", 24-strlen("Total")-strlen($num));
|
||||
echo "Total".$pad.$num."\n";
|
||||
}
|
||||
|
||||
const N = 5000000;
|
||||
|
||||
$t0 = $t = start_test();
|
||||
empty_loop(N);
|
||||
$t = end_test($t, 'empty_loop');
|
||||
$overhead = $last_time;
|
||||
simpleucall(N);
|
||||
$t = end_test($t, 'func()', $overhead);
|
||||
simpleudcall(N);
|
||||
$t = end_test($t, 'undef_func()', $overhead);
|
||||
simpleicall(N);
|
||||
$t = end_test($t, 'int_func()', $overhead);
|
||||
Foo::read_static(N);
|
||||
$t = end_test($t, '$x = self::$x', $overhead);
|
||||
Foo::write_static(N);
|
||||
$t = end_test($t, 'self::$x = 0', $overhead);
|
||||
Foo::isset_static(N);
|
||||
$t = end_test($t, 'isset(self::$x)', $overhead);
|
||||
Foo::empty_static(N);
|
||||
$t = end_test($t, 'empty(self::$x)', $overhead);
|
||||
read_static(N);
|
||||
$t = end_test($t, '$x = Foo::$x', $overhead);
|
||||
write_static(N);
|
||||
$t = end_test($t, 'Foo::$x = 0', $overhead);
|
||||
isset_static(N);
|
||||
$t = end_test($t, 'isset(Foo::$x)', $overhead);
|
||||
empty_static(N);
|
||||
$t = end_test($t, 'empty(Foo::$x)', $overhead);
|
||||
Foo::call_static(N);
|
||||
$t = end_test($t, 'self::f()', $overhead);
|
||||
call_static(N);
|
||||
$t = end_test($t, 'Foo::f()', $overhead);
|
||||
$x = new Foo();
|
||||
$x->read_prop(N);
|
||||
$t = end_test($t, '$x = $this->x', $overhead);
|
||||
$x->write_prop(N);
|
||||
$t = end_test($t, '$this->x = 0', $overhead);
|
||||
$x->assign_add_prop(N);
|
||||
$t = end_test($t, '$this->x += 2', $overhead);
|
||||
$x->pre_inc_prop(N);
|
||||
$t = end_test($t, '++$this->x', $overhead);
|
||||
$x->pre_dec_prop(N);
|
||||
$t = end_test($t, '--$this->x', $overhead);
|
||||
$x->post_inc_prop(N);
|
||||
$t = end_test($t, '$this->x++', $overhead);
|
||||
$x->post_dec_prop(N);
|
||||
$t = end_test($t, '$this->x--', $overhead);
|
||||
$x->isset_prop(N);
|
||||
$t = end_test($t, 'isset($this->x)', $overhead);
|
||||
$x->empty_prop(N);
|
||||
$t = end_test($t, 'empty($this->x)', $overhead);
|
||||
$x->call(N);
|
||||
$t = end_test($t, '$this->f()', $overhead);
|
||||
$x->read_const(N);
|
||||
$t = end_test($t, '$x = Foo::TEST', $overhead);
|
||||
create_object(N);
|
||||
$t = end_test($t, 'new Foo()', $overhead);
|
||||
read_const(N);
|
||||
$t = end_test($t, '$x = TEST', $overhead);
|
||||
total($t0, "Total");
|
||||
@@ -12,4 +12,4 @@ foo(123);
|
||||
--EXPECTF--
|
||||
3
|
||||
|
||||
Catchable fatal error: Argument 1 passed to foo() must be of the type array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
|
||||
@@ -17,8 +17,22 @@ array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,17 +20,46 @@ array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
[2]=>
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,29 @@ var_dump($a);
|
||||
$a->b = null;
|
||||
$a = null;
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["b"]=>
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
&array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
[2]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,16 +12,30 @@ var_dump($a);
|
||||
$a->x0->y1 = "ok\n";
|
||||
echo $a->x0;
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["x0"]=>
|
||||
&object(stdClass)#%d (3) {
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#2 (3) {
|
||||
["y0"]=>
|
||||
string(1) "b"
|
||||
["y1"]=>
|
||||
*RECURSION*
|
||||
["y2"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
ok
|
||||
@@ -30,9 +30,7 @@ if (defined("pass3")) {
|
||||
set_error_handler('errorHandler');
|
||||
define("pass2", 1);
|
||||
include(__FILE__);
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
--EXPECTF--
|
||||
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
|
||||
@@ -4,6 +4,7 @@ Bug #35655 (whitespace following end of heredoc is lost)
|
||||
highlight.string = #DD0000
|
||||
highlight.comment = #FF8000
|
||||
highlight.keyword = #007700
|
||||
highlight.bg = #FFFFFF
|
||||
highlight.default = #0000BB
|
||||
highlight.html = #000000
|
||||
--FILE--
|
||||
|
||||
@@ -4,6 +4,7 @@ Bug #42767 (highlight_string() truncates trailing comments)
|
||||
highlight.string = #DD0000
|
||||
highlight.comment = #FF8000
|
||||
highlight.keyword = #007700
|
||||
highlight.bg = #FFFFFF
|
||||
highlight.default = #0000BB
|
||||
highlight.html = #000000
|
||||
--FILE--
|
||||
|
||||
@@ -43,11 +43,11 @@ __call:
|
||||
string(3) "ABC"
|
||||
__call:
|
||||
string(3) "ABC"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "XYZ"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "WWW"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "ABC"
|
||||
__callstatic:
|
||||
string(1) "A"
|
||||
|
||||
@@ -35,17 +35,17 @@ call_user_func('self::y');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "ABC"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "ABC"
|
||||
__call:
|
||||
string(3) "xyz"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(3) "www"
|
||||
__call:
|
||||
string(1) "y"
|
||||
__callstatic:
|
||||
__call:
|
||||
string(1) "y"
|
||||
ok
|
||||
__callstatic:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Bug #45877 (Array key '2147483647' left as string)
|
||||
--INI--
|
||||
precision=16
|
||||
precision=20
|
||||
--FILE--
|
||||
<?php
|
||||
$keys = array(PHP_INT_MAX,
|
||||
@@ -18,6 +18,6 @@ array(3) {
|
||||
int(1)
|
||||
[-%d8]=>
|
||||
int(1)
|
||||
["%s"]=>
|
||||
["%d8"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -12,4 +12,4 @@ function __autoload($class) {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%string|unicode%(11) "Foo\Bar\Baz"
|
||||
%string|unicode%(12) "\Foo\Bar\Baz"
|
||||
@@ -29,6 +29,8 @@ $b->A();
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Redefining already defined constructor for class A in %s on line %d
|
||||
B::__construct
|
||||
A::__construct
|
||||
B::A
|
||||
|
||||
@@ -16,4 +16,7 @@ $c = new c();
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Strict Standards: Redefining already defined constructor for class a in %s on line %d
|
||||
|
||||
Fatal error: Call to undefined method b::b() in %s on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP>=5.3)
|
||||
--FILE--
|
||||
#!php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Test
|
||||
*/
|
||||
printf("__COMPILER_HALT_OFFSET__ is %d\n",__COMPILER_HALT_OFFSET__);
|
||||
|
||||
__halt_compiler();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
__COMPILER_HALT_OFFSET__ is 116
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #49893 (Crash while creating an instance of Zend_Mail_Storage_Pop3)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
function __destruct() {
|
||||
try {
|
||||
throw new Exception("2");
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
class B {
|
||||
function __construct() {
|
||||
$this->a = new A();
|
||||
throw new Exception("1");
|
||||
}
|
||||
}
|
||||
try {
|
||||
$b = new B();
|
||||
} catch(Exception $e) {
|
||||
echo $e->getMessage() . "\n";;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
2
|
||||
1
|
||||
@@ -1,130 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class myClass {
|
||||
public static function __callStatic($method, $args) {
|
||||
throw new Exception("Missing static method '$method'\n");
|
||||
}
|
||||
public function __call($method, $args) {
|
||||
throw new Exception("Missing method '$method'\n");
|
||||
}
|
||||
}
|
||||
|
||||
function thrower() {
|
||||
myClass::ThrowException();
|
||||
}
|
||||
function thrower2() {
|
||||
$x = new myClass;
|
||||
$x->foo();
|
||||
}
|
||||
|
||||
try {
|
||||
thrower();
|
||||
} catch(Exception $e) {
|
||||
print $e->getMessage();
|
||||
print_r($e->getTrace());
|
||||
}
|
||||
|
||||
try {
|
||||
thrower2();
|
||||
} catch (Exception $e) {
|
||||
print $e->getMessage();
|
||||
print_r($e->getTrace());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Missing static method 'ThrowException'
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 13
|
||||
[function] => __callStatic
|
||||
[class] => myClass
|
||||
[type] => ::
|
||||
[args] => Array
|
||||
(
|
||||
[0] => ThrowException
|
||||
[1] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 13
|
||||
[function] => ThrowException
|
||||
[class] => myClass
|
||||
[type] => ::
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 21
|
||||
[function] => thrower
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
Missing method 'foo'
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 17
|
||||
[function] => __call
|
||||
[class] => myClass
|
||||
[type] => ->
|
||||
[args] => Array
|
||||
(
|
||||
[0] => foo
|
||||
[1] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 17
|
||||
[function] => foo
|
||||
[class] => myClass
|
||||
[type] => ->
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[file] => %s
|
||||
[line] => 28
|
||||
[function] => thrower2
|
||||
[args] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Bug #50810 (property_exists does not work for private)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ExampleSuperClass
|
||||
{
|
||||
private $foo;
|
||||
static protected $bar;
|
||||
|
||||
private function foo()
|
||||
{
|
||||
}
|
||||
|
||||
public function propertyFooExists()
|
||||
{
|
||||
return property_exists($this, 'foo');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ExampleSubClass extends ExampleSuperClass
|
||||
{
|
||||
public function methodExists()
|
||||
{
|
||||
return method_exists($this, 'foo');
|
||||
}
|
||||
|
||||
public function propertyBarExists()
|
||||
{
|
||||
return property_exists($this, 'bar');
|
||||
}
|
||||
}
|
||||
|
||||
$example = new ExampleSubClass();
|
||||
var_dump($example->methodExists());
|
||||
var_dump(method_exists($example, 'propertyFooExists'));
|
||||
var_dump($example->propertyFooExists());
|
||||
var_dump($example->propertyBarExists());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51176 (Static calling in non-static method behaves like $this->)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function start()
|
||||
{
|
||||
self::bar();
|
||||
static::bar();
|
||||
Foo::bar();
|
||||
}
|
||||
|
||||
public function __call($n, $a)
|
||||
{
|
||||
echo "instance\n";
|
||||
}
|
||||
|
||||
public static function __callStatic($n, $a)
|
||||
{
|
||||
echo "static\n";
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$foo->start();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
static
|
||||
static
|
||||
static
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51394 (Error line reported incorrectly if error handler throws an exception)
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
--FILE--
|
||||
<?php
|
||||
function eh()
|
||||
{
|
||||
throw new Exception("error!");
|
||||
return false;
|
||||
}
|
||||
|
||||
set_error_handler("eh");
|
||||
$a = $empty($b);
|
||||
--EXPECTF--
|
||||
Fatal error: Function name must be a string in %sbug51394.php on line 9
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51421 (Abstract __construct constructor argument list not enforced)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ExampleClass {}
|
||||
|
||||
abstract class TestInterface {
|
||||
abstract public function __construct(ExampleClass $var);
|
||||
}
|
||||
|
||||
class Test extends TestInterface {
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of Test::__construct() must be compatible with that of TestInterface::__construct() in %s on line %d
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51791 (constant() failed to check undefined constant and php interpreter stoped)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
const B = 1;
|
||||
}
|
||||
var_dump(constant('A::B1'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: constant(): Couldn't find constant A::B1 in %s on line %d
|
||||
NULL
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51822 (Segfault with strange __destruct() for static class variables)
|
||||
--FILE--
|
||||
<?php
|
||||
class DestructableObject
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
echo "2\n";
|
||||
}
|
||||
}
|
||||
|
||||
class DestructorCreator
|
||||
{
|
||||
public function __destruct()
|
||||
{
|
||||
$this->test = new DestructableObject;
|
||||
echo "1\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Test
|
||||
{
|
||||
public static $mystatic;
|
||||
}
|
||||
|
||||
// Uncomment this to avoid segfault
|
||||
//Test::$mystatic = new DestructorCreator();
|
||||
|
||||
$x = new Test();
|
||||
|
||||
if (!isset(Test::$mystatic))
|
||||
Test::$mystatic = new DestructorCreator();
|
||||
|
||||
echo "bla\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
bla
|
||||
1
|
||||
2
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #51827 (Bad warning when register_shutdown_function called with wrong num of parameters)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
function abc() {
|
||||
var_dump(1);
|
||||
}
|
||||
|
||||
register_shutdown_function('timE');
|
||||
register_shutdown_function('ABC');
|
||||
register_shutdown_function('exploDe');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
|
||||
Warning: explode() expects at least 2 parameters, 0 given in Unknown on line %d
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52001 (Memory allocation problems after using variable variables)
|
||||
--FILE--
|
||||
<?php
|
||||
a(0,$$var);
|
||||
|
||||
$temp1=1;
|
||||
$temp2=2;
|
||||
var_dump($temp1);
|
||||
|
||||
function a($b,$c) {}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: var in %sbug52001.php on line 2
|
||||
|
||||
Notice: Undefined variable: in %sbug52001.php on line 2
|
||||
int(1)
|
||||
@@ -1,75 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52041 (Memory leak when writing on uninitialized variable returned from function)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
return $x;
|
||||
}
|
||||
|
||||
foo()->a = 1;
|
||||
foo()->a->b = 2;
|
||||
foo()->a++;
|
||||
foo()->a->b++;
|
||||
foo()->a += 2;
|
||||
foo()->a->b += 2;
|
||||
|
||||
foo()[0] = 1;
|
||||
foo()[0][0] = 2;
|
||||
foo()[0]++;
|
||||
foo()[0][0]++;
|
||||
foo()[0] += 2;
|
||||
foo()[0][0] += 2;
|
||||
|
||||
var_dump(foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 6
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 7
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 8
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 9
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value in %sbug52041.php on line 10
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Strict Standards: Creating default object from empty value 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
|
||||
|
||||
Notice: Undefined variable: x in %stests/bug52041.php on line 3
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 15
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 16
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 16
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 17
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 18
|
||||
|
||||
Notice: Undefined offset: 0 in %sbug52041.php on line 18
|
||||
|
||||
Notice: Undefined variable: x in %sbug52041.php on line 3
|
||||
NULL
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class AA {
|
||||
function AA() { echo "foo\n"; }
|
||||
}
|
||||
class bb extends AA {}
|
||||
class CC extends bb {
|
||||
function CC() { parent::bb(); }
|
||||
}
|
||||
new CC();
|
||||
|
||||
class A {
|
||||
function A() { echo "bar\n"; }
|
||||
}
|
||||
class B extends A {}
|
||||
class C extends B {
|
||||
function C() { parent::B(); }
|
||||
}
|
||||
new C();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
foo
|
||||
bar
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52060 (Memory leak when passing a closure to method_exists())
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$closure = function($a) { echo $a; };
|
||||
|
||||
var_dump(method_exists($closure, '__invoke')); // true
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52160 (Invalid E_STRICT redefined constructor error)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class bar {
|
||||
function __construct() { }
|
||||
static function bar() {
|
||||
var_dump(1);
|
||||
}
|
||||
}
|
||||
|
||||
bar::bar();
|
||||
|
||||
class foo {
|
||||
static function foo() {
|
||||
var_dump(2);
|
||||
}
|
||||
function __construct() { }
|
||||
}
|
||||
|
||||
foo::foo();
|
||||
|
||||
class baz {
|
||||
static function baz() {
|
||||
var_dump(3);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class foo in %s on line %d
|
||||
|
||||
Fatal error: Constructor baz::baz() cannot be static in %s on line %d
|
||||
@@ -1,78 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52193 (converting closure to array yields empty array)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump((array) 1);
|
||||
var_dump((array) NULL);
|
||||
var_dump((array) new stdclass);
|
||||
var_dump($h = (array) function () { return 2; });
|
||||
var_dump($h[0]());
|
||||
|
||||
$i = function () use (&$h) {
|
||||
return $h;
|
||||
};
|
||||
|
||||
var_dump($x = (array)$i);
|
||||
var_dump($y = $x[0]);
|
||||
var_dump($y());
|
||||
|
||||
$items = range(1, 5);
|
||||
$func = function(){ return 'just a test'; };
|
||||
|
||||
array_splice($items, 0 , 4, $func);
|
||||
var_dump($items);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
int(2)
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["h"]=>
|
||||
&array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["h"]=>
|
||||
&array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #52237 (Crash when passing the reference of the property of a non-object)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = 'test';
|
||||
preg_match('//', '', $data->info);
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: Attempt to modify property of non-object in %sbug52237.php on line 3
|
||||
string(4) "test"
|
||||
@@ -28,9 +28,9 @@ foo::BAZ();
|
||||
--EXPECT--
|
||||
nonstatic
|
||||
string(6) "fOoBaR"
|
||||
static
|
||||
nonstatic
|
||||
string(6) "foOBAr"
|
||||
static
|
||||
nonstatic
|
||||
string(6) "fOOBAr"
|
||||
static
|
||||
string(3) "bAr"
|
||||
|
||||
@@ -30,5 +30,5 @@ a::Foo();
|
||||
--EXPECT--
|
||||
__callstatic: Test
|
||||
__call: Test
|
||||
__callstatic: Bar
|
||||
__call: Bar
|
||||
__callstatic: Foo
|
||||
@@ -1,74 +0,0 @@
|
||||
--TEST--
|
||||
Closure 005: Lambda inside class, lifetime of $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private $x;
|
||||
|
||||
function __construct($x) {
|
||||
$this->x = $x;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
echo "Destroyed\n";
|
||||
}
|
||||
|
||||
function getIncer($val) {
|
||||
return function() use ($val) {
|
||||
$this->x += $val;
|
||||
};
|
||||
}
|
||||
|
||||
function getPrinter() {
|
||||
return function() {
|
||||
echo $this->x."\n";
|
||||
};
|
||||
}
|
||||
|
||||
function getError() {
|
||||
return static function() {
|
||||
echo $this->x."\n";
|
||||
};
|
||||
}
|
||||
|
||||
function printX() {
|
||||
echo $this->x."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A(3);
|
||||
$incer = $a->getIncer(2);
|
||||
$printer = $a->getPrinter();
|
||||
$error = $a->getError();
|
||||
|
||||
$a->printX();
|
||||
$printer();
|
||||
$incer();
|
||||
$a->printX();
|
||||
$printer();
|
||||
|
||||
unset($a);
|
||||
|
||||
$incer();
|
||||
$printer();
|
||||
|
||||
unset($incer);
|
||||
$printer();
|
||||
|
||||
unset($printer);
|
||||
|
||||
$error();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
3
|
||||
3
|
||||
5
|
||||
5
|
||||
7
|
||||
7
|
||||
Destroyed
|
||||
|
||||
Fatal error: Using $this when not in object context in %sclosure_005.php on line 28
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Closure 007: Nested lambdas in classes
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private $x = 0;
|
||||
|
||||
function getClosureGetter () {
|
||||
return function () {
|
||||
return function () {
|
||||
$this->x++;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function printX () {
|
||||
echo $this->x."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->printX();
|
||||
$getClosure = $a->getClosureGetter();
|
||||
$a->printX();
|
||||
$closure = $getClosure();
|
||||
$a->printX();
|
||||
$closure();
|
||||
$a->printX();
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
Done
|
||||
@@ -23,18 +23,27 @@ var_dump($y()->test);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(foo)#%d (2) {
|
||||
object(foo)#%d (%d) {
|
||||
["test":"foo":private]=>
|
||||
int(3)
|
||||
["a"]=>
|
||||
object(Closure)#%d (2) {
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
&object(foo)#%d (2) {
|
||||
["test":"foo":private]=>
|
||||
int(3)
|
||||
["a"]=>
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
["this"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
bool(true)
|
||||
|
||||
@@ -1,26 +1,16 @@
|
||||
--TEST--
|
||||
Closure 024: Clone the Closure object
|
||||
Closure 024: Trying to clone the Closure object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 1;
|
||||
$c = function($add) use(&$a) { return $a+$add; };
|
||||
$a = function () {
|
||||
return clone function () {
|
||||
return 1;
|
||||
};
|
||||
};
|
||||
|
||||
$cc = clone $c;
|
||||
$a();
|
||||
|
||||
echo $c(10)."\n";
|
||||
echo $cc(10)."\n";
|
||||
|
||||
$a++;
|
||||
|
||||
echo $c(10)."\n";
|
||||
echo $cc(10)."\n";
|
||||
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
11
|
||||
11
|
||||
12
|
||||
12
|
||||
Done.
|
||||
Fatal error: Trying to clone an uncloneable object of class Closure in %s on line %d
|
||||
@@ -32,9 +32,7 @@ object(foo)#%d (1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (1) {
|
||||
["this"]=>
|
||||
*RECURSION*
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,12 +41,7 @@ int(1)
|
||||
string(1) "a"
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Closure)#%d (1) {
|
||||
["this"]=>
|
||||
object(foo)#%d (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
@@ -9,11 +9,17 @@ var_dump($a);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(Closure)#%d (1) {
|
||||
object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
&object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -18,8 +18,14 @@ var_dump($x());
|
||||
object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["x"]=>
|
||||
*RECURSION*
|
||||
[%u|b%"x"]=>
|
||||
&object(Closure)#%d (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
[%u|b%"x"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Closure 036: Rebinding closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private $x;
|
||||
|
||||
public function __construct($v) {
|
||||
$this->x = $v;
|
||||
}
|
||||
|
||||
public function getIncrementor() {
|
||||
return function() { return ++$this->x; };
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A(0);
|
||||
$b = new A(10);
|
||||
|
||||
$ca = $a->getIncrementor();
|
||||
$cb = $ca->bindTo($b);
|
||||
$cb2 = Closure::bind($b, $ca);
|
||||
|
||||
var_dump($ca());
|
||||
var_dump($cb());
|
||||
var_dump($cb2());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(11)
|
||||
int(12)
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Closure 037: self:: and static:: within closures
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
private $x = 0;
|
||||
|
||||
function getClosure () {
|
||||
return function () {
|
||||
$this->x++;
|
||||
self::printX();
|
||||
self::print42();
|
||||
static::print42();
|
||||
};
|
||||
}
|
||||
|
||||
function printX () {
|
||||
echo $this->x."\n";
|
||||
}
|
||||
|
||||
function print42() {
|
||||
echo "42\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
function print42() {
|
||||
echo "forty two\n";
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$closure = $a->getClosure();
|
||||
$closure();
|
||||
$b = new B;
|
||||
$closure = $b->getClosure();
|
||||
$closure();
|
||||
?>
|
||||
Done.
|
||||
--EXPECTF--
|
||||
1
|
||||
42
|
||||
42
|
||||
1
|
||||
42
|
||||
forty two
|
||||
Done.
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function a() {
|
||||
return array(1,array(5));
|
||||
}
|
||||
var_dump(a()[1][0]); // int(5)
|
||||
|
||||
function b() {
|
||||
return array();
|
||||
}
|
||||
var_dump(b()[0]); // Notice: Undefined offset: 0
|
||||
|
||||
class foo {
|
||||
public $y = 1;
|
||||
|
||||
public function test() {
|
||||
return array(array(array('foobar')));
|
||||
}
|
||||
}
|
||||
|
||||
function c() {
|
||||
return array(new foo);
|
||||
}
|
||||
var_dump(c()[0]->y); // int(1)
|
||||
|
||||
function d() {
|
||||
$obj = new foo;
|
||||
return $obj->test();
|
||||
}
|
||||
var_dump(d()[0][0][0][3]); // string(1) "b"
|
||||
|
||||
function e() {
|
||||
$y = 'bar';
|
||||
$x = array('a' => 'foo', 'b' => $y);
|
||||
return $x;
|
||||
}
|
||||
var_dump(e()['b']); // string(3) "bar"
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(5)
|
||||
|
||||
Notice: Undefined offset: 0 in %s on line %d
|
||||
NULL
|
||||
int(1)
|
||||
string(1) "b"
|
||||
string(3) "bar"
|
||||
@@ -1,79 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference on method calls
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public function bar() {
|
||||
$x = array();
|
||||
$x[] = 3;
|
||||
$x[] = array(1, 5);
|
||||
$x[] = new foo;
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
var_dump($x = $foo->bar()[1]);
|
||||
var_dump($foo->bar()[1][1]);
|
||||
var_dump($x[0]);
|
||||
var_dump($x = $foo->bar()[2]);
|
||||
var_dump($x->bar());
|
||||
var_dump($x->bar()[0]);
|
||||
|
||||
$x = array();
|
||||
$x[] = new foo;
|
||||
var_dump($x[0]->bar()[2]);
|
||||
var_dump($foo->bar()[2]->bar()[1]);
|
||||
var_dump($foo->bar()[2]->bar()[2]->bar()[1][0]);
|
||||
var_dump($foo->bar()[2]->bar()[2]->bar()[1][0][1]);
|
||||
var_dump($foo->bar()[2]->bar()[2]->bar()[4]);
|
||||
var_dump($foo->bar()[3]->bar());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
int(5)
|
||||
int(1)
|
||||
object(foo)#2 (0) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
[2]=>
|
||||
object(foo)#3 (0) {
|
||||
}
|
||||
}
|
||||
int(3)
|
||||
object(foo)#3 (0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(5)
|
||||
}
|
||||
int(1)
|
||||
NULL
|
||||
|
||||
Notice: Undefined offset: 4 in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined offset: 3 in %s on line %d
|
||||
|
||||
Fatal error: Call to a member function bar() on a non-object in %s on line %d
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference on method calls
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x = 2;
|
||||
public function a() {
|
||||
$x = array();
|
||||
$x[] = new foo;
|
||||
return $x;
|
||||
}
|
||||
public function b() {
|
||||
return array(1.2, array(new self));
|
||||
}
|
||||
public function c() {
|
||||
$a = array();
|
||||
$b = &$a;
|
||||
$b[] = true;
|
||||
return $a;
|
||||
}
|
||||
public function d() {
|
||||
return $this->b();
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
var_dump($foo->a()[0]->x);
|
||||
var_dump($foo->a()[0]);
|
||||
var_dump($foo->b()[1][0]->a()[0]->x);
|
||||
var_dump($foo->c()[0]);
|
||||
var_dump($foo->d()[0]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2)
|
||||
object(foo)#%d (1) {
|
||||
["x"]=>
|
||||
int(2)
|
||||
}
|
||||
int(2)
|
||||
bool(true)
|
||||
float(1.2)
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference on __invoke() result
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x = array();
|
||||
public function __construct() {
|
||||
$h = array();
|
||||
$h[] = new stdclass;
|
||||
$this->x = $h;
|
||||
}
|
||||
public function __invoke() {
|
||||
return $this->x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$fo = new foo;
|
||||
var_dump($fo()[0]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference on object that implements ArrayAccess
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class obj implements arrayaccess {
|
||||
private $container = array();
|
||||
public function __construct() {
|
||||
$this->container = array(
|
||||
"one" => 1,
|
||||
"two" => 2,
|
||||
"three" => 3,
|
||||
);
|
||||
}
|
||||
public function offsetSet($offset, $value) {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
public function offsetGet($offset) {
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
}
|
||||
|
||||
function x() {
|
||||
return new obj;
|
||||
}
|
||||
var_dump(x()['two']);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference and references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function &foo(&$foo) {
|
||||
return $foo;
|
||||
}
|
||||
|
||||
$a = array(1);
|
||||
foo($a)[0] = 2;
|
||||
var_dump($a);
|
||||
|
||||
foo($a)[] = 3;
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Trying to write on method return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x = array();
|
||||
|
||||
public function b() {
|
||||
return $this->x;
|
||||
}
|
||||
|
||||
public function c() {
|
||||
return $x;
|
||||
}
|
||||
|
||||
static public function d() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
$foo->b()[0] = 1;
|
||||
|
||||
$foo->c()[100] = 2;
|
||||
|
||||
foo::d()[] = 3;
|
||||
|
||||
print "ok\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: x in %s on line %d
|
||||
ok
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference with dynamic method name and references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x = array(1);
|
||||
|
||||
public function &b() {
|
||||
return $this->x;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
$a = 'b';
|
||||
var_dump($foo->$a()[0]);
|
||||
|
||||
$h = &$foo->$a();
|
||||
$h[] = 2;
|
||||
var_dump($foo->$a());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference with references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$a = array();
|
||||
|
||||
function &a() {
|
||||
return $GLOBALS['a'];
|
||||
}
|
||||
|
||||
var_dump($h =& a());
|
||||
$h[] = 1;
|
||||
var_dump(a()[0]);
|
||||
|
||||
$h[] = array($h);
|
||||
var_dump(a()[1][0][0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Testing dereference in non-array values
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function a() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
$a = 1;
|
||||
var_dump($a[1]);
|
||||
var_dump(a()[1]);
|
||||
|
||||
function b() {
|
||||
return new stdClass;
|
||||
}
|
||||
|
||||
var_dump(b()[1]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
NULL
|
||||
|
||||
Fatal error: Cannot use object of type stdClass as array in %s on line %d
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereference with chaining
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $arr;
|
||||
|
||||
public function &a() {
|
||||
return $this->arr;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
$h = &$foo->a();
|
||||
$h[] = 1;
|
||||
$h[] = $foo;
|
||||
var_dump($foo->a()[1]->arr[1]->a()[1]->arr[1]->arr[0]);
|
||||
var_dump($foo->a()[1]);
|
||||
var_dump($foo->a()[1]->arr[1]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
object(foo)#%d (1) {
|
||||
["arr"]=>
|
||||
&array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
object(foo)#%d (1) {
|
||||
["arr"]=>
|
||||
&array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereferencing on return of a method with and without reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
static $x = array();
|
||||
|
||||
public function &a() {
|
||||
self::$x = array(1, 2, 3);
|
||||
return self::$x;
|
||||
}
|
||||
|
||||
public function b() {
|
||||
$x = array(1);
|
||||
$x[] = 2;
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
// Changing the static variable
|
||||
$foo->a()[0] = 2;
|
||||
var_dump($foo::$x);
|
||||
|
||||
$foo->b()[] = new stdClass;
|
||||
|
||||
$h = $foo->b();
|
||||
var_dump($h);
|
||||
|
||||
$h[0] = 3;
|
||||
var_dump($h);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Testing array dereferencing on array returned from __call method
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x = array(2);
|
||||
|
||||
public function __call($x, $y) {
|
||||
if (count($this->x) == 1) {
|
||||
$this->x[] = $y[0];
|
||||
}
|
||||
return $this->x;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
|
||||
$x = array(1);
|
||||
|
||||
$foo->b($x)[1] = 3;
|
||||
|
||||
var_dump($foo->b()[0]);
|
||||
var_dump($foo->b()[1]);
|
||||
var_dump($foo->b()[2]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2)
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Notice: Undefined offset: %d in %s on line %d
|
||||
NULL
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Trying to create an object from dereferencing uninitialized variable
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class foo {
|
||||
public $x;
|
||||
static public $y;
|
||||
|
||||
public function a() {
|
||||
return $this->x;
|
||||
}
|
||||
|
||||
static public function b() {
|
||||
return self::$y;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foo;
|
||||
$h = $foo->a()[0]->a;
|
||||
var_dump($h);
|
||||
|
||||
$h = foo::b()[1]->b;
|
||||
var_dump($h);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -15,6 +15,9 @@ array(1) {
|
||||
["a"]=>
|
||||
&array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
&array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 004: Simple array cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
@@ -16,7 +14,10 @@ array(1) {
|
||||
[0]=>
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 005: Simple object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
@@ -11,10 +9,13 @@ unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
echo "ok\n"
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
ok
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 006: Simple array-object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
@@ -12,12 +10,18 @@ unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
echo "ok\n"
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int(2)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 007: Unreferensed array cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(array());
|
||||
@@ -17,7 +15,10 @@ array(1) {
|
||||
[0]=>
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
int(0)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 008: Unreferensed object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
@@ -13,10 +11,13 @@ unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
echo "ok\n"
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
object(stdClass)#2 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
int(0)
|
||||
int(1)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 009: Unreferensed array-object cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
@@ -14,12 +12,18 @@ unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
echo "ok\n"
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#%d (1) {
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
&object(stdClass)#1 (1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int(0)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 010: Cycle with reference to $GLOBALS
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
@@ -17,7 +15,10 @@ array(1) {
|
||||
[0]=>
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
&array(1) {
|
||||
[0]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 011: GC and destructors
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@@ -17,10 +15,13 @@ unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
echo "ok\n"
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(Foo)#%d (1) {
|
||||
--EXPECT--
|
||||
object(Foo)#1 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
object(Foo)#1 (1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
__destruct
|
||||
int(1)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 012: collection of many loops at once
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a=array();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 013: Too many cycles in one array
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 014: Too many cycles in one object
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 015: Object as root of cycle
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 016: nested GC calls
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 017: GC and destructors with unset
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Node {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 018: GC detach with assign
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(array());
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 019: GC detach with assign by reference
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array(array());
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
GC 020: GC detach reference with assign
|
||||
--INI--
|
||||
zend.enable_gc=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array();
|
||||
|
||||
Loaded 100 of 1358 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user