Compare commits

..
5298 changed files with 56459 additions and 377810 deletions

No files matched your search

-19
View File
@@ -12,25 +12,6 @@ document ____executor_globals
ZTS detection is automatically based on ext/standard module struct
end
define print_cvs
____executor_globals
set $p = $eg.current_execute_data.CVs
set $c = $eg.current_execute_data.op_array.last_var
set $v = $eg.current_execute_data.op_array.vars
set $i = 0
printf "Compiled variables count: %d\n", $c
while $i < $c
printf "%d = %s\n", $i, $v[$i].name
if $p[$i] != 0
printzv *$p[$i]
else
printf "*uninitialized*\n"
end
set $i = $i + 1
end
end
define dump_bt
set $t = $arg0
while $t
+2 -2
View File
@@ -58,8 +58,8 @@ Exceptions:
calling.
[7] When commenting out code using a #if statement, do NOT use 0 only. Instead
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
svn user foo. This allows easier tracking of why code was commented out,
use "<cvs username here>_0". For example, #if FOO_0, where FOO is your
cvs user foo. This allows easier tracking of why code was commented out,
especially in bundled libraries.
[8] Do not define functions that are not available. For instance, if a
+1 -1
View File
@@ -206,7 +206,7 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_pgsql
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
+10 -7
View File
@@ -386,7 +386,7 @@ Apache 2.0 on Unix systems
http://snaps.php.net/php5-latest.tar.gz or download binaries for
Windows http://snaps.php.net/win32/php5-win32-latest.zip.
* a prerelease version downloadable from http://qa.php.net/.
* you have always the option to obtain PHP through SVN.
* you have always the option to obtain PHP through anonymous CVS.
These versions of PHP are compatible to Apache 2.0.40 and later.
@@ -1303,8 +1303,8 @@ Introduction to PECL Installations
When building PHP modules, it's important to have known-good versions
of the required tools (autoconf, automake, libtool, etc.) See the
SVN Instructions for details on the required tools, and required
versions.
Anonymous CVS Instructions for details on the required tools, and
required versions.
__________________________________________________________________
Downloading PECL extensions
@@ -1320,11 +1320,14 @@ Downloading PECL extensions
PECL extensions that have releases listed on the PECL web site are
available for download and installation using the pecl command.
Specific revisions may also be specified.
* SVN
All PECL files reside in SVN. A web-based view may be seen at
http://svn.php.net/pecl/. To download straight from SVN, use:
* CVS
Most PECL extensions also reside in CVS. A web-based view may be
seen at http://cvs.php.net/pecl/. To download straight from CVS,
the following sequence of commands may be used. Note that phpfi is
the password for user cvsread:
$ svn co http://svn.php.net/repository/pecl/<extname>/trunk <extname>
$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
* Windows downloads
Windows users may find compiled PECL binaries by downloading the
+18 -3
View File
@@ -5,7 +5,24 @@
lcov: lcov-html
lcov-test: lcov-clean-data test
lcov-test: all
@echo "Running test suite"
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
NO_INTERACTION=1 \
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
NO_INTERACTION=1 \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
php_lcov.info: lcov-test
@echo "Generating data for $@"
@@ -57,5 +74,3 @@ lcov-clean:
rm -rf lcov_data/
rm -rf lcov_html/
lcov-clean-data:
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
+47 -19
View File
@@ -11,7 +11,7 @@ all: $(all_targets)
@echo "Don't forget to run 'make test'."
@echo
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
build-modules: $(PHP_MODULES)
libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
@@ -73,30 +73,57 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
for i in $(PHP_MODULES)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
done; \
fi; \
if test "x$(PHP_ZEND_EX)" != "x"; then \
for i in $(PHP_ZEND_EX)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
done; \
fi`
test: all
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
if test "$$INI_SCANNED_PATH"; then \
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
$(EGREP) -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
$(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -U -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -U -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
utest: all
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -u -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
ntest: all
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -N -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
@@ -110,8 +137,9 @@ clean:
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
.PHONY: all clean install distclean test
.NOEXPORT:
+122 -1120
View File
File diff suppressed because it is too large. Load diff
+41 -62
View File
@@ -1,31 +1,24 @@
====================
SVN Commit Rules
====================
This is the first file you should be reading after you get your SVN account.
We'll assume you're basically familiar with SVN, but feel free to post
your questions on the mailing list. Please have a look at
http://svnbook.red-bean.com/ for more detailed information on SVN.
This is the first file you should be reading after you get your CVS account.
We'll assume you're basically familiar with CVS, but feel free to post
your questions on the mailing list. Please have a look at
http://cvsbook.red-bean.com/ for more detailed information on CVS.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
some basic rules with regards to SVN usage will::
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
some basic rules with regards to CVS usage will:
a. Make everybody happier, especially those responsible for maintaining
the SVN itself.
the CVS itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
Having said that, here are the organizational rules:
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
2. Discuss any significant changes on the list before committing.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
@@ -37,54 +30,45 @@ Having said that, here are the organizational rules::
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for thos who need that.
Currently we have the following branches in use::
Currently we have the following branches in use:
HEAD Will become PHP 6.0. This CVS branch is for active development.
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
enhancements may go in here, but please keep that as infrequent as
possible.
PHP_5_1 This branch is closed.
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
PHP_4_3 This branch is closed.
trunk Will become PHP 6.0. This CVS branch is for active development.
The next few rules are more of a technical nature.
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
larger enhancements.
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
branches/PHP_5_1 This branch is closed.
branches/PHP_4_4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to trunk and then get merged from trunk
(aka MFH'ed) to all other relevant branches.
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
messages every day. Woe be to those who attempt to mess with it.
3. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
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
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
4. Do not commit multiple file and dump all messages in one commit. If you
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
5. Do write your commit message in such a way that it makes sense even
4. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
6. In your commit messages, keep each line shorter than 80 characters. And
5. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
7. If you modified a function that is callable from PHP, prepend PHP to
6. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
@@ -96,7 +80,7 @@ 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.
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 # at the beginning of _every_ such line.
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
@@ -104,15 +88,13 @@ 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::
For datetime.c:
- Added new 'K' format modifier to date() for printing out number of days until
New Year's Eve.
- Added new 'K' format modifier to date() for printing out number of days
until New Year's Eve.
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!
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!
The # lines will be omitted from the ChangeLog automagically.
@@ -124,19 +106,16 @@ 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
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Example:
Fixed bug #14016 (pgsql notice handler double free crash bug.)
Fixed bug #14016 (pgsql notice handler double free crash bug.)
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later.
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
somewhat later.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP SVN repository in various ways.
to look at PHP CVS repository in various ways.
To receive daily updates to ChangeLog and NEWS, send an empty message to
php-cvs-daily-subscribe@lists.php.net.
+30 -10
View File
@@ -8,11 +8,11 @@ part is making it acceptable for inclusion into our repository. :-)
How to create patch?
--------------------
We use Subversion (SVN) for revision control. You need to get the
source from SVN in order to create a patch. Read
http://www.php.net/svn.php for help on using SVN. You can check out
older branches, but make sure you get trunk as well and make your
patch work there.
We are working with CVS. You need to get CVS source to create a patch
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
source. You can check out older versions, but make sure you get
the default branch (i.e. Do not use -r option when you check out the
CVS source)
Read CODING_STANDARDS file before you start working.
@@ -21,7 +21,7 @@ add a new feature to PHP. After you finished editing, please test your
patch. Read README.TESTING for testing.
After you finish testing your patch, take diff file using
"svn diff > your.patch" command.
"cvs diff > your.patch" command.
Read README.TESTING for submitting a test script for your patch. This is
not strictly required, but it is preferred to submit a test script along
@@ -41,8 +41,25 @@ maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
you are patching PEAR. Official module maintainers can be found in
EXTENSIONS file in PHP source.
If you are new to SVN (Subversion), visit
http://svnbook.red-bean.com/ for details.
If you are new to CVS (Concurrent Versions System), visit
http://cvshome.org/ for details.
Recommended CVS client settings for creating patch file
------------------------------------------------------
Recommended ~/.cvsrc file setting is:
------
cvs -z3
update -d -P
checkout -P
diff -u
------
diff -u means:
-u Use the unified output format.
With this CVS setting, you don't have to worry about adding/deleting
newlines and spaces.
Check list for submitting patch
@@ -53,7 +70,10 @@ Check list for submitting patch
web server error logs when you test your patch?
- Did you build PHP for multi-threaded web servers. (Optional)
- Did you create test script for "make test"? (Recommended)
- Did you update SVN source before you take final patch?
- Did you check your patch is unified format and it does not
contain white space changes? (If you are not using recommended
cvs setting)
- Did you update CVS source before you take final patch?
- Did you read the patch again?
@@ -98,7 +118,7 @@ these questions:
What happens when your patch is applied?
----------------------------------------
Your name will be included together with your email address in the SVN
Your name will be included together with your email address in the CVS
commit log. If your patch affects end-users, a brief description
and your name might be added to the NEWS file.
+4 -5
View File
@@ -32,12 +32,11 @@ sapi/cli/php [-c /path/to/php.ini] run-tests.php [ext/foo/tests/GLOB]
[Which "php" executable "make test" look for]
---------------------------------------------
If you are running the run-tests.php script from the command line (as above)
you must set the TEST_PHP_EXECUTABLE environment variable to explicitly
select the PHP executable that is to be tested, that is, used to run the test scripts.
You must use TEST_PHP_EXECUTABLE environment variable to explicitly
select the php executable to be used to run the tests. That can either
be the CLI or CGI executable.
If you run the tests using make test, the PHP CLI and CGI executables are
automatically set for you. "make test" executes "run-tests.php" script with the CLI binary. Some
"make test" executes "run-tests.php" script with "php" binary. Some
test scripts such as session must be executed by CGI SAPI. Therefore,
you must build PHP with CGI SAPI to perform all tests.
+14 -14
View File
@@ -1,11 +1,11 @@
[IMPORTANT NOTICE]
------------------
This is an addendum to README.TESTING with additional information
specific to server-tests.php.
specific to run-tests2.php.
server-tests.php is backward compatible with tests developed for
the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
run-tests2.php is backward compatible with tests developed for
the original run-tests.php script. run-tests2 is *not* used by
'make test'. run-tests2 was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
or are accessable via HTTP.
@@ -13,12 +13,12 @@ or are accessable via HTTP.
[New features]
----------------
* Command line interface:
You can run 'php server-tests.php -h' to get all the possible options.
You can run 'php run-tests2.php -h' to get all the possible options.
* Configuration file:
the -c argument will allow you to use a configuration file. This is
handy if you are testing multiple environments and need various options
depending on the environment.
see server-tests-config.php for details.
see run-tests-config.php for details.
* CGI Emulation:
Will emulate a CGI environment when testing with the cgi sapi executable.
* HTTP testing:
@@ -39,23 +39,23 @@ make testing work.
Some (but not all!) examples of usage:
1. run tests from the php source directory
php server-tests.php -p /path/to/php-cli
php run-tests2.php -p /path/to/php-cli
2. run tests using cgi emulation
php server-tests.php -p /path/to/php-cgi
php run-tests2.php -p /path/to/php-cgi
3. run tests over http, copying test files into document root
php server-tests.php -w -u http://localhost/test -m /path/to/htdocs/test
php run-tests2.php -w -u http://localhost/test -m /path/to/htdocs/test
4. run tests over http, php sources have been aliased in web server
php server-tests.php -w -u http://localhost/test
php run-tests2.php -w -u http://localhost/test
5. run tests using configuration file
php server-tests.php -c /path/to/server-tests-config.php
php run-tests2.php -c /path/to/run-tests-config.php
6. run tests using configuration file, but overriding some settings:
(config file must be first)
php server-tests.php -c /path/to/server-tests-config.php -w -t 3 -d /path/to/testdir
php run-tests2.php -c /path/to/run-tests-config.php -w -t 3 -d /path/to/testdir
NOTE: configuration as described in README.TESTING still works.
@@ -63,7 +63,7 @@ NOTE: configuration as described in README.TESTING still works.
----------------
In addition to the traditional test sections
(see http://qa.php.net/write-test.php), several new sections are available
under server-tests.
under run-tests2.
--POST--
This is not a new section, but not multipart posts are supported for testing
@@ -97,7 +97,7 @@ include:
$scriptname this is what will become SCRIPT_NAME unless you override it
$docroot the equivelant of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->conf all run-tests2 configuration vars
$this->env all environment variables that will get passed to the test
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| Copyright (c) 1999-2008, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1999-2009, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| Copyright (c) 1999-2008, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+4 -9
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -491,7 +491,6 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int use_relative_path = 0;
#ifdef TSRM_WIN32
int is_unc;
int exists;
#endif
TSRMLS_FETCH();
@@ -590,7 +589,6 @@ no_realpath:
CWD_STATE_COPY(&old_state, state);
#ifdef TSRM_WIN32
exists = (use_realpath != CWD_EXPAND);
ret = 0;
is_unc = 0;
if (path_length >= 2 && path[1] == ':') {
@@ -698,16 +696,13 @@ no_realpath:
ptr_length = length;
FindClose(hFind);
ret = 0;
} else {
} else if (use_realpath == CWD_REALPATH) {
if (is_unc) {
/* skip share name */
is_unc--;
ret = 0;
} else {
exists = 0;
if (use_realpath == CWD_REALPATH) {
ret = 1;
}
ret = 1;
}
}
}
@@ -747,7 +742,7 @@ no_realpath:
/* Store existent file in realpath cache. */
#ifdef TSRM_WIN32
if (use_cache && !is_unc && exists) {
if (use_cache && !is_unc) {
#else
if (use_cache && (use_realpath == CWD_REALPATH)) {
#endif
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+15 -35
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -88,7 +88,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
if (mode == 1 /*X_OK*/) {
#if 1
/* This code is not supported by Windows 98,
/* This code is not supported by Windows 98,
* but we don't support it anymore */
DWORD type;
@@ -96,7 +96,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
#else
SHFILEINFO sfi;
return access(pathname, 0) == 0 &&
return access(pathname, 0) == 0 &&
SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1;
#endif
} else {
@@ -109,22 +109,22 @@ static process_pair *process_get(FILE *stream TSRMLS_DC)
{
process_pair *ptr;
process_pair *newptr;
for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
if (ptr->stream == stream) {
break;
}
}
if (ptr < (TWG(process) + TWG(process_size))) {
return ptr;
}
newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair));
if (newptr == NULL) {
return NULL;
}
TWG(process) = newptr;
ptr = newptr + TWG(process_size);
TWG(process_size)++;
@@ -136,7 +136,7 @@ static shm_pair *shm_get(int key, void *addr)
shm_pair *ptr;
shm_pair *newptr;
TSRMLS_FETCH();
for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
if (!ptr->descriptor) {
continue;
@@ -151,12 +151,12 @@ static shm_pair *shm_get(int key, void *addr)
if (ptr < (TWG(shm) + TWG(shm_size))) {
return ptr;
}
newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair));
if (newptr == NULL) {
return NULL;
}
TWG(shm) = newptr;
ptr = newptr + TWG(shm_size);
TWG(shm_size)++;
@@ -179,42 +179,23 @@ TSRM_API FILE *popen(const char *command, const char *type)
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
{
FILE *stream = NULL;
int fno, type_len = strlen(type), read, mode;
int fno, str_len = strlen(type), read, mode;
STARTUPINFO startup;
PROCESS_INFORMATION process;
SECURITY_ATTRIBUTES security;
HANDLE in, out;
process_pair *proc;
char *cmd;
int i;
char *ptype = (char *)type;
process_pair *proc;
TSRMLS_FETCH();
if (!type) {
return NULL;
}
/*The following two checks can be removed once we drop XP support */
type_len = strlen(type);
if (type_len <1 || type_len > 2) {
return NULL;
}
for (i=0; i < type_len; i++) {
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
return NULL;
}
ptype++;
}
security.nLength = sizeof(SECURITY_ATTRIBUTES);
security.bInheritHandle = TRUE;
security.lpSecurityDescriptor = NULL;
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
return NULL;
}
memset(&startup, 0, sizeof(STARTUPINFO));
memset(&process, 0, sizeof(PROCESS_INFORMATION));
@@ -223,7 +204,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
read = (type[0] == 'r') ? TRUE : FALSE;
mode = ((type_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
if (read) {
@@ -239,7 +220,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c "));
sprintf(cmd, "%s /c %s", TWG(comspec), command);
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) {
free(cmd);
return NULL;
}
free(cmd);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2010 The PHP Group |
| Copyright (c) 1997-2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+3 -3
View File
@@ -381,12 +381,12 @@ ext/pfpro not actively maintained
ext/w32api pecl/ffi
ext/yp not actively maintained
sapi/activescript http://pecl4win.php.net/ext.php/php5activescript.dll (PECL package)
or pecl/activescript (SVN)
or pecl/activescript (CVS)
Modules in PECL that are not actively maintained (i.e. have not been supported
for some time, have no active maintainer working on them currently, and do not
have any PECL package releases), are still available in SVN at
http://svn.php.net/pecl/. However, unreleased PHP modules are by their nature
have any PECL package releases), are still available in CVS at
http://cvs.php.net/pecl/. However, unreleased PHP modules are by their nature
unsupported, and your mileage may vary when attempting to install or use them.
9b. Class constants in new PHP 5.1 extensions
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+6 -6
View File
@@ -23,18 +23,18 @@ var_dump(constant("test const"));
echo "Done\n";
?>
--EXPECTF--
Warning: define() expects at least 2 parameters, 0 given in %s on line %d
Warning: Wrong parameter count for define() in %s on line %d
NULL
Warning: define() expects at least 2 parameters, 1 given in %s on line %d
Warning: Wrong parameter count for define() in %s on line %d
NULL
bool(true)
Warning: define() expects parameter 3 to be boolean, array given in %s on line %d
NULL
Notice: Constant true already defined in %s on line %d
bool(false)
Warning: define() expects parameter 1 to be string, array given in %s on line %d
NULL
Notice: Array to string conversion in %s on line %d
bool(true)
bool(true)
bool(true)
bool(true)
+1 -1
View File
@@ -60,7 +60,7 @@ int(%d)
Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d
NULL
Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d
Warning: Wrong parameter count for get_defined_constants() in %s on line %d
NULL
string(5) "array"
string(5) "array"
+11 -12
View File
@@ -359,8 +359,7 @@ var_dump($global_var);
//Note: No error conditions relating to passing arugments can be tested
// because these are not functions but statements, it will result in syntax error.
?>
===DONE===
echo "Done\n";
--EXPECTF--
*** Testing unset(), empty() & isset() with scalar variables ***
-- Iteration 1 --
@@ -1186,11 +1185,11 @@ bool(true)
*** Testing unset(), emtpy() & isset() with resource variables ***
-- Iteration 1 --
resource(%d) of type (stream)
resource(5) of type (stream)
bool(true)
bool(false)
bool(true)
resource(%d) of type (stream)
resource(5) of type (stream)
bool(false)
bool(true)
bool(false)
@@ -1199,11 +1198,11 @@ bool(false)
Notice: Undefined variable: resource in %s on line %d
NULL
-- Iteration 2 --
resource(%d) of type (stream)
resource(6) of type (stream)
bool(true)
bool(false)
bool(true)
resource(%d) of type (stream)
resource(6) of type (stream)
bool(false)
bool(true)
bool(false)
@@ -1218,7 +1217,7 @@ bool(false)
bool(true)
*** Testing unset(), empty() & isset() with objects ***
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(30)
["y"]=>
@@ -1240,7 +1239,7 @@ bool(false)
Notice: Undefined variable: lable in %s on line %d
bool(true)
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(30)
["y"]=>
@@ -1248,7 +1247,7 @@ object(Point)#%d (3) {
["lable"]=>
string(6) "Point1"
}
object(Point)#%d (2) {
object(Point)#1 (2) {
["y"]=>
int(40)
["lable"]=>
@@ -1256,7 +1255,7 @@ object(Point)#%d (2) {
}
bool(false)
bool(true)
object(Point)#%d (0) {
object(Point)#1 (0) {
}
bool(true)
bool(false)
@@ -1277,7 +1276,7 @@ array(3) {
[2]=>
string(9) "testPoint"
}
object(Point)#%d (3) {
object(Point)#1 (3) {
["x"]=>
int(5)
["y"]=>
@@ -1330,4 +1329,4 @@ bool(false)
bool(false)
bool(true)
int(10)
===DONE===
Done
-39
View File
@@ -1,39 +0,0 @@
--TEST--
__call() for private/protected methods
--FILE--
<?php
class A {
private $var1 = 'var1 value';
protected $var2 = 'var2 value';
private function func1()
{
return "in func1";
}
protected function func2()
{
return "in func2";
}
public function __get($var)
{
return $this->$var;
}
public function __call($func, array $args = array())
{
return call_user_func_array(array($this, $func), $args);
}
}
$a = new A();
echo $a->var1,"\n";
echo $a->var2,"\n";
echo $a->func1(),"\n";
echo $a->func2(),"\n";
?>
--EXPECTF--
var1 value
var2 value
in func1
in func2
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Trigger __call() in lieu of non visible methods when called via a callback.
--FILE--
<?php
class C {
protected function prot() { }
private function priv() { }
public function __call($name, $args) {
echo "In __call() for method $name()\n";
}
}
$c = new C;
call_user_func(array($c, 'none'));
call_user_func(array($c, 'prot'));
call_user_func(array($c, 'priv'));
?>
--EXPECTF--
In __call() for method none()
In __call() for method prot()
In __call() for method priv()
+1 -3
View File
@@ -41,14 +41,12 @@ $db = new hariCow;
var_dump($db);
?>
===DONE===
--EXPECTF--
Notice: Undefined variable: db in %sbug30162.php on line 35
NULL
object(hariCow)#%d (2) {
object(hariCow)#1 (2) {
["x"]=>
string(1) "x"
["y"]=>
string(1) "y"
}
===DONE===
+19 -5
View File
@@ -12,16 +12,30 @@ var_dump($a);
$a->x0->y1 = "ok\n";
echo $a->x0;
?>
--EXPECTF--
object(stdClass)#%d (1) {
--EXPECT--
object(stdClass)#1 (1) {
["x0"]=>
&object(stdClass)#%d (3) {
&object(stdClass)#2 (3) {
["y0"]=>
string(1) "b"
["y1"]=>
*RECURSION*
&object(stdClass)#2 (3) {
["y0"]=>
string(1) "b"
["y1"]=>
*RECURSION*
["y2"]=>
*RECURSION*
}
["y2"]=>
*RECURSION*
&object(stdClass)#2 (3) {
["y0"]=>
string(1) "b"
["y1"]=>
*RECURSION*
["y2"]=>
*RECURSION*
}
}
}
ok
+2 -4
View File
@@ -30,9 +30,7 @@ if (defined("pass3")) {
set_error_handler('errorHandler');
define("pass2", 1);
include(__FILE__);
print "ok\n";
}
?>
--EXPECT--
ok
--EXPECTF--
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
+1 -27
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #38469 (Unexpected creation of cycle)
Bug #38469 Unexpected creation of cycle
--FILE--
<?php
$a = array();
@@ -8,16 +8,6 @@ var_dump($a);
$b = array(array());
$b[0][0] = $b;
var_dump($b);
function f() {
$a = array();
$a[0] = $a;
var_dump($a);
$b = array(array());
$b[0][0] = $b;
var_dump($b);
}
f();
?>
--EXPECT--
array(1) {
@@ -36,19 +26,3 @@ array(1) {
}
}
}
array(1) {
[0]=>
array(0) {
}
}
array(1) {
[0]=>
array(1) {
[0]=>
array(1) {
[0]=>
array(0) {
}
}
}
}
-82
View File
@@ -1,82 +0,0 @@
--TEST--
Bug #39018 (Error control operator '@' fails to suppress "Uninitialized string offset")
--FILE--
<?php
error_reporting(E_ALL);
$a = 'foo';
$a[11111111111];
$a = '';
$a[0];
print $a[0]; // 12
$a[-11111111111111111111111];
print $a[-11111111111111111111111]; // 16
$a[-0];
$x = 'test';
@$x[4];
@$y = $x[4];
@('a' == $x[4]);
$x[4] == 'a'; // 28
@$x[4] == 'a';
(@$x[4]) == 'a';
($x[4]) == 'a'; // 34
(@($x[4])) == 'a';
(($x[4])) == 'a'; // 38
@($x[4]) == 'a';
($x[4]) == 'a'; // 42
@($x[4] == 'a');
($x[4] == 'a'); // 46
$y = 'foobar';
$y[12.2];
print $y[12.2]; // 52
$y[3.5];
print $y[3.5]; // 56
print "\nDone\n";
?>
--EXPECTF--
Notice: Uninitialized string offset: 0 in %s on line 12
Notice: Uninitialized string offset: -%d in %s on line 16
Notice: Uninitialized string offset: 4 in %s on line 28
Notice: Uninitialized string offset: 4 in %s on line 34
Notice: Uninitialized string offset: 4 in %s on line 38
Notice: Uninitialized string offset: 4 in %s on line 42
Notice: Uninitialized string offset: 4 in %s on line 46
Notice: Uninitialized string offset: 12 in %s on line 52
b
Done
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #39018 [2] (Error control operator '@' fails to suppress "Uninitialized string offset")
--FILE--
<?php
error_reporting(E_ALL);
$foo = 'test';
$x = @$foo[6];
print @($foo[100] + $foo[130]);
print "\nDone\n";
?>
--EXPECT--
0
Done
+1 -3
View File
@@ -6,6 +6,4 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
list($a, $b) = $s[0];
?>
--EXPECTF--
Notice: Uninitialized string offset: 0 in %s on line %d
Fatal error: Cannot use string offset as an array in %sbug39304.php on line %d
Fatal error: Cannot use string offset as an array in %sbug39304.php on line 3
+1 -1
View File
@@ -8,7 +8,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
--FILE--
<?php
$php = getenv('TEST_PHP_EXECUTABLE');
$cmd = "\"$php\" -n -d memory_limit=4M -a \"".dirname(__FILE__)."\"/bug40236.inc";
$cmd = "$php -d memory_limit=4M -a ".dirname(__FILE__)."/bug40236.inc";
echo `$cmd`;
?>
--EXPECTF--
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #41372 (Internal pointer of source array resets during array copying)
Bug #41372 Internal pointer of source array resets during array copying
--FILE--
<?php
$Foo = array('val1', 'val2', 'val3');
+1 -1
View File
@@ -8,4 +8,4 @@ $foo[3]->bar[1] = "bang";
echo "ok\n";
?>
--EXPECTF--
Fatal error: Cannot use string offset as an object in %sbug41919.php on line %d
Fatal error: Cannot use string offset as an object in %s/bug41919.php on line %d
-38
View File
@@ -1,38 +0,0 @@
--TEST--
bug #42143 (The constant NAN is reported as 0 on Windows build)
--CREDITS--
Venkat Raman Don
--FILE--
<?php
echo "Testing NAN:\n";
echo "NAN= ";
var_dump(NAN);
var_dump(tan(-1) == 123);
var_dump(cos(-100) == "PHP String");
var_dump(deg2rad(-5.6) == null);
var_dump(sqrt(-0.1) == false);
var_dump(sqrt(cos(M_PI)) == 0.1);
var_dump(NAN);
var_dump(is_nan(sqrt(-1.005)) == false);
var_dump(is_nan(floor(1)) == true);
var_dump(log10(-1) == log(-1));
var_dump(log10(-1) != log10(-1));
var_dump(is_finite(log10(-1)) == false);
var_dump(NAN == NAN);
?>
--EXPECT--
Testing NAN:
NAN= float(NAN)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
float(NAN)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #43053 (Regression: some numbers shown in scientific notation)
--FILE--
<?php
echo 1200000.00."\n";
echo 1300000.00."\n";
echo 1400000.00."\n";
echo 1500000.00."\n";
?>
--EXPECT--
1200000
1300000
1400000
1500000
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #43128 (Very long class name causes segfault)
Bug #43128 Very long class name causes segfault
--FILE--
<?php
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #44827 (define() allows :: in constant names)
--FILE--
<?php
define('foo::bar', 1);
define('::', 1);
?>
--EXPECTF--
Warning: Class constants cannot be defined or redefined in %sbug44827.php on line %d
Warning: Class constants cannot be defined or redefined in %sbug44827.php on line %d
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #44830 (Very minor issue with backslash in heredoc)
--FILE--
<?php
$backslash = <<<EOT
\
EOT;
var_dump($backslash);
?>
--EXPECT--
string(1) "\"
-29
View File
@@ -1,29 +0,0 @@
--TEST--
Bug #45178 memory corruption on assignment result of "new" by reference
--FILE--
<?php
class Foo {
function __construct() {
$this->error = array($this,$this);
}
}
$a =& new Foo();
class Bar {
function __construct() {
$this->_rme2 = $this;
}
}
$b =& new Bar();
$b->_rme2 = 0;
var_dump($b);
?>
--EXPECTF--
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 7
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 15
object(Bar)#%d (1) {
["_rme2"]=>
int(0)
}
-48
View File
@@ -1,48 +0,0 @@
--TEST--
Bug #45805 (Crash on throwing exception from error handler)
--SKIPIF--
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip"; ?>
--FILE--
<?php
class PHPUnit_Util_ErrorHandler
{
public static function handleError($errno, $errstr, $errfile, $errline)
{
throw new RuntimeException;
}
}
class A {
public function getX() {
return NULL;
}
}
class B {
public function foo() {
$obj = new A;
$source = &$obj->getX();
}
public function bar() {
$m = new ReflectionMethod('B', 'foo');
$m->invoke($this);
}
}
set_error_handler(
array('PHPUnit_Util_ErrorHandler', 'handleError'), E_ALL | E_STRICT
);
$o = new B;
$o->bar();
?>
--EXPECTF--
Fatal error: Uncaught exception 'RuntimeException' in %sbug45805.php:%d
Stack trace:
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(2048, 'Only variables ...', '%s', %d, Array)
#1 [internal function]: B->foo()
#2 %sbug45805.php(%d): ReflectionMethod->invoke(Object(B))
#3 %sbug45805.php(%d): B->bar()
#4 {main}
thrown in %sbug45805.php on line %d
-43
View File
@@ -1,43 +0,0 @@
--TEST--
Bug #45862 (get_class_vars is inconsistent with 'protected' and 'private' variables)
--FILE--
<?php
class Ancestor {
function test() {
var_dump(get_class_vars("Tester"));
var_dump(Tester::$prot);
}
}
class Tester extends Ancestor {
static protected $prot = "protected var";
static private $priv = "private var";
}
class Child extends Tester {
function test() { var_dump(get_class_vars("Tester")); }
}
echo "\n From parent scope\n";
$parent = new Ancestor();
$parent->test();
echo "\n From child scope\n";
$child = new Child();
$child->test();
?>
--EXPECT--
From parent scope
array(1) {
["prot"]=>
string(13) "protected var"
}
string(13) "protected var"
From child scope
array(1) {
["prot"]=>
string(13) "protected var"
}
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #45877 (Array key '2147483647' left as string)
--INI--
precision=16
--FILE--
<?php
$keys = array(PHP_INT_MAX,
(string) PHP_INT_MAX,
(string) (-PHP_INT_MAX - 1),
-PHP_INT_MAX - 1,
(string) (PHP_INT_MAX + 1));
var_dump(array_fill_keys($keys, 1));
?>
--EXPECTF--
array(3) {
[%d7]=>
int(1)
[-%d8]=>
int(1)
["%s"]=>
int(1)
}
-40
View File
@@ -1,40 +0,0 @@
--TEST--
Bug #46246 (difference between call_user_func(array($this, $method)) and $this->$method())
--FILE--
<?php
class A
{
private function Test()
{
echo 'Hello from '.get_class($this)."\n";
}
public function call($method, $args = array())
{
$this->Test();
$this->$method();
call_user_func(array($this, $method));
}
}
class B extends A
{
protected function Test()
{
echo 'Overridden hello from '.get_class($this)."\n";
}
}
$a = new A;
$b = new B;
$a->call('Test');
$b->call('Test');
?>
--EXPECT--
Hello from A
Hello from A
Hello from A
Hello from B
Hello from B
Hello from B
-33
View File
@@ -1,33 +0,0 @@
--TEST--
Bug #46308 (Invalid write when changing property from inside getter)
--FILE--
<?php
class main
{
public static $dummy = NULL ;
public static $dataAccessor = NULL ;
}
class dataAccessor
{
}
class relay
{
public function __get( $name )
{
main::$dataAccessor = new dataAccessor;
}
}
class dummy
{
}
main::$dummy = new dummy();
main::$dataAccessor = new relay();
main::$dataAccessor->bar;
echo "ok\n";
?>
--EXPECT--
ok
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #46381 (wrong $this passed to internal methods causes segfault)
--SKIPIF--
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
--FILE--
<?php
class test {
public function test() {
return ArrayIterator::current();
}
}
$test = new test();
$test->test();
echo "Done\n";
?>
--EXPECTF--
Fatal error: Non-static method ArrayIterator::current() cannot be called statically, assuming $this from incompatible context in %s on line %d
-38
View File
@@ -1,38 +0,0 @@
--TEST--
Bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only'); ?>
--FILE--
<?php
$test_array = array(
0xcc5c4600 => 1,
0xce331a00 => 2
);
$test_array[0xce359000] = 3;
var_dump($test_array);
var_dump($test_array[0xce331a00]);
class foo {
public $x;
public function __construct() {
$this->x[0xce359000] = 3;
var_dump($this->x);
}
}
new foo;
?>
--EXPECT--
array(1) {
[-2147483648]=>
int(3)
}
int(3)
array(1) {
[-2147483648]=>
int(3)
}
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object)
--FILE--
<?php
$a->{"a"."b"};
?>
--EXPECTF--
Notice: Undefined variable: a in %sbug47109.php on line 2
Notice: Trying to get property of non-object in %sbug47109.php on line 2
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #47165 (Possible memory corruption when passing return value by reference)
--FILE--
<?php
class Foo {
var $bar = array();
static function bar() {
static $instance = null;
$instance = new Foo();
return $instance->bar;
}
}
extract(Foo::bar());
echo "ok\n";
?>
--EXPECT--
ok
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #47353 (crash when creating a lot of objects in object destructor)
--FILE--
<?php
class A
{
function __destruct()
{
$myArray = array();
for($i = 1; $i <= 3000; $i++) {
if(!isset($myArray[$i]))
$myArray[$i] = array();
$ref = & $myArray[$i];
$ref[] = new stdClass();
}
}
}
$a = new A();
echo "Done\n";
?>
--EXPECTF--
Done
-9
View File
@@ -1,9 +0,0 @@
--TEST--
Bug #47704 (crashes on some "bad" operations with string offsets)
--FILE--
<?php
$s = "abd";
$s[0]->a += 1;
?>
--EXPECTF--
Fatal error: Cannot use string offset as an object in %sbug47704.php on line %d
-31
View File
@@ -1,31 +0,0 @@
--TEST--
Bug #47801 (__call() accessed via parent:: operator is provided incorrect method name)
--FILE--
<?php
class A
{
function __call($name, $args)
{
echo("magic method called: $name\n");
}
}
class B extends A
{
function getFoo()
{
parent::getFoo();
}
}
$a = new A();
$a->getFoo();
$b = new B();
$b->getFoo();
?>
--EXPECT--
magic method called: getFoo
magic method called: getFoo
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX index value)
--FILE--
<?php
$arr[PHP_INT_MAX] = 1;
$arr[] = 2;
var_dump($arr);
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %s on line 4
array(1) {
[%d]=>
int(1)
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #47981 (error handler not called regardless)
--INI--
error_reporting=0
--FILE--
<?php
function errh($errno, $errstr) {
var_dump($errstr);
}
set_error_handler("errh");
interface a{}
class b implements a { function f($a=1) {}}
class c extends b {function f() {}}
?>
--EXPECTF--
string(62) "Declaration of c::f() should be compatible with that of b::f()"
-32
View File
@@ -1,32 +0,0 @@
--TEST--
Bug #48228 (crash when exception is thrown while passing function arguments)
--FILE--
<?php
function do_throw() {
throw new Exception();
}
class aa
{
function check()
{
}
function dosome()
{
$this->check(do_throw());
}
}
$l_aa=new aa();
$l_aa->dosome();
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %s
Stack trace:
#0 %s(%d): do_throw()
#1 %s(%d): aa->dosome()
#2 {main}
thrown in %s
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #48248 (SIGSEGV when access to private property via &__get)
--FILE--
<?php
class A
{
public function & __get($name)
{
return $this->test;
}
}
class B extends A
{
private $test;
}
$b = new B;
var_dump($b->test);
?>
--EXPECTF--
Notice: Undefined property: B::$test in %s on line %d
Notice: Only variable references should be returned by reference in %s on line %d
NULL
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #48408 (crash when exception is thrown while passing function arguments)
--FILE--
<?php
class B{
public function process($x){
return $x;
}
}
class C{
public function generate($x){
throw new Exception;
}
}
$b = new B;
$c = new C;
try{
$b->process($c->generate(0));
}
catch(Exception $e){
$c->generate(0);
}
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %s
Stack trace:
#0 %s(%d): C->generate(0)
#1 {main}
thrown in %s
-67
View File
@@ -1,67 +0,0 @@
--TEST--
Bug #48409 (crash when exception is thrown while passing function arguments)
--FILE--
<?php
class ABCException extends Exception {}
class BBB
{
public function xyz($d, $x)
{
if ($x == 34) {
throw new ABCException;
}
return array('foo' => 'xyz');
}
}
class CCC
{
public function process($p)
{
return $p;
}
}
class AAA
{
public function func()
{
$b = new BBB;
$c = new CCC;
$i = 34;
$item = array('foo' => 'bar');
try {
$c->process($b->xyz($item['foo'], $i));
}
catch(ABCException $e) {
$b->xyz($item['foo'], $i);
}
} // end func();
}
class Runner
{
public function run($x)
{
try {
$x->func();
}
catch(ABCException $e) {
throw new Exception;
}
}
}
try {
$runner = new Runner;
$runner->run(new AAA);
}
catch(Exception $e) {
die('Exception thrown');
}
?>
--EXPECT--
Exception thrown
-13
View File
@@ -1,13 +0,0 @@
--TEST--
Bug #48428 (crash when exception is thrown while passing function arguments)
--FILE--
<?php
try {
function x() { throw new Exception("ERROR"); }
x(x());
} catch(Exception $e) {
echo($e -> getMessage());
}
?>
--EXPECT--
ERROR
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #48667 (Implementing both iterator and iteratoraggregate)
--FILE--
<?php
abstract class A implements Iterator, IteratorAggregate { }
?>
--EXPECTF--
Fatal error: Class A cannot implement both IteratorAggregate and Iterator at the same time in %s on line %d
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #48667 (Implementing both iterator and iteratoraggregate)
--FILE--
<?php
abstract class A implements IteratorAggregate, Iterator { }
?>
--EXPECTF--
Fatal error: Class A cannot implement both Iterator and IteratorAggregate at the same time in %s on line %d
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
--FILE--
<?php
$x = create_function('', 'return 1; }');
$y = create_function('', 'function a() { }; return 2;');
$z = create_function('', '{');
$w = create_function('', 'return 3;');
var_dump(
$x,
$y(),
$z,
$w(),
$y != $z
);
?>
--EXPECTF--
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
bool(false)
int(2)
bool(false)
int(3)
bool(true)
-51
View File
@@ -1,51 +0,0 @@
--TEST--
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
--FILE--
<?php
class A {
public function func($str) {
var_dump(__METHOD__ .': '. $str);
}
private function func2($str) {
var_dump(__METHOD__ .': '. $str);
}
protected function func3($str) {
var_dump(__METHOD__ .': '. $str);
}
private function func22($str) {
var_dump(__METHOD__ .': '. $str);
}
}
class B extends A {
public function func($str) {
static $avoid_crash = 0;
if ($avoid_crash++ == 1) {
print "This method shouldn't be called when using parent::func!\n";
return;
}
call_user_func_array(array($this, 'parent::func'), array($str));
}
private function func2($str) {
var_dump(__METHOD__ .': '. $str);
}
protected function func3($str) {
var_dump(__METHOD__ .': '. $str);
}
}
class C extends B {
public function func($str) {
parent::func($str);
}
}
$c = new C;
$c->func('This should work!');
?>
--EXPECTF--
%unicode|string%(26) "A::func: This should work!"
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration).
--FILE--
<?php
class TestObject implements Iterator
{
public $n = 0;
function valid()
{
return ($this->n < 3);
}
function current() {return $this->n;}
function next() {$this->n++;}
function key() { }
function rewind() {$this->n = 0;}
}
$array_object = new TestObject();
foreach ((true ? $array_object : $array_object) as $item) echo "$item\n";
?>
--EXPECT--
0
1
2
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #49472 (Constants defined in Interfaces can be overridden)
--FILE--
<?php
interface ia {
const c = 'Sea';
const y = 2;
}
class Foo implements ia {
}
class FooBar extends Foo implements ia {
const x = 1;
const c = 'Ocean';
public function show() {
return ia::c;
}
}
new FooBar;
?>
--EXPECTF--
Fatal error: Cannot inherit previously-inherited or override constant c from interface ia in %s on line %d
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->file = null;
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in :%d
Stack trace:
#0 {main}
thrown in Unknown on line %d
-33
View File
@@ -1,33 +0,0 @@
--TEST--
Bug #50174 (Incorrectly matched docComment)
--SKIPIF--
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip"; ?>
--FILE--
<?php
class TestClass
{
/** const comment */
const C = 0;
function x() {}
}
$rm = new ReflectionMethod('TestClass', 'x');
var_dump($rm->getDocComment());
class TestClass2
{
/** const comment */
const C = 0;
public $x;
}
$rp = new ReflectionProperty('TestClass2', 'x');
var_dump($rp->getDocComment());
?>
--EXPECT--
bool(false)
bool(false)
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #50255 (isset() and empty() silently casts array to object)
--FILE--
<?php
$arr = array('foo' => 'bar');
print "isset\n";
var_dump(isset($arr->foo));
var_dump(isset($arr->bar));
var_dump(isset($arr['foo']));
var_dump(isset($arr['bar']));
print "empty\n";
var_dump(empty($arr->foo));
var_dump(empty($arr->bar));
var_dump(empty($arr['foo']));
var_dump(empty($arr['bar']));
?>
--EXPECT--
isset
bool(false)
bool(false)
bool(true)
bool(false)
empty
bool(true)
bool(true)
bool(false)
bool(true)
-71
View File
@@ -1,71 +0,0 @@
--TEST--
Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
--FILE--
<?php
class myClass {
public function __call($method, $args) {
throw new Exception("Missing method '$method'\n");
}
}
function thrower2() {
$x = new myClass;
$x->foo();
}
try {
thrower2();
} catch (Exception $e) {
print $e->getMessage();
print_r($e->getTrace());
}
?>
--EXPECTF--
Missing method 'foo'
Array
(
[0] => Array
(
[file] => %s
[line] => 11
[function] => __call
[class] => myClass
[type] => ->
[args] => Array
(
[0] => foo
[1] => Array
(
)
)
)
[1] => Array
(
[file] => %s
[line] => 11
[function] => foo
[class] => myClass
[type] => ->
[args] => Array
(
)
)
[2] => Array
(
[file] => %s
[line] => 15
[function] => thrower2
[args] => Array
(
)
)
)
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #50394: Reference argument converted to value in __call
--FILE--
<?php
function inc( &$x ) { $x++; }
class Proxy {
function __call( $name, $args ) {
echo "$name called!\n";
call_user_func_array( 'inc', $args );
}
}
$arg = 1;
$args = array( &$arg );
$proxy = new Proxy;
call_user_func_array( array( $proxy, 'bar' ), $args );
call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
var_dump($arg);
--EXPECT--
bar called!
bar called!
int(3)
-40
View File
@@ -1,40 +0,0 @@
--TEST--
Bug #51822 (Segfault with strange __destruct() for static class variables)
--FILE--
<?php
class DestructableObject
{
public function __destruct()
{
echo "2\n";
}
}
class DestructorCreator
{
public function __destruct()
{
$this->test = new DestructableObject;
echo "1\n";
}
}
class Test
{
public static $mystatic;
}
// Uncomment this to avoid segfault
//Test::$mystatic = new DestructorCreator();
$x = new Test();
if (!isset(Test::$mystatic))
Test::$mystatic = new DestructorCreator();
echo "bla\n";
?>
--EXPECT--
bla
1
2
-50
View File
@@ -1,50 +0,0 @@
--TEST--
Bug #52041 (Memory leak when writing on uninitialized variable returned from function)
--FILE--
<?php
function foo() {
return $x;
}
foo()->a = 1;
foo()->a->b = 2;
foo()->a++;
foo()->a->b++;
foo()->a += 2;
foo()->a->b += 2;
//foo()[0] = 1;
//foo()[0][0] = 2;
//foo()[0]++;
//foo()[0][0]++;
//foo()[0] += 2;
//foo()[0][0] += 2;
var_dump(foo());
?>
--EXPECTF--
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 6
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 7
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 8
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 9
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 10
Notice: Undefined variable: x in %sbug52041.php on line 3
Strict Standards: Creating default object from empty value in %sbug52041.php on line 11
Notice: Undefined variable: x in %sbug52041.php on line 3
NULL
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug #52160 (Invalid E_STRICT redefined constructor error)
--FILE--
<?php
class bar {
function __construct() { }
static function bar() {
var_dump(1);
}
}
bar::bar();
class foo {
static function foo() {
var_dump(2);
}
function __construct() { }
}
foo::foo();
class baz {
static function baz() {
var_dump(3);
}
}
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class foo in %s on line %d
Fatal error: Constructor baz::baz() cannot be static in %s on line %d
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Check call to non-ref function with call-time refs
--FILE--
<?php
function my_errorhandler($errno,$errormsg) {
global $my_var;
$my_var=0x12345;
echo $errormsg."\n";
return true;
}
$oldhandler = set_error_handler("my_errorhandler");
$my_var = str_repeat("A",64);
$data = call_user_func_array("substr_replace",array(&$my_var, new StdClass(),1));
echo "OK!";
--EXPECT--
Object of class stdClass could not be converted to string
Object of class stdClass to string conversion
OK!
+1 -1
View File
@@ -28,4 +28,4 @@ int(1)
int(5)
int(10)
Fatal error: Undefined class constant 'NoSuchClass::val' in %s on line %d
Fatal error: Class 'NoSuchClass' not found in %s on line %d
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Testing declare statement with several type values
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 1123131232131312321);
declare(encoding = NULL);
declare(encoding = M_PI);
declare(encoding = 'utf-8');
print 'DONE';
?>
--EXPECT--
DONE
+2 -2
View File
@@ -16,5 +16,5 @@ class test implements test1, test2 {
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot inherit previously-inherited or override constant FOO from interface test2 in %s on line %d
--EXPECTF--
Fatal error: Cannot inherit previously-inherited constant FOO from interface test2 in %s on line %d
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Testing exception properties
--FILE--
<?php
class my_file
{
public function __toString()
{
return "somebuildfilename" ;
}
}
class my_exception extends exception
{
public function __construct()
{
$this->message = new stdclass ;
$this->file = new my_file ;
$this->line = "12" ;
}
}
throw new my_exception;
?>
--EXPECT--
Catchable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Testing Exception's methods
--FILE--
<?php
$x = new Exception;
$x->gettraceasstring(1);
$x->gettraceasstring();
$x->__tostring(1);
$x->gettrace(1);
$x->getline(1);
$x->getfile(1);
$x->getmessage(1);
$x->getcode(1);
?>
--EXPECTF--
Warning: Wrong parameter count for Exception::getTraceAsString() in %s on line %d
Warning: Wrong parameter count for Exception::__toString() in %s on line %d
Warning: Wrong parameter count for Exception::getTrace() in %s on line %d
Warning: Wrong parameter count for Exception::getLine() in %s on line %d
Warning: Wrong parameter count for Exception::getFile() in %s on line %d
Warning: Wrong parameter count for Exception::getMessage() in %s on line %d
Warning: Wrong parameter count for Exception::getCode() in %s on line %d
-39
View File
@@ -1,39 +0,0 @@
--TEST--
function_exists function : basic functionality
--FILE--
<?php
/*
* proto bool function_exists(string function_name)
* Function is implemented in Zend/zend_builtin_functions.c
*/
echo "*** Testing function_exists() : basic functionality ***\n";
echo "Internal function: ";
var_dump(function_exists('function_exists'));
echo "User defined function: ";
function f() {}
var_dump(function_exists('f'));
echo "Case sensitivity: ";
var_dump(function_exists('F'));
echo "Non existent function: ";
var_dump(function_exists('g'));
echo "Method: ";
Class C {
static function f() {}
}
var_dump(function_exists('C::f'));
?>
===Done===
--EXPECT--
*** Testing function_exists() : basic functionality ***
Internal function: bool(true)
User defined function: bool(true)
Case sensitivity: bool(true)
Non existent function: bool(false)
Method: bool(false)
===Done===
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Test function_exists() function : error conditions
--FILE--
<?php
/*
* proto bool function_exists(string function_name)
* Function is implemented in Zend/zend_builtin_functions.c
*/
echo "*** Testing function_exists() : error conditions ***\n";
$arg_0 = "ABC";
$extra_arg = 1;
echo "\nToo many arguments\n";
var_dump(function_exists($arg_0, $extra_arg));
echo "\nToo few arguments\n";
var_dump(function_exists());
?>
===Done===
--EXPECTF--
*** Testing function_exists() : error conditions ***
Too many arguments
Warning: Wrong parameter count for function_exists() in %s on line %d
NULL
Too few arguments
Warning: Wrong parameter count for function_exists() in %s on line %d
NULL
===Done===
-135
View File
@@ -1,135 +0,0 @@
--TEST--
Test function_exists() function : usage variations - test values for $str argument
--FILE--
<?php
/*
* proto bool function_exists(string function_name)
* Function is implemented in Zend/zend_builtin_functions.c
*/
echo "*** Testing function_exists() function: with unexpected inputs for 'str' argument ***\n";
//get an unset variable
$unset_var = 'string_val';
unset($unset_var);
//defining a class
class sample {
public function __toString() {
return "sample object";
}
}
//getting the resource
$file_handle = fopen(__FILE__, "r");
// array with different values for $str
$inputs = array (
// integer values
0,
1,
255,
256,
PHP_INT_MAX,
-PHP_INT_MAX,
// float values
10.5,
-20.5,
10.1234567e10,
// array values
array(),
array(0),
array(1, 2),
// boolean values
true,
false,
TRUE,
FALSE,
// null values
NULL,
null,
// objects
new sample(),
// resource
$file_handle,
// undefined variable
@$undefined_var,
// unset variable
@$unset_var
);
// loop through with each element of the $inputs array to test function_exists() function
$count = 1;
foreach($inputs as $input) {
echo "-- Iteration $count --\n";
var_dump( function_exists($input) );
$count ++;
}
fclose($file_handle); //closing the file handle
?>
===Done===
--EXPECTF--
*** Testing function_exists() function: with unexpected inputs for 'str' argument ***
-- Iteration 1 --
bool(false)
-- Iteration 2 --
bool(false)
-- Iteration 3 --
bool(false)
-- Iteration 4 --
bool(false)
-- Iteration 5 --
bool(false)
-- Iteration 6 --
bool(false)
-- Iteration 7 --
bool(false)
-- Iteration 8 --
bool(false)
-- Iteration 9 --
bool(false)
-- Iteration 10 --
Notice: Array to string conversion in %s on line %d
bool(false)
-- Iteration 11 --
Notice: Array to string conversion in %s on line %d
bool(false)
-- Iteration 12 --
Notice: Array to string conversion in %s on line %d
bool(false)
-- Iteration 13 --
bool(false)
-- Iteration 14 --
bool(false)
-- Iteration 15 --
bool(false)
-- Iteration 16 --
bool(false)
-- Iteration 17 --
bool(false)
-- Iteration 18 --
bool(false)
-- Iteration 19 --
bool(false)
-- Iteration 20 --
bool(false)
-- Iteration 21 --
bool(false)
-- Iteration 22 --
bool(false)
===Done===
-55
View File
@@ -1,55 +0,0 @@
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
abstract class A {
public function a() { }
private function b() { }
protected function c() { }
}
class B extends A {
private function bb() { }
static public function test() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
}
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
B::test();
?>
--EXPECT--
array(1) {
[0]=>
string(1) "a"
}
array(2) {
[0]=>
string(4) "test"
[1]=>
string(1) "a"
}
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "c"
}
array(4) {
[0]=>
string(2) "bb"
[1]=>
string(4) "test"
[2]=>
string(1) "a"
[3]=>
string(1) "c"
}
-43
View File
@@ -1,43 +0,0 @@
--TEST--
get_class_methods(): Testing with interface
--FILE--
<?php
interface A {
function a();
function b();
}
class B implements A {
public function a() { }
public function b() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
public function __destruct() { }
}
new B;
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
array(4) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(11) "__construct"
[3]=>
string(10) "__destruct"
}
-78
View File
@@ -1,78 +0,0 @@
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
interface A {
function aa();
function bb();
static function cc();
}
class C {
public function a() { }
protected function b() { }
private function c() { }
static public function static_a() { }
static protected function static_b() { }
static private function static_c() { }
}
class B extends C implements A {
public function aa() { }
public function bb() { }
static function cc() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
var_dump(get_class_methods('C'));
}
public function __destruct() { }
}
new B;
?>
--EXPECT--
array(3) {
[0]=>
string(2) "aa"
[1]=>
string(2) "bb"
[2]=>
string(2) "cc"
}
array(9) {
[0]=>
string(2) "aa"
[1]=>
string(2) "bb"
[2]=>
string(2) "cc"
[3]=>
string(11) "__construct"
[4]=>
string(10) "__destruct"
[5]=>
string(1) "a"
[6]=>
string(1) "b"
[7]=>
string(8) "static_a"
[8]=>
string(8) "static_b"
}
array(4) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(8) "static_a"
[3]=>
string(8) "static_b"
}
-33
View File
@@ -1,33 +0,0 @@
--TEST--
get_class_vars(): Simple test
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
}
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
?>
--EXPECT--
array(1) {
["a"]=>
int(1)
}
array(2) {
["a"]=>
int(1)
["aa"]=>
int(4)
}
-49
View File
@@ -1,49 +0,0 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
}
class C extends B {
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump($this->a, $this->b, $this->c);
}
}
new C;
?>
--EXPECTF--
array(1) {
["a"]=>
int(1)
}
array(3) {
["a"]=>
int(1)
["aa"]=>
int(4)
["cc"]=>
int(6)
}
Notice: Undefined property: C::$b in %s on line %d
Notice: Undefined property: C::$c in %s on line %d
int(1)
NULL
NULL
-49
View File
@@ -1,49 +0,0 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
protected function __construct() {
var_dump(get_class_vars('C'));
}
}
class C extends B {
public $aaa = 7;
private $bbb = 8;
protected $ccc = 9;
public function __construct() {
parent::__construct();
}
}
new C;
?>
--EXPECT--
array(6) {
["aaa"]=>
int(7)
["ccc"]=>
int(9)
["a"]=>
int(1)
["aa"]=>
int(4)
["bb"]=>
int(5)
["cc"]=>
int(6)
}
-67
View File
@@ -1,67 +0,0 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
static public $A = 2;
private $b = 3;
static private $B = 4;
protected $c = 5;
static protected $C = 6;
public function __construct() {
var_dump(get_class_vars('A'));
}
static public function test() {
var_dump(get_class_vars('A'));
}
}
var_dump(get_class_vars('A'));
new A;
var_dump(A::test());
?>
--EXPECT--
array(2) {
["a"]=>
int(1)
["A"]=>
int(2)
}
array(6) {
["a"]=>
int(1)
["b"]=>
int(3)
["c"]=>
int(5)
["A"]=>
int(2)
["B"]=>
int(4)
["C"]=>
int(6)
}
array(6) {
["a"]=>
int(1)
["b"]=>
int(3)
["c"]=>
int(5)
["A"]=>
int(2)
["B"]=>
int(4)
["C"]=>
int(6)
}
NULL
-39
View File
@@ -1,39 +0,0 @@
--TEST--
get_class_vars(): Testing visibility
--FILE--
<?php
class A {
protected $a = 1;
private $b = 2;
}
class B extends A {
private $c = 3;
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
}
}
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
new B;
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(1) {
["a"]=>
int(1)
}
array(2) {
["c"]=>
int(3)
["a"]=>
int(1)
}
-50
View File
@@ -1,50 +0,0 @@
--TEST--
get_class_vars(): Testing visibility
--FILE--
<?php
class A {
protected $a = 1;
}
class B extends A { }
class C extends B { }
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump(get_class_vars('C'));
print "---\n";
class D extends B {
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump(get_class_vars('C'));
}
}
new D;
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(0) {
}
---
array(1) {
["a"]=>
int(1)
}
array(1) {
["a"]=>
int(1)
}
array(1) {
["a"]=>
int(1)
}
-41
View File
@@ -1,41 +0,0 @@
--TEST--
get_class_vars(): Testing with static properties
--FILE--
<?php
class A {
static public $a, $aa;
static private $b, $bb;
static protected $c, $cc;
static public function test() {
var_dump(get_class_vars(__CLASS__));
}
}
var_dump(get_class_vars('A'));
var_dump(A::test());
?>
--EXPECT--
array(2) {
["a"]=>
NULL
["aa"]=>
NULL
}
array(6) {
["a"]=>
NULL
["aa"]=>
NULL
["b"]=>
NULL
["bb"]=>
NULL
["c"]=>
NULL
["cc"]=>
NULL
}
NULL
@@ -1,59 +0,0 @@
--TEST--
get_defined_functions() function : basic functionality
--FILE--
<?php
/* Prototype : array get_defined_functions ( void )
* Description: Gets an array of all defined functions.
* Source code: Zend/zend_builtin_functions.c
*/
echo "*** Testing get_defined_functions() : basic functionality ***\n";
function foo() {}
// mixed case function
function HelloWorld() {}
Class C {
function f1() {}
static function f2() {}
}
$func = get_defined_functions();
if (!is_array($func)) {
echo "TEST FAILED: return type not an array\n";
}
if (!is_array($func["internal"])) {
echo "TEST FAILED: no element in result array with key 'internal'\n";
}
$internal = $func["internal"];
//check for a few core functions
if (!in_array("cos", $internal) || !in_array("strlen", $internal)) {
echo "TEST FAILED: missing elements from 'internal' array\n";
var_dump($internal);
}
if (!is_array($func["user"])) {
echo "TEST FAILED: no element in result array with key 'user'\n";
}
$user = $func["user"];
if (count($user) == 2 && in_array("foo", $user) && in_array("helloworld", $user)) {
echo "TEST PASSED\n";
} else {
echo "TEST FAILED: missing elements from 'user' array\n";
var_dump($user);
}
?>
===Done===
--EXPECT--
*** Testing get_defined_functions() : basic functionality ***
TEST PASSED
===Done===
@@ -1,29 +0,0 @@
--TEST--
Test get_defined_functions() function : error conditions
--FILE--
<?php
/* Prototype : array get_defined_functions ( void )
* Description: Gets an array of all defined functions.
* Source code: Zend/zend_builtin_functions.c
*/
echo "*** Testing get_defined_functions() : error conditions ***\n";
echo "\n-- Testing get_defined_functions() function with more than expected no. of arguments --\n";
$extra_arg = 10;
var_dump( get_defined_functions($extra_arg) );
?>
===Done===
--EXPECTF--
*** Testing get_defined_functions() : error conditions ***
-- Testing get_defined_functions() function with more than expected no. of arguments --
Warning: Wrong parameter count for get_defined_functions() in %s on line %d
NULL
===Done===
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Check if get_required_files works
--CREDITS--
Sebastian Schürmann
sschuermann@chip.de
Testfest 2009 Munich
--FILE--
<?php
$files = get_required_files();
var_dump($files);
?>
--EXPECTF--
array(1) {
[0]=>
%string|unicode%(%d)%s
}
+1 -1
View File
@@ -22,7 +22,7 @@ foreach ($doubles as $d) {
echo "Done\n";
?>
--EXPECTF--
float(4.0833602971%dE+14)
float(4083360297110%d)
float(4.7223664828%dE+21)
float(1.3521606402%dE+31)
float(1.9807040628%dE+27)
Loaded 100 of 5298 files, more files were not shown because too many files have changed in this diff. Show more