Compare commits

...
914 changed files with 120881 additions and 131691 deletions

No files matched your search

+18 -131
View File
@@ -1,120 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, PHP 5.3.0 Alpha 3
- Upgraded bundled PCRE to version 7.8. (Nuno)
- Upgraded bundled sqlite to version 3.6.6.2. (Scott, Ilia)
- Moved ext/msql to PECL. (Derick, Lukas)
- Removed ext/mhash, the BC layer is now entirely within ext/hash. (Scott)
- Changed error level E_ERROR into E_WARNING in Soap extension methods
parameter validation. (Felipe)
- Changed openssl info to show the shared library version number. (Scott)
- Changed floating point behaviour to consistently use double precision on all
platforms and with all compilers. (Christian Seiler)
- Changed round() to act more intuitively when rounding to a certain precision
and to correctly round very large and very small exponents. (Christian Seiler)
- Changed fileinfo to no longer send errors to stderr. (Scott)
- Added support for namespaces with brackets. (Greg)
- Added stream_cast() and stream_set_options() to user-space stream wrappers,
allowing stream_select(), stream_set_blocking(), stream_set_timeout() and
stream_set_write_buffer() to work with user-space stream wrappers. (Arnaud)
- Added header_remove() function. (chsc at peytz dot dk, Arnaud)
- Added stream_context_get_params() function. (Arnaud)
- Added optional parameter "new" to sybase_connect(). (Timm)
- Added parse_ini_string() function. (grange at lemonde dot fr, Arnaud)
- Added str_getcsv() function. (Sara)
- Added openssl_random_pseudo_bytes() function. (Scott)
- Added ability to send user defined HTTP headers with SOAP request.
(Brian J.France, Dmitry)
- Added concatenation option to bz2.decompress stream filter.
(Keisial at gmail dot com, Greg)
- Added support for using compressed connections with PDO_mysql. (Johannes)
- Implemented FR #46595 (Use cc as the default compiler). (David Soria Parra)
- Implemented FR #46513 (Missing compiler flags for suncc).
(David Soria Parra)
- Deprecated define_syslog_variables(). (Kalle)
- Deprecated ereg extension. (Felipe)
- Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott)
- Fixed invalid calls to free when internal fileinfo magic file is used. (Scott)
- Fixed memory leak inside wddx_add_vars() function. (Felipe)
- Synced changes from libmagic 4.26 to bundled libmagic. (Scott)
- Fixed check in recode extension to allow builing of recode and mysql
extensions when using a recent libmysql. (Johannes)
- Fixed bug #46731 (Missing validation for the options parameter of the
imap_fetch_overview() function). (Ilia)
- Fixed bug #46711 (cURL curl_setopt leaks memory in foreach loops).
(magicaltux [at] php [dot] net)
- Fixed bug #46578 (strip_tags() does not honor end-of-comment when it
encounters a single quote). (Felipe)
- Fixed bug #46546 (Segmentation fault when using declare statement with
non-string value). (Felipe)
- Fixed bug #46421 (SplFileInfo not correctly handling /). (Etienne)
- Fixed bug #46409 (__invoke method called outside of object context when using
array_map). (Dmitry)
- Fixed bug #46331 - (Segfault when using internal fileinfo magic file on big
endian systems). (Scott)
- Fixed bug #46285 (lastInsertId() returns "0" when a deferenced PDOStatement is
executed). (Johannes)
- Fixed bug #46241 (stacked error handlers, internal error handling in general).
(Etienne)
- Fixed bug #46238 (Segmentation fault on static call with empty string method).
(Felipe)
- Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown).
(Dmitry)
- Fixed bug #46194 (SIGSEGV when requested file is not found). (Greg)
- Fixed bug #46192 (ArrayObject with objects as storage serialization).
(Etienne)
- Fixed bug #46185 (importNode changes the namespace of an XML element). (Rob)
- Fixed bug #46178 (memory leak in ext/phar). (Greg)
- Fixed bug #46160 (SPL - Memory leak when exception is thrown in offsetSet).
(Felipe)
- Fixed Bug #46147 (after stream seek, appending stream filter reads incorrect data).
(Greg)
- Fixed bug #46127 (php_openssl_tcp_sockop_accept forgets to set context
on accepted stream) (Mark Karpeles, Pierre)
- Fixed bug #46115 (Memory leak when calling a method using Reflection).
(Dmitry)
- Fixed bug #46106 (Memory leaks when using global statement). (Dmitry)
- Fixed bug #46099 (Xsltprocessor::setProfiling - memory leak). (Felipe, Rob).
- Fixed bug #46087 (DOMXPath - segfault on destruction of a cloned object).
(Ilia)
- Fixed bug #46086 (Segfault when accessing fileinfo class properties).
(Scott)
- Fixed bug #46071 (finfo_open() segfaults when using wrong file name on BSD).
(Felipe)
- Fixed bug #46060 (Phar::addEmptyDir() breaks) (Greg)
- Fixed bug #46042 (memory leaks with reflection of mb_convert_encoding()).
(Ilia)
- Fixed bug #46039 (ArrayObject iteration is slow). (Arnaud)
- Fixed bug #46033 (Direct instantiation of SQLite3stmt and SQLite3result
cause a segfault.) (Scott)
- Fixed bug #45976 (Moved SXE from SPL to SimpleXML). (Etienne)
- Fixed bug #45928 (large scripts from stdin are stripped at 16K border).
(Christian Schneider, Arnaud)
- Fixed bug #45911 (Cannot disable ext/hash). (Arnaud)
- Fixed bug #45907 (undefined reference to 'PHP_SHA512Init'). (Greg)
- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Ilia)
- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto).
(vnegrier at optilian dot com, Ilia)
- Fixed bug #44575 (parse_ini_file comment # line problems). (Arnaud)
- Fixed bug #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS). (Johannes,
chx1975 at gmail dot com)
- Fixed bug #44153 (pdo->errorCode() returns NULL when there are no errors).
(David C.)
- Fixed bug #44154 (pdo->errorInfo() always have three elements in the
returned array). (David C.)
- Fixed bug #43069 (SoapClient causes 505 HTTP Version not supported error
message). (Dmitry)
- Fixed bug #41534 (SoapClient over HTTPS fails to reestablish connection).
(Dmitry)
02 Sep 2008, PHP 5.3.0 Alpha 2
- Removed special treatment of "/tmp" in sessions for open_basedir.
Note: This undocumented behaviour was introduced in 5.2.2. (Alexey)
@@ -144,31 +29,32 @@ PHP NEWS
- Fixed a bug causing miscalculations with the "last <weekday> of <n> month"
relative time string. (Derick)
- Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on
multiple calls). (Ilia)
- Fixed bug #46032 (PharData::__construct() wrong memory read). (Greg)
- Fixed bug #45826 (custom ArrayObject serialization). (Etienne)
- Fixed bug #45798 (sqlite3 doesn't notice if variable was bound). (Felipe)
- Fixed bug #45786 (FastCGI process exited unexpectedly). (Dmitry)
- Fixed bug #45763 (mysqli::multi_query does not work with mysqlnd). (Johannes)
- Fixed bug #45757 (FreeBSD4.11 build failure: failed include; stdint.h).
(Hannes)
- Fixed bug #45743 (property_exists fails to find static protected member in
- Fixed bug #45743 (property_exists fails to find static protected member in
child class). (Felipe)
- Fixed bug #45717 (Fileinfo/libmagic build fails, missing err.h and getopt.h).
(Derick)
- Fixed bug #45706 (Unserialization of classes derived from ArrayIterator
fails). (Etienne, Dmitry)
- Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick)
- Fixed bug #43668 (Added odbc.default_cursortype to control the ODBC
cursormodel). (Patrick)
- Fixed bug #43666 (Fixed code to use ODBC 3.52 datatypes for 64bit systems).
(Patrick)
- Fixed bug #45636 (fileinfo ext duplicate strndup). (Derick)
- Fixed bug #45545 (DateInterval has 4 char limitation for ISO durations).
(Derick)
- Fixed bug #45447 (Filesystem time functions on Vista and server 2008).
(Pierre)
- Fixed bug #45384 (parse_ini_file will result in parse error with no trailing
- Fixed bug #45384 (parse_ini_file will result in parse error with no trailing
newline). (Arnaud)
- Fixed bug #45044 (relative paths not resolved correctly). (Dmitry)
- Fixed bug #44842 (parse_ini_file keys that start/end with underscore).
- Fixed bug #44842 (parse_ini_file keys that start/end with underscore).
(Arnaud)
- Fixed bug #44100 (Inconsistent handling of static array declarations with
duplicate keys). (Dmitry)
@@ -210,7 +96,7 @@ PHP NEWS
. Improved syntax highlighting and consistency for variables in double-quoted
strings and literal text in HEREDOCs and backticks. (Matt)
. Added "?:" operator. (Marcus)
. Added support for namespaces. (Dmitry, Stas, Gregory, Marcus)
. Added support for namespaces. (Dmitry, Stas, Gregory)
. Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
. Added support for __callStatic() magic method. (Sara)
. Added forward_static_call(_array) to complete LSB. (Mike Lively)
@@ -218,6 +104,9 @@ PHP NEWS
(Etienne Kneuss)
. Improved checks for callbacks. (Marcus)
. Added __DIR__ constant. (Lars Strojny)
. Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION,
PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants.
(Pierre)
. Added new error modes E_USER_DEPRECATED and E_DEPRECATED.
E_DEPRECATED is used to inform about stuff being scheduled for removal
in future PHP versions. (Lars Strojny, Felipe, Marcus)
@@ -319,7 +208,7 @@ PHP NEWS
. Added access to internal values of DSA, RSA and DH keys. (Dmitry)
. Fixed a memory leak on openssl_decrypt(). (Henrique)
. Fixed segfault caused by openssl_pkey_new(). (Henrique)
. Fixed bug caused by uninitilized variables in openssl_pkcs7_encrypt() and
. Fixed bug caused by uninitilized variables in openssl_pkcs7_encrypt() and
openssl_pkcs7_sign(). (Henrique)
. Fixed error message in openssl_seal(). (Henrique)
@@ -360,8 +249,8 @@ PHP NEWS
- Improved crypt() function: (Pierre)
. Added Blowfish and extended DES support. (Using Blowfish implementation
from Solar Designer).
. Made crypt features portable by providing our own implementations
for crypt_r and the algorithms which are used when OS does not provide
. Made crypt features portable by providing our own implementations
for crypt_r and the algorithms which are used when OS does not provide
them. PHP implementations are always used for Windows builds.
- Added new extensions:
@@ -383,8 +272,7 @@ PHP NEWS
. date_create_from_format() / DateTime::createFromFormat()
. date_parse_from_format().
. support for abbreviation and offset based timezone specifiers for
the 'e' format specifier, DateTime::__construct(), DateTime::getTimeZone()
and DateTimeZone::getName().
DateTime::getOffset() and DateTime::getName().
. support for selectively listing timezone identifiers by continent or
country code through timezone_identifiers_list() /
DateTimezone::listIdentifiers().
@@ -410,7 +298,7 @@ PHP NEWS
. proper support for "this week", "previous week"/"last week" and "next week"
phrases so that they actually mean the week and not a seven day period
around the current day.
. support for "<xth> <weekday> of" and "last <weekday> of" phrases to be used
. support for "<xth> <weekday of" and "last <weekday> of" phrases to be used
with months - like in "last saturday of februari 2008".
. support for "back of <hour>" and "front of <hour>" phrases that are used in
Scotland.
@@ -420,8 +308,7 @@ PHP NEWS
- Added array_replace() and array_replace_recursive() functions. (Matt)
- Added ReflectionProperty::setAccessible() method that allows non-public
property's values to be read through ::getValue() and set through
::setValue(). (Derick, Sebastian)
property's values to be read through ::getValue(). (Derick)
- Added msg_queue_exists() function to sysvmsg extension. (Benjamin Schulz)
- Added Firebird specific attributes that can be set via PDO::setAttribute()
to control formatting of date/timestamp columns: PDO::FB_ATTR_DATE_FORMAT,
@@ -469,7 +356,7 @@ PHP NEWS
- Fixed bug #45179 (--with-mysql-sock fails to compile & work). (Andrey)
- Fixed bug #45038 (Crash when using DateTimeZone object returned by
Date::getTimezone). (Joe Orton, Derick)
- Fixed bug #45030 (Destination image alpha channel noise when using
- Fixed bug #45030 (Destination image alpha channel noise when using
imagecopyresampled). (Pierre)
- Fixed bug #44769 (declaring private magic methods should throw error).
(Felipe)
+11 -16
View File
@@ -53,38 +53,36 @@ Currently we have the following branches in use::
PHP_5_1 This branch is closed.
PHP_4_4 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.
The next few rules are more of a technical nature::
1. All changes should first go to HEAD and then get merged from HEAD
(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
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.
@@ -132,9 +130,6 @@ 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.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP CVS repository in various ways.
-2
View File
@@ -39,14 +39,12 @@ Type specifiers
instance of that class.
a - array (zval*)
A - array or object (zval *)
b - boolean (zend_bool)
C - class (zend_class_entry*)
d - double (double)
f - function or array containing php method call info (returned as
zend_fcall_info and zend_fcall_info_cache)
h - array (returned as HashTable*)
H - array or HASH_OF(object) (returned as HashTable*)
l - long (long)
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
+23 -33
View File
@@ -48,49 +48,45 @@ Do not use abbreviations for alpha and beta.
3. Commit those changes
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
5. tag the repository with the version f.e. "``cvs tag php_4_4_1RC1``"
4. tag the repository with the version f.e. "``cvs tag php_4_4_1RC1``"
(of course, you need to change that to the version you're rolling an RC for).
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
5. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
and possibly ``NEWS`` again, to the **next** version. F.e. if the release
candidate was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless
if we get a new RC or not. This is to make sure ``version_compare()`` can
correctly work.
7. Commit those changes
6. Commit those changes
8. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
7. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
branch if you're rolling 4.4.x releases).
9. You do not have to update the tree, but of course you can with "``cvs up -dP``".
8. You do not have to update the tree, but of course you can with "``cvs up -dP``".
10. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
9. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
11. Copy those two tarballs to www.php.net, in your homedir there should be a
10. Copy those two tarballs to www.php.net, in your homedir their should be a
directory "downloads/". Copy them into there, so that the system can generate
MD5 sums. If you do not have this directory, talk to Derick.
12. Now the RC can be found on http://downloads.php.net/yourname,
11. Now the RC can be found on http://downloads.php.net/yourname,
f.e. http://downloads.php.net/derick/
13. Once the release has been tagged, contact the PHP Windows development team
12. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
those are made, they should be placed into the same directory as the source snapshots.
Getting the non stable release (alpha/beta/RC) announced
--------------------------------------------------------
Getting the non stable release announced
----------------------------------------
1. Send an email (see example here: http://news.php.net/php.internals/19486)
**To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists
pointing out "the location of the release" and "the possible release date of
either the next RC, or the final release".
2. Only for an RC release also send an email
(see example here http://news.php.net/php.qa/26069) **To**
2. Send an email (see example here http://news.php.net/php.qa/26069) **To**
``php-qa@lists.php.net`` and **CC** ``primary-qa-tests@lists.php.net``.
This email is to notify the selected projects about a new RC so that they can
make sure their projects keep working. Make sure that you have been setup
@@ -101,7 +97,7 @@ Derick) run the following commands for you:
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
3. Update the MD5 sums in ``qaweb/include/rc-md5sums.txt`` (no empty lines).
3. Update the MD5 sums in ``qaweb/include/rc-md5sums.txt``.
4. Update in ``qaweb/include/release-qa.php`` constants with the new RC and
commit this.
@@ -129,9 +125,6 @@ function to include the new RC and commit.
a. ``cvs commit include/version.inc include/releases.inc``
5. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
Rolling a stable release
------------------------
@@ -143,37 +136,34 @@ Rolling a stable release
4. Commit those changes
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
5. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
(of course, you need to change that to the version you're rolling an RC for).
When making 5.X release, you need to tag the Zend directory separately!!
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
8. Commit those changes
7. Commit those changes
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
8. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
branch if you're rolling 4.4.x releases).
10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
9. You do not have to update the tree, but of course you can with "``cvs up -dP``".
11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
10. run: ``./makedist php 4.4.1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
12. Commit those two tarballs to CVS (phpweb/distributions)
11. Commit those two tarballs to CVS (phpweb/distributions)
13. Once the release has been tagged, contact the PHP Windows development team
12. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
those are made, they should be committed to CVS too.
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
13. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
15. When making a final release, also remind the PHP Windows development team
14. When making a final release, also remind the PHP Windows development team
(internals-win@lists.php.net) to prepare the installer packages for Win32.
Getting the stable release announced
+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
+3 -9
View File
@@ -503,7 +503,6 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
}
/* }}} */
#undef LINK_MAX
#define LINK_MAX 32
static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir TSRMLS_DC) /* {{{ */
@@ -819,6 +818,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
#endif
add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]);
t = CWDG(realpath_cache_ttl) ? 0 : -1;
path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC);
@@ -1033,14 +1033,8 @@ static int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
BOOL f;
HANDLE hFile;
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
the CreateFile operation succeeds */
if (GetLastError() == ERROR_ALREADY_EXISTS) {
SetLastError(0);
}
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
if ( hFile == INVALID_HANDLE_VALUE ) {
return -1;
-2
View File
@@ -115,8 +115,6 @@ AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
ZEND_FP_EXCEPT
ZEND_CHECK_FLOAT_PRECISION
])
+1 -115
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"
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
@@ -105,117 +105,3 @@ int main(void)
AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
dnl x87 floating point internal precision control checks
dnl See: http://wiki.php.net/rfc/rounding
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
AC_MSG_CHECKING([for usable _FPU_SETCW])
AC_TRY_LINK([
#include <fpu_control.h>
],[
fpu_control_t fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_FPU_GETCW(fpu_oldcw);
fpu_cw = (fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_SINGLE) | _FPU_DOUBLE;
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
], [ac_cfp_have__fpu_setcw=yes], [ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable fpsetprec])
AC_TRY_LINK([
#include <machine/ieeefp.h>
],[
fp_prec_t fpu_oldprec;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldprec = fpgetprec();
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp])
AC_TRY_LINK([
#include <float.h>
],[
unsigned int fpu_oldcw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldcw = _controlfp(0, 0);
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp_s])
AC_TRY_LINK([
#include <float.h>
],[
unsigned int fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_controlfp_s(&fpu_cw, 0, 0);
fpu_oldcw = fpu_cw;
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
AC_TRY_LINK([
/* nothing */
],[
unsigned int oldcw, cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&oldcw));
cw = (oldcw & ~0x0 & ~0x300) | 0x200;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
-26
View File
@@ -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) {
}
}
}
}
+12 -7
View File
@@ -11,30 +11,35 @@ function test1(bar $bar) {
echo "ok\n";
}
function test2(\foo\bar $bar) {
function test2(foo::bar $bar) {
echo "ok\n";
}
function test3(\foo\bar $bar) {
function test3(::foo::bar $bar) {
echo "ok\n";
}
function test4(\Exception $e) {
function test4(::Exception $e) {
echo "ok\n";
}
function test5(\bar $bar) {
function test5(Exception $e) {
echo "ok\n";
}
function test6(::bar $bar) {
echo "bug\n";
}
$x = new bar();
$y = new \Exception();
$y = new Exception();
test1($x);
test2($x);
test3($x);
test4($y);
test5($x);
test5($y);
test6($x);
--EXPECTF--
ok
ok
ok
ok
ok
Catchable fatal error: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php on line %d
Catchable fatal error: Argument 1 passed to foo::test6() must be an instance of bar, instance of foo::bar given, called in %sbug42802.php on line 23
+66 -84
View File
@@ -4,100 +4,88 @@ Bug #42819 (namespaces in indexes of constant arrays)
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
namespace foo\foo;
const C = "foo\\foo\\C\n";
const I = 12;
class foo {
const I = 32;
const C = "foo\\foo\\foo::C\n";
}
namespace foo;
use \ArrayObject;
const C = "foo\\C\n";
const C = "foo::C\n";
const I = 11;
class foo {
const C = "foo\\foo::C\n";
const C = "foo::foo::C\n";
const I = 22;
const C1 = C;
const C2 = foo\C;
const C3 = foo\foo::C;
const C4 = \foo\C;
const C5 = \foo\foo::C;
const C2 = foo::C;
const C3 = foo::foo::C;
const C4 = ::foo::C;
const C5 = ::foo::foo::C;
const C6 = ArrayObject::STD_PROP_LIST;
const C7 = E_ERROR;
}
class bar1 {
static $a1 = array(I => 0);
static $a2 = array(foo\I => 0);
static $a3 = array(foo\foo::I => 0);
static $a4 = array(\foo\I => 0);
static $a5 = array(\foo\foo::I => 0);
static $a2 = array(foo::I => 0);
static $a3 = array(foo::foo::I => 0);
static $a4 = array(::foo::I => 0);
static $a5 = array(::foo::foo::I => 0);
static $a6 = array(ArrayObject::STD_PROP_LIST => 0);
static $a7 = array(E_ERROR => 0);
}
class bar2 {
static $a1 = array(I => I);
static $a2 = array(foo\I => I);
static $a3 = array(foo\foo::I => I);
static $a4 = array(\foo\I => I);
static $a5 = array(\foo\foo::I => I);
static $a2 = array(foo::I => I);
static $a3 = array(foo::foo::I => I);
static $a4 = array(::foo::I => I);
static $a5 = array(::foo::foo::I => I);
static $a6 = array(ArrayObject::STD_PROP_LIST => I);
static $a7 = array(E_ERROR => I);
}
class bar3 {
static $a1 = array(I => foo\I);
static $a2 = array(foo\I => foo\I);
static $a3 = array(foo\foo::I => foo\I);
static $a4 = array(\foo\I => foo\I);
static $a5 = array(\foo\foo::I => foo\I);
static $a6 = array(ArrayObject::STD_PROP_LIST => foo\I);
static $a7 = array(E_ERROR => foo\I);
static $a1 = array(I => foo::I);
static $a2 = array(foo::I => foo::I);
static $a3 = array(foo::foo::I => foo::I);
static $a4 = array(::foo::I => foo::I);
static $a5 = array(::foo::foo::I => foo::I);
static $a6 = array(ArrayObject::STD_PROP_LIST => foo::I);
static $a7 = array(E_ERROR => foo::I);
}
class bar4 {
static $a1 = array(I => ArrayObject::STD_PROP_LIST);
static $a2 = array(foo\I => ArrayObject::STD_PROP_LIST);
static $a3 = array(foo\foo::I => ArrayObject::STD_PROP_LIST);
static $a4 = array(\foo\I => ArrayObject::STD_PROP_LIST);
static $a5 = array(\foo\foo::I => ArrayObject::STD_PROP_LIST);
static $a2 = array(foo::I => ArrayObject::STD_PROP_LIST);
static $a3 = array(foo::foo::I => ArrayObject::STD_PROP_LIST);
static $a4 = array(::foo::I => ArrayObject::STD_PROP_LIST);
static $a5 = array(::foo::foo::I => ArrayObject::STD_PROP_LIST);
static $a6 = array(ArrayObject::STD_PROP_LIST => ArrayObject::STD_PROP_LIST);
static $a7 = array(E_ERROR => ArrayObject::STD_PROP_LIST);
}
class bar5 {
static $a1 = array(I => E_ERROR);
static $a2 = array(foo\I => E_ERROR);
static $a3 = array(foo\foo::I => E_ERROR);
static $a4 = array(\foo\I => E_ERROR);
static $a5 = array(\foo\foo::I => E_ERROR);
static $a2 = array(foo::I => E_ERROR);
static $a3 = array(foo::foo::I => E_ERROR);
static $a4 = array(::foo::I => E_ERROR);
static $a5 = array(::foo::foo::I => E_ERROR);
static $a6 = array(ArrayObject::STD_PROP_LIST => E_ERROR);
static $a7 = array(E_ERROR => E_ERROR);
}
echo "first\n";
echo C;
echo foo\C;
echo foo\foo::C;
echo foo::C;
echo \foo\foo::C;
echo foo::foo::C;
echo ::foo::C;
echo ::foo::foo::C;
echo ArrayObject::STD_PROP_LIST . "\n";
echo E_ERROR . "\n";
echo "second\n";
echo \foo\foo::C1;
echo \foo\foo::C2;
echo \foo\foo::C3;
echo \foo\foo::C4;
echo \foo\foo::C5;
echo \foo\foo::C6 . "\n";
echo \foo\foo::C7 . "\n";
echo foo::foo::C1;
echo foo::foo::C2;
echo foo::foo::C3;
echo foo::foo::C4;
echo foo::foo::C5;
echo foo::foo::C6 . "\n";
echo foo::foo::C7 . "\n";
print_r(bar1::$a1);
print_r(bar1::$a2);
@@ -138,24 +126,20 @@ print_r(bar5::$a4);
print_r(bar5::$a5);
print_r(bar5::$a6);
print_r(bar5::$a7);
function oops($a = array(foo\unknown)){}
oops();
?>
--EXPECTF--
first
foo\C
foo\foo\C
foo\foo\foo::C
foo\foo::C
foo\foo::C
--EXPECT--
foo::C
foo::C
foo::foo::C
foo::C
foo::foo::C
1
1
second
foo\C
foo\foo\C
foo\foo\foo::C
foo\C
foo\foo::C
foo::C
foo::C
foo::foo::C
foo::C
foo::foo::C
1
1
Array
@@ -164,11 +148,11 @@ Array
)
Array
(
[12] => 0
[11] => 0
)
Array
(
[32] => 0
[22] => 0
)
Array
(
@@ -192,11 +176,11 @@ Array
)
Array
(
[12] => 11
[11] => 11
)
Array
(
[32] => 11
[22] => 11
)
Array
(
@@ -216,31 +200,31 @@ Array
)
Array
(
[11] => 12
[11] => 11
)
Array
(
[12] => 12
[11] => 11
)
Array
(
[32] => 12
[22] => 11
)
Array
(
[11] => 12
[11] => 11
)
Array
(
[22] => 12
[22] => 11
)
Array
(
[1] => 12
[1] => 11
)
Array
(
[1] => 12
[1] => 11
)
Array
(
@@ -248,11 +232,11 @@ Array
)
Array
(
[12] => 1
[11] => 1
)
Array
(
[32] => 1
[22] => 1
)
Array
(
@@ -276,11 +260,11 @@ Array
)
Array
(
[12] => 1
[11] => 1
)
Array
(
[32] => 1
[22] => 1
)
Array
(
@@ -298,5 +282,3 @@ Array
(
[1] => 1
)
Fatal error: Undefined constant 'foo\foo\unknown' in %sbug42819.php on line %d
+10 -10
View File
@@ -7,16 +7,16 @@ const ok = 0;
class foo {
const ok = 0;
}
var_dump(defined('ns\\ok'));
var_dump(defined('ns\\bug'));
var_dump(defined('\\ns\\ok'));
var_dump(defined('\\ns\\bug'));
var_dump(defined('ns\\foo::ok'));
var_dump(defined('ns\\foo::bug'));
var_dump(defined('\\ns\\foo::ok'));
var_dump(defined('\\ns\\foo::bug'));
var_dump(defined('ns\\bar::bug'));
var_dump(defined('\\ns\\bar::bug'));
var_dump(defined('ns::ok'));
var_dump(defined('ns::bug'));
var_dump(defined('::ns::ok'));
var_dump(defined('::ns::bug'));
var_dump(defined('ns::foo::ok'));
var_dump(defined('ns::foo::bug'));
var_dump(defined('::ns::foo::ok'));
var_dump(defined('::ns::foo::bug'));
var_dump(defined('ns::bar::bug'));
var_dump(defined('::ns::bar::bug'));
--EXPECT--
bool(true)
bool(false)
+3 -3
View File
@@ -5,8 +5,8 @@ Bug #42859 (import always conflicts with internal classes)
namespace Foo;
class Ex {}
use Blah\Exception;
use Blah\Ex;
use Blah::Exception;
use Blah::Ex;
?>
--EXPECTF--
Fatal error: Cannot use Blah\Ex as Ex because the name is already in use in %sbug42859.php on line 6
Fatal error: Cannot use Blah::Ex as Ex because the name is already in use in %sbug42859.php on line 6
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #43128 (Very long class name causes segfault)
--INI--
memory_limit=128000000
--FILE--
<?php
+2 -2
View File
@@ -3,10 +3,10 @@ Bug #43183 ("use" of the same class in difference scripts results in a fatal err
--FILE--
<?php
namespace Test;
use Test\Foo;
use Test::Foo;
class Foo {}
class Bar {}
use Test\Bar;
use Test::Bar;
echo "ok\n";
--EXPECT--
ok
+2 -2
View File
@@ -10,6 +10,6 @@ class foo {
$foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok!
$foo->bar(new stdclass); // Error, ok!
--EXPECTF--
Catchable fatal error: Argument 1 passed to foobar\foo::bar() must be an instance of foobar\foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php on line 5
Catchable fatal error: Argument 1 passed to foobar::foo::bar() must be an instance of foobar::foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php on line 5
+2 -2
View File
@@ -5,11 +5,11 @@ Bug #43332.2 (self and parent as type hint in namespace)
namespace foobar;
class foo {
public function bar(\self $a) { }
public function bar(::self $a) { }
}
$foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new stdclass); // Error, ok!
--EXPECTF--
Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5
Fatal error: '::self' is a wrong class name in %sbug43332_2.php on line 5
+1 -1
View File
@@ -8,4 +8,4 @@ $foo = 'bar';
var_dump(new namespace::$foo);
?>
--EXPECTF--
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR in %sbug43343.php on line 5
Fatal error: Cannot use 'namespace' as a class name in %sbug43343.php on line 5
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #43344.10 (Wrong error message for undefined namespace constant)
--FILE--
<?php
echo namespace\bar."\n";
echo namespace::bar."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'bar' in %sbug43344_10.php on line %d
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #43344.11 (Wrong error message for undefined namespace constant)
--FILE--
<?php
function f($a=namespace\bar) {
function f($a=namespace::bar) {
return $a;
}
echo f()."\n";
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #43344.12 (Wrong error message for undefined namespace constant)
--FILE--
<?php
function f($a=array(namespace\bar)) {
function f($a=array(namespace::bar)) {
return $a[0];
}
echo f()."\n";
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #43344.13 (Wrong error message for undefined namespace constant)
--FILE--
<?php
function f($a=array(namespace\bar=>0)) {
function f($a=array(namespace::bar=>0)) {
reset($a);
return key($a);
}
+1 -1
View File
@@ -6,4 +6,4 @@ namespace Foo;
echo Foo::bar."\n";
?>
--EXPECTF--
Fatal error: Class 'Foo\Foo' not found in %sbug43344_2.php on line %d
Fatal error: Class 'Foo::Foo' not found in %sbug43344_2.php on line %d
+1 -1
View File
@@ -9,4 +9,4 @@ function f($a=Foo::bar) {
echo f()."\n";
?>
--EXPECTF--
Fatal error: Class 'Foo\Foo' not found in %sbug43344_3.php on line %d
Fatal error: Class 'Foo::Foo' not found in %sbug43344_3.php on line %d
+1 -1
View File
@@ -9,4 +9,4 @@ function f($a=array(Foo::bar)) {
echo f()."\n";
?>
--EXPECTF--
Fatal error: Class 'Foo\Foo' not found in %sbug43344_4.php on line %d
Fatal error: Class 'Foo::Foo' not found in %sbug43344_4.php on line %d
+1 -1
View File
@@ -10,4 +10,4 @@ function f($a=array(Foo::bar=>0)) {
echo f()."\n";
?>
--EXPECTF--
Fatal error: Class 'Foo\Foo' not found in %sbug43344_5.php on line %d
Fatal error: Class 'Foo::Foo' not found in %sbug43344_5.php on line %d
+2 -2
View File
@@ -3,7 +3,7 @@ Bug #43344.6 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
echo namespace\bar."\n";
echo namespace::bar."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'Foo\bar' in %sbug43344_6.php on line %d
Fatal error: Undefined constant 'Foo::bar' in %sbug43344_6.php on line %d
+2 -2
View File
@@ -3,10 +3,10 @@ Bug #43344.7 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
function f($a=namespace\bar) {
function f($a=namespace::bar) {
return $a;
}
echo f()."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'Foo\bar' in %sbug43344_7.php on line %d
Fatal error: Undefined constant 'Foo::bar' in %sbug43344_7.php on line %d
+2 -2
View File
@@ -3,10 +3,10 @@ Bug #43344.8 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
function f($a=array(namespace\bar)) {
function f($a=array(namespace::bar)) {
return $a[0];
}
echo f()."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'Foo\bar' in %sbug43344_8.php on line %d
Fatal error: Undefined constant 'Foo::bar' in %sbug43344_8.php on line %d
+2 -2
View File
@@ -3,11 +3,11 @@ Bug #43344.9 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
function f($a=array(namespace\bar=>0)) {
function f($a=array(namespace::bar=>0)) {
reset($a);
return key($a);
}
echo f()."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'Foo\bar' in %sbug43344_9.php on line %d
Fatal error: Undefined constant 'Foo::bar' in %sbug43344_9.php on line %d
+13 -13
View File
@@ -6,22 +6,22 @@ class Test {
static function foo() {}
}
var_dump(is_callable("\\\\"));
var_dump(is_callable("\\"));
var_dump(is_callable("x\\"));
var_dump(is_callable("\\x"));
var_dump(is_callable("x\\x"));
var_dump(is_callable("x\\\\"));
var_dump(is_callable("\\x"));
var_dump(is_callable("x\\\\x"));
var_dump(is_callable("::"));
var_dump(is_callable(":"));
var_dump(is_callable("x:"));
var_dump(is_callable(":x"));
var_dump(is_callable("x:x"));
var_dump(is_callable("x::"));
var_dump(is_callable("::x"));
var_dump(is_callable("x::x"));
var_dump(is_callable("cd"));
var_dump(is_callable("Test\\"));
var_dump(is_callable("\\Test"));
var_dump(is_callable("\\Test\\"));
var_dump(is_callable("Test::"));
var_dump(is_callable("::Test"));
var_dump(is_callable("::Test::"));
var_dump(is_callable("Test::foo"));
var_dump(is_callable("\\Test::foo"));
var_dump(is_callable("::Test::foo"));
var_dump(is_callable("is_string"));
var_dump(is_callable("\\is_string"));
var_dump(is_callable("::is_string"));
--EXPECT--
bool(false)
bool(false)
+5 -9
View File
@@ -14,17 +14,13 @@ class B {
static function fooBar() { echo "bag2\n"; }
}
function fooBar() { echo __FUNCTION__ . PHP_EOL; }
var_dump(\A\XX);
var_dump(A::XX);
A::fooBar();
\A\fooBar();
B::fooBar();
fooBar();
\B\fooBar();
B::fooBar();
?>
--EXPECT--
int(1)
bag1
A\fooBar
bag2
B\fooBar
B\fooBar
A::fooBar
B::fooBar
B::fooBar
+8 -8
View File
@@ -3,31 +3,31 @@ Testing dynamic alias name
--FILE--
<?php
namespace test\baz;
namespace test::baz;
class foo {
}
new foo;
class_alias(__NAMESPACE__ .'\foo', __NAMESPACE__ .'\T');
class_alias(__NAMESPACE__ .'::foo', __NAMESPACE__ .'::T');
var_dump(new foo);
var_dump(new T);
$var = __NAMESPACE__ .'\foo';
$var = __NAMESPACE__ .'::foo';
var_dump(new $var);
$var = __NAMESPACE__ .'\T';
$var = __NAMESPACE__ .'::T';
var_dump(new $var);
?>
--EXPECTF--
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
+7 -7
View File
@@ -3,24 +3,24 @@ Testing alias of alias
--FILE--
<?php
namespace test\baz;
namespace test::baz;
class foo {
}
new foo;
$alias1 = __NAMESPACE__ .'\T';
class_alias(__NAMESPACE__ .'\foo', $alias1);
$alias1 = __NAMESPACE__ .'::T';
class_alias(__NAMESPACE__ .'::foo', $alias1);
$alias2 = $alias1 .'\BAR';
$alias2 = $alias1 .'::BAR';
class_alias($alias1, $alias2);
var_dump(new \test\baz\foo, new \test\baz\T\BAR);
var_dump(new test::baz::foo, new test::baz::T::BAR);
?>
--EXPECTF--
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
object(test\baz\foo)#%d (0) {
object(test::baz::foo)#%d (0) {
}
+3 -3
View File
@@ -8,11 +8,11 @@ namespace foo;
class bar {
}
class_alias('foo\bar', 'foo\baz');
class_alias('foo::bar', 'foo::baz');
var_dump(new namespace\baz);
var_dump(new namespace::baz);
?>
--EXPECTF--
object(foo\bar)#%d (0) {
object(foo::bar)#%d (0) {
}
+4 -4
View File
@@ -8,14 +8,14 @@ namespace foo;
class bar {
}
class_alias('foo\bar', 'foo');
class_alias('foo::bar', 'foo');
var_dump(new \foo);
var_dump(new ::foo);
var_dump(new foo);
?>
--EXPECTF--
object(foo\bar)#%d (0) {
object(foo::bar)#%d (0) {
}
Fatal error: Class 'foo\foo' not found in %s on line %d
Fatal error: Class 'foo::foo' not found in %s on line %d
+2 -2
View File
@@ -9,8 +9,8 @@ namespace foo;
class foo {
}
class_alias(__NAMESPACE__ .'\foo', 'foo');
class_alias('\foo', 'foo');
class_alias(__NAMESPACE__ .'::foo', 'foo');
class_alias('::foo', 'foo');
?>
--EXPECTF--
+8 -8
View File
@@ -9,25 +9,25 @@ namespace foo;
class foo {
}
class_alias(__NAMESPACE__ .'\foo', 'foo');
class_alias(__NAMESPACE__ .'::foo', 'foo');
namespace foo\bar;
namespace foo::bar;
class foo {
}
class_alias(__NAMESPACE__ .'\foo', 'bar');
class_alias(__NAMESPACE__ .'::foo', 'bar');
var_dump(new \foo, new \bar);
var_dump(new ::foo, new ::bar);
var_dump(new \foo\foo, new \foo\bar);
var_dump(new foo::foo, new foo::bar);
?>
--EXPECTF--
object(foo\foo)#1 (0) {
object(foo::foo)#1 (0) {
}
object(foo\bar\foo)#2 (0) {
object(foo::bar::foo)#2 (0) {
}
Fatal error: Class 'foo\bar' not found in %s on line %d
Fatal error: Class 'foo::bar' not found in %s on line %d
+7 -7
View File
@@ -7,19 +7,19 @@ namespace foo;
class bar { }
class_alias('foo\bar', 'baz');
class_alias('foo::bar', 'baz');
use \baz as stdClass;
use ::baz as stdClass;
var_dump(new bar);
var_dump(new foo::bar);
var_dump(new stdClass);
var_dump(new \baz);
var_dump(new ::baz);
?>
--EXPECTF--
object(foo\bar)#%d (0) {
object(foo::bar)#%d (0) {
}
object(foo\bar)#%d (0) {
object(foo::bar)#%d (0) {
}
object(foo\bar)#%d (0) {
object(foo::bar)#%d (0) {
}
+6 -6
View File
@@ -17,15 +17,15 @@ interface Ifoo {
const foo = 4;
}
$const = __NAMESPACE__ .'\\foo'; // class
$const2 = __NAMESPACE__ .'\\Ifoo'; // interface
$const = __NAMESPACE__ .'::foo'; // class
$const2 = __NAMESPACE__ .'::Ifoo'; // interface
var_dump( foo,
\foo\foo,
namespace\foo,
\foo\foo::foo,
foo::foo,
namespace::foo,
foo::foo::foo,
$const::foo,
\foo,
::foo,
constant('foo'),
Ifoo::foo,
$const2::foo
+4 -4
View File
@@ -9,13 +9,13 @@ class foo {
}
class_alias(__NAMESPACE__ .'\foo', 'bar');
class_alias(__NAMESPACE__ .'::foo', 'bar');
var_dump(class_exists('\bar'));
var_dump(class_exists('::bar'));
var_dump(class_exists('bar'));
var_dump(class_exists('foo\bar'));
var_dump(class_exists('foo\foo'));
var_dump(class_exists('foo::bar'));
var_dump(class_exists('foo::foo'));
var_dump(class_exists('foo'));
?>
+1 -1
View File
@@ -25,7 +25,7 @@ NULL
Notice: Undefined variable: y in %s on line %d
Warning: Missing argument 1 for {closure}(), called in %s on line %d and defined in %s on line %d
Warning: Missing argument 1 for (), called in %s on line %d and defined in %s on line %d
NULL
Catchable fatal error: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s on line %d
+1 -1
View File
@@ -9,7 +9,7 @@ const foo = 1;
define('foo', 2);
var_dump(foo, namespace\foo, \foo\foo, \foo, constant('foo'), constant('foo\foo'));
var_dump(foo, namespace::foo, foo::foo, ::foo, constant('foo'), constant('foo::foo'));
?>
--EXPECT--
+1 -1
View File
@@ -10,4 +10,4 @@ const foo = 2;
?>
--EXPECTF--
Notice: Constant foo\foo already defined in %s on line %d
Notice: Constant foo::foo already defined in %s on line %d
+2 -2
View File
@@ -26,7 +26,7 @@ var_dump(__namespace__);
string(%d) "%s"
string(%d) "%s"
int(%d)
string(21) "test\foo::__construct"
string(8) "test\foo"
string(22) "test::foo::__construct"
string(9) "test::foo"
string(11) "__construct"
string(4) "test"
+3 -5
View File
@@ -3,7 +3,7 @@ Accessing constants inside namespace
--FILE--
<?php
namespace foo\x;
namespace foo::x;
const x = 2;
@@ -12,10 +12,8 @@ class x {
}
var_dump(namespace\x,
x::x,
namespace\x::x);
var_dump(defined('foo\x\x'));
var_dump(namespace::x, x::x, namespace::x::x);
var_dump(defined('foo::x::x'));
?>
--EXPECT--
+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)
+1 -1
View File
@@ -11,7 +11,7 @@ interface foo {
const foo = 2;
}
function foo($x = \foo\foo::foo) {
function foo($x = foo::foo::foo) {
var_dump($x);
}
+2 -2
View File
@@ -13,8 +13,8 @@ interface IBar extends IFoo { }
var_dump(interface_exists('IFoo'));
var_dump(interface_exists('foo\\IFoo'));
var_dump(interface_exists('FOO\\ITEST'));
var_dump(interface_exists('foo::IFoo'));
var_dump(interface_exists('FOO::ITEST'));
?>
--EXPECT--
+2 -2
View File
@@ -1,5 +1,5 @@
--TEST--
ZE2 Late Static Binding access to static::const through defined() and get_constant()
--TEST--
ZE2 Late Static Binding access to static::const through defined() anf get_constant()
--FILE--
<?php
+9 -9
View File
@@ -2,7 +2,7 @@
001: Class in namespace
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Foo {
@@ -22,13 +22,13 @@ class Foo {
$x = new Foo;
$x->bar();
Foo::baz();
$y = new \test\ns1\Foo;
$y = new test::ns1::Foo;
$y->bar();
\test\ns1\Foo::baz();
test::ns1::Foo::baz();
--EXPECT--
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
+12 -12
View File
@@ -2,7 +2,7 @@
002: Import in namespace
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Foo {
static function bar() {
@@ -10,18 +10,18 @@ class Foo {
}
}
use test\ns1\Foo as Bar;
use test\ns1 as ns2;
use test\ns1;
use test::ns1::Foo as Bar;
use test::ns1 as ns2;
use test::ns1;
Foo::bar();
\test\ns1\Foo::bar();
test::ns1::Foo::bar();
Bar::bar();
ns2\Foo::bar();
ns1\Foo::bar();
ns2::Foo::bar();
ns1::Foo::bar();
--EXPECT--
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
test::ns1::Foo
+2 -2
View File
@@ -2,11 +2,11 @@
003: Name conflict (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Exception {
}
echo get_class(new Exception()),"\n";
--EXPECT--
test\ns1\Exception
test::ns1::Exception
+4 -4
View File
@@ -1,9 +1,9 @@
--TEST--
004: Using global class name from namespace (unqualified - fail)
004: Name conflict (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
echo get_class(new Exception()),"\n";
--EXPECTF--
Fatal error: Class 'test\ns1\Exception' not found in %sns_004.php on line %d
--EXPECT--
Exception
+2 -2
View File
@@ -2,11 +2,11 @@
005: Name conflict (php name in case if ns name exists)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Exception {
}
echo get_class(new \Exception()),"\n";
echo get_class(new ::Exception()),"\n";
--EXPECT--
Exception
+3 -3
View File
@@ -2,12 +2,12 @@
006: Run-time name conflict (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Exception {
}
$x = "test\\ns1\\Exception";
$x = "test::ns1::Exception";
echo get_class(new $x),"\n";
--EXPECT--
test\ns1\Exception
test::ns1::Exception
+1 -1
View File
@@ -2,7 +2,7 @@
007: Run-time name conflict (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
class Exception {
}
+2 -2
View File
@@ -7,7 +7,7 @@ namespace test;
class foo {
}
$x = __NAMESPACE__ . "\\foo";
$x = __NAMESPACE__ . "::foo";
echo get_class(new $x),"\n";
--EXPECT--
test\foo
test::foo
+1 -1
View File
@@ -5,7 +5,7 @@
class foo {
}
$x = __NAMESPACE__ . "\\foo";
$x = __NAMESPACE__ . "::foo";
echo get_class(new $x),"\n";
--EXPECT--
foo
+16 -8
View File
@@ -15,27 +15,35 @@ class Foo {
}
}
new Foo();
new Y\Foo();
new \X\Foo();
new X::Foo();
new Y::Foo();
new ::X::Foo();
Foo::bar();
Y\Foo::bar();
\X\Foo::bar();
X::Foo::bar();
Y::Foo::bar();
::X::Foo::bar();
echo Foo::C;
echo Y\Foo::C;
echo \X\Foo::C;
echo X::Foo::C;
echo Y::Foo::C;
echo ::X::Foo::C;
echo Foo::$var;
echo Y\Foo::$var;
echo \X\Foo::$var;
echo X::Foo::$var;
echo Y::Foo::$var;
echo ::X::Foo::$var;
--EXPECT--
class ok
class ok
class ok
class ok
method ok
method ok
method ok
method ok
const ok
const ok
const ok
const ok
var ok
var ok
var ok
var ok
+7 -7
View File
@@ -2,23 +2,23 @@
011: Function in namespace
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function foo() {
echo __FUNCTION__,"\n";
}
foo();
\test\ns1\foo();
test::ns1::foo();
bar();
\test\ns1\bar();
test::ns1::bar();
function bar() {
echo __FUNCTION__,"\n";
}
--EXPECT--
test\ns1\foo
test\ns1\foo
test\ns1\bar
test\ns1\bar
test::ns1::foo
test::ns1::foo
test::ns1::bar
test::ns1::bar
+16 -16
View File
@@ -2,34 +2,34 @@
012: Import in namespace and functions
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function foo() {
echo __FUNCTION__,"\n";
}
use test\ns1 as ns2;
use test::ns1 as ns2;
use test as ns3;
foo();
bar();
\test\ns1\foo();
\test\ns1\bar();
ns2\foo();
ns2\bar();
ns3\ns1\foo();
ns3\ns1\bar();
test::ns1::foo();
test::ns1::bar();
ns2::foo();
ns2::bar();
ns3::ns1::foo();
ns3::ns1::bar();
function bar() {
echo __FUNCTION__,"\n";
}
--EXPECT--
test\ns1\foo
test\ns1\bar
test\ns1\foo
test\ns1\bar
test\ns1\foo
test\ns1\bar
test\ns1\foo
test\ns1\bar
test::ns1::foo
test::ns1::bar
test::ns1::foo
test::ns1::bar
test::ns1::foo
test::ns1::bar
test::ns1::foo
test::ns1::bar
+2 -2
View File
@@ -2,7 +2,7 @@
013: Name conflict and functions (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
@@ -10,4 +10,4 @@ function strlen($x) {
echo strlen("Hello"),"\n";
--EXPECT--
test\ns1\strlen
test::ns1::strlen
+1 -1
View File
@@ -2,7 +2,7 @@
014: Name conflict and functions (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
echo strlen("Hello"),"\n";
--EXPECT--
+2 -2
View File
@@ -2,13 +2,13 @@
015: Name conflict and functions (php name in case if ns name exists)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
}
echo \strlen("Hello"),"\n";
echo ::strlen("Hello"),"\n";
--EXPECT--
5
+3 -3
View File
@@ -2,13 +2,13 @@
016: Run-time name conflict and functions (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
}
$x = "test\\ns1\\strlen";
$x = "test::ns1::strlen";
echo $x("Hello"),"\n";
--EXPECT--
test\ns1\strlen
test::ns1::strlen
+1 -1
View File
@@ -2,7 +2,7 @@
017: Run-time name conflict and functions (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
+2 -2
View File
@@ -8,7 +8,7 @@ function foo() {
return __FUNCTION__;
}
$x = __NAMESPACE__ . "\\foo";
$x = __NAMESPACE__ . "::foo";
echo $x(),"\n";
--EXPECT--
test\foo
test::foo
+1 -1
View File
@@ -6,7 +6,7 @@ function foo() {
return __FUNCTION__;
}
$x = __NAMESPACE__ . "\\foo";
$x = __NAMESPACE__ . "::foo";
echo $x(),"\n";
--EXPECT--
foo
+7 -7
View File
@@ -8,11 +8,11 @@ function foo() {
echo __FUNCTION__,"\n";
}
foo();
\X\foo();
Y\foo();
\X\foo();
X::foo();
Y::foo();
::X::foo();
--EXPECT--
X\foo
X\foo
X\foo
X\foo
X::foo
X::foo
X::foo
X::foo
+5 -5
View File
@@ -15,9 +15,9 @@ function foo() {
}
foo();
\test\foo();
\test\test::foo();
test::foo();
test::test::foo();
--EXPECT--
test\foo
test\foo
test\Test::foo
test::foo
test::foo
test::Test::foo
+5 -5
View File
@@ -2,9 +2,9 @@
022: Name search priority (first look into import, then into current namespace and then for class)
--FILE--
<?php
namespace a\b\c;
namespace a::b::c;
use a\b\c as test;
use a::b::c as test;
require "ns_022.inc";
@@ -12,8 +12,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
test\foo();
\test::foo();
test::foo();
::test::foo();
--EXPECT--
a\b\c\foo
a::b::c::foo
Test::foo
+3 -3
View File
@@ -2,10 +2,10 @@
023: __NAMESPACE__ constant
--FILE--
<?php
namespace test\foo;
namespace test::foo;
var_dump(__NAMESPACE__);
--EXPECT--
string(8) "test\foo"
string(9) "test::foo"
--UEXPECT--
unicode(8) "test\foo"
unicode(9) "test::foo"
+7 -7
View File
@@ -2,7 +2,7 @@
025: Name ambiguity (class name & part of namespace name)
--FILE--
<?php
namespace Foo\Bar;
namespace Foo::Bar;
class Foo {
function __construct() {
@@ -15,10 +15,10 @@ class Foo {
$x = new Foo;
Foo::Bar();
$x = new \Foo\Bar\Foo;
\Foo\Bar\Foo::Bar();
$x = new Foo::Bar::Foo;
Foo::Bar::Foo::Bar();
--EXPECT--
Foo\Bar\Foo
Foo\Bar\Foo
Foo\Bar\Foo
Foo\Bar\Foo
Foo::Bar::Foo
Foo::Bar::Foo
Foo::Bar::Foo
Foo::Bar::Foo
+10 -13
View File
@@ -18,16 +18,13 @@ function Bar() {
}
$x = new Foo;
\Foo\Bar();
$x = new \Foo\Foo;
\Foo\Foo::Bar();
\Foo\Bar();
Foo\Bar();
--EXPECTF--
Method - Foo\Foo::__construct
Func - Foo\Bar
Method - Foo\Foo::__construct
Method - Foo\Foo::Bar
Func - Foo\Bar
Fatal error: Call to undefined function Foo\Foo\Bar() in %sns_026.php on line %d
Foo::Bar();
$x = new Foo::Foo;
Foo::Foo::Bar();
::Foo::Bar();
--EXPECT--
Method - Foo::Foo::__construct
Func - Foo::Bar
Method - Foo::Foo::__construct
Method - Foo::Foo::Bar
Func - Foo::Bar
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Foo\Bar;
namespace Foo::Bar;
class Foo {
function __construct() {
+4 -4
View File
@@ -15,10 +15,10 @@ class Foo {
$x = new Foo;
Foo::Bar();
$x = new Foo\Bar\Foo;
Foo\Bar\Foo::Bar();
$x = new Foo::Bar::Foo;
Foo::Bar::Foo::Bar();
--EXPECT--
Foo
Foo
Foo\Bar\Foo
Foo\Bar\Foo
Foo::Bar::Foo
Foo::Bar::Foo
+8 -8
View File
@@ -14,13 +14,13 @@ class Foo {
}
$x = new Foo;
Foo\Bar();
$x = new Foo\Foo;
Foo\Foo::Bar();
\Foo\Bar();
Foo::Bar();
$x = new Foo::Foo;
Foo::Foo::Bar();
::Foo::Bar();
--EXPECT--
Method - Foo::__construct
Func - Foo\Bar
Method - Foo\Foo::__construct
Method - Foo\Foo::Bar
Func - Foo\Bar
Func - Foo::Bar
Method - Foo::Foo::__construct
Method - Foo::Foo::Bar
Func - Foo::Bar
+1 -1
View File
@@ -2,7 +2,7 @@
029: Name ambiguity (class name & import name)
--FILE--
<?php
use A\B as Foo;
use A::B as Foo;
class Foo {
}
+2 -2
View File
@@ -5,8 +5,8 @@
class Foo {
}
use A\B as Foo;
use A::B as Foo;
new Foo();
--EXPECTF--
Fatal error: Cannot use A\B as Foo because the name is already in use in %sns_030.php on line 5
Fatal error: Cannot use A::B as Foo because the name is already in use in %sns_030.php on line 5
+4 -4
View File
@@ -14,8 +14,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
call_user_func(__NAMESPACE__."\\foo");
call_user_func(__NAMESPACE__."\\test::foo");
call_user_func(__NAMESPACE__."::foo");
call_user_func(__NAMESPACE__."::test::foo");
--EXPECT--
test\foo
test\Test::foo
test::foo
test::Test::foo
+2 -2
View File
@@ -12,8 +12,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
call_user_func(__NAMESPACE__."\\foo");
call_user_func(__NAMESPACE__."\\test::foo");
call_user_func(__NAMESPACE__."::foo");
call_user_func(__NAMESPACE__."::test::foo");
--EXPECT--
foo
Test::foo
+11 -4
View File
@@ -10,18 +10,23 @@ class Foo {
function f1($x=Foo::C) {
echo $x;
}
function f2($x=B\Foo::C) {
function f2($x=A::Foo::C) {
echo $x;
}
function f3($x=\A\Foo::C) {
function f3($x=B::Foo::C) {
echo $x;
}
function f4($x=::A::Foo::C) {
echo $x;
}
echo Foo::C;
echo B\Foo::C;
echo \A\Foo::C;
echo A::Foo::C;
echo B::Foo::C;
echo ::A::Foo::C;
f1();
f2();
f3();
f4();
--EXPECT--
ok
ok
@@ -29,3 +34,5 @@ ok
ok
ok
ok
ok
ok
+2 -4
View File
@@ -5,16 +5,14 @@
--FILE--
<?php
namespace A;
use \ArrayObject;
function f1($x = ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
function f2($x = \ArrayObject::STD_PROP_LIST) {
function f2($x = ::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
var_dump(ArrayObject::STD_PROP_LIST);
var_dump(\ArrayObject::STD_PROP_LIST);
var_dump(::ArrayObject::STD_PROP_LIST);
f1();
f2();
+13 -6
View File
@@ -12,23 +12,28 @@ class ArrayObject {
function f1($x = ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
function f2($x = \ArrayObject::STD_PROP_LIST) {
function f2($x = ::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
function f3($x = \A\ArrayObject::STD_PROP_LIST) {
function f3($x = A::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
function f4($x = B\ArrayObject::STD_PROP_LIST) {
function f4($x = B::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
function f5($x = ::A::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
var_dump(ArrayObject::STD_PROP_LIST);
var_dump(\ArrayObject::STD_PROP_LIST);
var_dump(B\ArrayObject::STD_PROP_LIST);
var_dump(\A\ArrayObject::STD_PROP_LIST);
var_dump(::ArrayObject::STD_PROP_LIST);
var_dump(A::ArrayObject::STD_PROP_LIST);
var_dump(B::ArrayObject::STD_PROP_LIST);
var_dump(::A::ArrayObject::STD_PROP_LIST);
f1();
f2();
f3();
f4();
f5();
?>
--EXPECT--
int(2)
@@ -36,6 +41,8 @@ int(1)
int(2)
int(2)
int(2)
int(2)
int(1)
int(2)
int(2)
int(2)
+16 -8
View File
@@ -15,27 +15,35 @@ class X {
}
}
new X();
new Y\X();
new \X\X();
new X::X();
new Y::X();
new ::X::X();
X::bar();
Y\X::bar();
\X\X::bar();
X::X::bar();
Y::X::bar();
::X::X::bar();
echo X::C;
echo Y\X::C;
echo \X\X::C;
echo X::X::C;
echo Y::X::C;
echo ::X::X::C;
echo X::$var;
echo Y\X::$var;
echo \X\X::$var;
echo X::X::$var;
echo Y::X::$var;
echo ::X::X::$var;
--EXPECT--
class ok
class ok
class ok
class ok
method ok
method ok
method ok
method ok
const ok
const ok
const ok
const ok
var ok
var ok
var ok
var ok
+2 -2
View File
@@ -6,8 +6,8 @@ namespace Exception;
function foo() {
echo "ok\n";
}
\Exception\foo();
\Exception::bar();
Exception::foo();
Exception::bar();
--EXPECTF--
ok
+6 -6
View File
@@ -9,13 +9,13 @@ const B = A;
function f1($x=A) {
echo $x;
}
function f2($x=\X\A) {
function f2($x=X::A) {
echo $x;
}
function f3($x=Y\A) {
function f3($x=Y::A) {
echo $x;
}
function f4($x=\X\A) {
function f4($x=::X::A) {
echo $x;
}
function f5($x=B) {
@@ -31,9 +31,9 @@ function f8($x=array(A=>"aaa\n")) {
echo $x["ok\n"];
}
echo A;
echo \X\A;
echo Y\A;
echo \X\A;
echo X::A;
echo Y::A;
echo ::X::A;
f1();
f2();
f3();
+3 -3
View File
@@ -2,13 +2,13 @@
041: Constants in namespace
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const FOO = "ok\n";
echo(FOO);
echo(\test\ns1\FOO);
echo(\test\ns1\FOO);
echo(test::ns1::FOO);
echo(::test::ns1::FOO);
echo(BAR);
const BAR = "ok\n";
+6 -6
View File
@@ -2,18 +2,18 @@
042: Import in namespace and constants
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const FOO = "ok\n";
use test\ns1 as ns2;
use test::ns1 as ns2;
use test as ns3;
echo FOO;
echo \test\ns1\FOO;
echo \test\ns1\FOO;
echo ns2\FOO;
echo ns3\ns1\FOO;
echo test::ns1::FOO;
echo ::test::ns1::FOO;
echo ns2::FOO;
echo ns3::ns1::FOO;
--EXPECT--
ok
ok
+1 -1
View File
@@ -2,7 +2,7 @@
043: Name conflict and constants (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
044: Name conflict and constants (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
var_dump(INI_ALL);
--EXPECT--
+2 -2
View File
@@ -2,10 +2,10 @@
045: Name conflict and constants (php name in case if ns name exists)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
var_dump(\INI_ALL);
var_dump(::INI_ALL);
--EXPECT--
int(7)
+2 -2
View File
@@ -2,10 +2,10 @@
046: Run-time name conflict and constants (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
var_dump(constant("test\\ns1\\INI_ALL"));
var_dump(constant("test::ns1::INI_ALL"));
--EXPECT--
int(0)
+1 -1
View File
@@ -2,7 +2,7 @@
047: Run-time name conflict and constants (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
+2 -2
View File
@@ -2,10 +2,10 @@
048: __NAMESPACE__ constant and runtime names (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const FOO = 0;
var_dump(constant(__NAMESPACE__ . "\\FOO"));
var_dump(constant(__NAMESPACE__ . "::FOO"));
--EXPECT--
int(0)
+1 -1
View File
@@ -4,6 +4,6 @@
<?php
const FOO = 0;
var_dump(constant(__NAMESPACE__ . "\\FOO"));
var_dump(constant(__NAMESPACE__ . "::FOO"));
--EXPECT--
int(0)
+1 -1
View File
@@ -2,7 +2,7 @@
050: Name conflict and compile-time constants (ns name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
051: Name conflict and compile-time constants (php name)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
function foo($x = INI_ALL) {
var_dump($x);
+2 -2
View File
@@ -2,11 +2,11 @@
052: Name conflict and compile-time constants (php name in case if ns name exists)
--FILE--
<?php
namespace test\ns1;
namespace test::ns1;
const INI_ALL = 0;
function foo($x = \INI_ALL) {
function foo($x = ::INI_ALL) {
var_dump($x);
}
foo();
Loaded 100 of 914 files, more files were not shown because too many files have changed in this diff. Show more