mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-18 22:46:38 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c83dc9ade |
No files matched your search
@@ -1,243 +1,3 @@
|
||||
2004-07-14 Edin Kadribasic <edink@emini.dk>
|
||||
|
||||
* (PHP_4_3)
|
||||
sapi/cgi/cgi_main.c
|
||||
sapi/cli/php_cli.c:
|
||||
MFH: Made php -m output sorted case-insensitevly
|
||||
|
||||
* sapi/cgi/cgi_main.c
|
||||
sapi/cli/php_cli.c:
|
||||
Made php -m output sorted case-insensitevly
|
||||
|
||||
2004-07-14 Stefan Esser <sesser@suspekt.org>
|
||||
|
||||
* (PHP_4_3)
|
||||
ext/standard/tests/strings/strip_tags.phpt:
|
||||
Ups... CAN-2004-0595 regression test went into wrong branch...
|
||||
|
||||
* (PHP_4_3_7)
|
||||
ext/standard/tests/strings/strip_tags.phpt:
|
||||
Add CAN-2004-0595 regression test. (modified from Joe Ortons version)
|
||||
|
||||
* sapi/apache_hooks/mod_php5.c:
|
||||
same bug.
|
||||
|
||||
2004-07-14 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* ext/iconv/config.m4:
|
||||
- Fixed text.
|
||||
|
||||
2004-07-14 Stefan Esser <sesser@suspekt.org>
|
||||
|
||||
* sapi/apache/mod_php5.c:
|
||||
Security Fix broken! Destroyed Basic auth. Blame: me
|
||||
4.3.x not affected
|
||||
|
||||
2004-07-14 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* ZendEngine2/zend_object_handlers.c:
|
||||
be consistent with write_dimension
|
||||
|
||||
* ZendEngine2/zend_object_handlers.c:
|
||||
fix #28957
|
||||
|
||||
2004-07-14 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* NEWS
|
||||
ext/bcmath/bcmath.c
|
||||
ext/bcmath/php_bcmath.h:
|
||||
Bugfix# 28829 bcmath values for 0, 1, and 2 initialized/freed at wrong time
|
||||
for threaded sapis.
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* NEWS
|
||||
configure.in
|
||||
ZendEngine2/zend.h
|
||||
main/php_version.h:
|
||||
- 5.0.1-dev
|
||||
|
||||
2004-07-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* (PHP_4_3)
|
||||
NEWS
|
||||
NEWS:
|
||||
BFN
|
||||
|
||||
* ZendEngine2/zend_constants.c:
|
||||
Bugfix #29116 Zend constant warning uses memory after free (jdolecek at
|
||||
NetBSD dot org)
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0)
|
||||
NEWS
|
||||
configure.in
|
||||
ZendEngine2/zend.h
|
||||
main/php_version.h:
|
||||
- Roll PHP 5.0.0
|
||||
|
||||
2004-07-13 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* (php_5_0_0)
|
||||
ext/standard/html.c:
|
||||
add missing break
|
||||
|
||||
2004-07-13 Georg Richter <georg@mysql.com>
|
||||
|
||||
* (php_5_0_0)
|
||||
ext/mysqli/mysqli_api.c:
|
||||
prototype fixes
|
||||
|
||||
2004-07-13 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* (php_5_0_0)
|
||||
main/streams/streams.c:
|
||||
Looks like Sara forgot to change this too.
|
||||
|
||||
2004-07-13 Georg Richter <georg@mysql.com>
|
||||
|
||||
* ext/mysqli/mysqli_api.c:
|
||||
changed mysqli_stmt_reset (returns now bool instead of void)
|
||||
|
||||
2004-07-13 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* (PHP_4_3_7)
|
||||
NEWS
|
||||
configure.in
|
||||
Zend/zend_alloc.c
|
||||
Zend/zend_constants.c
|
||||
Zend/zend_execute.c
|
||||
Zend/zend_hash.c
|
||||
Zend/zend_variables.c
|
||||
ext/imap/php_imap.c
|
||||
ext/msession/msession.c
|
||||
ext/mssql/php_mssql.c
|
||||
ext/mysql/php_mysql.c
|
||||
ext/pcntl/pcntl.c
|
||||
ext/session/mod_mm.c
|
||||
ext/session/session.c
|
||||
ext/standard/ftok.c
|
||||
ext/standard/iptc.c
|
||||
ext/standard/string.c
|
||||
ext/sybase/php_sybase_db.c
|
||||
ext/sybase_ct/php_sybase_ct.c
|
||||
ext/w32api/w32api.c
|
||||
ext/wddx/wddx.c
|
||||
main/main.c
|
||||
main/php_version.h
|
||||
main/rfc1867.c:
|
||||
4.3.8 patches.
|
||||
|
||||
2004-07-13 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* (PHP_4_3_7)
|
||||
main/php_version.h:
|
||||
- Fixed typo
|
||||
|
||||
* (PHP_4_3)
|
||||
configure.in
|
||||
main/php_version.h:
|
||||
- Bump version numbers in the PHP_4_3 branch.
|
||||
|
||||
* (PHP_4_3_7)
|
||||
configure.in
|
||||
main/php_version.h:
|
||||
- Create a branch PHP_4_3_7 based on php 4.3.7 to form 4.3.8
|
||||
- Updated version numbers in branch
|
||||
|
||||
2004-07-13 Stefan Esser <sesser@suspekt.org>
|
||||
|
||||
* (php_5_0_0)
|
||||
tests/lang/038.phpt:
|
||||
Fixed typo
|
||||
|
||||
2004-07-13 Alan Knowles <alan@akbkhome.com>
|
||||
|
||||
* (php_5_0_0)
|
||||
tests/lang/039.phpt:
|
||||
remove test dependance on postgres ** this still fails however
|
||||
|
||||
* tests/lang/038.phpt:
|
||||
ensure that test passes on systems without postgres built in.
|
||||
|
||||
2004-07-12 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* (PHP_4_3)
|
||||
Zend/zend_alloc.c
|
||||
Zend/zend_hash.c
|
||||
Zend/zend_variables.c:
|
||||
MFHZE2: Better stability during premature shutdown of request startup
|
||||
|
||||
2004-07-12 Timm Friebe <thekid@thekid.de>
|
||||
|
||||
* (PHP_4_3)
|
||||
ext/sybase_ct/php_sybase_ct.c:
|
||||
- Fixed bug #29064 (Exact numeric/decimal/money datatypes lose precision)
|
||||
- Fixed bug #27843 (sybase_query() triggers (spurious?) notices when
|
||||
query is a stored procedure)
|
||||
- Fixed multiple memory leaks with sybase_unbuffered_query()
|
||||
- Changed sybase_query() to ignore store_results = false in buffering
|
||||
mode, it would yield unpredictable results
|
||||
- Fixed sybase_unbuffered_query() when used with store_results = false
|
||||
- Changed sybase_fetch_object() to ignore second argument when passed
|
||||
as NULL
|
||||
- Made sybase_data_seek() error message more verbose
|
||||
- Fixed memory leak in shutdown when not all rows where selected in an
|
||||
unbuffered query
|
||||
CVS ----------------------------------------------------------------------
|
||||
|
||||
2004-07-12 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* main/streams/streams.c:
|
||||
Fix file_get_contents() bug...
|
||||
|
||||
2004-07-12 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ext/standard/exec.c:
|
||||
Missing patch.
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
NEWS:
|
||||
Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X).
|
||||
|
||||
* (PHP_4_3)
|
||||
Zend/zend_execute.c:
|
||||
MFZE2: Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts).
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ZendEngine2/zend_execute.c:
|
||||
Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts).
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ext/sqlite/libsqlite/src/parse.c:
|
||||
Touch the file so that build system does not try to rebuild it.
|
||||
|
||||
2004-07-12 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ZendEngine2/zend.c:
|
||||
- Convert zend_class_entry -> zend_class_entry *
|
||||
|
||||
2004-07-12 Christian Stocker <chregu@phant.ch>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ext/xsl/php_xsl.c:
|
||||
implement the clone code for the XSLTProcessor object and fix #29108
|
||||
"xslt segfaults when ze1_compatibility_mode is on" (By Rob Richards)
|
||||
|
||||
2004-07-12 Antony Dovgal <tony2001@phpclub.net>
|
||||
|
||||
* (PHP_4_3)
|
||||
ext/oci8/oci8.c:
|
||||
MFH: fix #28978 (multiple OCIBindByName on the same placeholder eats
|
||||
memory)
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
ext/oci8/oci8.c:
|
||||
fix #28978 (multiple OCIBindByName on the same placeholder eats memory)
|
||||
|
||||
2004-07-11 Andrey Hristov <php@hristov.com>
|
||||
|
||||
* NEWS:
|
||||
|
||||
+45
-118
@@ -26,6 +26,11 @@ Status legend
|
||||
|
||||
== Server APIs ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: activescript
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: aolserver
|
||||
MAINTENANCE: Unknown
|
||||
@@ -36,20 +41,15 @@ PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache2handler / apache2filter
|
||||
PRIMARY MAINTAINER: Aaron Bannert <aaron@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache_hooks
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache2filter
|
||||
PRIMARY MAINTAINER: Aaron Bannert <aaron@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache2handler
|
||||
PRIMARY MAINTAINER: Aaron Bannert <aaron@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: caudium
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
@@ -63,11 +63,6 @@ MAINTENANCE: Marcus Boerger <helly@php.net>, Edin Kadribasic <edink@php.
|
||||
STATUS: Working
|
||||
SINCE: 4.3.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: continuity
|
||||
PRIMARY MAINTAINER: Alex Leigh <aleigh@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: embed
|
||||
PRIMARY MAINTAINER: Edin Kadribasic <edink@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -134,8 +129,12 @@ STATUS: Working
|
||||
SINCE: 4.0.6
|
||||
COMMENT: DB abstraction for odbc, mysql, pgsql, mssql, fbsql and more, see documentation
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fbsql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
EXTENSION: filepro
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hwapi
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -176,26 +175,6 @@ MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ovrimos
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -217,6 +196,22 @@ EXTENSION: sybase_ct
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== XML extensions ==
|
||||
@@ -225,7 +220,7 @@ STATUS: Working
|
||||
EXTENSION: dom
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: simplexml
|
||||
@@ -234,11 +229,6 @@ MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: soap
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -257,7 +247,7 @@ STATUS: Experimental
|
||||
EXTENSION: xsl
|
||||
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
STATUS: Experimental
|
||||
SINCE: 5.0
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -275,6 +265,11 @@ MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dio
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
SINCE: 4.0.6
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: calendar
|
||||
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
@@ -302,31 +297,17 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dio
|
||||
MAINTENANCE: Orphaned
|
||||
STATUS: Working
|
||||
SINCE: 4.0.6
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fam
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filepro
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
PRIMARY MAINTAINER: Stefan Esser (sesser@php.net)
|
||||
MAINTENANCE: Maintained
|
||||
@@ -346,11 +327,6 @@ MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hwapi
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -361,11 +337,6 @@ PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ircg
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -381,63 +352,33 @@ PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcve
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mime_magic
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Deprecated
|
||||
STATUS: Experimental
|
||||
COMMENT: Use PECL's fileinfo extension instead
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ming
|
||||
PRIMARY MAINTAINER: Frank M. Kromann
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mnogosearch
|
||||
PRIMARY MAINTAINER: Sergey Kartashoff <gluke@mail.ru>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mono
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: msession
|
||||
PRIMARY MAINTAINER Mark L. Woodward <mlwmohawk@mohawksoft.com>
|
||||
PRIMARY MAINTAINER Mark L. Woodward mlwmohawk@mohawksoft.com
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working/Experimental
|
||||
COMMENT: Tested on Linux, should work on other UNIX platforms. Backend server code can compile under Windows.
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ncurses
|
||||
PRIMARY MAINTAINER Ilia Alshanetsky <iliaa@php.net>, Wez Furlong <wez@php.net>, Hartmut Holzgraefe <hholzgra@php.net>, Georg Richter <georg@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcntl
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pfpro
|
||||
PRIMARY MAINTAINER: David Croft <david@infotrek.co.uk>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -498,20 +439,6 @@ EXTENSION: sysvshm
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tidy
|
||||
PRIMARY MAINTAINER: John Coggeshall <john@php.net>, Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: tokenizer
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: w32api
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ clean:
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module buildmk.stamp
|
||||
egrep define'.*include/php' $(top_srcdir)/configure|sed 's/.*>//'|xargs rm -f
|
||||
egrep define'.*include/php' configure|sed 's/.*>//'|xargs rm -f
|
||||
find . -name Makefile | xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
@@ -1,629 +1,13 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
21 Aug 2005, PHP 5.0.5RC1
|
||||
- Fixed various reentrancy bugs in user-sort functions, solves bugs #33286 and
|
||||
#33295. (Mike Bretz)
|
||||
- Upgraded PCRE library to version 5.0. (Andrei)
|
||||
- Removed php_check_syntax() function which never worked properly. (Ilia)
|
||||
- Added new function mysqli_set_charset(). (Georg)
|
||||
- Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana)
|
||||
- Added support for .cc files in extensions. (Brian)
|
||||
- Added PHP_INT_MAX and PHP_INT_SIZE as predefined constants. (Andrey)
|
||||
- Changed sha1_file() and md5_file() functions to use streams instead of
|
||||
low level IO. (Uwe)
|
||||
- Changed ming to support official 0.2a and 0.3 library versions. (Marcus)
|
||||
- Fixed failing queries problem (FALSE returned) with mysqli_query() on 64 bit.
|
||||
(Andrey)
|
||||
- Fixed memory corruption in pg_copy_from() in case the as_null parameter was
|
||||
passed. (Derick)
|
||||
- Fixed ext/mysqli to allocate less memory when fetching bound params
|
||||
of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
|
||||
- Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
|
||||
- Fixed memory corruption in stristr(). (Derick)
|
||||
- Fixed segfaults when CURL callback functions throw exception. (Tony)
|
||||
- Fixed bug #34078 (Reflection API problems in methods with boolean or
|
||||
null default values). (Tony)
|
||||
- Fixed bug #34064 (arr[] as param to function is allowed only if function
|
||||
receives argument by reference). (Dmitry)
|
||||
- Fixed bug #34062 (Crash in catch block when many arguments are used).
|
||||
(Dmitry)
|
||||
- Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry)
|
||||
- Fixed bug #33940 (array_map() fails to pass by reference when called
|
||||
recursively). (Dmitry)
|
||||
- Fixed bug #33853 (php:function call __autoload with lowercase param). (Marcus)
|
||||
- Fixed bug #33802 (throw Exception in error handler causes crash). (Dmitry)
|
||||
- Fixed bug #33723 (php_value overrides php_admin_value). (Dmitry)
|
||||
- Fixed bug #33710 (ArrayAccess objects doen't initialize $this). (Dmitry)
|
||||
- Fixed bug #33588 (LDAP: RootDSE query not possible). (Jani)
|
||||
- Fixed bug #33558 (warning with nested calls to functions returning by
|
||||
reference). (Dmitry)
|
||||
- Fixed bug #33520 (crash if safe_mode is on and session.save_path is changed).
|
||||
(Dmitry)
|
||||
- Fixed bug #33491 (crash after extending MySQLi internal class). (Tony)
|
||||
- Fixed bug #33340 (CLI Crash when calling php:function from XSLT). (Rob)
|
||||
- Fixed bug #33277 (private method accessed by child class). (Dmitry)
|
||||
- Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3 in
|
||||
length). (Ilia)
|
||||
- Fixed bug #33263 (mysqli_real_escape doesn't work in __construct) (Georg)
|
||||
- Fixed bug #33257 (array_splice() inconsistent when passed function instead
|
||||
of variable). (Dmitry)
|
||||
- Fixed bug #33243 (ze1_compatibility_mode does not work as expected). (Dmitry)
|
||||
- Fixed bug #33242 (Mangled error message when stream fails). (Derick)
|
||||
- Fixed bug #33222 (segfault when CURL handle is closed in a callback). (Tony)
|
||||
- Fixed bug #33214 (odbc_next_result does not signal SQL errors with
|
||||
2-statement SQL batches). (rich at kastle dot com, Tony)
|
||||
- Fixed bug #33210 (relax jpeg recursive loop protection). (Ilia)
|
||||
- Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier
|
||||
misbehave). (Jani)
|
||||
- Fixed bug #33185 (--enable-session=shared does not build). (Jani)
|
||||
- Fixed bug #33171 (foreach enumerates private fields declared in base
|
||||
classes). (Dmitry)
|
||||
- Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). (Ilia)
|
||||
- Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF).
|
||||
(Nuno)
|
||||
- Fixed bug #33116 (crash when assigning class name to global variable in
|
||||
__autoload). (Dmitry)
|
||||
- Fixed bug #33090 (mysqli_prepare() doesn't return an error). (Georg)
|
||||
- Fixed bug #33076 (str_ireplace() incorrectly counts result string length
|
||||
and may cause segfault). (Tony)
|
||||
- Fixed bug #33072 (Add a safemode/open_basedir check for runtime
|
||||
"session.save_path" change using session_save_path() function). (Rasmus)
|
||||
- Fixed bug #33070 (Improved performance of bzdecompress() by several orders
|
||||
of magnitude). (Ilia)
|
||||
- Fixed bug #33059 (crash when moving xml attribute set in dtd). (Ilia)
|
||||
- Fixed bug #33057 (Don't send extraneous entity-headers on a 304 as per
|
||||
RFC 2616 section 10.3.5) (Rasmus, Choitel)
|
||||
- Fixed bug #33019 (socket errors cause memory leaks in php_strerror()).
|
||||
(jwozniak23 at poczta dot onet dot pl, Tony).
|
||||
- Fixed bug #33017 ("make distclean" gives an error with VPATH build). (Jani)
|
||||
- Fixed bug #33013 ("next month" was handled wrong while parsing dates).
|
||||
(Derick)
|
||||
- Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54
|
||||
seg fault). (Dmitry)
|
||||
- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL). (Georg)
|
||||
- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
|
||||
- Fixed bug #32944 (Disabling session.use_cookies doesn't prevent reading
|
||||
session cookies). (Jani, Tony)
|
||||
- Fixed bug #32941 (Sending structured SOAP fault kills a php). (Dmitry)
|
||||
- Fixed bug #32936 (http redirects URLs are not checked for control chars). (Ilia)
|
||||
- Fixed bug #32933 (Cannot extend class "SQLiteDatabase"). (Marcus)
|
||||
- Fixed bug #32932 (Oracle LDAP: ldap_get_entries(), invalid pointer). (Jani)
|
||||
- Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
|
||||
- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Tony)
|
||||
- Fixed bug #32852 (Crash with singleton and __destruct when
|
||||
zend.ze1_compatibility_mode = On). (Dmitry)
|
||||
- Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). (Ilia)
|
||||
- Fixed bug #32810 (temporary files not using plain file wrapper). (Ilia)
|
||||
- Fixed bug #32809 (Missing T1LIB support on Windows). (Edin)
|
||||
- Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
|
||||
- Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)
|
||||
- Fixed bug #32799 (crash: calling the corresponding global var during the
|
||||
destruct). (Dmitry)
|
||||
- Fixed bug #32776 (SOAP doesn't support one-way operations). (Dmitry)
|
||||
- Fixed bug #32773 (GMP functions break when second parameter is 0). (Stas)
|
||||
- Fixed bug #32759 (incorrect determination of default value (COM)). (Wez)
|
||||
- Fixed bug #32758 (Cannot access safearray properties in VB6 objects). (Wez)
|
||||
- Fixed bug #32755 (Segfault in replaceChild() when DocumentFragment has
|
||||
no children). (Rob)
|
||||
- Fixed bug #32753 (Undefined constant SQLITE_NOTADB). (Ilia)
|
||||
- Fixed bug #32742 (segmentation fault when the stream with a wrapper
|
||||
is not closed). (Tony, Dmitry)
|
||||
- Fixed bug #32699 (pg_affected_rows() was defined when it was not available).
|
||||
(Derick)
|
||||
- Fixed bug #32686 (Require/include file in destructor causes segfault).
|
||||
(Marcus)
|
||||
- Fixed bug #32682 (ext/mssql: Error on module shutdown when called from
|
||||
activescript). (Frank)
|
||||
- Fixed bug #32674 (exception in iterator causes crash). (Dmitry)
|
||||
- Fixed bug #32660 (Assignment by reference causes crash when field access is
|
||||
overloaded (__get)). (Dmitry)
|
||||
- Fixed bug #32647 (Using register_shutdown_function() with invalid callback
|
||||
can crash PHP). (Jani)
|
||||
- Fixed bug #32615 (Segfault in replaceChild() using fragment when
|
||||
previousSibling is NULL). (Rob)
|
||||
- Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf
|
||||
access errors). (Jani, ric at arizona dot edu)
|
||||
- Fixed bug #32608 (html_entity_decode() converts single quotes even if
|
||||
ENT_NOQUOTES is given). (Ilia)
|
||||
- Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct).
|
||||
(Dmitry)
|
||||
- Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani)
|
||||
- Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets).
|
||||
(Ilia)
|
||||
- Fixed bug #32587 (Apache2: errors sent to error_log do not include
|
||||
timestamps). (Jani)
|
||||
- Fixed bug #32560 (configure looks for incorrect db2 library). (Tony)
|
||||
- Fixed bug #32553 (mmap loads only the 1st 2000000 bytes on Win32). (Ilia)
|
||||
- Fixed bug #32533 (proc_get_status() returns the incorrect process status). (Ilia)
|
||||
- Fixed bug #32530 (chunk_split() does not append endstr if chunklen is
|
||||
longer then the original string). (Ilia)
|
||||
- Fixed bug #32491 (File upload error - unable to create a temporary file).
|
||||
(Uwe Schindler)
|
||||
- Fixed bug #32405 (mysqli::fetch() returns bad data - 64bit problem). (Andrey)
|
||||
- Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit). (Georg)
|
||||
- Fixed bug #32296 (get_class_methods() output has changed between 5.0.2 and
|
||||
5.0.3). (Dmitry)
|
||||
- Fixed bug #32245 (xml_parser_free() in a function assigned to the xml parser
|
||||
gives a segfault). (Rob)
|
||||
- Fixed bug #32171 (Userspace stream wrapper crashes PHP). (Tony, Dmitry)
|
||||
- Fixed bug #32080 (segfault when assigning object to itself with
|
||||
zend.ze1_compatibility_mode=On). (Dmitry)
|
||||
- Fixed bug #32013 (ext/mysqli bind_result causes fatal error: memory
|
||||
limit). (Andrey)
|
||||
- Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP
|
||||
response message). (Jani)
|
||||
- Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On). (Dmitry)
|
||||
- Fixed bug #31668 (multi_query works exactly every other time - multi query
|
||||
d/e flag global and not per connection). (Andrey)
|
||||
- Fixed bug #31636 (another crash when echoing a COM object). (Wez)
|
||||
- Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance
|
||||
mode). (mike at php dot net)
|
||||
- Fixed bug #31525 (object reference being dropped. $this getting lost).
|
||||
(Stas, Dmitry)
|
||||
- Fixed bug #31502 (Wrong deserialization from session when using WDDX
|
||||
serializer). (Dmitry)
|
||||
- Fixed bug #31465 (False warning in unpack() when working with *). (Ilia)
|
||||
- Fixed bug #31363 (broken non-blocking flock()). ian at snork dot net
|
||||
- Fixed bug #31213 (Sideeffects caused by fix of bug #29493). (Dmitry)
|
||||
- Fixed bug #31158 (array_splice on $GLOBALS crashes). (Dmitry)
|
||||
- Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()).
|
||||
(Dmitry)
|
||||
- Fixed bug #30889 (Conflict between __get/__set and ++ operator). (Dmitry)
|
||||
- Fixed bug #30833 (array_count_values() modifying input array). (Tony)
|
||||
- Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden
|
||||
methods). (Dmitry)
|
||||
- Fixed bug #30820 (static member conflict with $this->member silently
|
||||
ignored). (Dmitry)
|
||||
- Fixed bug #30819 (Better support for LDAP SASL bind). (Jani)
|
||||
- Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if
|
||||
object is overloaded). (Dmitry)
|
||||
- Fixed bug #30707 (Segmentation fault on exception in method). (Stas, Dmitry)
|
||||
- Fixed bug #30702 (cannot initialize class variable from class constant).
|
||||
(Dmitry)
|
||||
- Fixed bug #30519 (Interface not existing says Class not found). (Dmitry)
|
||||
- Fixed bug #30394 (Assignment operators yield wrong result with __get/__set).
|
||||
(Dmitry)
|
||||
- Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with
|
||||
array_push()). (Dmitry)
|
||||
- Fixed bug #30162 (Catching exception in constructor causes lose of $this).
|
||||
(Dmitry)
|
||||
- Fixed bug #30140 (Problem with array in static properties). (Dmitry)
|
||||
- Fixed bug #30126 (Enhancement for error message for abstract classes).
|
||||
(Marcus)
|
||||
- Fixed bug #30080 (Passing array or non array of objects). (Dmitry)
|
||||
- Fixed bug #29975 (memory leaks when set_error_handler() is used inside error
|
||||
handler). (Tony)
|
||||
- Fixed bug #29971 (variables_order behaviour). (Dmitry)
|
||||
- Fixed bug #29944 (Function defined in switch, crashes). (Dmitry)
|
||||
- Fixed bug #29896 (Backtrace argument list out of sync). (Dmitry)
|
||||
- Fixed bug #29683 (headers_list() returns empty array). (Tony)
|
||||
- Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez)
|
||||
- Fixed bug #29338 (unencoded spaces get ignored after certain tags). (Ilia)
|
||||
- Fixed bug #29210 (Function: is_callable - no support for private and
|
||||
protected classes). (Dmitry)
|
||||
- Fixed bug #29104 (Function declaration in method doesn't work). (Dmitry)
|
||||
- Fixed bug #29015 (Incorrect behavior of member vars(non string ones)-numeric
|
||||
mem vars und others). (Dmitry)
|
||||
- Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
|
||||
(kameshj at fastmail dot fm)
|
||||
- Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs). (Jani)
|
||||
- Fixed bug #28377 (debug_backtrace is intermittently passing args). (Dmitry)
|
||||
- Fixed bug #27598 (list() array key assignment causes HUGE memory leak).
|
||||
(Dmitry)
|
||||
- Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when
|
||||
called via STDIN). (Dmitry)
|
||||
- Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may result
|
||||
in seg fault). (Dmitry)
|
||||
- Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry)
|
||||
- Fixed bug #29689 (default value of protected member overrides default value of private)
|
||||
and other private variable problems in inherited classes (Stas)
|
||||
- Fixed bug #29253 (array_diff with $GLOBALS argument fails). (Dmitry)
|
||||
- Abstract private methods are no longer allowed (Stas)
|
||||
|
||||
31 Mar 2005, PHP 5.0.4
|
||||
- Added SNMPv2 support. (harrie)
|
||||
- Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
|
||||
- Added length and charsetnr for field array and object in mysqli. (Georg)
|
||||
- Added checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem()
|
||||
and gmp_fact() to prevent SIGFPE. (Tony)
|
||||
- Changed foreach() to throw an exception if IteratorAggregate::getIterator()
|
||||
does not return an Iterator. (Marcus)
|
||||
- Changed phpize not to require libtool. (Jani)
|
||||
- Updated bundled oniguruma library (used for multibyte regular expression)
|
||||
to 3.7.0. (Moriyoshi)
|
||||
- Updated bundled libmbfl library (used for multibyte functions). (Moriyoshi)
|
||||
Fixed bugs:
|
||||
. Bug #32311 (mb_encode_mimeheader() does not properly escape characters)
|
||||
. Bug #32063 (mb_convert_encoding ignores named entity 'alpha')
|
||||
. Bug #31911 (mb_decode_mimeheader() is case-sensitive to hex escapes)
|
||||
. bug #30573 (compiler warnings in libmbfl due to invalid type cast)
|
||||
. Bug #30549 (incorrect character translations for some ISO8859 charsets).
|
||||
- Fixed bug preventing from building oci8 as shared.
|
||||
(stanislav dot voroniy at portavita dot nl, Tony)
|
||||
- Fixed a bug in mysql_affected_rows and mysql_stmt_affected_rows when the
|
||||
api function returns -1 (Georg)
|
||||
- Fixed several leaks in ext/browscap and sapi/embed. (Andrei)
|
||||
- Fixed several leaks in ext/filepro. (Tony)
|
||||
- Fixed build system to always use bundled libtool files. (Jani)
|
||||
- Fixed a bug in mysqli_stmt_execute() (type conversion with NULL values).
|
||||
(Georg)
|
||||
- Fixed segfault in mysqli_fetch_field_direct() when invalid field offset
|
||||
is passed. (Tony)
|
||||
- Fixed posix_getsid() & posix_getpgid() to return sid & pgid instead
|
||||
of true. (Tony)
|
||||
- Fixed bug #32394 (offsetUnset() segfaults in a foreach). (Marcus)
|
||||
- Fixed bug #32373 (segfault in bzopen() if supplied path to non-existent
|
||||
file). (Tony)
|
||||
- Fixed bug #32326 (Check values of Connection/Transfer-Encoding
|
||||
case-incentively in SOAP extension). (Ilia)
|
||||
- Fixed bug #32290 (call_user_func_array() calls wrong class method within
|
||||
child class). (Marcus)
|
||||
- Fixed bug #32238 (spl_array.c: void function cannot return value). (Johannes)
|
||||
- Fixed bug #32210 (proc_get_status() sets "running" always to true). (Ilia)
|
||||
- Fixed bug #32200 (Prevent using both --with-apxs2 and --with-apxs2filter).
|
||||
(Jani)
|
||||
- Fixed bug #32134 (Overloading offsetGet/offsetSet). (Marcus)
|
||||
- Fixed bug #32130 (ArrayIterator::seek() does not throw an Exception on
|
||||
invalid index). (Marcus)
|
||||
- Fixed bug #32115 (dateTime SOAP encoding of timezone incorrect). (Dmitry)
|
||||
- Fixed bug #32081 (in mysqli default socket value is not being used). (Ilia)
|
||||
- Fixed bug #32021 (Crash caused by range('', 'z')). (Derick)
|
||||
- Fixed bug #32011 (Fragments which replaced Nodes are not globaly useable).
|
||||
(Rob)
|
||||
- Fixed bug #32001 (xml_parse_into_struct() function exceeds maximum
|
||||
execution time). (Rob, Moriyoshi)
|
||||
- Fixed bug #31980 (Unicode exif data not available on Windows). (Edin)
|
||||
- Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping columns
|
||||
with NULL values). (Daniel Convissor)
|
||||
- Fixed bug #31878 (Segmentation fault using clone keyword on nodes). (Rob)
|
||||
- Fixed bug #31858 (--disable-cli does not force --without-pear). (Jani)
|
||||
- Fixed bug #31842 (*date('r') does not return RFC2822 conforming date string).
|
||||
(Jani)
|
||||
- Fixed bug #31832 (SOAP encoding problem with complex types in WSDL mode with
|
||||
multiple parts). (Dmitry)
|
||||
- Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia)
|
||||
- Fixed bug #31796 (readline completion handler does not handle empty return
|
||||
values). (Ilia)
|
||||
- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia)
|
||||
- Fixed bug #31755 (Cannot create SOAP header in no namespace). (Dmitry)
|
||||
- Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick)
|
||||
- Fixed bug #31751 (pg_parameter_status() missing on Windows). (Edin)
|
||||
- Fixed bug #31747 (SOAP Digest Authentication doesn't work with
|
||||
"HTTP/1.1 100 Continue" response). (Dmitry)
|
||||
- Fixed bug #31732 (mb_get_info() causes segfault when no parameters
|
||||
specified). (Tony)
|
||||
- Fixed bug #31710 (Wrong return values for mysqli_autocommit/commit/rollback).
|
||||
(Georg)
|
||||
- Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar). (Ilia)
|
||||
- Fixed bug #31695 (Cannot redefine endpoint when using WSDL). (Dmitry)
|
||||
- Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings).
|
||||
(elod at itfais dot com)
|
||||
- Fixed bug #31683 (changes to $name in __get($name) override future
|
||||
parameters). (Dmitry)
|
||||
- Fixed bug #31699 (unserialize() float problem on non-English locales). (Ilia)
|
||||
- Fixed bug #31562 (__autoload() problem with static variables). (Marcus)
|
||||
- Fixed bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays).
|
||||
(Marcus)
|
||||
- Fixed bug #31623 (OCILogin does not support password grace period).
|
||||
(daniel dot beet at accuratesoftware dot com, Tony)
|
||||
- Fixed bug #31527 (crash in msg_send() when non-string is stored without
|
||||
being serialized). (Ilia)
|
||||
- Fixed bug #31515 (Improve performance of scandir() by factor of 10 or so). (Ilia)
|
||||
- Fixed bug #31514 (open_basedir uses path_translated rather then cwd for .
|
||||
translation). (Ilia)
|
||||
- Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia)
|
||||
- Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia)
|
||||
- Fixed bug #31454 (session_set_save_handler crashes PHP when supplied
|
||||
non-existent object ref). (Tony)
|
||||
- Fixed bug #31444 (Memory leak in zend_language_scanner.c).
|
||||
(hexer at studentcenter dot org)
|
||||
- Fixed bug #31442 (unserialize broken on 64-bit systems). (Marcus)
|
||||
- Fixed bug #31440 ($GLOBALS can be overwritten via GPC when register_globals
|
||||
is enabled). (Ilia)
|
||||
- Fixed bug #31422 (No Error-Logging on SoapServer-Side). (Dmitry)
|
||||
- Fixed bug #31413 (curl POSTFIELDS crashes on 64-bit platforms). (Joe)
|
||||
- Fixed bug #31396 (compile fails with gd 2.0.33 without freetype). (Jani)
|
||||
- Fixed bug #31371 (highlight_file() trims new line after heredoc). (Ilia)
|
||||
- Fixed bug #31361 (simplexml/domxml segfault when adding node twice). (Rob)
|
||||
- Fixed bug #31348 (CachingIterator::rewind() leaks). (Marcus)
|
||||
- Fixed bug #31346 (ArrayIterator::next segfaults). (Marcus)
|
||||
- Fixed bug #31190 (Unexpected warning then exception is thrown from
|
||||
call_user_func_array()). (phpbugs at domain51 dot net, Dmitry)
|
||||
- Fixed bug #31142 (imap_mail_compose() fails to generate correct output). (Ilia)
|
||||
- Fixed bug #31139 (XML Parser Functions seem to drop & when parsing). (Rob)
|
||||
- Fixed bug #31398 (When magic_guotes_gpc are enabled filenames with ' get cutoff).
|
||||
(Ilia)
|
||||
- Fixed bug #31288 (Possible crash in mysql_fetch_field(), if mysql_list_fields()
|
||||
was not called previously). (Ilia)
|
||||
- Fixed bug #31107, #31110, #31111, #31249 (Compile failure of zend_strtod.c).
|
||||
(Jani)
|
||||
- Fixed bug #31110 (PHP 4.3.10 does not compile on Tru64 UNIX 5.1B). (Derick)
|
||||
- Fixed bug #31107 (Compile failure on Solaris 9 (Intel) and gcc 3.4.3). (Derick)
|
||||
- Fixed bug #31103 (Better error message when c-client cannot be found). (Ilia)
|
||||
- Fixed bug #31101 (missing kerberos header file path with --with-openssl). (Jani)
|
||||
- Fixed bug #31098 (isset() / empty() incorrectly return true in dereference of
|
||||
a string type). (Moriyoshi)
|
||||
- Fixed bug #31087 (broken php_url_encode_hash macro). (Ilia)
|
||||
- Fixed bug #31072 (var_export() does not output an array element with an empty
|
||||
string key). (Derick)
|
||||
- Fixed bug #31060 (imageftbbox() does not use linespacing parameter). (Jani)
|
||||
- Fixed bug #31056 (php_std_date() returns invalid formatted date if
|
||||
y2k_compliance is On). (Ilia)
|
||||
- Fixed bug #31055 (apache2filter: per request leak proportional to the full
|
||||
path of the request URI). (kameshj at fastmail dot fm)
|
||||
- Fixed bug #30901 (can't send cookies with soap envelop). (Dmitry)
|
||||
- Fixed bug #30871 (Misleading warning message for array_combine()). (Andrey)
|
||||
- Fixed bug #30868 (evaluated pointer comparison in mbregex causes compile
|
||||
failure). (Moriyoshi)
|
||||
- Fixed bug #30862 (Static array with boolean indexes). (Marcus)
|
||||
- Fixed bug #30726 (-.1 like numbers are not being handled correctly). (Ilia)
|
||||
- Fixed bug #30725 (PHP segfaults when an exception is thrown in getIterator()
|
||||
within foreach). (Marcus)
|
||||
- Fixed bug #30609 (cURL functions bypass open_basedir). (Jani)
|
||||
- Fixed bug #30446 (apache2handler: virtual() includes files out of sequence)
|
||||
- Fixed bug #30430 (odbc_next_result() doesn't bind values and that results
|
||||
in segfault). (pdan-php at esync dot org, Tony)
|
||||
- Fixed bug #30266 (Invalid opcode 137/1/8). (Marcus)
|
||||
- Fixed bug #30120 (imagettftext() and imagettfbbox() accept too many
|
||||
parameters). (Jani)
|
||||
- Fixed bug #30106 (SOAP cannot not parse 'ref' element. Causes Uncaught
|
||||
SoapFault exception). (Dmitry)
|
||||
- Fixed bug #29989 (type re_registers redefined in oniguruma.h). (Moriyoshi)
|
||||
- Fixed bug #28803 (enabled debug causes bailout errors with CLI on AIX
|
||||
because of fflush() called on already closed filedescriptor). (Tony)
|
||||
- Fixed bug #29767 (Weird behaviour of __set($name, $value)). (Dmitry)
|
||||
- Fixed bug #29733 (printf() handles repeated placeholders wrong).
|
||||
(bugs dot php dot net at bluetwanger dot de, Ilia)
|
||||
- Fixed bug #29424 (width and height inverted for JPEG2000 files). (Ilia)
|
||||
- Fixed bug #29329 (configure for mysqli with shared doesn't work). (Georg)
|
||||
- Fixed bug #29136 (make test - libtool failure on MacOSX). (Jani)
|
||||
- Fixed bug #28976 (mail(): use "From:" from headers if sendmail_from is empty).
|
||||
(Jani)
|
||||
- Fixed bug #28930 (PHP sources pick wrong header files generated by bison).
|
||||
(eggert at gnu dot org, Jani)
|
||||
- Fixed bug #28840 (__destruct of a class that extends mysqli not called).
|
||||
(Marcus)
|
||||
- Fixed bug #28804 (ini-file section parsing pattern is buggy).
|
||||
(wendland at scan-plus dot de)
|
||||
- Fixed bug #28451 (corrupt EXIF headers have unlimited recursive IFD directory
|
||||
entries). (Andrei)
|
||||
- Fixed bug #28444 (Cannot access undefined property for object with overloaded
|
||||
property access). (Dmitry)
|
||||
- Fixed bug #28442 (Changing a static variables in a class changes it across
|
||||
sub/super classes.) (Marcus)
|
||||
- Fixed bug #28324 (HTTP_SESSION_VARS appear when register_long_arrays is
|
||||
Off). (Tony)
|
||||
- Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr stream).
|
||||
(chris at ex-parrot dot com)
|
||||
- Fixed bug #28067 (partially incorrect utf8 to htmlentities mapping). (Derick,
|
||||
Benjamin Greiner)
|
||||
- Fixed bug #28041 (SOAP HTTP Digest Access Authentication). (Dmitry)
|
||||
- Fixed bug #27633 (Double \r problem on ftp_get in ASCII mode on Win32). (Ilia)
|
||||
- Fixed bug #18613 (Multiple OUs in x509 certificate not handled properly).
|
||||
(Jani)
|
||||
|
||||
15 Dec 2004, PHP 5.0.3
|
||||
- Added the %F modifier to *printf to render a non-locale-aware representation
|
||||
of a float with the . as decimal seperator. (Derick)
|
||||
- Fixed error handling in mysqli_multi_query. (Georg)
|
||||
- Extended the functionality of is_subclass_of() to accept either a class name
|
||||
or an object as first parameter. (Andrey)
|
||||
- Fixed potential problems with unserializing invalid serialize data. (Marcus)
|
||||
- Fixed bug #32076 (ReflectionMethod::isDestructor() always return true).
|
||||
(Derick, Tony)
|
||||
- Fixed bug #31034 (Problem with non-existing iconv header file). (Derick)
|
||||
- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia)
|
||||
- Fixed bug #30994 (SOAP server unable to handle request with references).
|
||||
(Dmitry)
|
||||
- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia)
|
||||
- Fixed bug #30967 (properties in extended mysqli classes don't work). (Georg)
|
||||
- Fixed bug #30928 (When Using WSDL, SoapServer doesn't handle private or
|
||||
protected properties). (Dmitry)
|
||||
- Fixed bug #30922 (reflective functions crash PHP when interfaces extend
|
||||
themselves). (Tony, Dmitry)
|
||||
- Fixed bug #30904 (segfault when recording soapclient into session). (Tony,
|
||||
Dmitry)
|
||||
- Fixed bug #30890 (MySQLi testsuite)
|
||||
- Fixed bug #30856 (ReflectionClass::getStaticProperties segfaults). (Marcus)
|
||||
- Fixed bug #30832 ("!" stripped off comments in xml parser). (Rob)
|
||||
- Fixed bug #30799 (SoapServer doesn't handle private or protected properties).
|
||||
(Dmitry)
|
||||
- Fixed bug #30783 (Apache crash when using ReflectionFunction::
|
||||
getStaticVariables()). (Marcus)
|
||||
- Fixed bug #30750 (Meaningful error message when upload directory is not
|
||||
accessible). (Ilia)
|
||||
- Fixed bug #30685 (Malformed SOAPClient http header reequest). (Dmitry)
|
||||
- Fixed bug #30672 (Problem handling exif data in jpeg images at unusual
|
||||
places). (Marcus)
|
||||
- Fixed bug #30658 (Ensure that temporary files created by GD are removed).
|
||||
(Ilia)
|
||||
- Fixed bug #30645 (def. multi result set support for mysql_connect). (Georg)
|
||||
- Fixed bug #30637 (compile with pear error). (Antony)
|
||||
- Fixed bug #30587 (array_multisort doesn't separate zvals before
|
||||
changing them). (Tony)
|
||||
- Fixed bug #30572 (crash when comparing SimpleXML attribute to a boolean).
|
||||
(Andi)
|
||||
- Fixed bug #30566 (attribute namespace URIs are inconsistent when parsing).
|
||||
(Rob)
|
||||
- Fixed bug #30490 (PEAR installation fails). (Antony)
|
||||
- Fixed bug #30475 (curl_getinfo() may crash in some situations). (Ilia)
|
||||
- Fixed bug #30442 (segfault when parsing ?getvariable[][ ). (Tony)
|
||||
- Fixed bug #30388 (rename across filesystems loses ownership and
|
||||
permission info). (Tony)
|
||||
- Fixed bug #30387 (stream_socket_client async connect was broken).
|
||||
(vnegrier at esds dot com, Wez).
|
||||
- Fixed bug #30381 (Strange results with get_class_vars()). (Marcus)
|
||||
- Fixed bug #30375 (cal_info() does not work without a parameter). (Ilia)
|
||||
- Fixed bug #30362 (stream_get_line() not handling end string correctly).
|
||||
(Ilia)
|
||||
- Fixed bug #30359 (SOAP client requests have no port in "Host" field).
|
||||
(Dmitry)
|
||||
- Fixed bug #30356 (str_ireplace() does not work on all strings). (Ilia)
|
||||
- Fixed bug #30344 (Reflection::getModifierNames() returns too long strings).
|
||||
(Marcus)
|
||||
- Fixed bug #30329 (Error Fetching http body, No Content-Length, connection
|
||||
closed or chunked data). (Dmitry)
|
||||
- Fixed bug #30282 (segfault when using unknown/unsupported
|
||||
session.save_handler and/or session.serialize_handler). (Tony)
|
||||
- Fixed bug #30281 (Prevent non-wbmp images from being detected as such).
|
||||
(Ilia)
|
||||
- Fixed bug #30276 (Possible crash in ctype_digit on large numbers). (Ilia)
|
||||
- Fixed bug #30230 (exception handler not working with objects). (Marcus)
|
||||
- Fixed bug #30224 (Sybase date strings are sometimes not null terminated).
|
||||
(Ilia)
|
||||
- Fixed bug #30175 (SOAP results aren't parsed correctly). (Dmitry)
|
||||
- Fixed bug #30147 (OO sqlite_fetch_object did not reset error handler). (Wez)
|
||||
- Fixed bug #30133 (get_current_user() crashes on Windows). (Edin)
|
||||
- Fixed bug #30061 (xml_set_start_namespace_decl_handler not called). (Rob)
|
||||
- Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
|
||||
- Fixed bug #30042 (strtotime does not use second param). (Derick)
|
||||
- Fixed bug #30027 (Possible crash inside ftp_get()).
|
||||
(cfield at affinitysolutions dot com)
|
||||
- Fixed bug #29954 (array_reduce segfaults when initial value is array). (Tony)
|
||||
- Fixed bug #29883 (isset gives invalid values on strings). (Tony, Dmitry)
|
||||
- Fixed bug #29801 (Set limit on the size of mmapable data). (Ilia)
|
||||
- Fixed bug #29557 (strtotime error). (Derick)
|
||||
- Fixed bug #29418 (double free when openssl_csr_new fails).
|
||||
(Kamesh Jayachandran).
|
||||
- Fixed bug #29385 (Soapserver always uses std class). (David, Dmitry)
|
||||
- Fixed bug #29211 (SoapClient doesn't request wsdl through proxy). (Rob)
|
||||
- Fixed bug #28817 (Var problem when extending domDocument). (Georg)
|
||||
- Fixed bug #28599 (strtotime fails with zero base time). (Derick)
|
||||
- Fixed bug #28598 (Lost support for MS Symbol fonts). (Pierre)
|
||||
- Fixed bug #28220 (mb_strwidth() returns wrong width values for some hangul
|
||||
characters). (Moriyoshi)
|
||||
- Fixed bug #28228 (NULL decimal separator is not being handled correctly).
|
||||
(Ilia)
|
||||
- Fixed bug #28209 (strtotime("now")). (Derick)
|
||||
- Fixed bug #27798 (private / protected variables not exposed by
|
||||
get_object_vars() inside class). (Marcus)
|
||||
- Fixed bug #27728 (Can't return within a zend_try {} block or the previous
|
||||
bailout state isn't restored. (Andi)
|
||||
- Fixed bug #27183 (Userland stream wrapper segfaults on stream_write).
|
||||
(Christian)
|
||||
|
||||
23 Sep 2004, PHP 5.0.2
|
||||
- Added new boolean (fourth) parameter to array_slice() that turns on the
|
||||
preservation of keys in the returned array. (Derick)
|
||||
- Added the sorting flag SORT_LOCALE_STRING to the sort() functions which makes
|
||||
them sort based on the current locale. (Derick)
|
||||
- Added interface_exists() and make class_exists() only return true for real
|
||||
classes. (Andrey)
|
||||
- Added PHP_EOL constant that contains the OS way of representing newlines.
|
||||
(Paul Hudson, Derick)
|
||||
- Implemented periodic PCRE compiled regexp cache cleanup, to avoid memory
|
||||
exhaustion. (Andrei)
|
||||
- Renamed SoapClient->__call() to SoapClinet->__soapCall(). (Dmitry)
|
||||
- Fixed bug with raw_post_data not getting set (Brian)
|
||||
- Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev)
|
||||
- Fixed bug #30209 (ReflectionClass::getMethod() lowercases attribute).
|
||||
(Marcus)
|
||||
- Fixed bug #30182 (SOAP module processing WSDL file dumps core). (Dmitry)
|
||||
- Fixed bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests).
|
||||
(Dmitry)
|
||||
- Fixed bug #29985 (unserialize()/ __PHP_Incomplete_class does not report
|
||||
correctly class name). (Marcus, Tony)
|
||||
- Fixed bug #29945 (simplexml_load_file URL limitation 255 char). (Rob)
|
||||
- Fixed bug #29873 (No defines around pcntl_*priority definitions). (Derick)
|
||||
- Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
|
||||
(Dmitry)
|
||||
- Fixed bug #29842 (soapclient return null value). (Dmitry)
|
||||
- Fixed bug #29839 (incorrect convert (xml:lang to lang)). (Dmitry)
|
||||
- Fixed bug #29830 (SoapServer::setClass() should not export non-public
|
||||
methods). (Dmitry)
|
||||
- Fixed bug #29828 (Interfaces no longer work). (Marcus)
|
||||
- Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
|
||||
data). (Ilia)
|
||||
- Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia)
|
||||
- Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler)
|
||||
- Fixed bug #29795 (SegFault with Soap and Amazon's Web Services). (Dmitry)
|
||||
- Fixed bug #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE
|
||||
on error). (Tony)
|
||||
- Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob)
|
||||
- Fixed bug #29678 (opendir() with ftp:// wrapper segfaults if path does not
|
||||
have trailing slash). (Ilia)
|
||||
- Fixed bug #29657 (xml_* functions throw non descriptive error).
|
||||
(Christian, Rob)
|
||||
- Fixed bug #29656 (segfault on result and statement properties). (Georg)
|
||||
- Fixed bug #29566 (foreach/string handling strangeness (crash)). (Dmitry)
|
||||
- Fixed bug #29447 (Reflection API issues). (Marcus)
|
||||
- Fixed bug #29296 (Added sslv2 and sslv3 transports). (Wez)
|
||||
- Fixed bug #29283 (Invalid statement handle in mysqli on execute). (Georg)
|
||||
- Fixed bug #29913 (parse_url() is now binary safe). (Ilia)
|
||||
- Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled).
|
||||
(Dmitry)
|
||||
- Fixed bug #27791 (Apache 2.0 SAPI build against Apache 2 HEAD). (Joe Orton,
|
||||
Derick)
|
||||
- Fixed bug #26737 (private/protected properties not serialized when user
|
||||
declared method __sleep() exists). E_NOTICE thrown when __sleep() returns
|
||||
name of non-existing member. (Andrey, Curt)
|
||||
|
||||
12 Aug 2004, PHP 5.0.1
|
||||
- Changed destructor mechanism so that destructors are called prior to request
|
||||
shutdown. (Marcus)
|
||||
- Rewritten UNIX and Windows install help files. (Documentation Team)
|
||||
- Updated several libraries bundled with the windows release which now
|
||||
includes libxml2-2.6.11, libxslt-1.1.7 and iconv-1.9.1. (Rob, Edin)
|
||||
- Improved and moved ActiveScript SAPI to PECL. (Wez)
|
||||
- Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then
|
||||
returning the value). (Ilia)
|
||||
- Fixed bug #29577 (MYSQLI_CLIENT_FOUND_ROWS undefined) (Georg)
|
||||
- Fixed bug #29573 (Segmentation fault, when exception thrown within
|
||||
PHP function called from XSLT). (Christian)
|
||||
- Fixed bug #29522 (accessing properties without connection) (Georg)
|
||||
- Fixed bug #29505 (get_class_vars() severely broken when used with arrays).
|
||||
(Marcus)
|
||||
- Fixed bug #29490 (.Net object instantiation failed). (Michael Sisolak).
|
||||
- Fixed bug #29474 (win32: usleep() doesn't work). (Wez)
|
||||
- Fixed bug #29449 (win32: feof() hangs on empty tcp stream). (Wez)
|
||||
- Fixed bug #29437 (Possible crash inside array_walk_recursive()). (Ilia)
|
||||
- Fixed bug #29431 (crash when parsing invalid address; invalid address
|
||||
returned by stream_socket_recvfrom(), stream_socket_getname()). (Wez)
|
||||
- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob)
|
||||
- Fixed unloading of dynamically loaded extensions.
|
||||
(Marcus, kameshj at fastmail dot fm)
|
||||
- Fixed bug #29395 (sqlite_escape_string() returns bogus data on empty
|
||||
strings). (Ilia, Tony)
|
||||
- Fixed bug #29392 (com_dotnet crashes when echo'ing an object). (Wez)
|
||||
- Fixed bug #29368 (The destructor is called when an exception is thrown from
|
||||
the constructor). (Marcus)
|
||||
- Fixed bug #29354 (Exception constructor marked as both public and protected).
|
||||
(Marcus)
|
||||
- Fixed bug #29342 (strtotime() does not handle empty date string properly).
|
||||
(Ilia)
|
||||
- Fixed bug #29340 (win32 build produces invalid php_ifx.dll). (Edin)
|
||||
- Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg)
|
||||
- Fixed bug #29291 (get_class_vars() return names with NULLs). (Marcus)
|
||||
- Fixed bug #29264 (gettext extension not working). (Edin)
|
||||
- Fixed bug #29258 (variant_date_from_timestamp() does not honour
|
||||
timezone). (Wez)
|
||||
- Fixed bug #29256 (error when sending large packets on a socket). (Dmitry)
|
||||
- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry)
|
||||
- Fixed bug #29147 (Compile Error in mnoGoSearch functions). (Sergey, Antony)
|
||||
- Fixed bug #29132 ($_SERVER["PHP_AUTH_USER"] isn't defined). (Stefan)
|
||||
- Fixed bug #29119 (html_entity_decode() misbehaves with UTF-8). (Moriyoshi)
|
||||
- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry)
|
||||
- Fixed bug #29061 (soap extension segfaults). (Dmitry)
|
||||
- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry)
|
||||
- Fixed bug #28969 (Wrong data encoding of special characters). (Dmitry)
|
||||
- Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
|
||||
- Fixed bug #28829 (Thread-unsafety in bcmath elementary values). (Sara)
|
||||
- Fixed bug #28464 (catch() does not catch exceptions by interfaces). (Marcus)
|
||||
- Fixed bug #27669 (PHP 5 didn't support all possibilities for calling static
|
||||
methods dynamically). (Dmitry)
|
||||
- Fixed ReflectionClass::getMethod() and ReflectionClass::getProperty() to
|
||||
raise an ReflectionException instead of returning NULL on failure.
|
||||
(Sebastian)
|
||||
- Fixed convert.* filters to consume remaining buckets_in on flush. (Sara)
|
||||
- Fixed bug in mysqli->client_version. (Georg)
|
||||
|
||||
13 Jul 2004, PHP 5.0.0
|
||||
?? Jul 2004, PHP 5.0.0
|
||||
- Updated PCRE to provide better error handling in certain cases. (Andrei)
|
||||
- Changed doc comments to require a single white space after '/**'. (Marcus)
|
||||
- Fixed bug #29019 (Database not closing). (Marcus)
|
||||
- Fixed bug #29008 (array_combine() does not handle non-numeric/string keys).
|
||||
(Ilia)
|
||||
- Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X). (Ilia)
|
||||
- Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
|
||||
- Fixed bug #28868 (Internal filter registry not thread safe). (Sara)
|
||||
- Fixed bug #28851 (call_user_func_array has typo in error message). (Marcus)
|
||||
- Fixed bug #28831 (ArrayObject::offsetGet() does the work of offsetUnset()).
|
||||
@@ -640,6 +24,7 @@ PHP NEWS
|
||||
- Fixed bug #28699 (Reflection api bugs). (Marcus)
|
||||
- Fixed bug #28694 (ReflectionExtension::getFunctions() crashes PHP). (Marcus)
|
||||
- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank)
|
||||
- Fixed bug #28325 (Circular references not properly serialised). (Moriyoshi)
|
||||
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
|
||||
|
||||
7 Jun 2004, PHP 5 Release Candidate 3
|
||||
@@ -724,6 +109,7 @@ PHP NEWS
|
||||
- Fixed bug #27619 (filters not applied to pre-buffered stream data). (Sara)
|
||||
- Fixed bug #27519 (Reflection_Function constructor crashes with non-existant
|
||||
function's name). (Marcus)
|
||||
- Fixed bug #27469 (serialize() objects of incomplete class). (Dmitry)
|
||||
- Fixed bug #27457 (handling of numeric indexes in strtr()). (Dmitry)
|
||||
- Fixed bug #27397 (debug_backtrace() not showing function arguments). (Zeev)
|
||||
- Fixed bug #27283 (The last catch statement was sometimes skipped). (Andi)
|
||||
|
||||
+28
-28
@@ -29,14 +29,7 @@ Having said that, here are the organizational rules:
|
||||
5. If you don't know how to do something, ask first!
|
||||
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
|
||||
Currently we have the following branches in use:
|
||||
HEAD Will become PHP 5.1. This CVS branch is for active development.
|
||||
PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted
|
||||
on this branch.
|
||||
|
||||
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
@@ -44,11 +37,8 @@ The next few rules are more of a technical nature.
|
||||
messages every day. Woe be to those who attempt to mess with it.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file.
|
||||
|
||||
NB! Lines, starting with @ will go automagically into NEWS file, but
|
||||
this is NOT recommended, though. Please, add news entries directly to
|
||||
NEWS file and don't forget to keep them adjusted and sorted.
|
||||
bug fixes, improvements, etc., should go into the NEWS file. Also see
|
||||
the note below about automatically updating NEWS in your commit message.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
@@ -68,29 +58,37 @@ The next few rules are more of a technical nature.
|
||||
|
||||
The format of the commit messages is pretty simple.
|
||||
|
||||
Use a - to start a new item in your commit message.
|
||||
|
||||
If a line begins with #, it is taken to be a comment and will not appear
|
||||
in the ChangeLog. Everything else goes into the ChangeLog.
|
||||
in the ChangeLog. If the line begins with @, it will be redirected to the
|
||||
NEWS file. Everything else goes into the ChangeLog.
|
||||
|
||||
It is important to note that if your comment or news logline spans multiple
|
||||
lines, you have to put # at the beginning of _every_ such line.
|
||||
lines, you have to put # or @ at the beginning of _every_ such line. Every
|
||||
entry in NEWS has to have a name after it, so if you did it with someone's
|
||||
help, put both your names there. Your name WILL NOT be automatically put
|
||||
at the end of the NEWS entry - so, please provide it yourself.
|
||||
|
||||
Example. Say you modified two files, datetime.c and string.c. In datetime.c you
|
||||
added a new format option for the date() function, and in string.c you fixed a
|
||||
memory leak in php_trim(). Don't commit both of these at once. Commit them
|
||||
Example. Say you modified two files, datetime.c and string.c. In datetime.c
|
||||
you added a new format option for date() function, and in string.c you fixed
|
||||
a memory leak in php_trim(). Don't commit both of these at once. Commit them
|
||||
separately and try to make sure your commit messages look something like the
|
||||
following.
|
||||
|
||||
For datetime.c:
|
||||
- Added new 'K' format modifier to date() for printing out number of days until
|
||||
New Year's Eve.
|
||||
|
||||
(PHP date) Added new 'K' format modifier for printing out number of
|
||||
days until New Year's Eve.
|
||||
@- Added new 'K' format modifier that will output the number of days
|
||||
@ until New Year's Eve. (Bob)
|
||||
|
||||
For string.c:
|
||||
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
|
||||
#- Man, that thing was leaking all over the place!
|
||||
(php_trim) Fixed a memory leak resulting from improper use of zval_dtor().
|
||||
# Man, that thing was leaking all over the place!
|
||||
@- Fixed memory leak in trim(). (Bob)
|
||||
|
||||
The # lines will be omitted from the ChangeLog automagically.
|
||||
The lines above marked with @ will go into NEWS file automagically, and the
|
||||
# lines will be omitted from the ChangeLog. Alternatively, you might want
|
||||
to modify NEWS file directly and not use the @ lines.
|
||||
|
||||
If you fix some bugs, you should note the bug ID numbers in your
|
||||
commit message. Bug ID should be prefixed by "#" for easier access to
|
||||
@@ -98,11 +96,13 @@ bug report when developers are browsing CVS via. LXR or Bonsai.
|
||||
|
||||
Example:
|
||||
|
||||
Fixed bug #14016 (pgsql notice handler double free crash bug.)
|
||||
Fixed pgsql notice handler double free crash bug. Bug #14016
|
||||
@ Fixed pgsql notice handler double free crash bug. Bug #14016
|
||||
|
||||
If you don't see your messages in ChangeLog right away, don't worry!
|
||||
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later.
|
||||
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
|
||||
lines in the commit message.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
@@ -77,24 +77,20 @@
|
||||
|
||||
9. get_class() starting PHP 5 returns the name of the class as it was
|
||||
declared which may lead to problems in older scripts that rely on
|
||||
the previous behaviour - the class name is lowercased. Expect the
|
||||
same behaviour from get_parent_class() when applicable.
|
||||
the previous behaviour - the class name is lowercased.
|
||||
Example :
|
||||
<?php
|
||||
class FooBar {
|
||||
}
|
||||
class ExtFooBar extends FooBar{}
|
||||
$a = new FooBar();
|
||||
var_dump(get_class($a), get_parent_class($a));
|
||||
var_dump(get_class($a));
|
||||
?>
|
||||
|
||||
Output (PHP 4):
|
||||
string(6) "foobar"
|
||||
string(9) "extfoobar"
|
||||
|
||||
Output (PHP 5):
|
||||
string(6) "FooBar"
|
||||
string(9) "ExtFooBar"
|
||||
----------------------------------------------------------------------
|
||||
Example code that will break :
|
||||
//....
|
||||
@@ -105,51 +101,7 @@
|
||||
//...
|
||||
}
|
||||
//...
|
||||
Possible solution is to search for get_class() and get_parent_class() in
|
||||
all your scripts and use strtolower().
|
||||
|
||||
10. get_class_methods() returns the names of the methods of a class as they
|
||||
declared. In PHP4 the names are all lowercased.
|
||||
Example code :
|
||||
<?php
|
||||
class Foo{
|
||||
function doFoo(){}
|
||||
function hasFoo(){}
|
||||
}
|
||||
var_dump(get_class_methods("Foo"));
|
||||
?>
|
||||
Output (PHP4):
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(5) "dofoo"
|
||||
[1]=>
|
||||
string(6) "hasfoo"
|
||||
}
|
||||
Output (PHP5):
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(5) "doFoo"
|
||||
[1]=>
|
||||
string(6) "hasFoo"
|
||||
}
|
||||
|
||||
11. Assignment $this is impossible. Starting PHP 5.0.0 $this has special
|
||||
meaning in class methods and is recognized by the PHP parser. The latter
|
||||
will generate a parse error when assignment to $this is found
|
||||
Example code :
|
||||
<?php
|
||||
class Foo {
|
||||
function assignNew($obj) {
|
||||
$this = $obj;
|
||||
}
|
||||
}
|
||||
$a = new Foo();
|
||||
$b = new Foo();
|
||||
$a->assignNew($b);
|
||||
echo "I was executed\n";
|
||||
?>
|
||||
Output (PHP 4):
|
||||
I was executed
|
||||
Output (PHP 5):
|
||||
PHP Fatal error: Cannot re-assign $this in /tmp/this_ex.php on line 4
|
||||
Possible solution is to search for get_class() in all your scripts and
|
||||
use strtolower().
|
||||
|
||||
|
||||
+42
-2
@@ -296,11 +296,11 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
}
|
||||
}
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
if (tsrm_new_thread_end_handler) {
|
||||
tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage));
|
||||
}
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}
|
||||
|
||||
|
||||
@@ -481,6 +481,13 @@ TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
{
|
||||
#ifdef TSRM_WIN32
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(NETWARE)
|
||||
/* There seems to be some problem with the LibC call: NXThreadGetId().
|
||||
* Due to this, the PHPMyAdmin application is abending in PHP calls.
|
||||
* Used the call, kCurrentThread instead and it works fine.
|
||||
*/
|
||||
/* return NXThreadGetId(); */
|
||||
return kCurrentThread();
|
||||
#elif defined(GNUPTH)
|
||||
return pth_self();
|
||||
#elif defined(PTHREADS)
|
||||
@@ -501,9 +508,24 @@ TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
|
||||
{
|
||||
MUTEX_T mutexp;
|
||||
#ifdef NETWARE
|
||||
#ifndef USE_MPK
|
||||
/* To use the Recursive Mutex Locking of LibC */
|
||||
long flags = NX_MUTEX_RECURSIVE;
|
||||
NXHierarchy_t order = 0;
|
||||
NX_LOCK_INFO_ALLOC (lockInfo, "PHP-TSRM", 0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
mutexp = malloc(sizeof(CRITICAL_SECTION));
|
||||
InitializeCriticalSection(mutexp);
|
||||
#elif defined(NETWARE)
|
||||
#ifdef USE_MPK
|
||||
mutexp = kMutexAlloc((BYTE*)"PHP-TSRM");
|
||||
#else
|
||||
mutexp = NXMutexAlloc(flags, order, &lockInfo);
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
mutexp = (MUTEX_T) malloc(sizeof(*mutexp));
|
||||
pth_mutex_init(mutexp);
|
||||
@@ -535,6 +557,12 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
#ifdef TSRM_WIN32
|
||||
DeleteCriticalSection(mutexp);
|
||||
free(mutexp);
|
||||
#elif defined(NETWARE)
|
||||
#ifdef USE_MPK
|
||||
kMutexFree(mutexp);
|
||||
#else
|
||||
NXMutexFree(mutexp);
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
free(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
@@ -564,6 +592,12 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
|
||||
#ifdef TSRM_WIN32
|
||||
EnterCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(NETWARE)
|
||||
#ifdef USE_MPK
|
||||
return kMutexLock(mutexp);
|
||||
#else
|
||||
return NXLock(mutexp);
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
return pth_mutex_acquire(mutexp, 0, NULL);
|
||||
#elif defined(PTHREADS)
|
||||
@@ -589,6 +623,12 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
|
||||
#ifdef TSRM_WIN32
|
||||
LeaveCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(NETWARE)
|
||||
#ifdef USE_MPK
|
||||
return kMutexUnlock(mutexp);
|
||||
#else
|
||||
return NXUnlock(mutexp);
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
return pth_mutex_release(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
|
||||
+16
-2
@@ -14,8 +14,8 @@
|
||||
#define TSRM_H
|
||||
|
||||
/* #ifndef WIN32 */
|
||||
#ifndef WIN32
|
||||
# include <tsrm_config.h>
|
||||
#if !defined(WIN32) && !defined(NETWARE)
|
||||
# include "tsrm_config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -42,6 +42,13 @@
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <shellapi.h>
|
||||
#elif defined(NETWARE)
|
||||
# include <nks/thread.h>
|
||||
#ifdef USE_MPK
|
||||
# include <mpklib4php.h>
|
||||
#else
|
||||
# include <nks/synch.h>
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
# include <pth.h>
|
||||
#elif defined(PTHREADS)
|
||||
@@ -59,6 +66,13 @@ typedef int ts_rsrc_id;
|
||||
#ifdef TSRM_WIN32
|
||||
# define THREAD_T DWORD
|
||||
# define MUTEX_T CRITICAL_SECTION *
|
||||
#elif defined(NETWARE)
|
||||
# define THREAD_T NXThreadId_t
|
||||
#ifdef USE_MPK
|
||||
# define MUTEX_T MUTEX
|
||||
#else
|
||||
# define MUTEX_T NXMutex_t *
|
||||
#endif
|
||||
#elif defined(GNUPTH)
|
||||
# define THREAD_T pth_t
|
||||
# define MUTEX_T pth_mutex_t *
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
])
|
||||
|
||||
+5
-13
@@ -30,7 +30,7 @@ dnl PTHREADS_FLAGS
|
||||
dnl
|
||||
dnl Set some magic defines to achieve POSIX threads conformance
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_FLAGS],[
|
||||
AC_DEFUN(PTHREADS_FLAGS,[
|
||||
if test -z "$host_alias" && test -n "$host"; then
|
||||
host_alias=$host
|
||||
fi
|
||||
@@ -65,7 +65,7 @@ dnl PTHREADS_CHECK_COMPILE
|
||||
dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
|
||||
AC_DEFUN(PTHREADS_CHECK_COMPILE, [
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
@@ -84,15 +84,7 @@ int main() {
|
||||
pthreads_working=yes
|
||||
], [
|
||||
pthreads_working=no
|
||||
], [
|
||||
dnl For cross compiling running this test is of no use. NetWare supports pthreads
|
||||
pthreads_working=no
|
||||
case $host_alias in
|
||||
*netware*)
|
||||
pthreads_working=yes
|
||||
esac
|
||||
]
|
||||
) ] )dnl
|
||||
], pthreads_working=no ) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
dnl
|
||||
@@ -108,7 +100,7 @@ dnl -pthreads gcc (Solaris)
|
||||
dnl -qthreaded AIX cc V5
|
||||
dnl -threads gcc (HP-UX)
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK],[
|
||||
AC_DEFUN(PTHREADS_CHECK,[
|
||||
|
||||
if test "$beos_threads" = "1"; then
|
||||
pthreads_working="yes"
|
||||
@@ -162,7 +154,7 @@ fi
|
||||
])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_ASSIGN_VARS],[
|
||||
AC_DEFUN(PTHREADS_ASSIGN_VARS,[
|
||||
if test -n "$ac_cv_pthreads_lib"; then
|
||||
LIBS="$LIBS -l$ac_cv_pthreads_lib"
|
||||
fi
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
|
||||
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
||||
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
|
||||
AC_DEFUN(TSRM_CHECK_GCC_ARG,[
|
||||
gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
|
||||
AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
|
||||
echo 'void somefunc() { };' > conftest.c
|
||||
@@ -21,7 +21,7 @@ AC_DEFUN([TSRM_CHECK_GCC_ARG],[
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([TSRM_BASIC_CHECKS],[
|
||||
AC_DEFUN(TSRM_BASIC_CHECKS,[
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
|
||||
@@ -33,7 +33,7 @@ AC_CHECK_HEADERS(stdarg.h)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([TSRM_CHECK_PTH],[
|
||||
AC_DEFUN(TSRM_CHECK_PTH,[
|
||||
|
||||
AC_MSG_CHECKING(for GNU Pth)
|
||||
PTH_PREFIX="`$1 --prefix`"
|
||||
@@ -50,7 +50,7 @@ AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([TSRM_CHECK_ST],[
|
||||
AC_DEFUN(TSRM_CHECK_ST,[
|
||||
if test -r "$1/include/st.h"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$1/include"
|
||||
LDFLAGS="$LDFLAGS -L$1/lib"
|
||||
@@ -70,7 +70,7 @@ AC_DEFUN([TSRM_CHECK_ST],[
|
||||
sinclude(threads.m4)
|
||||
sinclude(TSRM/threads.m4)
|
||||
|
||||
AC_DEFUN([TSRM_CHECK_PTHREADS],[
|
||||
AC_DEFUN(TSRM_CHECK_PTHREADS,[
|
||||
|
||||
PTHREADS_CHECK
|
||||
|
||||
@@ -89,7 +89,7 @@ fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([TSRM_THREADS_CHECKS],[
|
||||
AC_DEFUN(TSRM_THREADS_CHECKS,[
|
||||
|
||||
dnl For the thread implementations, we always use --with-*
|
||||
dnl to maintain consistency
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
# include "tsrm_config.w32.h"
|
||||
#elif defined(NETWARE)
|
||||
# include "tsrm_config.nw.h"
|
||||
#else
|
||||
# include <tsrm_config.h>
|
||||
# include "tsrm_config.h"
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
|
||||
+43
-79
@@ -42,7 +42,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
#include <fsio.h>
|
||||
/*#include "pipe.h"*/
|
||||
#include "tsrm_nw.h"
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_REALPATH
|
||||
@@ -141,9 +142,15 @@ static int php_check_dots(const char *element, int n)
|
||||
|
||||
static int php_is_dir_ok(const cwd_state *state)
|
||||
{
|
||||
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
|
||||
struct stat buf;
|
||||
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
#else
|
||||
struct stat_libc buf;
|
||||
|
||||
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode))
|
||||
#endif
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
@@ -151,9 +158,15 @@ static int php_is_dir_ok(const cwd_state *state)
|
||||
|
||||
static int php_is_file_ok(const cwd_state *state)
|
||||
{
|
||||
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
|
||||
struct stat buf;
|
||||
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
|
||||
#else
|
||||
struct stat_libc buf;
|
||||
|
||||
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode))
|
||||
#endif
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
@@ -189,20 +202,7 @@ CWD_API void virtual_cwd_startup(void)
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
#ifdef NETWARE
|
||||
result = getcwdpath(cwd, NULL, 1);
|
||||
if(result)
|
||||
{
|
||||
char *c=cwd;
|
||||
while(c = strchr(c, '\\'))
|
||||
{
|
||||
*c='/';
|
||||
++c;
|
||||
}
|
||||
}
|
||||
#else
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
cwd[0] = '\0';
|
||||
}
|
||||
@@ -308,22 +308,15 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
|
||||
if (path_length == 0)
|
||||
return (0);
|
||||
if (path_length >= MAXPATHLEN)
|
||||
return (1);
|
||||
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
/* cwd_length can be 0 when getcwd() fails.
|
||||
* This can happen under solaris when a dir does not have read permissions
|
||||
* but *does* have execute permissions */
|
||||
if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) {
|
||||
if (use_realpath) {
|
||||
if (realpath(path, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
} else {
|
||||
/* disable for now
|
||||
return 1; */
|
||||
}
|
||||
if (use_realpath && realpath(path, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
}
|
||||
} else { /* Concat current directory with relative path and then run realpath() on it */
|
||||
char *tmp;
|
||||
@@ -339,19 +332,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
memcpy(ptr, path, path_length);
|
||||
ptr += path_length;
|
||||
*ptr = '\0';
|
||||
if (strlen(tmp) >= MAXPATHLEN) {
|
||||
free(tmp);
|
||||
return 1;
|
||||
}
|
||||
if (use_realpath) {
|
||||
if (realpath(tmp, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
} else {
|
||||
/* disable for now
|
||||
free(tmp);
|
||||
return 1; */
|
||||
}
|
||||
if (use_realpath && realpath(tmp, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
}
|
||||
free(tmp);
|
||||
}
|
||||
@@ -445,19 +428,8 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/*
|
||||
Below code keeps appending to state->cwd a File system seperator
|
||||
cases where this appending should not happen is given below,
|
||||
a) sys: should just be left as it is
|
||||
b) sys:system should just be left as it is,
|
||||
Colon is allowed only in the first token as volume names alone can have the : in their names.
|
||||
Files and Directories cannot have : in their names
|
||||
So the check goes like this,
|
||||
For second token and above simply append the DEFAULT_SLASH to the state->cwd.
|
||||
For first token check for the existence of :
|
||||
if it exists don't append the DEFAULT_SLASH to the state->cwd.
|
||||
*/
|
||||
if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) {
|
||||
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
|
||||
if (ptr[ptr_length-1] != ':') {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#else
|
||||
@@ -727,6 +699,7 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
@@ -740,8 +713,23 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
#else
|
||||
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
retval = stat(new_state.cwd, (struct stat*)buf);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
@@ -863,24 +851,13 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
{
|
||||
int command_length;
|
||||
int dir_length, extra = 0;
|
||||
char *command_line;
|
||||
char *ptr, *dir;
|
||||
char *ptr;
|
||||
FILE *retval;
|
||||
|
||||
command_length = strlen(command);
|
||||
|
||||
dir_length = CWDG(cwd).cwd_length;
|
||||
dir = CWDG(cwd).cwd;
|
||||
while (dir_length > 0) {
|
||||
if (*dir == '\'') extra+=3;
|
||||
dir++;
|
||||
dir_length--;
|
||||
}
|
||||
dir_length = CWDG(cwd).cwd_length;
|
||||
dir = CWDG(cwd).cwd;
|
||||
|
||||
ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length +extra+1+1);
|
||||
ptr = command_line = (char *) malloc(command_length + sizeof("cd ; ") + CWDG(cwd).cwd_length+1);
|
||||
if (!command_line) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -890,21 +867,8 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
|
||||
if (CWDG(cwd).cwd_length == 0) {
|
||||
*ptr++ = DEFAULT_SLASH;
|
||||
} else {
|
||||
*ptr++ = '\'';
|
||||
while (dir_length > 0) {
|
||||
switch (*dir) {
|
||||
case '\'':
|
||||
*ptr++ = '\'';
|
||||
*ptr++ = '\\';
|
||||
*ptr++ = '\'';
|
||||
/* fall-through */
|
||||
default:
|
||||
*ptr++ = *dir;
|
||||
}
|
||||
dir++;
|
||||
dir_length--;
|
||||
}
|
||||
*ptr++ = '\'';
|
||||
memcpy(ptr, CWDG(cwd).cwd, CWDG(cwd).cwd_length);
|
||||
ptr += CWDG(cwd).cwd_length;
|
||||
}
|
||||
|
||||
*ptr++ = ' ';
|
||||
|
||||
@@ -74,8 +74,10 @@ typedef unsigned short mode_t;
|
||||
#define DEFAULT_DIR_SEPARATOR ';'
|
||||
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
|
||||
#define IS_SLASH_P(c) IS_SLASH(*(c))
|
||||
#define COPY_WHEN_ABSOLUTE(path) \
|
||||
(strchr(path, ':') - path + 1) /* Take the volume name which ends with a colon */
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
|
||||
(strchr(path, ':') != NULL) /* Colon indicates volume name */
|
||||
|
||||
#else
|
||||
#ifdef HAVE_DIRENT_H
|
||||
@@ -139,7 +141,11 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
|
||||
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
|
||||
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
|
||||
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
|
||||
#else
|
||||
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC);
|
||||
#endif
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
|
||||
#endif
|
||||
@@ -223,7 +229,7 @@ typedef struct _virtual_cwd_globals {
|
||||
#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
|
||||
#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
|
||||
#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
|
||||
#ifndef TSRM_WIN32
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
|
||||
#endif
|
||||
#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
|
||||
|
||||
+2
-39
@@ -1,40 +1,3 @@
|
||||
2004-07-14 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_object_handlers.c:
|
||||
be consistent with write_dimension
|
||||
|
||||
* zend_object_handlers.c:
|
||||
fix #28957
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- 5.0.1-dev
|
||||
|
||||
2004-07-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_constants.c:
|
||||
Bugfix #29116 Zend constant warning uses memory after free (jdolecek at
|
||||
NetBSD dot org)
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0)
|
||||
zend.h:
|
||||
- Roll PHP 5.0.0
|
||||
|
||||
2004-07-12 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
zend_execute.c:
|
||||
Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts).
|
||||
|
||||
2004-07-12 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
zend.c:
|
||||
- Convert zend_class_entry -> zend_class_entry *
|
||||
|
||||
2004-07-10 Jon Parise <jon+php@csh.rit.edu>
|
||||
|
||||
* zend.c:
|
||||
@@ -6446,13 +6409,13 @@
|
||||
2003-02-08 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
The string.h is already available through zend.h, so the manual inclusion
|
||||
The string.h is already avaliable through zend.h, so the manual inclusion
|
||||
is not necessary.
|
||||
|
||||
2003-02-07 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Added a check to ensure that string.h is available before trying to use it.
|
||||
Added a check to ensure that string.h is avaliable before trying to use it.
|
||||
|
||||
Thanks Andi.
|
||||
|
||||
|
||||
+1
-2
@@ -16,8 +16,7 @@ libZend_la_SOURCES=\
|
||||
zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c zend_mm.c \
|
||||
zend_default_classes.c zend_reflection_api.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c \
|
||||
zend_strtod.c zend_multibyte.c
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
|
||||
+1
-42
@@ -545,7 +545,7 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
<?php
|
||||
class Exception {
|
||||
function __construct(/*string*/ $message=NULL, /*int*/ $code=0) {
|
||||
function __construct(string $message=NULL, int $code=0) {
|
||||
if (func_num_args()) {
|
||||
$this->message = $message;
|
||||
}
|
||||
@@ -890,47 +890,6 @@ Changes in the Zend Engine 2.0
|
||||
the use of all abstract methods declared in the interfaces Iterator
|
||||
and IteratorAggregate respectively.
|
||||
|
||||
* Array overloading
|
||||
|
||||
Objects can be used with Array notation when they implement the
|
||||
interface ArrayAccess. You cannot use such objects in standard
|
||||
array functions, however you have full control over the array
|
||||
notation. This allows lazy initialization or read only array.
|
||||
|
||||
Note that setting [] results in a call to offsetSet() with
|
||||
index being NULL. That means that as with standard arrays you
|
||||
cannot store NULL keys.
|
||||
|
||||
Example:
|
||||
|
||||
<?php
|
||||
class ArrayClass implements ArrayAccess {
|
||||
public $a = array();
|
||||
|
||||
function offsetExists($index) {
|
||||
return array_key_exists($index, $this->a);
|
||||
}
|
||||
function offsetGet($index) {
|
||||
return $this->a[$index];
|
||||
}
|
||||
function offsetSet($index, $newval) {
|
||||
return $this->a[$index] = $newval;
|
||||
}
|
||||
function offsetUnset($index) {
|
||||
unset($this->a[$index]);
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new ArrayClass;
|
||||
|
||||
$obj[0] = 'bla'; // calls offsetSet(0,'bla')
|
||||
$obj[] = 42; // calls offsetSet(NULL, 42)
|
||||
$x = $obj[0]; // calls offsetGet(0)
|
||||
$b = isset($obj[0]); // calls offsetExists(0)
|
||||
unset($obj[0]); // calls offsetUnset(0)
|
||||
?>
|
||||
|
||||
|
||||
* __METHOD__
|
||||
|
||||
The pseudo constant __METHOD__ shows the current class and method
|
||||
|
||||
+19
-27
@@ -7,20 +7,20 @@
|
||||
CFG=Zend - Win32 Release_inline
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Zend.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Zend.mak" CFG="Zend - Win32 Release_inline"
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE "Zend - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Zend - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Zend - Win32 Release_inline" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
@@ -95,7 +95,7 @@ LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
@@ -135,6 +135,10 @@ SOURCE=.\zend_default_classes.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_interfaces.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_dynamic_array.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -175,10 +179,6 @@ SOURCE=.\zend_ini_scanner.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_interfaces.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend_language_parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -243,10 +243,6 @@ SOURCE=.\zend_stream.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ts_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -295,6 +291,10 @@ SOURCE=.\zend_default_classes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_interfaces.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_dynamic_array.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -351,10 +351,6 @@ SOURCE=.\zend_ini_scanner.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_interfaces.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_istdiostream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -419,10 +415,6 @@ SOURCE=.\zend_stream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ts_hash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -457,7 +449,7 @@ BuildCmds= \
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -512,7 +504,7 @@ BuildCmds= \
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
@@ -541,7 +533,7 @@ InputPath=.\zend_ini_scanner.l
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -578,7 +570,7 @@ InputPath=".\zend_language_scanner.l"
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
|
||||
+7
-56
@@ -4,7 +4,7 @@ dnl
|
||||
dnl This file contains Zend specific autoconf functions.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
AC_DEFUN(LIBZEND_BISON_CHECK,[
|
||||
|
||||
if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.)
|
||||
@@ -19,29 +19,7 @@ fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
|
||||
AC_MSG_CHECKING(for $1)
|
||||
AC_TRY_COMPILE([
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#elif HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif],
|
||||
[if (($1 *) 0)
|
||||
return 0;
|
||||
if (sizeof ($1))
|
||||
return 0;
|
||||
],[
|
||||
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
|
||||
AC_MSG_RESULT(yes)
|
||||
], AC_MSG_RESULT(no)
|
||||
)dnl
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
|
||||
AC_DEFUN(LIBZEND_BASIC_CHECKS,[
|
||||
|
||||
AC_REQUIRE([AC_PROG_YACC])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
@@ -64,8 +42,6 @@ if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(
|
||||
inttypes.h \
|
||||
stdint.h \
|
||||
limits.h \
|
||||
malloc.h \
|
||||
string.h \
|
||||
@@ -82,12 +58,12 @@ dlfcn.h)
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_DEFUN([LIBZEND_LIBDL_CHECKS],[
|
||||
AC_DEFUN(LIBZEND_LIBDL_CHECKS,[
|
||||
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
|
||||
AC_CHECK_FUNC(dlopen,[AC_DEFINE(HAVE_LIBDL, 1,[ ])])
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_DLSYM_CHECK],[
|
||||
AC_DEFUN(LIBZEND_DLSYM_CHECK,[
|
||||
dnl
|
||||
dnl Ugly hack to check if dlsym() requires a leading underscore in symbol name.
|
||||
dnl
|
||||
@@ -106,10 +82,6 @@ dnl This is required for QNX and may be some BSD derived systems
|
||||
AC_CHECK_TYPE( uint, unsigned int )
|
||||
AC_CHECK_TYPE( ulong, unsigned long )
|
||||
|
||||
dnl Check if int32_t and uint32_t are defined
|
||||
LIBZEND_CHECK_INT_TYPE(int32_t)
|
||||
LIBZEND_CHECK_INT_TYPE(uint32_t)
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_MEMCMP
|
||||
@@ -123,7 +95,7 @@ ZEND_FP_EXCEPT
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_ENABLE_DEBUG],[
|
||||
AC_DEFUN(LIBZEND_ENABLE_DEBUG,[
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Compile with debugging symbols],[
|
||||
@@ -134,16 +106,7 @@ AC_ARG_ENABLE(debug,
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
|
||||
|
||||
AC_ARG_ENABLE(zend-memory-manager,
|
||||
[ --disable-zend-memory-manager
|
||||
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
|
||||
[
|
||||
ZEND_USE_ZEND_ALLOC=$enableval
|
||||
], [
|
||||
ZEND_USE_ZEND_ALLOC=yes
|
||||
])
|
||||
AC_DEFUN(LIBZEND_OTHER_CHECKS,[
|
||||
|
||||
AC_ARG_ENABLE(maintainer-zts,
|
||||
[ --enable-maintainer-zts Enable thread safety - for code maintainers only],[
|
||||
@@ -174,9 +137,6 @@ AC_ARG_ENABLE(zend-multibyte,
|
||||
ZEND_MULTIBYTE=no
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable the Zend memory manager)
|
||||
AC_MSG_RESULT($ZEND_USE_ZEND_ALLOC)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable thread-safety)
|
||||
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
|
||||
|
||||
@@ -207,12 +167,6 @@ fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
|
||||
AC_DEFINE(USE_ZEND_ALLOC,1,[Use Zend memory manager])
|
||||
else
|
||||
AC_DEFINE(USE_ZEND_ALLOC,0,[Use Zend memory manager])
|
||||
fi
|
||||
|
||||
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
CFLAGS="$CFLAGS -DZTS"
|
||||
@@ -283,9 +237,6 @@ int main()
|
||||
LIBZEND_MM_ALIGN_LOG2=`cat conftest.zend | cut -d ' ' -f 2`
|
||||
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
|
||||
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
|
||||
], [], [
|
||||
dnl cross-compile needs something here
|
||||
LIBZEND_MM_ALIGN=8
|
||||
])
|
||||
|
||||
AC_MSG_RESULT(done)
|
||||
@@ -293,7 +244,7 @@ AC_MSG_RESULT(done)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([LIBZEND_CPLUSPLUS_CHECKS],[
|
||||
AC_DEFUN(LIBZEND_CPLUSPLUS_CHECKS,[
|
||||
|
||||
])
|
||||
|
||||
@@ -276,10 +276,6 @@ SOURCE=.\zend_stream.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ts_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -456,10 +452,6 @@ SOURCE=.\zend_stream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_strtod.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ts_hash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+4
-11
@@ -23,7 +23,9 @@
|
||||
#define ZEND_DLEXPORT
|
||||
#define ZEND_DLIMPORT
|
||||
|
||||
#ifndef NETWARE
|
||||
@TOP@
|
||||
#endif
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
@@ -31,7 +33,9 @@
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
|
||||
#ifndef NETWARE
|
||||
@BOTTOM@
|
||||
#endif
|
||||
|
||||
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
|
||||
|
||||
@@ -43,10 +47,6 @@
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
@@ -98,13 +98,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||
|
||||
#ifdef NETWARE
|
||||
#ifdef USE_WINSOCK
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+4
-31
@@ -2,7 +2,7 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([ZEND_FP_EXCEPT],[
|
||||
AC_DEFUN(ZEND_FP_EXCEPT,[
|
||||
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
|
||||
AC_TRY_COMPILE([
|
||||
#include <floatingpoint.h>
|
||||
@@ -23,7 +23,7 @@ fp_except x = (fp_except) 0;
|
||||
dnl
|
||||
dnl Check for broken sprintf()
|
||||
dnl
|
||||
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
|
||||
AC_DEFUN(AC_ZEND_BROKEN_SPRINTF,[
|
||||
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
|
||||
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
|
||||
ac_cv_broken_sprintf=no
|
||||
@@ -41,34 +41,7 @@ AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
|
||||
AC_DEFINE_UNQUOTED(ZEND_BROKEN_SPRINTF, $ac_result, [Whether sprintf is broken])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ZEND_C_BIGENDIAN
|
||||
dnl Replacement macro for AC_C_BIGENDIAN
|
||||
dnl
|
||||
AC_DEFUN([AC_ZEND_C_BIGENDIAN],
|
||||
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
|
||||
[
|
||||
ac_cv_c_bigendian_php=unknown
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
int main(void)
|
||||
{
|
||||
short one = 1;
|
||||
char *cp = (char *)&one;
|
||||
|
||||
if (*cp == 0) {
|
||||
return(0);
|
||||
} else {
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
])
|
||||
if test $ac_cv_c_bigendian_php = yes; then
|
||||
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
])
|
||||
|
||||
@@ -10,14 +10,10 @@ AC_PROG_CC
|
||||
AM_PROG_LEX
|
||||
AM_PROG_CC_STDC
|
||||
ZEND_VERSION=$VERSION
|
||||
AC_ZEND_C_BIGENDIAN
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
AC_CHECK_SIZEOF(long, 8)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
|
||||
sinclude(Zend.m4)
|
||||
|
||||
LIBZEND_BASIC_CHECKS
|
||||
|
||||
@@ -39,5 +39,5 @@ echo "Done\n";
|
||||
2
|
||||
3
|
||||
Done
|
||||
test::__destruct
|
||||
test::destructor
|
||||
test::__destruct
|
||||
@@ -19,48 +19,56 @@ for ($i = 0; $i < 8; $i++) {
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
string(3) "foo"
|
||||
'foo'
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Strict Standards: Only variable references should be returned by reference in %s on line %d
|
||||
|
||||
|
||||
@@ -11,19 +11,11 @@ class array_iterator implements IteratorAggregate {
|
||||
|
||||
$obj = new array_iterator;
|
||||
|
||||
try
|
||||
{
|
||||
foreach ($obj as $property => $value)
|
||||
{
|
||||
var_dump($value);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo $e->getMessage() . "\n";
|
||||
foreach ($obj as $property => $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
|
||||
===DONE===
|
||||
Warning: Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator in %sbug26229.php on line %d
|
||||
===DONE===
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #27145 (Errors messages print unmangled PPP property names)
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
protected static $v = "aa";
|
||||
}
|
||||
class b extends a {
|
||||
protected static $v = "bb";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot redeclare property static protected a::$v in class b in %s on line %d
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27268 (Bad references accentuated by clone)
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
{
|
||||
public function &getA()
|
||||
{
|
||||
return $this->a;
|
||||
}
|
||||
}
|
||||
|
||||
$A = new A;
|
||||
$A->a = array(1);
|
||||
$x = $A->getA();
|
||||
$clone = clone $A;
|
||||
$clone->a = array();
|
||||
print_r($A);
|
||||
?>
|
||||
--EXPECT--
|
||||
A Object
|
||||
(
|
||||
[a] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27304
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Staticexample
|
||||
{
|
||||
static function test()
|
||||
{
|
||||
var_dump(isset($this));
|
||||
}
|
||||
}
|
||||
|
||||
$b = new Staticexample();
|
||||
Staticexample::test();
|
||||
$b->test();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27598 (list() array key assignment causes HUGE memory leak)
|
||||
--FILE--
|
||||
<?php
|
||||
list($out[0]) = array(1);
|
||||
var_dump($out);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27798 (private / protected variables not exposed by get_object_vars() inside class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Base
|
||||
{
|
||||
public $Foo = 1;
|
||||
protected $Bar = 2;
|
||||
private $Baz = 3;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
var_dump(get_object_vars($this));
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Base
|
||||
{
|
||||
private $Baz = 4;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
echo __METHOD__ . "\n";
|
||||
var_dump(get_object_vars($this));
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(get_object_vars(new Base));
|
||||
var_dump(get_object_vars(new Child));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Base::__construct
|
||||
array(3) {
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
["Bar"]=>
|
||||
int(2)
|
||||
["Baz"]=>
|
||||
int(3)
|
||||
}
|
||||
array(1) {
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
}
|
||||
Base::__construct
|
||||
array(3) {
|
||||
["Baz"]=>
|
||||
int(4)
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
["Bar"]=>
|
||||
int(2)
|
||||
}
|
||||
Child::__construct
|
||||
array(3) {
|
||||
["Baz"]=>
|
||||
int(4)
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
["Bar"]=>
|
||||
int(2)
|
||||
}
|
||||
array(1) {
|
||||
["Foo"]=>
|
||||
int(1)
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28377 (debug_backtrace is intermittently passing args)
|
||||
--FILE--
|
||||
<?php
|
||||
function doit($a, $b)
|
||||
{
|
||||
$trace = debug_backtrace();
|
||||
custom_callback('dereferenced', $trace);
|
||||
custom_callback('direct', debug_backtrace());
|
||||
}
|
||||
|
||||
function custom_callback($traceName, $btInfo)
|
||||
{
|
||||
echo $traceName ." -- args: ";
|
||||
echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist';
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
doit('a','b');
|
||||
?>
|
||||
--EXPECT--
|
||||
dereferenced -- args: 2
|
||||
direct -- args: 2
|
||||
@@ -1,65 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28442 (Changing a static variables in a class changes it across sub/super classes.)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ClassA
|
||||
{
|
||||
static $prop;
|
||||
}
|
||||
|
||||
class ClassB extends ClassA
|
||||
{
|
||||
static $prop;
|
||||
}
|
||||
|
||||
class ClassC extends ClassB
|
||||
{
|
||||
}
|
||||
|
||||
echo "===INIT===\n";
|
||||
ClassA::$prop = 'A';
|
||||
ClassB::$prop = 'B';
|
||||
ClassC::$prop = 'C';
|
||||
var_dump(ClassA::$prop);
|
||||
var_dump(ClassB::$prop);
|
||||
var_dump(ClassC::$prop);
|
||||
|
||||
echo "===SetA===\n";
|
||||
ClassA::$prop = 'A2';
|
||||
var_dump(ClassA::$prop);
|
||||
var_dump(ClassB::$prop);
|
||||
var_dump(ClassC::$prop);
|
||||
|
||||
echo "===SetB===\n";
|
||||
ClassB::$prop = 'B2';
|
||||
var_dump(ClassA::$prop);
|
||||
var_dump(ClassB::$prop);
|
||||
var_dump(ClassC::$prop);
|
||||
|
||||
echo "===SetC===\n";
|
||||
ClassC::$prop = 'C2';
|
||||
var_dump(ClassA::$prop);
|
||||
var_dump(ClassB::$prop);
|
||||
var_dump(ClassC::$prop);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
===INIT===
|
||||
string(1) "A"
|
||||
string(1) "C"
|
||||
string(1) "C"
|
||||
===SetA===
|
||||
string(2) "A2"
|
||||
string(1) "C"
|
||||
string(1) "C"
|
||||
===SetB===
|
||||
string(2) "A2"
|
||||
string(2) "B2"
|
||||
string(2) "B2"
|
||||
===SetC===
|
||||
string(2) "A2"
|
||||
string(2) "C2"
|
||||
string(2) "C2"
|
||||
===DONE===
|
||||
@@ -1,74 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28444 (Cannot access undefined property for object with overloaded property access)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Object
|
||||
{
|
||||
public $x;
|
||||
|
||||
function __construct($x)
|
||||
{
|
||||
$this->x = $x;
|
||||
}
|
||||
}
|
||||
|
||||
class Overloaded
|
||||
{
|
||||
public $props = array();
|
||||
public $x;
|
||||
|
||||
function __construct($x)
|
||||
{
|
||||
$this->x = new Object($x);
|
||||
}
|
||||
|
||||
function __get($prop)
|
||||
{
|
||||
echo __METHOD__ . "($prop)\n";
|
||||
return $this->props[$prop];
|
||||
}
|
||||
|
||||
function __set($prop, $val)
|
||||
{
|
||||
echo __METHOD__ . "($prop,$val)\n";
|
||||
$this->props[$prop] = $val;
|
||||
}
|
||||
}
|
||||
$y = new Overloaded(2);
|
||||
var_dump($y->x);
|
||||
var_dump($y->x->x);
|
||||
var_dump($y->x->x = 3);
|
||||
var_dump($y->y = 3);
|
||||
var_dump($y->y);
|
||||
var_dump($y->z = new Object(4));
|
||||
var_dump($y->z->x);
|
||||
$t = $y->z;
|
||||
var_dump($t->x = 5);
|
||||
var_dump($y->z->x = 6);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(2)
|
||||
}
|
||||
int(2)
|
||||
int(3)
|
||||
Overloaded::__set(y,3)
|
||||
int(3)
|
||||
Overloaded::__get(y)
|
||||
int(3)
|
||||
Overloaded::__set(z,Object id #3)
|
||||
object(Object)#%d (1) {
|
||||
["x"]=>
|
||||
int(4)
|
||||
}
|
||||
Overloaded::__get(z)
|
||||
int(4)
|
||||
Overloaded::__get(z)
|
||||
int(5)
|
||||
Overloaded::__get(z)
|
||||
int(6)
|
||||
===DONE===
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29015 (Incorrect behavior of member vars(non string ones)-numeric mem vars und others)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass();
|
||||
$x = "";
|
||||
$a->$x = "string('')";
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot access empty property in %sbug29015.php on line 4
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29104 Function declaration in method doesn't work
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
{
|
||||
function g()
|
||||
{
|
||||
echo "function g - begin\n";
|
||||
|
||||
function f()
|
||||
{
|
||||
echo "function f\n";
|
||||
}
|
||||
|
||||
echo "function g - end\n";
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->g();
|
||||
f();
|
||||
?>
|
||||
--EXPECT--
|
||||
function g - begin
|
||||
function g - end
|
||||
function f
|
||||
@@ -1,104 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29210 Function: is_callable - no support for private and protected classes
|
||||
--FILE--
|
||||
<?php
|
||||
class test_class {
|
||||
private function test_func1() {
|
||||
echo "test_func1\n";
|
||||
}
|
||||
protected function test_func2() {
|
||||
echo "test_func2\n";
|
||||
}
|
||||
static private function test_func3() {
|
||||
echo "test_func3\n";
|
||||
}
|
||||
static protected function test_func4() {
|
||||
echo "test_func4\n";
|
||||
}
|
||||
function test() {
|
||||
if (is_callable(array($this,'test_func1'))) {
|
||||
$this->test_func1();
|
||||
} else {
|
||||
echo "test_func1 isn't callable from inside\n";
|
||||
}
|
||||
if (is_callable(array($this,'test_func2'))) {
|
||||
$this->test_func2();
|
||||
} else {
|
||||
echo "test_func2 isn't callable from inside\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func3'))) {
|
||||
test_class::test_func3();
|
||||
} else {
|
||||
echo "test_func3 isn't callable from inside\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func4'))) {
|
||||
test_class::test_func4();
|
||||
} else {
|
||||
echo "test_func4 isn't callable from inside\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class foo extends test_class {
|
||||
function test() {
|
||||
if (is_callable(array($this,'test_func1'))) {
|
||||
$this->test_func1();
|
||||
} else {
|
||||
echo "test_func1 isn't callable from child\n";
|
||||
}
|
||||
if (is_callable(array($this,'test_func2'))) {
|
||||
$this->test_func2();
|
||||
} else {
|
||||
echo "test_func2 isn't callable from child\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func3'))) {
|
||||
test_class::test_func3();
|
||||
} else {
|
||||
echo "test_func3 isn't callable from child\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func4'))) {
|
||||
test_class::test_func4();
|
||||
} else {
|
||||
echo "test_func4 isn't callable from child\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$object = new test_class;
|
||||
$object->test();
|
||||
if (is_callable(array($object,'test_func1'))) {
|
||||
$object->test_func1();
|
||||
} else {
|
||||
echo "test_func1 isn't callable from outside\n";
|
||||
}
|
||||
if (is_callable(array($object,'test_func2'))) {
|
||||
$object->test_func2();
|
||||
} else {
|
||||
echo "test_func2 isn't callable from outside\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func3'))) {
|
||||
test_class::test_func3();
|
||||
} else {
|
||||
echo "test_func3 isn't callable from outside\n";
|
||||
}
|
||||
if (is_callable(array('test_class','test_func4'))) {
|
||||
test_class::test_func4();
|
||||
} else {
|
||||
echo "test_func4 isn't callable from outside\n";
|
||||
}
|
||||
$object = new foo();
|
||||
$object->test();
|
||||
?>
|
||||
--EXPECT--
|
||||
test_func1
|
||||
test_func2
|
||||
test_func3
|
||||
test_func4
|
||||
test_func1 isn't callable from outside
|
||||
test_func2 isn't callable from outside
|
||||
test_func3 isn't callable from outside
|
||||
test_func4 isn't callable from outside
|
||||
test_func1 isn't callable from child
|
||||
test_func2
|
||||
test_func3 isn't callable from child
|
||||
test_func4
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29368 (The destructor is called when an exception is thrown from the constructor)
|
||||
--FILE--
|
||||
<?
|
||||
|
||||
class Foo
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
throw new Exception;
|
||||
}
|
||||
function __destruct()
|
||||
{
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$bar = new Foo;
|
||||
} catch(Exception $exc)
|
||||
{
|
||||
echo "Caught exception!\n";
|
||||
}
|
||||
|
||||
unset($bar);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Foo::__construct
|
||||
Caught exception!
|
||||
===DONE===
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29505 (get_class_vars() severely broken when used with arrays)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public $empty = array();
|
||||
public $three = array(1, "b"=>"c", 3=>array());
|
||||
}
|
||||
|
||||
var_dump(get_class_vars('Test'));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["empty"]=>
|
||||
array(0) {
|
||||
}
|
||||
["three"]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
string(1) "c"
|
||||
[3]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,62 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29689 (default value of protected member overrides default value of private)
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
private $foo = 'foo';
|
||||
private $foo2 = 'foo2';
|
||||
|
||||
function printFoo()
|
||||
{
|
||||
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
protected $foo = 'bar';
|
||||
|
||||
function printFoo()
|
||||
{
|
||||
parent::printFoo();
|
||||
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class baz extends bar {
|
||||
protected $foo = 'baz';
|
||||
protected $foo2 = 'baz2';
|
||||
}
|
||||
|
||||
class bar2 extends foo {
|
||||
function printFoo()
|
||||
{
|
||||
parent::printFoo();
|
||||
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class baz2 extends bar2 {
|
||||
protected $foo = 'baz2';
|
||||
protected $foo2 = 'baz22';
|
||||
}
|
||||
|
||||
$bar = new bar;
|
||||
$bar->printFoo();
|
||||
echo "---baz--\n";
|
||||
$baz = new baz();
|
||||
$baz->printFoo();
|
||||
echo "---baz2--\n";
|
||||
$baz = new baz2();
|
||||
$baz->printFoo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
foo: foo foo2
|
||||
bar: bar
|
||||
Notice: Undefined property: bar::$foo2 in %s on line %d
|
||||
|
||||
---baz--
|
||||
foo: foo foo2
|
||||
bar: baz baz2
|
||||
---baz2--
|
||||
foo: foo foo2
|
||||
bar2: baz2 baz22
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29883 (isset gives invalid values on strings)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = "bug";
|
||||
var_dump(isset($x[-1]));
|
||||
var_dump(isset($x["1"]));
|
||||
echo $x["1"]."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(true)
|
||||
u
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29890 (crash if error handler fails)
|
||||
--FILE--
|
||||
<?php
|
||||
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,&$fClass) {
|
||||
echo "error :".$fErrStr."\n";
|
||||
}
|
||||
|
||||
set_time_limit(5);
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
set_error_handler("customErrorHandler");
|
||||
|
||||
define("TEST",2);
|
||||
|
||||
//should return a notice that the constant is already defined
|
||||
|
||||
define("TEST",3);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
error :Constant TEST already defined
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29896 (Backtrace argument list out of sync)
|
||||
--FILE--
|
||||
<?php
|
||||
function userErrorHandler($num, $msg, $file, $line, $vars)
|
||||
{
|
||||
debug_print_backtrace();
|
||||
}
|
||||
|
||||
$OldErrorHandler = set_error_handler("userErrorHandler");
|
||||
|
||||
function GenerateError1($A1)
|
||||
{
|
||||
$a = $b;
|
||||
}
|
||||
|
||||
function GenerateError2($A1)
|
||||
{
|
||||
GenerateError1("Test1");
|
||||
}
|
||||
|
||||
GenerateError2("Test2");
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11]
|
||||
#1 GenerateError1(Test1) called at [%sbug29896.php:16]
|
||||
#2 GenerateError2(Test2) called at [%sbug29896.php:19]
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29944 (Function defined in switch, crashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = 1;
|
||||
switch ($a) {
|
||||
case 1:
|
||||
function foo($a) {
|
||||
return "ok\n";
|
||||
}
|
||||
echo foo($a);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30080 (Passing array or non array of objects)
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
function foo($arrayobj) {
|
||||
var_dump($arrayobj);
|
||||
}
|
||||
}
|
||||
|
||||
new foo(array(new stdClass));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30140 (Problem with array in static properties)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public static $test1 = true;
|
||||
public static $test2 = array();
|
||||
public static $test3 = "str";
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
}
|
||||
|
||||
A::$test1 = "x";
|
||||
A::$test2 = "y";
|
||||
A::$test3 = "z";
|
||||
var_dump(A::$test1);
|
||||
var_dump(A::$test2);
|
||||
var_dump(A::$test3);
|
||||
var_dump(B::$test1);
|
||||
var_dump(B::$test2);
|
||||
var_dump(B::$test3);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "x"
|
||||
string(1) "y"
|
||||
string(1) "z"
|
||||
string(1) "x"
|
||||
string(1) "y"
|
||||
string(1) "z"
|
||||
@@ -1,52 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30162 (Catching exception in constructor couses lose of $this)
|
||||
--FILE--
|
||||
<?php
|
||||
class FIIFO {
|
||||
|
||||
public function __construct() {
|
||||
$this->x = "x";
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class hariCow extends FIIFO {
|
||||
|
||||
public function __construct() {
|
||||
try {
|
||||
parent::__construct();
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
$this->y = "y";
|
||||
try {
|
||||
$this->z = new FIIFO;
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return "Rusticus in asino sedet.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$db = new FIIFO();
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
var_dump($db);
|
||||
|
||||
$db = new hariCow;
|
||||
|
||||
var_dump($db);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: db in %sbug30162.php on line 35
|
||||
NULL
|
||||
object(hariCow)#1 (2) {
|
||||
["x"]=>
|
||||
string(1) "x"
|
||||
["y"]=>
|
||||
string(1) "y"
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push())
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=on
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class x { };
|
||||
|
||||
$first = new x;
|
||||
$second = $first;
|
||||
$container = array();
|
||||
array_push($container, $first);
|
||||
|
||||
$first->first = " im in the first";
|
||||
|
||||
print_r($first);
|
||||
print_r($second);
|
||||
print_r($container);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 4
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 5
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 7
|
||||
x Object
|
||||
(
|
||||
[first] => im in the first
|
||||
)
|
||||
x Object
|
||||
(
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => x Object
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30394 (Assignment operators yield wrong result with __get/__set)
|
||||
--FILE--
|
||||
<?php
|
||||
class Container
|
||||
{
|
||||
public function __get( $what )
|
||||
{
|
||||
return $this->_p[ $what ];
|
||||
}
|
||||
|
||||
public function __set( $what, $value )
|
||||
{
|
||||
$this->_p[ $what ] = $value;
|
||||
}
|
||||
|
||||
private $_p = array();
|
||||
}
|
||||
|
||||
$c = new Container();
|
||||
$c->a = 1;
|
||||
$c->a += 1;
|
||||
print $c->a; // --> 2
|
||||
|
||||
print " - ";
|
||||
$c->a += max( 0, 1 );
|
||||
print $c->a; // --> 4 (!)
|
||||
?>
|
||||
--EXPECT--
|
||||
2 - 3
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30451 (static properties permissions broken)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
|
||||
protected static $property = TRUE;
|
||||
|
||||
protected static function method() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
|
||||
public function __construct() {
|
||||
|
||||
var_dump(self::method());
|
||||
var_dump(parent::method());
|
||||
|
||||
var_dump(self::$property);
|
||||
var_dump(parent::$property);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new B;
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30519 Interface not existing says Class not found
|
||||
--FILE--
|
||||
<?php
|
||||
class test implements a {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Interface 'a' not found in %sbug30519.php on line 2
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30702 cannot initialize class variable from class constant
|
||||
--FILE--
|
||||
<?php
|
||||
class foo {
|
||||
const C1=1;
|
||||
}
|
||||
|
||||
class bar extends foo {
|
||||
const C2=2;
|
||||
|
||||
public $c1=bar::C1;
|
||||
public $c2=bar::C2;
|
||||
|
||||
public $c3=self::C1;
|
||||
public $c4=self::C2;
|
||||
|
||||
public $c5=foo::C1;
|
||||
public $c6=parent::C1;
|
||||
}
|
||||
|
||||
$x= new bar();
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(bar)#1 (6) {
|
||||
["c1"]=>
|
||||
int(1)
|
||||
["c2"]=>
|
||||
int(2)
|
||||
["c3"]=>
|
||||
int(1)
|
||||
["c4"]=>
|
||||
int(2)
|
||||
["c5"]=>
|
||||
int(1)
|
||||
["c6"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30707 (Segmentation fault on exception in method)
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
function byePHP($plop) {
|
||||
echo "ok\n";
|
||||
}
|
||||
|
||||
function plip() {
|
||||
try {
|
||||
$this->plap($this->plop());
|
||||
} catch(Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
function plap($a) {
|
||||
}
|
||||
|
||||
function plop() {
|
||||
throw new Exception;
|
||||
}
|
||||
}
|
||||
|
||||
$x = new C;
|
||||
$x->byePHP($x->plip());
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test implements IteratorAggregate
|
||||
{
|
||||
function getIterator()
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$it = new Test;
|
||||
foreach($it as $v)
|
||||
{
|
||||
echo "Fail\n";
|
||||
}
|
||||
echo "Wrong\n";
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Caught\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught
|
||||
===DONE===
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
public $a = 4;
|
||||
function __call($a,$b) {
|
||||
return "unknown method";
|
||||
}
|
||||
}
|
||||
$b = new a;
|
||||
echo $b,"\n";
|
||||
$c = unserialize(serialize($b));
|
||||
echo $c,"\n";
|
||||
var_dump($c);
|
||||
?>
|
||||
--EXPECT--
|
||||
Object id #1
|
||||
Object id #2
|
||||
object(a)#2 (1) {
|
||||
["a"]=>
|
||||
int(4)
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30820 (static member conflict with $this->member silently ignored)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class Blah {
|
||||
private static $x;
|
||||
|
||||
public function show() {
|
||||
Blah::$x = 1;
|
||||
$this->x = 5; // no warning, but refers to different variable
|
||||
|
||||
echo 'Blah::$x = '. Blah::$x ."\n";
|
||||
echo '$this->x = '. $this->x ."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$b = new Blah();
|
||||
$b->show();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 7
|
||||
Blah::$x = 1
|
||||
|
||||
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 10
|
||||
$this->x = 5
|
||||
@@ -1,61 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30828 (debug_backtrace() reports incorrect class in overridden methods)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
function __construct() {
|
||||
debug_print_backtrace();
|
||||
$bt = debug_backtrace();
|
||||
foreach ($bt as $t) {
|
||||
print $t['class'].$t['type'].$t['function']."\n";
|
||||
}
|
||||
}
|
||||
|
||||
function foo() {
|
||||
debug_print_backtrace();
|
||||
$bt = debug_backtrace();
|
||||
foreach ($bt as $t) {
|
||||
print $t['class'].$t['type'].$t['function']."\n";
|
||||
}
|
||||
}
|
||||
|
||||
static function bar() {
|
||||
debug_print_backtrace();
|
||||
$bt = debug_backtrace();
|
||||
foreach ($bt as $t) {
|
||||
print $t['class'].$t['type'].$t['function']."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function foo() {
|
||||
parent::foo();
|
||||
}
|
||||
|
||||
static function bar() {
|
||||
parent::bar();
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B();
|
||||
$b->foo();
|
||||
B::bar();
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 A->__construct() called at [%sbug30828.php:30]
|
||||
#1 B->__construct() called at [%sbug30828.php:42]
|
||||
A->__construct
|
||||
B->__construct
|
||||
#0 A->foo() called at [%sbug30828.php:34]
|
||||
#1 B->foo() called at [%sbug30828.php:43]
|
||||
A->foo
|
||||
B->foo
|
||||
#0 A::bar() called at [%sbug30828.php:38]
|
||||
#1 B::bar() called at [%sbug30828.php:44]
|
||||
A::bar
|
||||
B::bar
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30889 Conflict between __get/__set and ++ operator
|
||||
--FILE--
|
||||
<?php
|
||||
class overloaded
|
||||
{
|
||||
private $values;
|
||||
function __construct()
|
||||
{
|
||||
$this->values = array('a' => 0);
|
||||
}
|
||||
function __set($name, $value)
|
||||
{
|
||||
print "set $name = $value ($name was ".$this->values[$name].")\n";
|
||||
$this->values[$name] = $value;
|
||||
}
|
||||
function __get($name)
|
||||
{
|
||||
print "get $name (returns ".$this->values[$name].")\n";
|
||||
return $this->values[$name];
|
||||
}
|
||||
}
|
||||
$test = new overloaded();
|
||||
$test->a++; // __get(), then __set()
|
||||
++$test->a;
|
||||
?>
|
||||
--EXPECT--
|
||||
get a (returns 0)
|
||||
set a = 1 (a was 0)
|
||||
get a (returns 1)
|
||||
set a = 2 (a was 1)
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30922 (reflective functions crash PHP when interfaces extend themselves)
|
||||
--FILE--
|
||||
<?php
|
||||
interface RecurisiveFooFar extends RecurisiveFooFar {}
|
||||
class A implements RecurisiveFooFar {}
|
||||
|
||||
$a = new A();
|
||||
var_dump($a instanceOf A);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Interface RecurisiveFooFar cannot not implement itself in %sbug30922.php on line %d
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31098 (isset() / empty() incorrectly returns true in dereference of a wrong type)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = '';
|
||||
var_dump(isset($a->b));
|
||||
$a = 'a';
|
||||
var_dump(isset($a->b));
|
||||
$a = '0';
|
||||
var_dump(isset($a->b));
|
||||
$a = '';
|
||||
var_dump(isset($a{'b'}));
|
||||
$a = 'a';
|
||||
var_dump(isset($a{'b'}));
|
||||
$a = '0';
|
||||
var_dump(isset($a{'b'}));
|
||||
|
||||
$simpleString = "Bogus String Text";
|
||||
echo isset($simpleString->wrong)?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString[-1])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[0])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["0"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["16"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["17"])?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"][0])?"bug\n":"ok\n";
|
||||
echo $simpleString->wrong === null?"ok\n":"bug\n";
|
||||
echo $simpleString["wrong"] === "B"?"ok\n":"bug\n";
|
||||
echo $simpleString["0"] === "B"?"ok\n":"bug\n";
|
||||
$simpleString["wrong"] = "f";
|
||||
echo $simpleString["0"] === "f"?"ok\n":"bug\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
|
||||
Notice: Trying to get property of non-object in %sbug31098.php on line %d
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31177 (Memory leak)
|
||||
--FILE--
|
||||
<?php
|
||||
class DbGow {
|
||||
|
||||
public function query() {
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
public function select() {
|
||||
return new DbGowRecordSet($this->query());
|
||||
}
|
||||
|
||||
public function select2() {
|
||||
new DbGowRecordSet($this->query());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DbGowRecordSet {
|
||||
|
||||
public function __construct($resource) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$db = new DbGow;
|
||||
|
||||
try {
|
||||
$rs = $db->select();
|
||||
} catch(Exception $e) {
|
||||
echo "ok\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$db->select2();
|
||||
} catch(Exception $e) {
|
||||
echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
ok
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31525 (object reference being dropped. $this getting lost)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
function getThis() {
|
||||
return $this;
|
||||
}
|
||||
function destroyThis() {
|
||||
$baz =& $this->getThis();
|
||||
}
|
||||
}
|
||||
$bar = new Foo();
|
||||
$bar->destroyThis();
|
||||
var_dump($bar);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Only variables should be assigned by reference in %sbug31525.php on line 7
|
||||
object(Foo)#1 (0) {
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31683 (changes to $name in __get($name) override future parameters)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo implements ArrayAccess {
|
||||
|
||||
function __get($test) {
|
||||
var_dump($test);
|
||||
$test = 'bug';
|
||||
}
|
||||
|
||||
function __set($test, $val) {
|
||||
var_dump($test);
|
||||
var_dump($val);
|
||||
$test = 'bug';
|
||||
$val = 'bug';
|
||||
}
|
||||
|
||||
function __call($test, $arg) {
|
||||
var_dump($test);
|
||||
$test = 'bug';
|
||||
}
|
||||
|
||||
function offsetget($test) {
|
||||
var_dump($test);
|
||||
$test = 'bug';
|
||||
return 123;
|
||||
}
|
||||
|
||||
function offsetset($test, $val) {
|
||||
var_dump($test);
|
||||
var_dump($val);
|
||||
$test = 'bug';
|
||||
$val = 'bug';
|
||||
}
|
||||
|
||||
function offsetexists($test) {
|
||||
var_dump($test);
|
||||
$test = 'bug';
|
||||
}
|
||||
|
||||
function offsetunset($test) {
|
||||
var_dump($test);
|
||||
$test = 'bug';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$a = "ok";
|
||||
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
$foo->ok("ok");
|
||||
$foo->ok;
|
||||
$foo->ok = "ok";
|
||||
$x = $foo["ok"];
|
||||
$foo["ok"] = "ok";
|
||||
isset($foo["ok"]);
|
||||
unset($foo["ok"]);
|
||||
// $foo[];
|
||||
$foo[] = "ok";
|
||||
// isset($foo[]);
|
||||
// unset($foo[]);
|
||||
$foo->$a;
|
||||
echo "---\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
NULL
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
---
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
NULL
|
||||
string(2) "ok"
|
||||
string(2) "ok"
|
||||
---
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31720 (Invalid object callbacks not caught in array_walk())
|
||||
--FILE--
|
||||
<?
|
||||
$array = array('at least one element');
|
||||
|
||||
array_walk($array, array($nonesuchvar,'show'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: nonesuchvar in %s on line %d
|
||||
|
||||
Notice: Non-callable array passed to zend_call_function() in %s on line %d
|
||||
|
||||
Warning: array_walk(): Unable to call Array() - function does not exist in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #31828 (Crash with zend.ze1_compatibility_mode=On)
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=on
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
$o = new stdClass();
|
||||
$o->id = 77;
|
||||
$o->name = "Aerospace";
|
||||
$a[] = $o;
|
||||
$a = $a[0];
|
||||
print_r($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 2
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 5
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 6
|
||||
stdClass Object
|
||||
(
|
||||
[id] => 77
|
||||
[name] => Aerospace
|
||||
)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On)
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=on
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class test { }
|
||||
$t = new test;
|
||||
$t = $t; // gives segfault
|
||||
var_dump($t);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 3
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 5
|
||||
object(test)#%d (0) {
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug # 32226 (SEGV with exception handler on non existing instance)
|
||||
--FILE--
|
||||
<?
|
||||
|
||||
class A
|
||||
{
|
||||
public function A()
|
||||
{
|
||||
set_exception_handler(array($this, 'EH'));
|
||||
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public function EH()
|
||||
{
|
||||
restore_exception_handler();
|
||||
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$a = new A();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Caught\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Caught
|
||||
===DONE===
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32252 (Segfault when offsetSet throws an Exception (only without debug))
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test implements ArrayAccess
|
||||
{
|
||||
function offsetExists($offset)
|
||||
{
|
||||
echo __METHOD__ . "($offset)\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
function offsetGet($offset)
|
||||
{
|
||||
echo __METHOD__ . "($offset)\n";
|
||||
return null;
|
||||
}
|
||||
|
||||
function offsetSet($offset, $value)
|
||||
{
|
||||
echo __METHOD__ . "($offset, $value)\n";
|
||||
throw new Exception("Ooops");
|
||||
}
|
||||
|
||||
function offsetUnset($offset)
|
||||
{
|
||||
echo __METHOD__ . "($offset)\n";
|
||||
}
|
||||
}
|
||||
|
||||
$list = new Test();
|
||||
try
|
||||
{
|
||||
$list[-1] = 123;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo "CAUGHT\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Test::offsetSet(-1, 123)
|
||||
CAUGHT
|
||||
===DONE===
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32290 (calling call_user_func_array() ends in infinite loop within child class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestA
|
||||
{
|
||||
public function doSomething($i)
|
||||
{
|
||||
echo __METHOD__ . "($this)\n";
|
||||
return --$i;
|
||||
}
|
||||
}
|
||||
|
||||
class TestB extends TestA
|
||||
{
|
||||
public function doSomething($i)
|
||||
{
|
||||
echo __METHOD__ . "($this)\n";
|
||||
$i++;
|
||||
if ($i >= 5) return 5;
|
||||
return call_user_func_array(array("TestA","doSomething"), array($i));
|
||||
}
|
||||
}
|
||||
|
||||
$x = new TestB();
|
||||
var_dump($x->doSomething(1));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
TestB::doSomething(Object id #%d)
|
||||
TestA::doSomething(Object id #%d)
|
||||
int(1)
|
||||
===DONE===
|
||||
@@ -1,60 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32296 get_class_methods output has changed between 5.0.2 and 5.0.3
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class space{
|
||||
function __construct(){}
|
||||
abstract protected function unfold();
|
||||
}
|
||||
|
||||
abstract class shape extends space{
|
||||
private function x1() {}
|
||||
protected final function unfold(){}
|
||||
}
|
||||
|
||||
abstract class quad extends shape{
|
||||
private function x2() {}
|
||||
function buggy(){
|
||||
$c = get_class($this);
|
||||
$a = get_class_methods(get_class($this));
|
||||
$b = get_class_methods($this);
|
||||
print($c."\n".'a:');
|
||||
print_r($a);
|
||||
print('b:');
|
||||
print_r($b);
|
||||
}
|
||||
}
|
||||
|
||||
class square extends quad{}
|
||||
|
||||
$a = new square();
|
||||
$a->buggy();
|
||||
print_r(get_class_methods("square"));
|
||||
print_r(get_class_methods($a));
|
||||
?>
|
||||
--EXPECT--
|
||||
square
|
||||
a:Array
|
||||
(
|
||||
[0] => x2
|
||||
[1] => buggy
|
||||
[2] => unfold
|
||||
[3] => __construct
|
||||
)
|
||||
b:Array
|
||||
(
|
||||
[0] => x2
|
||||
[1] => buggy
|
||||
[2] => unfold
|
||||
[3] => __construct
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => buggy
|
||||
[1] => __construct
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => buggy
|
||||
[1] => __construct
|
||||
)
|
||||
@@ -1,80 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32322 (Return values by reference broken( using self::),example singleton instance)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class test
|
||||
{
|
||||
private static $instance = null;
|
||||
private $myname = '';
|
||||
|
||||
private function __construct( $value = '' )
|
||||
{
|
||||
echo "New class $value created \n";
|
||||
$this -> myname = $value;
|
||||
}
|
||||
private function __clone() {}
|
||||
static public function getInstance()
|
||||
{
|
||||
if ( self::$instance == null )
|
||||
{
|
||||
self::$instance = new test('Singleton1');
|
||||
}
|
||||
else {
|
||||
echo "Using old class " . self::$instance -> myname . "\n";
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
static public function getInstance2()
|
||||
{
|
||||
static $instance2 = null;
|
||||
if ( $instance2 == null )
|
||||
{
|
||||
$instance2 = new test('Singleton2');
|
||||
}
|
||||
else {
|
||||
echo "Using old class " . $instance2 -> myname . "\n";
|
||||
}
|
||||
return $instance2;
|
||||
}
|
||||
public function __destruct()
|
||||
{
|
||||
if ( defined('SCRIPT_END') )
|
||||
{
|
||||
echo "Class " . $this -> myname . " destroyed at script end\n";
|
||||
} else {
|
||||
echo "Class " . $this -> myname . " destroyed beforce script end\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "Try static instance inside class :\n";
|
||||
$getCopyofSingleton = test::getInstance();
|
||||
$getCopyofSingleton = null;
|
||||
$getCopyofSingleton = &test::getInstance();
|
||||
$getCopyofSingleton = null;
|
||||
$getCopyofSingleton = test::getInstance();
|
||||
echo "Try static instance inside function :\n";
|
||||
$getCopyofSingleton2 = test::getInstance2();
|
||||
$getCopyofSingleton2 = null;
|
||||
$getCopyofSingleton2 = &test::getInstance2();
|
||||
$getCopyofSingleton2 = null;
|
||||
$getCopyofSingleton2 = test::getInstance2();
|
||||
|
||||
define('SCRIPT_END',1);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Try static instance inside class :
|
||||
New class Singleton1 created
|
||||
Using old class Singleton1
|
||||
|
||||
Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 49
|
||||
Using old class Singleton1
|
||||
Try static instance inside function :
|
||||
New class Singleton2 created
|
||||
Using old class Singleton2
|
||||
|
||||
Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 55
|
||||
Using old class Singleton2
|
||||
Class Singleton1 destroyed at script end
|
||||
Class Singleton2 destroyed at script end
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct)
|
||||
--FILE--
|
||||
<?php
|
||||
class BUG {
|
||||
public $error = "please fix this thing, it wasted a nice part of my life!\n";
|
||||
static function instance() {return new BUG();}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
$c=get_class($this); unset($c);
|
||||
echo get_class($this) ."\n";
|
||||
if(defined('DEBUG_'.__CLASS__)){}
|
||||
$c=get_class($this); //memory leak only
|
||||
echo $this->error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BUG::instance()->error;
|
||||
echo "this is still executed\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
BUG
|
||||
please fix this thing, it wasted a nice part of my life!
|
||||
this is still executed
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32660 Assignment by reference causes crash when field access is overloaded (__get)
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
{
|
||||
public $q;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->q = 3;//array();
|
||||
}
|
||||
|
||||
function __get($name)
|
||||
{
|
||||
return $this->q;
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
|
||||
$b = "short";
|
||||
$c =& $a->whatever;
|
||||
$c = "long";
|
||||
print_r($a);
|
||||
$a->whatever =& $b;
|
||||
$b = "much longer";
|
||||
print_r($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
A Object
|
||||
(
|
||||
[q] => long
|
||||
)
|
||||
|
||||
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
|
||||
@@ -1,62 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32674 exception in iterator causes crash
|
||||
--FILE--
|
||||
<?php
|
||||
class collection implements Iterator {
|
||||
|
||||
private $_elements = array();
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function rewind() {
|
||||
reset($this->_elements);
|
||||
}
|
||||
|
||||
public function count() {
|
||||
return count($this->_elements);
|
||||
}
|
||||
|
||||
public function current() {
|
||||
$element = current($this->_elements);
|
||||
return $element;
|
||||
}
|
||||
|
||||
public function next() {
|
||||
$element = next($this->_elements);
|
||||
return $element;
|
||||
}
|
||||
|
||||
public function key() {
|
||||
$this->_fillCollection();
|
||||
$element = key($this->_elements);
|
||||
return $element;
|
||||
}
|
||||
|
||||
public function valid() {
|
||||
throw new Exception('shit happend');
|
||||
|
||||
return ($this->current() !== false);
|
||||
}
|
||||
}
|
||||
|
||||
class class2 {
|
||||
public $dummy;
|
||||
}
|
||||
|
||||
$obj = new class2();
|
||||
$col = new collection();
|
||||
|
||||
try {
|
||||
foreach($col as $co) {
|
||||
//irrelevant
|
||||
}
|
||||
echo 'shouldn`t get here';
|
||||
//$dummy = 'this will not crash';
|
||||
$obj->dummy = 'this will crash';
|
||||
} catch (Exception $e) {
|
||||
echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32799 (crash: calling the corresponding global var during the destruct)
|
||||
--FILE--
|
||||
<?php
|
||||
class test{
|
||||
public $c=1;
|
||||
function __destruct (){
|
||||
$GLOBALS['p']->c++; // no warning
|
||||
print $GLOBALS['p']->c."\n"; // segfault
|
||||
var_dump($GLOBALS['p']);
|
||||
}
|
||||
}
|
||||
$p=new test;
|
||||
$p=null; //destroy the object by a new assignment (segfault)
|
||||
?>
|
||||
--EXPECT--
|
||||
2
|
||||
object(test)#1 (1) {
|
||||
["c"]=>
|
||||
int(2)
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On)
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=on
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
class crashme {
|
||||
private static $instance = null;
|
||||
|
||||
public function __construct() {
|
||||
self::$instance = $this;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
echo "i'm called\n";
|
||||
}
|
||||
|
||||
public static function singleton() {
|
||||
if (!isset(self::$instance)) {
|
||||
self::$instance = new crashme();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
|
||||
crashme::singleton();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 6
|
||||
i'm called
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 15
|
||||
i'm called
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 17
|
||||
i'm called
|
||||
i'm called
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #32993 (implemented Iterator function current() don't throw exception)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements Iterator {
|
||||
|
||||
public $arr = array();
|
||||
|
||||
public function rewind() { return reset($this->arr); }
|
||||
public function current() { throw new Exception(); }
|
||||
public function key() { return key($this->arr); }
|
||||
public function next() { return next($this->arr); }
|
||||
public function valid() { return (current($this->arr) !== false); }
|
||||
}
|
||||
|
||||
$t = new Test();
|
||||
$t->arr = array(1, 2, 3);
|
||||
|
||||
try {
|
||||
foreach ($t as $v) {
|
||||
echo "$v\n";
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
; // handle exception
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33116 (crash when assigning class name to global variable in __autoload)
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($class)
|
||||
{
|
||||
$GLOBALS['include'][] = $class;
|
||||
eval("class DefClass{}");
|
||||
}
|
||||
|
||||
$a = new DefClass;
|
||||
print_r($a);
|
||||
print_r($GLOBALS['include']);
|
||||
?>
|
||||
--EXPECT--
|
||||
DefClass Object
|
||||
(
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => DefClass
|
||||
)
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33171 (foreach enumerates private fields declared in base classes)
|
||||
--FILE--
|
||||
<?php
|
||||
class A
|
||||
{
|
||||
private $c = "A's c";
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
private $c = "B's c";
|
||||
|
||||
public function go()
|
||||
{
|
||||
foreach ($this as $key => $val)
|
||||
{
|
||||
echo "$key => $val\n";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$x = new B;
|
||||
$x->go();
|
||||
?>
|
||||
--EXPECT--
|
||||
c => B's c
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33243 (ze1_compatibility_mode does not work as expected)
|
||||
--INI--
|
||||
zend.ze1_compatibility_mode=1
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
$a->y->z = 0;
|
||||
$b = $a; // should perform deep copy of $a
|
||||
$b->y->z = 1; // hence this should have no effect on $a
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Creating default object from empty value in %sbug33243.php on line 2
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 3
|
||||
|
||||
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 5
|
||||
object(stdClass)#%d (1) {
|
||||
["y"]=>
|
||||
object(stdClass)#%d (1) {
|
||||
["z"]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33257 array_splice() inconsistent when passed function instead of variable
|
||||
--FILE--
|
||||
<?php
|
||||
class X {
|
||||
protected static $arr = array("a", "b", "c");
|
||||
public static function getArr() {
|
||||
return self::$arr;
|
||||
}
|
||||
}
|
||||
|
||||
//$arr1 = X::getArr();
|
||||
array_splice(X::getArr(), 1, 1);
|
||||
print_r(X::getArr());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Only variables can be passed by reference in %sbug33257.php on line 10
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33277 (private method accessed by child class)
|
||||
--FILE--
|
||||
<?
|
||||
class foo {
|
||||
private function bar() {
|
||||
echo "private!\n";
|
||||
}
|
||||
}
|
||||
|
||||
class fooson extends foo {
|
||||
function barson() {
|
||||
$this->bar();
|
||||
}
|
||||
}
|
||||
|
||||
class foo2son extends fooson {
|
||||
|
||||
function bar() {
|
||||
echo "public!\n";
|
||||
}
|
||||
}
|
||||
|
||||
$b = new foo2son();
|
||||
$b->barson();
|
||||
?>
|
||||
--EXPECT--
|
||||
public!
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33558 (warning with nested calls to functions returning by reference)
|
||||
--INI--
|
||||
error_reporting=4095
|
||||
--FILE--
|
||||
<?php
|
||||
function & foo() {
|
||||
$var = 'ok';
|
||||
return $var;
|
||||
}
|
||||
|
||||
function & bar() {
|
||||
return foo();
|
||||
}
|
||||
|
||||
$a =& bar();
|
||||
echo "$a\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #33802 (throw Exception in error handler causes crash)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler('errorHandler', E_USER_ERROR);
|
||||
try{
|
||||
test();
|
||||
}catch(Exception $e){
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
function test(){
|
||||
trigger_error("error", E_USER_ERROR);
|
||||
}
|
||||
|
||||
function errorHandler($errno, $errstr, $errfile, $errline) {
|
||||
throw new Exception();
|
||||
}
|
||||
?>
|
||||
ok
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #34064 (arr[] as param to function in class gives invalid opcode)
|
||||
--FILE--
|
||||
<?php
|
||||
class XmlTest {
|
||||
|
||||
function test_ref(&$test)
|
||||
{
|
||||
$test = "ok";
|
||||
}
|
||||
|
||||
function test($test)
|
||||
{
|
||||
}
|
||||
|
||||
function run()
|
||||
{
|
||||
$ar = array();
|
||||
$this->test_ref($ar[]);
|
||||
var_dump($ar);
|
||||
$this->test($ar[]);
|
||||
}
|
||||
}
|
||||
|
||||
$o = new XmlTest();
|
||||
$o->run();
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(2) "ok"
|
||||
}
|
||||
|
||||
Fatal error: Cannot use [] for reading in %sbug34064.php on line 18
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug - crash in debug_backtrace when trace starts in eval
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
bar();
|
||||
}
|
||||
|
||||
function bar() {
|
||||
boo();
|
||||
}
|
||||
|
||||
function boo(){
|
||||
debug_print_backtrace();
|
||||
}
|
||||
|
||||
eval("foo();");
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
#0 boo() called at [%s:%d]
|
||||
#1 bar() called at [%s:%d]
|
||||
#2 foo() called at [%s(%d) : eval()'d code:1]
|
||||
#3 eval() called at [%s:%d]
|
||||
Done
|
||||
===DONE===
|
||||
@@ -1,171 +0,0 @@
|
||||
--TEST--
|
||||
Magic object handlers segfault and memory errors
|
||||
--FILE--
|
||||
<?php
|
||||
function f($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
class foo implements ArrayAccess {
|
||||
function __get($property) {
|
||||
$GLOBALS["y"] = $property;
|
||||
}
|
||||
function __set($property, $value) {
|
||||
$GLOBALS["y"] = $property;
|
||||
}
|
||||
function __call($func, $args) {
|
||||
$GLOBALS["y"] = $func;
|
||||
}
|
||||
function offsetGet($index) {
|
||||
$GLOBALS["y"] = $index;
|
||||
}
|
||||
function offsetSet($index, $newval) {
|
||||
$GLOBALS["y"] = $index;
|
||||
}
|
||||
function offsetExists($index) {
|
||||
$GLOBALS["y"] = $index;
|
||||
}
|
||||
function offsetUnset($index) {
|
||||
$GLOBALS["y"] = $index;
|
||||
}
|
||||
}
|
||||
|
||||
$x = new foo();
|
||||
$y = null;
|
||||
|
||||
// IS_CONST
|
||||
$z = $x->const_get;
|
||||
echo $y,"\n";
|
||||
$x->const_set = 1;
|
||||
echo $y,"\n";
|
||||
$x->const_call();
|
||||
echo $y,"\n";
|
||||
$z = $x["const_dim_get"];
|
||||
echo $y,"\n";
|
||||
$x["const_dim_set"] = 1;
|
||||
echo $y,"\n";
|
||||
isset($x["const_dim_isset"]);
|
||||
echo $y,"\n";
|
||||
unset($x["const_dim_unset"]);
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_CONST + conversion
|
||||
$z = $x->{1};
|
||||
echo $y,"\n";
|
||||
$x->{2} = 1;
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_TMP_VAR
|
||||
$c = "tmp";
|
||||
$z = $x->{$c."_get"};
|
||||
echo $y,"\n";
|
||||
$x->{$c."_set"} = 1;
|
||||
echo $y,"\n";
|
||||
$x->{$c."_call"}();
|
||||
echo $y,"\n";
|
||||
$z = $x[$c."_dim_get"];
|
||||
echo $y,"\n";
|
||||
$x[$c."_dim_set"] = 1;
|
||||
echo $y,"\n";
|
||||
isset($x[$c."_dim_isset"]);
|
||||
echo $y,"\n";
|
||||
unset($x[$c."_dim_unset"]);
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_TMP_VAR + conversion
|
||||
$c = 0;
|
||||
$z = $x->{$c+3};
|
||||
echo $y,"\n";
|
||||
$x->{$c+4} = 1;
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_CV
|
||||
$c = "cv_get";
|
||||
$z = $x->{$c};
|
||||
echo $y,"\n";
|
||||
$c = "cv_set";
|
||||
$x->{$c} = 1;
|
||||
echo $y,"\n";
|
||||
$c = "cv_call";
|
||||
$x->{$c}();
|
||||
echo $y,"\n";
|
||||
$c = "cv_dim_get";
|
||||
$z = $x[$c];
|
||||
echo $y,"\n";
|
||||
$c = "cv_dim_set";
|
||||
$x[$c] = 1;
|
||||
echo $y,"\n";
|
||||
$c = "cv_dim_isset";
|
||||
isset($x[$c]);
|
||||
echo $y,"\n";
|
||||
$c = "cv_dim_unset";
|
||||
unset($x[$c]);
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_CV + conversion
|
||||
$c = 5;
|
||||
$z = $x->{$c};
|
||||
echo $y,"\n";
|
||||
$c = 6;
|
||||
$x->{$c} = 1;
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_VAR
|
||||
$z = $x->{f("var_get")};
|
||||
echo $y,"\n";
|
||||
$x->{f("var_set")} = 1;
|
||||
echo $y,"\n";
|
||||
$x->{f("var_call")}();
|
||||
echo $y,"\n";
|
||||
$z = $x[f("var_dim_get")];
|
||||
echo $y,"\n";
|
||||
$x[f("var_dim_set")] = 1;
|
||||
echo $y,"\n";
|
||||
isset($x[f("var_dim_isset")]);
|
||||
echo $y,"\n";
|
||||
unset($x[f("var_dim_unset")]);
|
||||
echo $y,"\n";
|
||||
|
||||
// IS_VAR + conversion
|
||||
$z = $x->{f(7)};
|
||||
echo $y,"\n";
|
||||
$x->{f(8)} = 1;
|
||||
echo $y,"\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
const_get
|
||||
const_set
|
||||
const_call
|
||||
const_dim_get
|
||||
const_dim_set
|
||||
const_dim_isset
|
||||
const_dim_unset
|
||||
1
|
||||
2
|
||||
tmp_get
|
||||
tmp_set
|
||||
tmp_call
|
||||
tmp_dim_get
|
||||
tmp_dim_set
|
||||
tmp_dim_isset
|
||||
tmp_dim_unset
|
||||
3
|
||||
4
|
||||
cv_get
|
||||
cv_set
|
||||
cv_call
|
||||
cv_dim_get
|
||||
cv_dim_set
|
||||
cv_dim_isset
|
||||
cv_dim_unset
|
||||
5
|
||||
6
|
||||
var_get
|
||||
var_set
|
||||
var_call
|
||||
var_dim_get
|
||||
var_dim_set
|
||||
var_dim_isset
|
||||
var_dim_unset
|
||||
7
|
||||
8
|
||||
+30
-33
@@ -83,6 +83,7 @@ ZEND_INI_END()
|
||||
ZEND_API int compiler_globals_id;
|
||||
ZEND_API int executor_globals_id;
|
||||
ZEND_API int alloc_globals_id;
|
||||
zend_class_entry global_main_class;
|
||||
HashTable *global_function_table;
|
||||
HashTable *global_class_table;
|
||||
HashTable *global_constants_table;
|
||||
@@ -494,12 +495,6 @@ static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
|
||||
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
{
|
||||
shutdown_memory_manager(0, 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -509,6 +504,14 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
{
|
||||
shutdown_memory_manager(0, 1 TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
/* FreeBSD and DragonFly floating point precision fix */
|
||||
#include <floatingpoint.h>
|
||||
@@ -703,7 +706,6 @@ void zend_shutdown(TSRMLS_D)
|
||||
|
||||
zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE);
|
||||
free(GLOBAL_AUTO_GLOBALS_TABLE);
|
||||
|
||||
zend_shutdown_extensions(TSRMLS_C);
|
||||
free(zend_version_info);
|
||||
|
||||
@@ -803,13 +805,6 @@ void zend_deactivate_modules(TSRMLS_D)
|
||||
} zend_end_try();
|
||||
}
|
||||
|
||||
void zend_call_destructors(TSRMLS_D)
|
||||
{
|
||||
zend_try {
|
||||
shutdown_destructors(TSRMLS_C);
|
||||
} zend_end_try();
|
||||
}
|
||||
|
||||
void zend_deactivate(TSRMLS_D)
|
||||
{
|
||||
/* we're no longer executing anything */
|
||||
@@ -827,8 +822,6 @@ void zend_deactivate(TSRMLS_D)
|
||||
shutdown_compiler(TSRMLS_C);
|
||||
} zend_end_try();
|
||||
|
||||
zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
|
||||
|
||||
zend_try {
|
||||
zend_ini_deactivate(TSRMLS_C);
|
||||
} zend_end_try();
|
||||
@@ -847,7 +840,6 @@ static int exec_done_cb(zend_module_entry *module TSRMLS_DC)
|
||||
void zend_post_deactivate_modules(TSRMLS_D)
|
||||
{
|
||||
zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC);
|
||||
zend_hash_apply(&module_registry, (apply_func_t) module_registry_unload_temp TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -874,13 +866,14 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval
|
||||
ZEND_API void zend_error(int type, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_list usr_copy;
|
||||
zval ***params;
|
||||
zval *retval;
|
||||
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
|
||||
char *error_filename;
|
||||
uint error_lineno;
|
||||
zval *orig_user_error_handler;
|
||||
zval *orig_garbage[2];
|
||||
int orig_garbage_ptr;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* Obtain relevant filename and lineno */
|
||||
@@ -944,15 +937,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
ALLOC_INIT_ZVAL(z_error_lineno);
|
||||
ALLOC_INIT_ZVAL(z_context);
|
||||
|
||||
#if defined(va_copy)
|
||||
va_copy(usr_copy, args);
|
||||
#else
|
||||
usr_copy = args;
|
||||
#endif
|
||||
z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, usr_copy);
|
||||
#if defined(va_copy)
|
||||
va_end(usr_copy);
|
||||
#endif
|
||||
z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, args);
|
||||
z_error_message->type = IS_STRING;
|
||||
|
||||
z_error_type->value.lval = type;
|
||||
@@ -969,7 +954,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
|
||||
z_context->value.ht = EG(active_symbol_table);
|
||||
z_context->type = IS_ARRAY;
|
||||
zval_copy_ctor(z_context);
|
||||
ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*5);
|
||||
params[0] = &z_error_type;
|
||||
@@ -981,6 +966,12 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
orig_user_error_handler = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
|
||||
orig_garbage_ptr = EG(garbage_ptr);
|
||||
EG(garbage_ptr) = 0;
|
||||
if (orig_garbage_ptr > 0) {
|
||||
memcpy(&orig_garbage, &EG(garbage), sizeof(zval*)*orig_garbage_ptr);
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
|
||||
if (retval) {
|
||||
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
|
||||
@@ -993,18 +984,24 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
EG(user_error_handler) = orig_user_error_handler;
|
||||
} else {
|
||||
zval_ptr_dtor(&orig_user_error_handler);
|
||||
if (orig_garbage_ptr > 0) {
|
||||
while (EG(garbage_ptr)) {
|
||||
zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
|
||||
}
|
||||
EG(garbage_ptr) = orig_garbage_ptr;
|
||||
memcpy(&EG(garbage), &orig_garbage, sizeof(zval*)*orig_garbage_ptr);
|
||||
}
|
||||
|
||||
EG(user_error_handler) = orig_user_error_handler;
|
||||
|
||||
efree(params);
|
||||
zval_ptr_dtor(&z_error_message);
|
||||
zval_ptr_dtor(&z_error_type);
|
||||
zval_ptr_dtor(&z_error_filename);
|
||||
zval_ptr_dtor(&z_error_lineno);
|
||||
zval_ptr_dtor(&z_context);
|
||||
if (ZVAL_REFCOUNT(z_context) == 2) {
|
||||
FREE_ZVAL(z_context);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+7
-24
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "2.0.4-dev"
|
||||
#define ZEND_VERSION "2.0.0-dev"
|
||||
|
||||
#define ZEND_ENGINE_2
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
# include "zend_config.w32.h"
|
||||
# define ZEND_PATHS_SEPARATOR ';'
|
||||
#elif defined(NETWARE)
|
||||
# include <zend_config.h>
|
||||
# define ZEND_PATHS_SEPARATOR ';'
|
||||
# include "zend_config.nw.h"
|
||||
# include "acconfig.h"
|
||||
#elif defined(__riscos__)
|
||||
# include <zend_config.h>
|
||||
# include "zend_config.h"
|
||||
# define ZEND_PATHS_SEPARATOR ';'
|
||||
#else
|
||||
# include <zend_config.h>
|
||||
# include "zend_config.h"
|
||||
# define ZEND_PATHS_SEPARATOR ':'
|
||||
#endif
|
||||
|
||||
@@ -91,7 +91,7 @@ const char *zend_mh_bundle_error(void);
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H)
|
||||
#if defined(HAVE_LIBDL)
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
@@ -103,8 +103,6 @@ const char *zend_mh_bundle_error(void);
|
||||
|
||||
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
|
||||
# elif defined(RTLD_DEEPBIND)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
|
||||
# else
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
|
||||
# endif
|
||||
@@ -119,7 +117,7 @@ const char *zend_mh_bundle_error(void);
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(HAVE_MACH_O_DYLD_H)
|
||||
# define DL_LOAD(libname) zend_mh_bundle_load(libname)
|
||||
# define DL_UNLOAD zend_mh_bundle_unload
|
||||
# define DL_UNLOAD(handle) zend_mh_bundle_unload(handle)
|
||||
# define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s)
|
||||
# define DL_ERROR zend_mh_bundle_error
|
||||
# define DL_HANDLE void *
|
||||
@@ -452,7 +450,6 @@ END_EXTERN_C()
|
||||
|
||||
void zend_activate(TSRMLS_D);
|
||||
void zend_deactivate(TSRMLS_D);
|
||||
void zend_call_destructors(TSRMLS_D);
|
||||
void zend_activate_modules(TSRMLS_D);
|
||||
void zend_deactivate_modules(TSRMLS_D);
|
||||
void zend_post_deactivate_modules(TSRMLS_D);
|
||||
@@ -604,20 +601,6 @@ END_EXTERN_C()
|
||||
(*ppzv_dest)->refcount = refcount; \
|
||||
}
|
||||
|
||||
#define SEPARATE_ARG_IF_REF(varptr) \
|
||||
if (PZVAL_IS_REF(varptr)) { \
|
||||
zval *original_var = varptr; \
|
||||
ALLOC_ZVAL(varptr); \
|
||||
varptr->value = original_var->value; \
|
||||
varptr->type = original_var->type; \
|
||||
varptr->is_ref = 0; \
|
||||
varptr->refcount = 1; \
|
||||
zval_copy_ctor(varptr); \
|
||||
} else { \
|
||||
varptr->refcount++; \
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 4
|
||||
|
||||
|
||||
|
||||
+59
-208
@@ -152,29 +152,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
|
||||
}
|
||||
|
||||
while (param_count-->0) {
|
||||
zval **value = (zval**)(p-arg_count);
|
||||
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_PP(value) == IS_OBJECT) {
|
||||
zval *value_ptr;
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
ALLOC_ZVAL(value_ptr);
|
||||
*value_ptr = **value;
|
||||
INIT_PZVAL(value_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
if(!dup) {
|
||||
efree(class_name);
|
||||
}
|
||||
value_ptr->value.obj = Z_OBJ_HANDLER_PP(value, clone_obj)(*value TSRMLS_CC);
|
||||
zval_ptr_dtor(value);
|
||||
*value = value_ptr;
|
||||
}
|
||||
*(argument_array++) = value;
|
||||
arg_count--;
|
||||
*(argument_array++) = (zval **) p-(arg_count--);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -183,10 +161,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
|
||||
|
||||
ZEND_API void zend_wrong_param_count(TSRMLS_D)
|
||||
{
|
||||
char *space;
|
||||
char *class_name = get_active_class_name(&space TSRMLS_CC);
|
||||
|
||||
zend_error(E_WARNING, "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name(TSRMLS_C));
|
||||
zend_error(E_WARNING, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
|
||||
|
||||
@@ -234,20 +209,6 @@ ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
/* returns 1 if you need to copy result, 0 if it's already a copy */
|
||||
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC)
|
||||
{
|
||||
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
|
||||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
|
||||
zend_class_entry *ce = Z_OBJCE_P(object);
|
||||
|
||||
*class_name = ce->name;
|
||||
*class_name_len = ce->name_length;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
|
||||
{
|
||||
@@ -355,13 +316,11 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
|
||||
*pl = Z_STRLEN_PP(arg);
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(arg);
|
||||
if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
*pl = Z_STRLEN_PP(arg);
|
||||
*p = Z_STRVAL_PP(arg);
|
||||
break;
|
||||
}
|
||||
if (Z_OBJ_HANDLER_PP(arg, cast_object)
|
||||
&& Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
*pl = Z_STRLEN_PP(arg);
|
||||
*p = Z_STRVAL_PP(arg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,10 +450,8 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
|
||||
expected_type = zend_parse_arg_impl(arg, va, spec TSRMLS_CC);
|
||||
if (expected_type) {
|
||||
if (!quiet) {
|
||||
char *space;
|
||||
char *class_name = get_active_class_name(&space TSRMLS_CC);
|
||||
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be %s, %s given",
|
||||
class_name, space, get_active_function_name(TSRMLS_C), arg_num, expected_type,
|
||||
zend_error(E_WARNING, "%s() expects parameter %d to be %s, %s given",
|
||||
get_active_function_name(TSRMLS_C), arg_num, expected_type,
|
||||
zend_zval_type_name(*arg));
|
||||
}
|
||||
return FAILURE;
|
||||
@@ -728,21 +685,6 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC)
|
||||
{
|
||||
if (!class_type->constants_updated) {
|
||||
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
|
||||
zend_class_entry *old_scope = *scope;
|
||||
|
||||
*scope = class_type;
|
||||
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
*scope = old_scope;
|
||||
class_type->constants_updated = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This function requires 'properties' to contain all props declared in the
|
||||
* class and all props being public. If only a subset is given or the class
|
||||
* has protected members then you need to merge the properties seperately by
|
||||
@@ -757,7 +699,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
|
||||
zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name);
|
||||
}
|
||||
|
||||
zend_update_class_constants(class_type TSRMLS_CC);
|
||||
if (!class_type->constants_updated) {
|
||||
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
class_type->constants_updated = 1;
|
||||
}
|
||||
|
||||
arg->type = IS_OBJECT;
|
||||
if (class_type->create_object == NULL) {
|
||||
@@ -1270,29 +1216,6 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
|
||||
return zend_register_module_ex(module TSRMLS_CC);
|
||||
}
|
||||
|
||||
void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC)
|
||||
{
|
||||
char lcname[16];
|
||||
int name_len;
|
||||
|
||||
/* we don't care if the function name is longer, in fact lowercasing only
|
||||
* the beginning of the name speeds up the check process */
|
||||
name_len = strlen(fptr->common.function_name);
|
||||
zend_str_tolower_copy(lcname, fptr->common.function_name, MIN(name_len, sizeof(lcname)-1));
|
||||
lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
|
||||
|
||||
if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && fptr->common.num_args != 0) {
|
||||
zend_error(error_type, "Destuctor %s::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)) && fptr->common.num_args != 0) {
|
||||
zend_error(error_type, "Method %s::%s() cannot accept any arguments", ce->name, ZEND_CLONE_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)) && fptr->common.num_args != 1) {
|
||||
zend_error(error_type, "Method %s::%s() must take exactly 1 argument", ce->name, ZEND_GET_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_SET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)) && fptr->common.num_args != 2) {
|
||||
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->name, ZEND_SET_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)) && fptr->common.num_args != 2) {
|
||||
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->name, ZEND_CALL_FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/* registers all functions in *library_functions in the function hash */
|
||||
ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC)
|
||||
@@ -1303,11 +1226,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
int count=0, unload=0;
|
||||
HashTable *target_function_table = function_table;
|
||||
int error_type;
|
||||
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__call = NULL;
|
||||
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL;
|
||||
char *lowercase_name;
|
||||
int fname_len;
|
||||
char *lc_class_name;
|
||||
int class_name_len;
|
||||
|
||||
if (type==MODULE_PERSISTENT) {
|
||||
error_type = E_CORE_WARNING;
|
||||
@@ -1319,11 +1240,6 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
target_function_table = CG(function_table);
|
||||
}
|
||||
internal_function->type = ZEND_INTERNAL_FUNCTION;
|
||||
|
||||
if (scope) {
|
||||
class_name_len = strlen(scope->name);
|
||||
lc_class_name = zend_str_tolower_dup(scope->name, class_name_len);
|
||||
}
|
||||
|
||||
while (ptr->fname) {
|
||||
internal_function->handler = ptr->handler;
|
||||
@@ -1351,7 +1267,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
if (ptr->flags) {
|
||||
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
|
||||
internal_function->fn_flags = ZEND_ACC_PUBLIC;
|
||||
internal_function->fn_flags |= ZEND_ACC_PUBLIC;
|
||||
} else {
|
||||
internal_function->fn_flags = ptr->flags;
|
||||
}
|
||||
@@ -1393,28 +1309,18 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
* If it's an old-style constructor, store it only if we don't have
|
||||
* a constructor already.
|
||||
*/
|
||||
if ((fname_len == class_name_len) && !memcmp(lowercase_name, lc_class_name, class_name_len+1) && !ctor) {
|
||||
if (!strcmp(ptr->fname, scope->name) && !ctor) {
|
||||
ctor = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
|
||||
} else if (!strcmp(ptr->fname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
|
||||
ctor = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME))) {
|
||||
} else if (!strcmp(ptr->fname, ZEND_DESTRUCTOR_FUNC_NAME)) {
|
||||
dtor = reg_function;
|
||||
if (internal_function->num_args) {
|
||||
zend_error(error_type, "Destructor %s::%s() cannot take arguments", scope->name, ptr->fname);
|
||||
}
|
||||
} else if ((fname_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME))) {
|
||||
|
||||
} else if (!strcmp(ptr->fname, ZEND_CLONE_FUNC_NAME)) {
|
||||
clone = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) {
|
||||
__call = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) {
|
||||
__get = reg_function;
|
||||
} else if ((fname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME))) {
|
||||
__set = reg_function;
|
||||
} else {
|
||||
reg_function = NULL;
|
||||
}
|
||||
if (reg_function) {
|
||||
zend_check_magic_method_implementation(scope, reg_function, error_type TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
ptr++;
|
||||
@@ -1422,12 +1328,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
free_alloca(lowercase_name);
|
||||
}
|
||||
if (unload) { /* before unloading, display all remaining bad function in the module */
|
||||
if (scope) {
|
||||
efree(lc_class_name);
|
||||
}
|
||||
while (ptr->fname) {
|
||||
if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
|
||||
zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
|
||||
zend_error(error_type, "Function registration failed - duplicate name - %s", ptr->fname);
|
||||
}
|
||||
ptr++;
|
||||
}
|
||||
@@ -1438,49 +1341,27 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
scope->constructor = ctor;
|
||||
scope->destructor = dtor;
|
||||
scope->clone = clone;
|
||||
scope->__call = __call;
|
||||
scope->__get = __get;
|
||||
scope->__set = __set;
|
||||
if (ctor) {
|
||||
ctor->common.fn_flags |= ZEND_ACC_CTOR;
|
||||
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Constructor %s::%s() cannot be static", scope->name, ctor->common.function_name);
|
||||
zend_error(error_type, "Constructor %s::%s cannot be static", ctor->common.scope->name, ctor->common.function_name);
|
||||
}
|
||||
ctor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (dtor) {
|
||||
dtor->common.fn_flags |= ZEND_ACC_DTOR;
|
||||
if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Destructor %s::%s() cannot be static", scope->name, dtor->common.function_name);
|
||||
zend_error(error_type, "Destructor %s::%s cannot be static", dtor->common.scope->name, dtor->common.function_name);
|
||||
}
|
||||
dtor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (clone) {
|
||||
clone->common.fn_flags |= ZEND_ACC_CLONE;
|
||||
if (clone->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Constructor %s::%s() cannot be static", scope->name, clone->common.function_name);
|
||||
zend_error(error_type, "Constructor %s::%s cannot be static", clone->common.scope->name, clone->common.function_name);
|
||||
}
|
||||
clone->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (__call) {
|
||||
if (__call->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __call->common.function_name);
|
||||
}
|
||||
__call->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (__get) {
|
||||
if (__get->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __get->common.function_name);
|
||||
}
|
||||
__get->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
if (__set) {
|
||||
if (__set->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __set->common.function_name);
|
||||
}
|
||||
__set->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
efree(lc_class_name);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -1534,6 +1415,9 @@ void module_destructor(zend_module_entry *module)
|
||||
if (module->type == MODULE_TEMPORARY) {
|
||||
zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
|
||||
clean_module_constants(module->module_number TSRMLS_CC);
|
||||
if (module->request_shutdown_func) {
|
||||
module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
if (module->module_started && module->module_shutdown_func) {
|
||||
@@ -1547,9 +1431,9 @@ void module_destructor(zend_module_entry *module)
|
||||
zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H)
|
||||
#if HAVE_LIBDL
|
||||
if (module->handle) {
|
||||
DL_UNLOAD(module->handle);
|
||||
dlclose(module->handle);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1571,23 +1455,24 @@ int module_registry_request_startup(zend_module_entry *module TSRMLS_DC)
|
||||
}
|
||||
|
||||
|
||||
/* call request shutdown for all modules */
|
||||
/* for persistent modules - call request shutdown and flag NOT to erase
|
||||
* for temporary modules - do nothing, and flag to erase
|
||||
*/
|
||||
int module_registry_cleanup(zend_module_entry *module TSRMLS_DC)
|
||||
{
|
||||
if (module->request_shutdown_func) {
|
||||
#if 0
|
||||
zend_printf("%s: Request shutdown\n", module->name);
|
||||
#endif
|
||||
module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC)
|
||||
{
|
||||
switch (module->type) {
|
||||
case MODULE_PERSISTENT:
|
||||
if (module->request_shutdown_func) {
|
||||
#if 0
|
||||
zend_printf("%s: Request shutdown\n", module->name);
|
||||
#endif
|
||||
module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case MODULE_TEMPORARY:
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1649,9 +1534,7 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
|
||||
ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...)
|
||||
{
|
||||
zend_class_entry *interface_entry;
|
||||
int ce_num = class_entry->num_interfaces, impl_num;
|
||||
va_list interface_list;
|
||||
va_start(interface_list, num_interfaces);
|
||||
|
||||
if (class_entry->type & ZEND_INTERNAL_CLASS) {
|
||||
class_entry->interfaces = realloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
|
||||
@@ -1659,13 +1542,11 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
|
||||
class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
|
||||
}
|
||||
|
||||
va_start(interface_list, num_interfaces);
|
||||
while (num_interfaces--) {
|
||||
interface_entry = va_arg(interface_list, zend_class_entry *);
|
||||
class_entry->interfaces[class_entry->num_interfaces++] = interface_entry;
|
||||
}
|
||||
impl_num = class_entry->num_interfaces;
|
||||
while(ce_num < impl_num) {
|
||||
zend_do_implement_interface(class_entry, class_entry->interfaces[ce_num++] TSRMLS_CC);
|
||||
zend_do_implement_interface(class_entry, interface_entry TSRMLS_CC);
|
||||
}
|
||||
va_end(interface_list);
|
||||
}
|
||||
@@ -1758,7 +1639,7 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name)
|
||||
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name)
|
||||
{
|
||||
char *lcname;
|
||||
zend_bool retval = 0;
|
||||
@@ -1769,7 +1650,7 @@ ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **cal
|
||||
if (callable_name) {
|
||||
*callable_name = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
|
||||
}
|
||||
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) {
|
||||
if (syntax_only) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1806,7 +1687,7 @@ ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **cal
|
||||
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
|
||||
}
|
||||
|
||||
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY)
|
||||
if (syntax_only)
|
||||
return 1;
|
||||
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
|
||||
@@ -1835,27 +1716,14 @@ ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **cal
|
||||
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
|
||||
}
|
||||
|
||||
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY)
|
||||
if (syntax_only)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ce) {
|
||||
zend_function *fbc;
|
||||
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
|
||||
if (zend_hash_find(&ce->function_table, lcname, Z_STRLEN_PP(method)+1, (void **)&fbc) == SUCCESS) {
|
||||
if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1)) {
|
||||
retval = 1;
|
||||
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) {
|
||||
if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
if (!zend_check_private(fbc, (Z_TYPE_PP(obj) == IS_STRING)?EG(scope):(*obj)->value.obj.handlers->get_class_entry(*obj TSRMLS_CC), lcname, Z_STRLEN_PP(method) TSRMLS_CC)) {
|
||||
retval = 0;
|
||||
}
|
||||
} else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) {
|
||||
if (!zend_check_protected(fbc->common.scope, EG(scope))) {
|
||||
retval = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* check for __call too */
|
||||
if (retval == 0 && ce->__call != 0) {
|
||||
@@ -1887,10 +1755,8 @@ ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **cal
|
||||
|
||||
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC)
|
||||
{
|
||||
char *lcname, *func, *class_name;
|
||||
char *lcname, *func;
|
||||
zend_bool retval = 0;
|
||||
zend_class_entry **pce;
|
||||
int class_name_len;
|
||||
|
||||
if (zend_is_callable(callable, 0, callable_name)) {
|
||||
return 1;
|
||||
@@ -1900,18 +1766,12 @@ ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRML
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
|
||||
|
||||
if ((func = strstr(lcname, "::")) != NULL) {
|
||||
*func = '\0';
|
||||
class_name_len = func - lcname;
|
||||
class_name = estrndup(Z_STRVAL_P(callable), class_name_len);
|
||||
if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC) == SUCCESS) {
|
||||
zval_dtor(callable);
|
||||
array_init(callable);
|
||||
add_next_index_stringl(callable, lcname, class_name_len, 1);
|
||||
func += 2;
|
||||
add_next_index_stringl(callable, func, strlen(func), 1);
|
||||
retval = 1;
|
||||
}
|
||||
efree(class_name);
|
||||
zval_dtor(callable);
|
||||
array_init(callable);
|
||||
add_next_index_stringl(callable, lcname, func - lcname, 1);
|
||||
func += 2;
|
||||
add_next_index_stringl(callable, func, strlen(func), 1);
|
||||
retval = 1;
|
||||
}
|
||||
efree(lcname);
|
||||
break;
|
||||
@@ -2051,12 +1911,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
|
||||
EG(scope) = scope;
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->write_property) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
|
||||
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
|
||||
|
||||
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, class_name);
|
||||
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", Z_OBJCE_P(object)->name, name);
|
||||
}
|
||||
ZVAL_STRINGL(&property, name, name_length, 0);
|
||||
Z_OBJ_HT_P(object)->write_property(object, &property, value TSRMLS_CC);
|
||||
@@ -2105,11 +1960,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
|
||||
EG(scope) = scope;
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->read_property) {
|
||||
char *class_name;
|
||||
zend_uint class_name_len;
|
||||
|
||||
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
|
||||
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", name, class_name);
|
||||
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", Z_OBJCE_P(object)->name, name);
|
||||
}
|
||||
ZVAL_STRINGL(&property, name, name_length, 0);
|
||||
value = Z_OBJ_HT_P(object)->read_property(object, &property, silent TSRMLS_CC);
|
||||
|
||||
+1
-8
@@ -168,7 +168,6 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
|
||||
ZEND_API int zend_register_module(zend_module_entry *module_entry);
|
||||
ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
|
||||
void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC);
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
|
||||
@@ -179,11 +178,7 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_wrong_param_count(TSRMLS_D);
|
||||
|
||||
#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
|
||||
#define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
|
||||
|
||||
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name);
|
||||
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
|
||||
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
|
||||
ZEND_API char *zend_get_module_version(char *module_name);
|
||||
ZEND_API int zend_get_module_started(char *module_name);
|
||||
@@ -192,7 +187,6 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na
|
||||
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
|
||||
ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
|
||||
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
|
||||
ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC);
|
||||
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
|
||||
@@ -201,7 +195,6 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
|
||||
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC);
|
||||
|
||||
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
|
||||
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
|
||||
|
||||
#define getThis() (this_ptr)
|
||||
|
||||
|
||||
+3
-3
@@ -75,8 +75,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
int php_mem_limit = AG(memory_limit); \
|
||||
AG(allocated_memory) -= rs; \
|
||||
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory)) { \
|
||||
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
|
||||
AG(memory_limit) = AG(allocated_memory) + 1048576; \
|
||||
if (file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", php_mem_limit, file, lineno, s); \
|
||||
@@ -389,6 +388,7 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
char *p;
|
||||
@@ -481,7 +481,7 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
|
||||
unsigned int i, j;
|
||||
zend_mem_header *ptr;
|
||||
|
||||
for (i=0; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<AG(cache_count)[i]; j++) {
|
||||
ptr = (zend_mem_header *) AG(cache)[i][j];
|
||||
# if MEMORY_LIMIT
|
||||
|
||||
@@ -85,8 +85,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
|
||||
#if USE_ZEND_ALLOC
|
||||
|
||||
/* Standard wrapper macros */
|
||||
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
@@ -122,48 +120,6 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
|
||||
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
|
||||
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
|
||||
|
||||
#else
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#undef _GNU_SOURCE
|
||||
|
||||
/* Standard wrapper macros */
|
||||
#define emalloc(size) malloc(size)
|
||||
#define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
|
||||
#define efree(ptr) free(ptr)
|
||||
#define ecalloc(nmemb, size) calloc((nmemb), (size))
|
||||
#define erealloc(ptr, size) realloc((ptr), (size))
|
||||
#define erealloc_recoverable(ptr, size) realloc((ptr), (size))
|
||||
#define estrdup(s) strdup(s)
|
||||
#define estrndup(s, length) zend_strndup((s), (length))
|
||||
|
||||
/* Relay wrapper macros */
|
||||
#define emalloc_rel(size) malloc(size)
|
||||
#define safe_emalloc_rel(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
|
||||
#define efree_rel(ptr) free(ptr)
|
||||
#define ecalloc_rel(nmemb, size) calloc((nmemb), (size))
|
||||
#define erealloc_rel(ptr, size) realloc((ptr), (size))
|
||||
#define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size))
|
||||
#define estrdup_rel(s) strdup(s)
|
||||
#define estrndup_rel(s, length) zend_strndup((s), (length))
|
||||
|
||||
/* Selective persistent/non persistent allocation macros */
|
||||
#define pemalloc(size, persistent) malloc(size)
|
||||
#define pefree(ptr, persistent) free(ptr)
|
||||
#define pecalloc(nmemb, size, persistent) calloc((nmemb), (size))
|
||||
#define perealloc(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define perealloc_recoverable(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define pestrdup(s, persistent) strdup(s)
|
||||
|
||||
#define pemalloc_rel(size, persistent) malloc(size)
|
||||
#define pefree_rel(ptr, persistent) free(ptr)
|
||||
#define pecalloc_rel(nmemb, size, persistent) calloc((nmemb), (size))
|
||||
#define perealloc_rel(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size))
|
||||
#define pestrdup_rel(s, persistent) strdup(s)
|
||||
#endif /* !USE_ZEND_ALLOC */
|
||||
|
||||
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string))
|
||||
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string))
|
||||
|
||||
|
||||
+74
-260
@@ -44,7 +44,6 @@ static ZEND_FUNCTION(get_class);
|
||||
static ZEND_FUNCTION(get_parent_class);
|
||||
static ZEND_FUNCTION(method_exists);
|
||||
static ZEND_FUNCTION(class_exists);
|
||||
static ZEND_FUNCTION(interface_exists);
|
||||
static ZEND_FUNCTION(function_exists);
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_FUNCTION(leak);
|
||||
@@ -103,7 +102,6 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(get_parent_class, NULL)
|
||||
ZEND_FE(method_exists, NULL)
|
||||
ZEND_FE(class_exists, NULL)
|
||||
ZEND_FE(interface_exists, NULL)
|
||||
ZEND_FE(function_exists, NULL)
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FE(leak, NULL)
|
||||
@@ -433,7 +431,7 @@ ZEND_FUNCTION(error_reporting)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto bool define(string constant_name, mixed value, boolean case_sensitive=true)
|
||||
/* {{{ proto bool define(string constant_name, mixed value, case_sensitive=true)
|
||||
Define a new constant */
|
||||
ZEND_FUNCTION(define)
|
||||
{
|
||||
@@ -523,7 +521,6 @@ ZEND_FUNCTION(get_class)
|
||||
zval **arg;
|
||||
char *name = "";
|
||||
zend_uint name_len = 0;
|
||||
int dup;
|
||||
|
||||
if (!ZEND_NUM_ARGS()) {
|
||||
if (EG(scope)) {
|
||||
@@ -539,9 +536,19 @@ ZEND_FUNCTION(get_class)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
dup = zend_get_object_classname(*arg, &name, &name_len TSRMLS_CC);
|
||||
if (Z_OBJ_HT_PP(arg)->get_class_name == NULL ||
|
||||
Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
|
||||
zend_class_entry *ce;
|
||||
|
||||
RETURN_STRINGL(name, name_len, dup);
|
||||
ce = zend_get_class_entry(*arg TSRMLS_CC);
|
||||
if (!ce) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_STRINGL(ce->name, ce->name_length, 1);
|
||||
}
|
||||
|
||||
RETURN_STRINGL(name, name_len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -594,21 +601,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (only_subclass && Z_TYPE_PP(obj) == IS_STRING) {
|
||||
zend_class_entry **the_ce;
|
||||
if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &the_ce TSRMLS_CC) == FAILURE) {
|
||||
zend_error(E_WARNING, "Unknown class passed as parameter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
instance_ce = *the_ce;
|
||||
} else if (Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
if (Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
instance_ce = NULL;
|
||||
}
|
||||
|
||||
/* TBI!! new object handlers */
|
||||
if (Z_TYPE_PP(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(**obj)) {
|
||||
if (!HAS_CLASS_ENTRY(**obj)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -618,11 +616,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
retval = 0;
|
||||
} else {
|
||||
if (only_subclass) {
|
||||
if (!instance_ce) {
|
||||
instance_ce = Z_OBJCE_PP(obj)->parent;
|
||||
} else {
|
||||
instance_ce = instance_ce->parent;
|
||||
}
|
||||
instance_ce = Z_OBJCE_PP(obj)->parent;
|
||||
} else {
|
||||
instance_ce = Z_OBJCE_PP(obj);
|
||||
}
|
||||
@@ -661,72 +655,30 @@ ZEND_FUNCTION(is_a)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ add_class_vars */
|
||||
static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *return_value TSRMLS_DC)
|
||||
{
|
||||
int instanceof = EG(scope) && instanceof_function(EG(scope), ce TSRMLS_CC);
|
||||
|
||||
if (zend_hash_num_elements(properties) > 0) {
|
||||
HashPosition pos;
|
||||
zval **prop;
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(properties, &pos);
|
||||
while (zend_hash_get_current_data_ex(properties, (void **) &prop, &pos) == SUCCESS) {
|
||||
char *key, *class_name, *prop_name;
|
||||
uint key_len;
|
||||
ulong num_index;
|
||||
zval *prop_copy;
|
||||
|
||||
zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos);
|
||||
zend_hash_move_forward_ex(properties, &pos);
|
||||
zend_unmangle_property_name(key, &class_name, &prop_name);
|
||||
if (class_name) {
|
||||
if (class_name[0] != '*' && strcmp(class_name, ce->name)) {
|
||||
/* filter privates from base classes */
|
||||
continue;
|
||||
} else if (!instanceof) {
|
||||
/* filter protected if not inside class */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* copy: enforce read only access */
|
||||
ALLOC_ZVAL(prop_copy);
|
||||
*prop_copy = **prop;
|
||||
zval_copy_ctor(prop_copy);
|
||||
INIT_PZVAL(prop_copy);
|
||||
|
||||
/* this is necessary to make it able to work with default array
|
||||
* properties, returned to user */
|
||||
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
|
||||
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
add_assoc_zval(return_value, prop_name, prop_copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array get_class_vars(string class_name)
|
||||
Returns an array of default properties of the class. */
|
||||
Returns an array of default properties of the class */
|
||||
ZEND_FUNCTION(get_class_vars)
|
||||
{
|
||||
char *class_name;
|
||||
int class_name_len;
|
||||
zend_class_entry **pce;
|
||||
zval **class_name;
|
||||
zend_class_entry *ce, **pce;
|
||||
zval *tmp;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) {
|
||||
return;
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC) == FAILURE) {
|
||||
convert_to_string_ex(class_name);
|
||||
|
||||
if (zend_lookup_class(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name), &pce TSRMLS_CC) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
ce = *pce;
|
||||
array_init(return_value);
|
||||
add_class_vars(*pce, &(*pce)->default_properties, return_value TSRMLS_CC);
|
||||
add_class_vars(*pce, (*pce)->static_members, return_value TSRMLS_CC);
|
||||
if (!ce->constants_updated) {
|
||||
zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
ce->constants_updated = 1;
|
||||
}
|
||||
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -740,10 +692,9 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zval **value;
|
||||
HashTable *properties;
|
||||
HashPosition pos;
|
||||
char *key, *prop_name, *class_name;
|
||||
char *key;
|
||||
uint key_len;
|
||||
ulong num_index;
|
||||
int instanceof;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
@@ -756,27 +707,16 @@ ZEND_FUNCTION(get_object_vars)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
instanceof = EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), Z_OBJCE_PP(obj) TSRMLS_CC);
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
properties = Z_OBJ_HT_PP(obj)->get_properties(*obj TSRMLS_CC);
|
||||
zend_hash_internal_pointer_reset_ex(properties, &pos);
|
||||
|
||||
while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) {
|
||||
if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING) {
|
||||
if (key[0]) {
|
||||
if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_STRING && key[0]) {
|
||||
/* Not separating references */
|
||||
(*value)->refcount++;
|
||||
add_assoc_zval_ex(return_value, key, key_len, *value);
|
||||
} else if (instanceof) {
|
||||
zend_unmangle_property_name(key, &class_name, &prop_name);
|
||||
if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) {
|
||||
/* Not separating references */
|
||||
(*value)->refcount++;
|
||||
add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value);
|
||||
}
|
||||
}
|
||||
}
|
||||
zend_hash_move_forward_ex(properties, &pos);
|
||||
}
|
||||
@@ -818,20 +758,14 @@ ZEND_FUNCTION(get_class_methods)
|
||||
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
|
||||
|
||||
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) {
|
||||
if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
|
||||
|| (EG(scope) &&
|
||||
(((mptr->common.fn_flags & ZEND_ACC_PROTECTED) &&
|
||||
instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
|
||||
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
|
||||
EG(scope) == mptr->common.scope)))) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRING(method_name, mptr->common.function_name, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRING(method_name, mptr->common.function_name, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
zend_hash_move_forward_ex(&ce->function_table, &pos);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
\
|
||||
|
||||
|
||||
/* {{{ proto bool method_exists(object object, string method)
|
||||
@@ -885,42 +819,11 @@ ZEND_FUNCTION(class_exists)
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name);
|
||||
RETURN_BOOL(found == SUCCESS && !((*ce)->ce_flags & ZEND_ACC_INTERFACE));
|
||||
RETURN_BOOL(found == SUCCESS);
|
||||
}
|
||||
|
||||
if (zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC) == SUCCESS) {
|
||||
RETURN_BOOL(((*ce)->ce_flags & ZEND_ACC_INTERFACE) == 0);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool interface_exists(string classname [, bool autoload])
|
||||
Checks if the class exists */
|
||||
ZEND_FUNCTION(interface_exists)
|
||||
{
|
||||
char *iface_name, *lc_name;
|
||||
zend_class_entry **ce;
|
||||
int iface_name_len;
|
||||
zend_bool autoload = 1;
|
||||
int found;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &iface_name, &iface_name_len, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!autoload) {
|
||||
lc_name = do_alloca(iface_name_len + 1);
|
||||
zend_str_tolower_copy(lc_name, iface_name, iface_name_len);
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, iface_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name);
|
||||
RETURN_BOOL(found == SUCCESS && (*ce)->ce_flags & ZEND_ACC_INTERFACE);
|
||||
}
|
||||
|
||||
if (zend_lookup_class(iface_name, iface_name_len, &ce TSRMLS_CC) == SUCCESS) {
|
||||
RETURN_BOOL(((*ce)->ce_flags & ZEND_ACC_INTERFACE) > 0);
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1132,15 +1035,13 @@ ZEND_FUNCTION(set_exception_handler)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(exception_handler) != IS_NULL) { /* NULL == unset */
|
||||
if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) {
|
||||
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
|
||||
get_active_function_name(TSRMLS_C), exception_handler_name?exception_handler_name:"unknown");
|
||||
efree(exception_handler_name);
|
||||
return;
|
||||
}
|
||||
if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) {
|
||||
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
|
||||
get_active_function_name(TSRMLS_C), exception_handler_name?exception_handler_name:"unknown");
|
||||
efree(exception_handler_name);
|
||||
return;
|
||||
}
|
||||
efree(exception_handler_name);
|
||||
|
||||
if (EG(user_exception_handler)) {
|
||||
had_orig_exception_handler = 1;
|
||||
@@ -1150,7 +1051,7 @@ ZEND_FUNCTION(set_exception_handler)
|
||||
}
|
||||
ALLOC_ZVAL(EG(user_exception_handler));
|
||||
|
||||
if (Z_TYPE_PP(exception_handler) == IS_NULL) { /* unset user-defined handler */
|
||||
if (Z_STRLEN_PP(exception_handler)==0) { /* unset user-defined handler */
|
||||
FREE_ZVAL(EG(user_exception_handler));
|
||||
EG(user_exception_handler) = NULL;
|
||||
RETURN_TRUE;
|
||||
@@ -1520,12 +1421,6 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
|
||||
(*arg)->refcount++;
|
||||
add_next_index_zval(arg_array, *arg);
|
||||
}
|
||||
|
||||
/* skip args from incomplete frames */
|
||||
while ((((*curpos)-1) > EG(argument_stack).elements) && *((*curpos)-1)) {
|
||||
(*curpos)--;
|
||||
}
|
||||
|
||||
return arg_array;
|
||||
}
|
||||
|
||||
@@ -1548,7 +1443,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC)
|
||||
/* {{{ proto void debug_print_backtrace(void) */
|
||||
ZEND_FUNCTION(debug_print_backtrace)
|
||||
{
|
||||
zend_execute_data *ptr, *skip;
|
||||
zend_execute_data *ptr;
|
||||
int lineno;
|
||||
char *function_name;
|
||||
char *filename;
|
||||
@@ -1573,11 +1468,6 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
args -= *(ulong*)args;
|
||||
frames_on_stack++;
|
||||
|
||||
/* skip args from incomplete frames */
|
||||
while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
|
||||
args--;
|
||||
}
|
||||
|
||||
if ((args-1) == EG(argument_stack).elements) {
|
||||
arg_stack_consistent = 1;
|
||||
break;
|
||||
@@ -1591,35 +1481,13 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
cur_arg_pos -= 2;
|
||||
frames_on_stack--;
|
||||
|
||||
if (arg_stack_consistent) {
|
||||
/* skip args from incomplete frames */
|
||||
while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
|
||||
cur_arg_pos--;
|
||||
}
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
while (ptr) {
|
||||
char *free_class_name = NULL;
|
||||
|
||||
class_name = call_type = NULL;
|
||||
arg_array = NULL;
|
||||
|
||||
skip = ptr;
|
||||
/* skip internal handler */
|
||||
if (!skip->op_array &&
|
||||
skip->prev_execute_data &&
|
||||
skip->prev_execute_data->opline &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL_BY_NAME &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
|
||||
skip = skip->prev_execute_data;
|
||||
}
|
||||
|
||||
if (skip->op_array) {
|
||||
filename = skip->op_array->filename;
|
||||
lineno = skip->opline->lineno;
|
||||
class_name = call_type = NULL;
|
||||
if (ptr->op_array) {
|
||||
filename = ptr->op_array->filename;
|
||||
lineno = ptr->opline->lineno;
|
||||
} else {
|
||||
filename = NULL;
|
||||
lineno = 0;
|
||||
@@ -1629,18 +1497,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
|
||||
if (function_name) {
|
||||
if (ptr->object) {
|
||||
if (ptr->function_state.function->common.scope) {
|
||||
class_name = ptr->function_state.function->common.scope->name;
|
||||
} else {
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
|
||||
if(!dup) {
|
||||
free_class_name = class_name;
|
||||
}
|
||||
}
|
||||
|
||||
class_name = Z_OBJCE(*ptr->object)->name;
|
||||
call_type = "->";
|
||||
} else if (ptr->function_state.function->common.scope) {
|
||||
class_name = ptr->function_state.function->common.scope->name;
|
||||
@@ -1659,11 +1516,6 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
|
||||
zend_bool build_filename_arg = 1;
|
||||
|
||||
if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
|
||||
/* can happen when calling eval from a custom sapi */
|
||||
function_name = "unknown";
|
||||
build_filename_arg = 0;
|
||||
} else
|
||||
switch (ptr->opline->op2.u.constant.value.lval) {
|
||||
case ZEND_EVAL:
|
||||
function_name = "eval";
|
||||
@@ -1708,11 +1560,8 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
}
|
||||
zend_printf(") called at [%s:%d]\n", filename, lineno);
|
||||
include_filename = filename;
|
||||
ptr = skip->prev_execute_data;
|
||||
ptr = ptr->prev_execute_data;
|
||||
++indent;
|
||||
if (free_class_name) {
|
||||
efree(free_class_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1720,11 +1569,12 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
|
||||
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC)
|
||||
{
|
||||
zend_execute_data *ptr, *skip;
|
||||
zend_execute_data *ptr;
|
||||
int lineno;
|
||||
char *function_name;
|
||||
char *filename;
|
||||
char *class_name;
|
||||
char *call_type;
|
||||
char *include_filename = NULL;
|
||||
zval *stack_frame;
|
||||
void **cur_arg_pos = EG(argument_stack).top_element;
|
||||
@@ -1739,11 +1589,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
args -= *(ulong*)args;
|
||||
frames_on_stack++;
|
||||
|
||||
/* skip args from incomplete frames */
|
||||
while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
|
||||
args--;
|
||||
}
|
||||
|
||||
if ((args-1) == EG(argument_stack).elements) {
|
||||
arg_stack_consistent = 1;
|
||||
break;
|
||||
@@ -1752,24 +1597,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
|
||||
ptr = EG(current_execute_data);
|
||||
|
||||
/* skip "new Exception()" */
|
||||
if ((skip_last == 0) && ptr->opline && (ptr->opline->opcode == ZEND_NEW)) {
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
|
||||
/* skip debug_backtrace() */
|
||||
ptr = ptr->prev_execute_data;
|
||||
if (skip_last--) {
|
||||
int arg_count = *((ulong*)(cur_arg_pos - 2));
|
||||
cur_arg_pos -= (arg_count + 2);
|
||||
frames_on_stack--;
|
||||
ptr = ptr->prev_execute_data;
|
||||
|
||||
if (arg_stack_consistent) {
|
||||
/* skip args from incomplete frames */
|
||||
while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
|
||||
cur_arg_pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
@@ -1778,20 +1611,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
MAKE_STD_ZVAL(stack_frame);
|
||||
array_init(stack_frame);
|
||||
|
||||
skip = ptr;
|
||||
/* skip internal handler */
|
||||
if (!skip->op_array &&
|
||||
skip->prev_execute_data &&
|
||||
skip->prev_execute_data->opline &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL_BY_NAME &&
|
||||
skip->prev_execute_data->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
|
||||
skip = skip->prev_execute_data;
|
||||
}
|
||||
|
||||
if (skip->op_array) {
|
||||
filename = skip->op_array->filename;
|
||||
lineno = skip->opline->lineno;
|
||||
if (ptr->op_array) {
|
||||
filename = ptr->op_array->filename;
|
||||
lineno = ptr->opline->lineno;
|
||||
add_assoc_string_ex(stack_frame, "file", sizeof("file"), filename, 1);
|
||||
add_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno);
|
||||
|
||||
@@ -1807,21 +1629,20 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
if (function_name) {
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
|
||||
if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
|
||||
if (ptr->function_state.function->common.scope) {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
} else {
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
|
||||
|
||||
}
|
||||
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
|
||||
if (ptr->object) {
|
||||
class_name = Z_OBJCE(*ptr->object)->name;
|
||||
call_type = "->";
|
||||
} else if (ptr->function_state.function->common.scope) {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "::", 1);
|
||||
class_name = ptr->function_state.function->common.scope->name;
|
||||
call_type = "::";
|
||||
} else {
|
||||
class_name = NULL;
|
||||
call_type = NULL;
|
||||
}
|
||||
|
||||
if (class_name) {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, 1);
|
||||
add_assoc_string_ex(stack_frame, "type", sizeof("type"), call_type, 1);
|
||||
}
|
||||
|
||||
if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) {
|
||||
@@ -1834,11 +1655,6 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
|
||||
zend_bool build_filename_arg = 1;
|
||||
|
||||
if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
|
||||
/* can happen when calling eval from a custom sapi */
|
||||
function_name = "unknown";
|
||||
build_filename_arg = 0;
|
||||
} else
|
||||
switch (ptr->opline->op2.u.constant.value.lval) {
|
||||
case ZEND_EVAL:
|
||||
function_name = "eval";
|
||||
@@ -1885,7 +1701,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
|
||||
include_filename = filename;
|
||||
|
||||
ptr = skip->prev_execute_data;
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1940,13 +1756,10 @@ ZEND_FUNCTION(get_extension_funcs)
|
||||
|
||||
convert_to_string_ex(extension_name);
|
||||
if (strncasecmp(Z_STRVAL_PP(extension_name), "zend", sizeof("zend"))) {
|
||||
char *lcname = zend_str_tolower_dup(Z_STRVAL_PP(extension_name), Z_STRLEN_PP(extension_name));
|
||||
if (zend_hash_find(&module_registry, lcname,
|
||||
if (zend_hash_find(&module_registry, Z_STRVAL_PP(extension_name),
|
||||
Z_STRLEN_PP(extension_name)+1, (void**)&module) == FAILURE) {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
efree(lcname);
|
||||
|
||||
if (!(func = module->functions)) {
|
||||
RETURN_FALSE;
|
||||
@@ -1964,6 +1777,7 @@ ZEND_FUNCTION(get_extension_funcs)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+129
-209
@@ -19,7 +19,7 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <zend_language_parser.h>
|
||||
#include "zend_language_parser.h"
|
||||
#include "zend.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_constants.h"
|
||||
@@ -68,7 +68,7 @@ static void build_runtime_defined_function_key(zval *result, char *name, int nam
|
||||
uint char_pos_len;
|
||||
char *filename;
|
||||
|
||||
char_pos_len = zend_sprintf(char_pos_buf, "%p", LANG_SCNG(_yy_last_accepting_cpos));
|
||||
char_pos_len = zend_sprintf(char_pos_buf, "%x", (unsigned int) LANG_SCNG(_yy_last_accepting_cpos));
|
||||
if (CG(active_op_array)->filename) {
|
||||
filename = CG(active_op_array)->filename;
|
||||
} else {
|
||||
@@ -418,9 +418,6 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
|
||||
}
|
||||
|
||||
if (modifiers->u.constant.value.lval & ZEND_ACC_ABSTRACT) {
|
||||
if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
|
||||
zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
|
||||
}
|
||||
if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
@@ -486,12 +483,6 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
static inline zend_bool zend_is_function_or_method_call(znode *variable)
|
||||
{
|
||||
zend_uint type = variable->u.EA.type;
|
||||
|
||||
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
|
||||
}
|
||||
|
||||
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
|
||||
{
|
||||
@@ -503,11 +494,6 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
|
||||
if (opline_is_fetch_this(last_op TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
|
||||
}
|
||||
if (zend_is_function_or_method_call(rvar)) {
|
||||
opline->extended_value = ZEND_RETURNS_FUNCTION;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
if (result) {
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.EA.type = 0;
|
||||
@@ -731,6 +717,13 @@ void zend_check_writable_variable(znode *variable)
|
||||
}
|
||||
}
|
||||
|
||||
static inline zend_bool zend_is_function_or_method_call(znode *variable)
|
||||
{
|
||||
zend_uint type = variable->u.EA.type;
|
||||
|
||||
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
|
||||
}
|
||||
|
||||
void zend_do_begin_variable_parse(TSRMLS_D)
|
||||
{
|
||||
zend_llist fetch_list;
|
||||
@@ -745,53 +738,48 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_llist_element *le;
|
||||
zend_op *opline, *opline_ptr=NULL;
|
||||
int num_of_created_opcodes = 0;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
|
||||
le = fetch_list_ptr->head;
|
||||
|
||||
if (le) {
|
||||
while (le) {
|
||||
opline_ptr = (zend_op *)le->data;
|
||||
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
|
||||
CG(active_op_array)->uses_this = 1;
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
memcpy(opline, opline_ptr, sizeof(zend_op));
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
opline->opcode -= 3;
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
opline->opcode += 3;
|
||||
break;
|
||||
case BP_VAR_IS:
|
||||
opline->opcode += 6; /* 3+3 */
|
||||
break;
|
||||
case BP_VAR_FUNC_ARG:
|
||||
opline->opcode += 9; /* 3+3+3 */
|
||||
opline->extended_value = arg_offset;
|
||||
break;
|
||||
case BP_VAR_UNSET:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
|
||||
}
|
||||
opline->opcode += 12; /* 3+3+3+3 */
|
||||
break;
|
||||
}
|
||||
le = le->next;
|
||||
num_of_created_opcodes++;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
memcpy(opline, opline_ptr, sizeof(zend_op));
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
opline->opcode -= 3;
|
||||
break;
|
||||
case BP_VAR_W:
|
||||
break;
|
||||
case BP_VAR_RW:
|
||||
opline->opcode += 3;
|
||||
break;
|
||||
case BP_VAR_IS:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
opline->opcode += 6; /* 3+3 */
|
||||
break;
|
||||
case BP_VAR_FUNC_ARG:
|
||||
opline->opcode += 9; /* 3+3+3 */
|
||||
opline->extended_value = arg_offset;
|
||||
break;
|
||||
case BP_VAR_UNSET:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
|
||||
}
|
||||
opline->opcode += 12; /* 3+3+3+3 */
|
||||
break;
|
||||
}
|
||||
le = le->next;
|
||||
if (le == NULL) break;
|
||||
opline_ptr = (zend_op *)le->data;
|
||||
}
|
||||
if (num_of_created_opcodes == 1 && opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
|
||||
CG(active_op_array)->uses_this = 1;
|
||||
}
|
||||
|
||||
zend_llist_destroy(fetch_list_ptr);
|
||||
@@ -903,8 +891,7 @@ void zend_do_free(znode *op1 TSRMLS_DC)
|
||||
* Find JMP_NO_CTOR, mark the preceding ASSIGN and the
|
||||
* proceeding INIT_FCALL_BY_NAME as unused
|
||||
*/
|
||||
if (opline->opcode == ZEND_JMP_NO_CTOR &&
|
||||
opline->op1.u.var == op1->u.var) {
|
||||
if (opline->opcode == ZEND_JMP_NO_CTOR) {
|
||||
opline->op1.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
(opline-1)->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
(opline+1)->op1.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
@@ -975,7 +962,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
op_array.fn_flags = fn_flags;
|
||||
op_array.pass_rest_by_reference = 0;
|
||||
|
||||
op_array.scope = is_method?CG(active_class_entry):NULL;
|
||||
op_array.scope = CG(active_class_entry);
|
||||
op_array.prototype = NULL;
|
||||
|
||||
op_array.line_start = zend_get_compiled_lineno(TSRMLS_C);
|
||||
@@ -1005,37 +992,35 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
fn_flags |= ZEND_ACC_PUBLIC;
|
||||
}
|
||||
|
||||
if (!(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
short_class_name = do_alloca(short_class_name_length + 1);
|
||||
zend_str_tolower_copy(short_class_name, CG(active_class_entry)->name, short_class_name_length);
|
||||
/* Improve after RC: cache the lowercase class name */
|
||||
|
||||
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
} else {
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
}
|
||||
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
}
|
||||
short_class_name = do_alloca(short_class_name_length + 1);
|
||||
zend_str_tolower_copy(short_class_name, CG(active_class_entry)->name, short_class_name_length);
|
||||
/* Improve after RC: cache the lowercase class name */
|
||||
|
||||
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
} else {
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->destructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->clone = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__call = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__get = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__set = (zend_function *) CG(active_op_array);
|
||||
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
free_alloca(short_class_name);
|
||||
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
}
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->destructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->clone = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__call = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__get = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)))) {
|
||||
CG(active_class_entry)->__set = (zend_function *) CG(active_op_array);
|
||||
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
|
||||
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
|
||||
}
|
||||
free_alloca(short_class_name);
|
||||
|
||||
efree(lcname);
|
||||
} else {
|
||||
@@ -1084,10 +1069,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
}
|
||||
|
||||
if (CG(doc_comment)) {
|
||||
CG(active_op_array)->doc_comment = CG(doc_comment);
|
||||
CG(active_op_array)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len));
|
||||
CG(active_op_array)->doc_comment_len = CG(doc_comment_len);
|
||||
CG(doc_comment) = NULL;
|
||||
CG(doc_comment_len) = 0;
|
||||
RESET_DOC_COMMENT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1103,26 +1087,16 @@ void zend_do_handle_exception(TSRMLS_D)
|
||||
|
||||
void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
|
||||
{
|
||||
char lcname[16];
|
||||
int name_len;
|
||||
|
||||
zend_do_extended_info(TSRMLS_C);
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
zend_do_handle_exception(TSRMLS_C);
|
||||
|
||||
pass_two(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC);
|
||||
} else {
|
||||
/* we don't care if the function name is longer, in fact lowercasing only
|
||||
* the beginning of the name speeds up the check process */
|
||||
name_len = strlen(CG(active_op_array)->function_name);
|
||||
zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1));
|
||||
lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
|
||||
if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
|
||||
zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
|
||||
}
|
||||
if (CG(active_class_entry)
|
||||
&& !strcmp(CG(active_op_array)->function_name, ZEND_CLONE_FUNC_NAME)
|
||||
&& CG(active_op_array)->num_args != 0) {
|
||||
zend_error(E_COMPILE_ERROR, "The clone method cannot accept any arguments");
|
||||
}
|
||||
|
||||
CG(active_op_array)->line_end = zend_get_compiled_lineno(TSRMLS_C);
|
||||
@@ -1140,6 +1114,10 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
zend_arg_info *cur_arg_info;
|
||||
|
||||
if (CG(active_class_entry) && CG(active_class_entry)->destructor == (zend_function *) CG(active_op_array))
|
||||
{
|
||||
zend_error(E_COMPILE_ERROR, "Destuctor %s::%s() cannot take arguments", CG(active_class_entry)->name, CG(active_op_array)->function_name);
|
||||
}
|
||||
CG(active_op_array)->num_args++;
|
||||
opline->opcode = op;
|
||||
opline->result = *var;
|
||||
@@ -1215,7 +1193,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
|
||||
if ((last_op->op2.op_type == IS_CONST) && (last_op->op2.u.constant.type == IS_STRING) && (last_op->op2.u.constant.value.str.len == sizeof(ZEND_CLONE_FUNC_NAME)-1)
|
||||
if ((last_op->op2.op_type == IS_CONST) && (last_op->op2.u.constant.value.str.len == sizeof(ZEND_CLONE_FUNC_NAME)-1)
|
||||
&& !zend_binary_strcasecmp(last_op->op2.u.constant.value.str.val, last_op->op2.u.constant.value.str.len, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead");
|
||||
}
|
||||
@@ -1297,7 +1275,6 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC)
|
||||
opline->op2 = *class_name;
|
||||
}
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.u.EA.type = opline->extended_value;
|
||||
opline->result.op_type = IS_CONST; /* FIXME: Hack so that INIT_FCALL_BY_NAME still knows this is a class */
|
||||
*result = opline->result;
|
||||
}
|
||||
@@ -1321,27 +1298,36 @@ void zend_do_fetch_class_name(znode *result, znode *class_name_entry, znode *cla
|
||||
result->u.constant.value.str.len = length;
|
||||
}
|
||||
|
||||
void zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC)
|
||||
void zend_do_begin_class_member_function_call(TSRMLS_D)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
long fetch_const_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *last_op = &CG(active_op_array)->opcodes[fetch_const_op_number-1];
|
||||
|
||||
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
|
||||
opline->op1 = *class_name;
|
||||
opline->op2 = *method_name;
|
||||
|
||||
if (opline->op2.op_type == IS_CONST) {
|
||||
if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(opline->op2.u.constant) &&
|
||||
memcmp(Z_STRVAL(opline->op2.u.constant), ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
|
||||
zval_dtor(&opline->op2.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
if (last_op->opcode == ZEND_FETCH_CONSTANT) { /* regular method call */
|
||||
/* a tmp var is leaked here */
|
||||
last_op->opcode = ZEND_INIT_STATIC_METHOD_CALL;
|
||||
if(last_op->op2.op_type == IS_CONST &&
|
||||
(sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(last_op->op2.u.constant) &&
|
||||
memcmp(Z_STRVAL(last_op->op2.u.constant), ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
|
||||
zval_dtor(&last_op->op2.u.constant);
|
||||
SET_UNUSED(last_op->op2);
|
||||
} else {
|
||||
zend_str_tolower(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
|
||||
zend_lowercase_znode_if_const(&last_op->op2);
|
||||
}
|
||||
} else if (last_op->opcode == ZEND_FETCH_R) { /* indirect method call */
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
last_op->op2.u.EA.type = ZEND_FETCH_LOCAL;
|
||||
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
|
||||
opline->op1 = last_op->op2;
|
||||
opline->op2 = last_op->result;
|
||||
} else {
|
||||
zend_error(E_COMPILE_ERROR, "Internal compiler error - please report!");
|
||||
}
|
||||
|
||||
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
zend_do_extended_fcall_begin(TSRMLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -1382,7 +1368,6 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
int original_op=op;
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
int send_by_reference;
|
||||
int send_function = 0;
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
function_ptr = *function_ptr_ptr;
|
||||
@@ -1407,7 +1392,6 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
|
||||
/* Method call */
|
||||
op = ZEND_SEND_VAR_NO_REF;
|
||||
send_function = ZEND_ARG_SEND_FUNCTION;
|
||||
} else if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) {
|
||||
op = ZEND_SEND_VAR_NO_REF;
|
||||
}
|
||||
@@ -1446,9 +1430,9 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
|
||||
|
||||
if (op == ZEND_SEND_VAR_NO_REF) {
|
||||
if (function_ptr) {
|
||||
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference | send_function;
|
||||
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference;
|
||||
} else {
|
||||
opline->extended_value = send_function;
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
} else {
|
||||
if (function_ptr) {
|
||||
@@ -1469,7 +1453,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
|
||||
zend_op *opline;
|
||||
|
||||
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
|
||||
return (switch_entry->cond.op_type == IS_UNUSED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
@@ -1691,11 +1675,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
if (!zend_hash_exists(&ce->function_table, lc_class_name, ce->name_length+1)) {
|
||||
lc_parent_class_name = zend_str_tolower_dup(ce->parent->name, ce->parent->name_length);
|
||||
if (zend_hash_find(&ce->parent->function_table, lc_parent_class_name, ce->parent->name_length+1, (void **)&function)==SUCCESS) {
|
||||
if (function->common.fn_flags & ZEND_ACC_CTOR) {
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, lc_class_name, ce->name_length+1, function, sizeof(zend_function), NULL);
|
||||
function_add_ref(function);
|
||||
}
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, lc_class_name, ce->name_length+1, function, sizeof(zend_function), NULL);
|
||||
function_add_ref(function);
|
||||
}
|
||||
efree(lc_parent_class_name);
|
||||
}
|
||||
@@ -1868,18 +1850,9 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
zend_property_info *child_info;
|
||||
zend_class_entry *parent_ce = ce->parent;
|
||||
|
||||
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
|
||||
if (parent_info->flags & ZEND_ACC_PRIVATE) {
|
||||
if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
|
||||
child_info->flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
zend_hash_quick_update(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, parent_info, sizeof(zend_property_info), (void **) &child_info);
|
||||
if(ce->type & ZEND_INTERNAL_CLASS) {
|
||||
zend_duplicate_property_info_internal(child_info);
|
||||
} else {
|
||||
zend_duplicate_property_info(child_info);
|
||||
}
|
||||
child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */
|
||||
child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */
|
||||
}
|
||||
return 0; /* don't copy access information to child */
|
||||
}
|
||||
@@ -1891,11 +1864,6 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
|
||||
|
||||
}
|
||||
|
||||
if(parent_info->flags & ZEND_ACC_CHANGED) {
|
||||
child_info->flags |= ZEND_ACC_CHANGED;
|
||||
}
|
||||
|
||||
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
|
||||
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
|
||||
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
|
||||
@@ -1936,6 +1904,12 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
|
||||
zend_hash_del(&ce->default_properties, prot_name, prot_name_length+1);
|
||||
}
|
||||
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
|
||||
} else if (!(child_info->flags & ZEND_ACC_PRIVATE) && (child_info->flags & ZEND_ACC_STATIC)) {
|
||||
char *prop_name, *tmp;
|
||||
|
||||
zend_unmangle_property_name(child_info->name, &tmp, &prop_name);
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare property static %s %s::$%s in class %s",
|
||||
zend_visibility_string(child_info->flags), parent_ce->name, prop_name, ce->name);
|
||||
}
|
||||
return 0; /* Don't copy from parent */
|
||||
} else {
|
||||
@@ -1950,9 +1924,6 @@ static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry
|
||||
if (!(ce->ce_flags & ZEND_ACC_INTERFACE) && iface->interface_gets_implemented && iface->interface_gets_implemented(iface, ce TSRMLS_CC) == FAILURE) {
|
||||
zend_error(E_CORE_ERROR, "Class %s could not implement interface %s", ce->name, iface->name);
|
||||
}
|
||||
if (ce == iface) {
|
||||
zend_error(E_ERROR, "Interface %s cannot not implement itself", ce->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2022,8 +1993,6 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRML
|
||||
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
|
||||
do_inherit_parent_constructor(ce);
|
||||
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -2131,10 +2100,6 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
|
||||
ce = *pce;
|
||||
}
|
||||
|
||||
if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name);
|
||||
}
|
||||
|
||||
zend_do_inheritance(ce, parent_ce TSRMLS_CC);
|
||||
|
||||
ce->refcount++;
|
||||
@@ -2195,19 +2160,6 @@ void zend_do_early_binding(TSRMLS_D)
|
||||
if (do_bind_inherited_class(opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
|
||||
return;
|
||||
}
|
||||
/* clear unnecessary ZEND_FETCH_CLASS opcode */
|
||||
if (opline > CG(active_op_array)->opcodes &&
|
||||
(opline-1)->opcode == ZEND_FETCH_CLASS) {
|
||||
zend_op *fetch_class_opline = opline-1;
|
||||
|
||||
zval_dtor(&fetch_class_opline->op2.u.constant);
|
||||
fetch_class_opline->opcode = ZEND_NOP;
|
||||
memset(&fetch_class_opline->op1, 0, sizeof(znode));
|
||||
memset(&fetch_class_opline->op2, 0, sizeof(znode));
|
||||
SET_UNUSED(fetch_class_opline->op1);
|
||||
SET_UNUSED(fetch_class_opline->op2);
|
||||
SET_UNUSED(fetch_class_opline->result);
|
||||
}
|
||||
} else {
|
||||
/* We currently don't early-bind classes that implement interfaces */
|
||||
return;
|
||||
@@ -2537,20 +2489,10 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
|
||||
|
||||
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
|
||||
new_class_entry->filename = zend_get_compiled_filename(TSRMLS_C);
|
||||
new_class_entry->line_start = class_token->u.opline_num;
|
||||
new_class_entry->ce_flags |= class_token->u.EA.type;
|
||||
new_class_entry->line_start = zend_get_compiled_lineno(TSRMLS_C);
|
||||
new_class_entry->ce_flags |= class_token->u.constant.value.lval;
|
||||
|
||||
if (parent_class_name && parent_class_name->op_type != IS_UNUSED) {
|
||||
switch (parent_class_name->u.EA.type) {
|
||||
case ZEND_FETCH_CLASS_SELF:
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved");
|
||||
break;
|
||||
case ZEND_FETCH_CLASS_PARENT:
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
doing_inheritance = 1;
|
||||
}
|
||||
|
||||
@@ -2580,10 +2522,9 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
|
||||
CG(implementing_class) = opline->result;
|
||||
|
||||
if (CG(doc_comment)) {
|
||||
CG(active_class_entry)->doc_comment = CG(doc_comment);
|
||||
CG(active_class_entry)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len));
|
||||
CG(active_class_entry)->doc_comment_len = CG(doc_comment_len);
|
||||
CG(doc_comment) = NULL;
|
||||
CG(doc_comment_len) = 0;
|
||||
RESET_DOC_COMMENT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2627,8 +2568,7 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
|
||||
|
||||
/* Inherit interfaces */
|
||||
if (ce->num_interfaces > 0) {
|
||||
ce->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *)*ce->num_interfaces);
|
||||
memset(ce->interfaces, 0, sizeof(zend_class_entry *)*ce->num_interfaces);
|
||||
ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *)*ce->num_interfaces);
|
||||
}
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
@@ -2643,26 +2583,8 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
|
||||
|
||||
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
switch (interface_znode->u.EA.type) {
|
||||
case ZEND_FETCH_CLASS_SELF:
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'self' as interface name as it is reserved");
|
||||
break;
|
||||
case ZEND_FETCH_CLASS_PARENT:
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as interface name as it is reserved");
|
||||
break;
|
||||
default:
|
||||
if (CG(active_op_array)->last > 0) {
|
||||
opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
if (opline->opcode == ZEND_FETCH_CLASS) {
|
||||
opline->extended_value = ZEND_FETCH_CLASS_INTERFACE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_ADD_INTERFACE;
|
||||
opline->op1 = CG(implementing_class);
|
||||
opline->op2 = *interface_znode;
|
||||
@@ -3029,16 +2951,9 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
|
||||
zval_dtor(&offset->u.constant);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);
|
||||
@@ -3091,6 +3006,7 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
|
||||
zend_llist_element *dimension;
|
||||
zend_op *opline;
|
||||
znode last_container;
|
||||
int opcode_index;
|
||||
int last_op_number;
|
||||
zend_op *last_op;
|
||||
|
||||
@@ -3132,10 +3048,14 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
|
||||
((list_llist_element *) le->data)->value = last_container;
|
||||
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
opcode_index = - 1;
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
if (last_op->opcode == ZEND_FETCH_OBJ_W) {
|
||||
opcode_index = - 2;
|
||||
}
|
||||
zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value TSRMLS_CC);
|
||||
zend_do_free(result TSRMLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last + opcode_index].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
le = le->next;
|
||||
}
|
||||
zend_llist_destroy(&CG(dimension_llist));
|
||||
|
||||
+5
-14
@@ -41,13 +41,10 @@
|
||||
#define DEC_BPC(op_array) if (CG(interactive)) { ((op_array)->backpatch_count--); }
|
||||
#define HANDLE_INTERACTIVE() if (CG(interactive)) { execute_new_code(TSRMLS_C); }
|
||||
|
||||
#define RESET_DOC_COMMENT() \
|
||||
{ \
|
||||
if (CG(doc_comment)) { \
|
||||
efree(CG(doc_comment)); \
|
||||
CG(doc_comment) = NULL; \
|
||||
} \
|
||||
CG(doc_comment_len) = 0; \
|
||||
#define RESET_DOC_COMMENT() \
|
||||
{ \
|
||||
CG(doc_comment) = NULL; \
|
||||
CG(doc_comment_len) = 0; \
|
||||
}
|
||||
|
||||
typedef struct _zend_op_array zend_op_array;
|
||||
@@ -134,9 +131,6 @@ typedef struct _zend_try_catch_element {
|
||||
/* method flag (bc only), any method that has this flag can be used statically and non statically. */
|
||||
#define ZEND_ACC_ALLOW_STATIC 0x10000
|
||||
|
||||
/* shadow of parent's private method/property */
|
||||
#define ZEND_ACC_SHADOW 0x20000
|
||||
|
||||
char *zend_visibility_string(zend_uint fn_flags);
|
||||
|
||||
|
||||
@@ -381,7 +375,7 @@ void zend_do_clone(znode *result, znode *expr TSRMLS_DC);
|
||||
void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC);
|
||||
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
|
||||
void zend_do_fetch_class_name(znode *result, znode *class_entry, znode *class_name TSRMLS_DC);
|
||||
void zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
|
||||
void zend_do_begin_class_member_function_call(TSRMLS_D);
|
||||
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
|
||||
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
|
||||
void zend_do_handle_exception(TSRMLS_D);
|
||||
@@ -744,7 +738,6 @@ int zendlex(znode *zendlval TSRMLS_DC);
|
||||
#define ZEND_FETCH_CLASS_MAIN 3
|
||||
#define ZEND_FETCH_CLASS_GLOBAL 4
|
||||
#define ZEND_FETCH_CLASS_AUTO 5
|
||||
#define ZEND_FETCH_CLASS_INTERFACE 6
|
||||
|
||||
|
||||
/* variable parsing type (compile-time) */
|
||||
@@ -805,7 +798,6 @@ int zendlex(znode *zendlval TSRMLS_DC);
|
||||
|
||||
#define ZEND_ARG_SEND_BY_REF (1<<0)
|
||||
#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
|
||||
#define ZEND_ARG_SEND_FUNCTION (1<<2)
|
||||
|
||||
#define AI_USE_PTR(ai) \
|
||||
if ((ai).ptr_ptr) { \
|
||||
@@ -848,7 +840,6 @@ END_EXTERN_C()
|
||||
#define ZEND_GET_FUNC_NAME "__get"
|
||||
#define ZEND_SET_FUNC_NAME "__set"
|
||||
#define ZEND_CALL_FUNC_NAME "__call"
|
||||
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
|
||||
|
||||
#endif /* ZEND_COMPILE_H */
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#ifndef ZEND_CONFIG_W32_H
|
||||
#define ZEND_CONFIG_W32_H
|
||||
|
||||
#define USE_ZEND_ALLOC 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
@@ -56,7 +55,6 @@ typedef unsigned int uint;
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
|
||||
@@ -317,11 +317,11 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
|
||||
zend_error(E_NOTICE,"Constant %s already defined", name);
|
||||
free(c->name);
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_dtor(&c->value);
|
||||
}
|
||||
zend_error(E_NOTICE,"Constant %s already defined", name);
|
||||
ret = FAILURE;
|
||||
}
|
||||
if (lowercase_name) {
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct _dynamic_array {
|
||||
} dynamic_array;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size);
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_push(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
|
||||
|
||||
Loaded 100 of 1039 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user