mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
173
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f79b879c38 | ||
|
|
355e1831c3 | ||
|
|
554db3159d | ||
|
|
4ef9f536ba | ||
|
|
4d08b9dac0 | ||
|
|
0db20a7cb1 | ||
|
|
c1504b81d3 | ||
|
|
2f606dc5e8 | ||
|
|
04cc2f6473 | ||
|
|
3bcab31749 | ||
|
|
b47cff48de | ||
|
|
a797421e98 | ||
|
|
2689917b17 | ||
|
|
5cf54f6073 | ||
|
|
62700f76cb | ||
|
|
b5338c0b7d | ||
|
|
0fdceb6cd5 | ||
|
|
5ca02ca494 | ||
|
|
af07b76ccf | ||
|
|
390f64701d | ||
|
|
7991a88675 | ||
|
|
aa3fceeaad | ||
|
|
8b1559b9f4 | ||
|
|
55b880070c | ||
|
|
703be4f77e | ||
|
|
27a743b82b | ||
|
|
bdf7393ddb | ||
|
|
2693e52113 | ||
|
|
4e68b2c52b | ||
|
|
54840f9c8f | ||
|
|
f269cdcd4f | ||
|
|
f76a6cd023 | ||
|
|
6b18d956de | ||
|
|
e46d589624 | ||
|
|
0496f5407f | ||
|
|
3a25a56a92 | ||
|
|
0525574913 | ||
|
|
73cabfedf5 | ||
|
|
12107d619b | ||
|
|
f7f4fd4706 | ||
|
|
e8b7698f5e | ||
|
|
2aae60461c | ||
|
|
f8c514ba6b | ||
|
|
8dc4f4dc9e | ||
|
|
5f8380d33e | ||
|
|
89637c6b41 | ||
|
|
4b38feabe7 | ||
|
|
a29264eb8c | ||
|
|
4903f044d3 | ||
|
|
ce64b82ebb | ||
|
|
d02f953faf | ||
|
|
d0b7eed0c9 | ||
|
|
c71b773a62 | ||
|
|
e3cc15daf2 | ||
|
|
2a1ad88538 | ||
|
|
3f4340a796 | ||
|
|
08089f014c | ||
|
|
751d19f698 | ||
|
|
604827b694 | ||
|
|
cfee5116dd | ||
|
|
0c4f11ecaa | ||
|
|
2fddc4a7f1 | ||
|
|
de66e80d75 | ||
|
|
fda0a8b735 | ||
|
|
cd1869bcf2 | ||
|
|
3eecee16d1 | ||
|
|
4d6100569b | ||
|
|
b255b97e43 | ||
|
|
b1301a0686 | ||
|
|
660250f4da | ||
|
|
81c2a4b9ba | ||
|
|
db287b2303 | ||
|
|
b3bd379198 | ||
|
|
cda87977a5 | ||
|
|
b4c5f20c46 | ||
|
|
fa3615f14e | ||
|
|
3fbbcf7f93 | ||
|
|
1bdc290017 | ||
|
|
18b6de7a91 | ||
|
|
14c422a32f | ||
|
|
6a854e2740 | ||
|
|
b4fa2ba295 | ||
|
|
0f8cf3b849 | ||
|
|
27d6814351 | ||
|
|
64447030bb | ||
|
|
073ac50374 | ||
|
|
98bcc0bd43 | ||
|
|
135265ef69 | ||
|
|
ec6ac50812 | ||
|
|
1b797f7ad3 | ||
|
|
a6c67a088a | ||
|
|
51a7e35c24 | ||
|
|
509f5097ab | ||
|
|
887fabe78f | ||
|
|
4a39d33ee5 | ||
|
|
f19dfac830 | ||
|
|
648be8600f | ||
|
|
c4d7cfa536 | ||
|
|
78970d5338 | ||
|
|
5f07a895cc | ||
|
|
aea8c6ddc1 | ||
|
|
81b2533a68 | ||
|
|
3968ffe7b3 | ||
|
|
e05f79c3de | ||
|
|
91f129ebf7 | ||
|
|
c3b910370c | ||
|
|
ee0e6963f3 | ||
|
|
9997767dc3 | ||
|
|
3704947696 | ||
|
|
585c9f3c4b | ||
|
|
d027bc2add | ||
|
|
95c4564f93 | ||
|
|
9c5717d0de | ||
|
|
77cbf8a657 | ||
|
|
dc7e53690f | ||
|
|
46bb35a853 | ||
|
|
1c845d2950 | ||
|
|
5416deec66 | ||
|
|
6a8ae7cf8d | ||
|
|
60b1829e1c | ||
|
|
1e0c4386ab | ||
|
|
2dee44c74c | ||
|
|
8dcfec9789 | ||
|
|
6d2d0bbda7 | ||
|
|
05849a242a | ||
|
|
60912e66c8 | ||
|
|
ece7d223e8 | ||
|
|
5269c4cacb | ||
|
|
49d1cdc393 | ||
|
|
d51b8f915f | ||
|
|
872e43d6e5 | ||
|
|
fff1cab367 | ||
|
|
c4ae856912 | ||
|
|
464c1639ae | ||
|
|
0954ea8d6d | ||
|
|
ef09bc0645 | ||
|
|
e347b2ded6 | ||
|
|
8a1713e39c | ||
|
|
9f49ebb5ba | ||
|
|
d74fbfb38f | ||
|
|
89dd7fb328 | ||
|
|
777929b1ae | ||
|
|
b8e0351978 | ||
|
|
1b22e9dc2e | ||
|
|
d40a852919 | ||
|
|
99549ce79c | ||
|
|
b39c70b4a7 | ||
|
|
1a06fae543 | ||
|
|
ca870dfee7 | ||
|
|
abad134681 | ||
|
|
b966a8b5fa | ||
|
|
87d56a3d07 | ||
|
|
5c957b502e | ||
|
|
561f1afe6e | ||
|
|
622dc2a611 | ||
|
|
c0c0871911 | ||
|
|
36c53036e7 | ||
|
|
20a608d9da | ||
|
|
4c0e50c88a | ||
|
|
f50df1d0e3 | ||
|
|
a581e64199 | ||
|
|
1967950dc3 | ||
|
|
d9dfac90bf | ||
|
|
a0b9554f94 | ||
|
|
7b392c7154 | ||
|
|
e7166ea9be | ||
|
|
e67096dbbb | ||
|
|
09ef61e3ca | ||
|
|
bf3e2dce7b | ||
|
|
36301bd615 | ||
|
|
c0203c0ceb | ||
|
|
f639b64dca | ||
|
|
8cfaea656c |
No files matched your search
+2
-2
@@ -24,7 +24,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.7
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
@@ -43,7 +43,7 @@ environment:
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql95
|
||||
- postgresql96
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ User Functions/Methods Naming Conventions
|
||||
'foobar'
|
||||
'foo_bar'
|
||||
|
||||
Internal Function Naming Conventions
|
||||
Internal Function Naming Convensions
|
||||
----------------------
|
||||
|
||||
1. Functions that are part of the external API should be named
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ The next few rules are more of a technical nature::
|
||||
should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
|
||||
not master, which is not a public released version yet.
|
||||
|
||||
3. Do not commit multiple files 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.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ It is recommended to do so a couple of days before the packaging day, to
|
||||
have enough time to investigate failures, communicate with the authors and
|
||||
commit the fixes.
|
||||
The RM for the branch is also responsible for keeping the CI green on
|
||||
ongoing basis between the releases. Check the CI status for your branch
|
||||
ongoing bases between the releases. Check the CI status for your branch
|
||||
periodically and resolve the failures ASAP. See more in:
|
||||
https://wiki.php.net/rfc/travis_ci
|
||||
|
||||
@@ -31,7 +31,7 @@ team (Bjori) on hand.
|
||||
|
||||
6. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
7. Moving extensions from/to PECL requires write access to the destination.
|
||||
7. Moving extensions from/to PECL requires write acces to the destination.
|
||||
Most developers should have this.
|
||||
|
||||
Moving extensions from php-src to PECL
|
||||
@@ -274,8 +274,8 @@ to upgrade.
|
||||
10. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
http://news.php.net/php.internals/17222.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
@@ -312,6 +312,6 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
@@ -11,7 +11,7 @@ Pull Requests
|
||||
=============
|
||||
PHP accepts pull requests via github. Discussions are done on github, but
|
||||
depending on the topic can also be relayed to the official PHP developer
|
||||
mailing list internals@lists.php.net.
|
||||
mailinglist internals@lists.php.net.
|
||||
|
||||
New features require an RFC and must be accepted by the developers.
|
||||
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
|
||||
@@ -42,10 +42,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# if _WIN32
|
||||
# include "win32/ioutil.h"
|
||||
# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
|
||||
# elif PATH_MAX
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# elif defined(MAX_PATH)
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
|
||||
+22
-76
@@ -33,7 +33,6 @@
|
||||
#include <Sddl.h>
|
||||
#include "tsrm_win32.h"
|
||||
#include "zend_virtual_cwd.h"
|
||||
#include "win32/ioutil.h"
|
||||
|
||||
#ifdef ZTS
|
||||
static ts_rsrc_id win32_globals_id;
|
||||
@@ -208,42 +207,29 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
|
||||
BYTE * psec_desc = NULL;
|
||||
BOOL fAccess = FALSE;
|
||||
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
|
||||
PHP_WIN32_IOUTIL_INIT_W(pathname)
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode == 1 /*X_OK*/) {
|
||||
DWORD type;
|
||||
int ret;
|
||||
|
||||
ret = GetBinaryTypeW(pathw, &type) ? 0 : -1;
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
return ret;
|
||||
return GetBinaryType(pathname, &type) ? 0 : -1;
|
||||
} else {
|
||||
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) == NULL) {
|
||||
goto Finished;
|
||||
}
|
||||
pathname = real_path;
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
|
||||
if(php_win32_ioutil_access(pathname, mode)) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(access(pathname, mode)) {
|
||||
free(real_path);
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* If only existence check is made, return now */
|
||||
if (mode == 0) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
free(real_path);
|
||||
return 0;
|
||||
}
|
||||
@@ -299,11 +285,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
if(bucket == NULL && real_path == NULL) {
|
||||
/* We used the pathname directly. Call tsrm_realpath */
|
||||
/* so that entry is created in realpath cache */
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) != NULL) {
|
||||
pathname = real_path;
|
||||
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,13 +325,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
|
||||
/* Get size of security buffer. Call is expected to fail */
|
||||
if(GetFileSecurityW(pathw, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
if(GetFileSecurity(pathname, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
psec_desc = (BYTE *)malloc(sec_desc_length);
|
||||
if(psec_desc == NULL ||
|
||||
!GetFileSecurityW(pathw, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
!GetFileSecurity(pathname, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
@@ -388,7 +373,6 @@ Finished:
|
||||
real_path = NULL;
|
||||
}
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(fAccess == FALSE) {
|
||||
errno = EACCES;
|
||||
return errno;
|
||||
@@ -475,15 +459,14 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, type_len, read, mode;
|
||||
STARTUPINFOW startup;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
BOOL res;
|
||||
process_pair *proc;
|
||||
char *cmd = NULL;
|
||||
wchar_t *cmdw = NULL, *cwdw = NULL, *envw = NULL;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
HANDLE thread_token = NULL;
|
||||
@@ -507,42 +490,18 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
ptype++;
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
cmdw = php_win32_cp_any_to_w(cmd);
|
||||
if (!cmdw) {
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cwd) {
|
||||
cwdw = php_win32_ioutil_any_to_w(cwd);
|
||||
if (!cwdw) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&startup, 0, sizeof(STARTUPINFOW));
|
||||
memset(&startup, 0, sizeof(STARTUPINFO));
|
||||
memset(&process, 0, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
startup.cb = sizeof(STARTUPINFOW);
|
||||
startup.cb = sizeof(STARTUPINFO);
|
||||
startup.dwFlags = STARTF_USESTDHANDLES;
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
@@ -574,28 +533,19 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
}
|
||||
}
|
||||
|
||||
envw = php_win32_cp_env_any_to_w(env);
|
||||
if (envw) {
|
||||
dwCreateFlags |= CREATE_UNICODE_ENVIRONMENT;
|
||||
} else {
|
||||
if (env) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
return NULL;
|
||||
}
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUserW(token_user, NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
CloseHandle(token_user);
|
||||
} else {
|
||||
res = CreateProcessW(NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
}
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(envw);
|
||||
|
||||
if (!res) {
|
||||
return NULL;
|
||||
@@ -730,7 +680,10 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
@@ -811,17 +764,10 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
{
|
||||
FILETIME mtime, atime;
|
||||
HANDLE hFile;
|
||||
PHP_WIN32_IOUTIL_INIT_W(filename)
|
||||
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
hFile = CreateFileW(pathw, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
|
||||
the CreateFile operation succeeds */
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
|
||||
+281
-48
@@ -1,10 +1,25 @@
|
||||
PHP 7.1 INTERNALS UPGRADE NOTES
|
||||
PHP 7.0 INTERNALS UPGRADE NOTES
|
||||
|
||||
0. Wiki Examples
|
||||
1. Internal API changes
|
||||
e. Codepage handling on Windows
|
||||
f. Path handling on Windows
|
||||
g. SAPI logging
|
||||
e. New data types
|
||||
f. zend_parse_parameters() specs
|
||||
g. sprintf() formats
|
||||
h. HashTable API
|
||||
i. New portable macros for large file support
|
||||
j. New portable macros for integers
|
||||
k. get_class_entry object handler info
|
||||
l. get_class_name object handler info
|
||||
m. Other portable macros info
|
||||
n. ZEND_ENGINE_2 removal
|
||||
o. Updated final class modifier
|
||||
p. TSRM changes
|
||||
q. gc_collect_cycles() is now hookable
|
||||
r. PDO uses size_t for lengths
|
||||
s. Resource API changes
|
||||
t. Optimized strings concatenation.
|
||||
u. Streams changes
|
||||
v. Sort algorithm changes
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -24,56 +39,218 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
e. Codepage handling on Windows
|
||||
e. New data types
|
||||
|
||||
String
|
||||
|
||||
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
|
||||
was introduced. It expects an argument of the type zend_string *. String lengths
|
||||
in it are bound to the size_t datatype.
|
||||
|
||||
Integer types
|
||||
|
||||
Integers do no more depend on the firm 'long' type. Instead a platform
|
||||
dependent integer type is used, it is called zend_long. That datatype is
|
||||
defined dynamically to guarantee the consistent 64 bit support. The zval
|
||||
field representing user land integer it bound to zend_long.
|
||||
|
||||
Signed integer is defined as zend_long, unsigned integer as zend_ulong
|
||||
inside Zend.
|
||||
|
||||
Other datatypes
|
||||
|
||||
zend_off_t - portable off_t analogue
|
||||
zend_stat_t - portable 'struct stat' analogue
|
||||
|
||||
These datatypes are declared to be portable across platforms. Thus, direct
|
||||
usage of the functions like fseek, stat, etc. as well as direct usage of
|
||||
off_t and struct stat is strongly not recommended. Instead the portable
|
||||
macros should be used.
|
||||
|
||||
zend_fseek - portable fseek equivalent
|
||||
zend_ftell - portable ftell equivalent
|
||||
zend_lseek - portable lseek equivalent
|
||||
zend_fstat - portable fstat equivalent
|
||||
zend_stat - portable stat equivalent
|
||||
|
||||
f. zend_parse_parameters() specs
|
||||
|
||||
The new spec 'S' introduced, which expects an argument of type zend_string *.
|
||||
The 'l' spec expects a parameter of the type zend_long, not long anymore.
|
||||
The 's' spec expects parameters of the type char * and size_t, no int anymore.
|
||||
|
||||
g. sprintf() formats
|
||||
|
||||
New printf modifier 'p' was implemented to platform independently output zend_long,
|
||||
zend_ulong and php_size_t datatypes. That modifier can be used with 'd', 'u', 'x' and 'o'
|
||||
printf format specs with spprintf, snprintf and the wrapping printf implementations.
|
||||
%pu is sufficient for both zend_ulong and php_size_t. the code using %p spec to output
|
||||
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
|
||||
'u', 'x' or 'o'.
|
||||
|
||||
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
||||
they can use the implemenations available on the system, not the PHP one. With snprintf the
|
||||
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
|
||||
|
||||
h. HashTable API
|
||||
|
||||
Datatype for array indexes was changed to zend_ulong, for string keys to zend_string *.
|
||||
|
||||
i. New portable macros for large file support
|
||||
|
||||
Function(s) Alias Comment
|
||||
stat, _stat64 zend_stat for use with zend_stat_t
|
||||
fstat, _fstat64 zend_fstat for use with zend_stat_t
|
||||
lseek, _lseeki64 zend_lseek for use with zend_off_t
|
||||
ftell, _ftelli64 zend_ftell for use with zend_off_t
|
||||
fseek, _fseeki64 zend_fseek for use with zend_off_t
|
||||
|
||||
j. New portable macros for integers
|
||||
|
||||
Function(s) Alias Comment
|
||||
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_LTOA for use with zend_long
|
||||
atol, atoll, _atoi64 ZEND_ATOL for use with zend_long
|
||||
strtol, strtoll, _strtoi64 ZEND_STRTOL for use with zend_long
|
||||
strtoul, strtoull, _strtoui64 ZEND_STRTOUL for use with zend_long
|
||||
abs, llabs, _abs64 ZEND_ABS for use with zend_long
|
||||
- ZEND_LONG_MAX replaces LONG_MAX where appropriate
|
||||
- ZEND_LONG_MIN replaces LONG_MIN where appropriate
|
||||
- ZEND_ULONG_MAX replaces ULONG_MAX where appropriate
|
||||
- SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype
|
||||
- ZEND_SIZE_MAX Max value of size_t
|
||||
- Z_L casts an integral constant to zend_long
|
||||
- Z_UL casts an integral constant to zend_ulong
|
||||
|
||||
The macro ZEND_ENABLE_ZVAL_LONG64 reveals whether zval operates on 64 or 32 bit integer.
|
||||
|
||||
k. The get_class_entry object handler is no longer available. Instead
|
||||
zend_object.ce is always used.
|
||||
|
||||
l. The get_class_name object handler is now only used for displaying class
|
||||
names in debugging functions like var_dump(). It is no longer used in
|
||||
get_class(), get_parent_class() or similar.
|
||||
|
||||
The handler is now obligatory, no longer accepts a `parent` argument and
|
||||
must return a non-NULL zend_string*, which will be released by the caller.
|
||||
|
||||
m. Other portable macros info
|
||||
|
||||
ZEND_SECURE_ZERO - zeroes chunk of memory
|
||||
ZEND_VALID_SOCKET - validates a php_socket_t variable
|
||||
|
||||
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
|
||||
ZEND_NORETURN is defined as __declspec(noreturn) on VS
|
||||
|
||||
n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.
|
||||
|
||||
o. Removed ZEND_ACC_FINAL_CLASS in favour of ZEND_ACC_FINAL, turning final class
|
||||
modifier now a different class entry flag. Update your extensions.
|
||||
|
||||
p. TSRM changes
|
||||
|
||||
The TSRM layer undergone significant changes. It is not necessary anymore to
|
||||
pass the tsrm_ls pointer explicitly. The TSRMLS_* macros should not be used
|
||||
in any new developments.
|
||||
|
||||
The recommended way accessing globals in TS builds is by implementing it
|
||||
to use a local thread unique pointer to the corresponding data pool. These
|
||||
are the new macros that serve to achieve this goal:
|
||||
|
||||
- ZEND_TSRMG - based on TSRMG and if static pointer for data pool access is
|
||||
implemented, will use it
|
||||
- ZEND_TSRMLS_CACHE_EXTERN - to be used in a header shared across multiple
|
||||
C/C++ files
|
||||
- ZEND_TSRMLS_CACHE_DEFINE - to be used in the main extension C/C++ file
|
||||
- ZEND_TSRMLS_CACHE_UPDATE - to be integrated at the top of the globals
|
||||
ctor or RINIT function
|
||||
- ZEND_ENABLE_STATIC_TSRMLS_CACHE - to be used in the config.[m4|w32] for
|
||||
enabling the globals access per thread unique pointer
|
||||
- TSRMLS_CACHE - expands to the variable name which links to the thread
|
||||
unique data pool
|
||||
|
||||
Note that usually it will work without implementing the globals access per
|
||||
a thread unique pointer, however it might cause a slowdown. The reason is
|
||||
that the access model to the extension/SAPI own globals as well as the
|
||||
access to the core globals is determined in the compilation phase depending
|
||||
on whether ZEND_ENABLE_STATIC_TSRMLS_CACHE macro is defined.
|
||||
|
||||
Due to the current compiler evolution state, the TSRMLS_CACHE pointer
|
||||
(when implemented) has to be present and updated in every binary unit which
|
||||
is not compiled statically into PHP. So any DLL, DSO, EXE, etc. has to take
|
||||
care about defining and updating it's TSRMLS cache. An update should happen
|
||||
before any globals was accessed.
|
||||
|
||||
Porting an extension or SAPI is usually as easy as removing all the TSRMLS_*
|
||||
occurrences and integrating the macros mentioned above. However if tsrm_ls
|
||||
is used explicitly, its usage can be considered obsolete in most cases.
|
||||
Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't
|
||||
be passed to that threads directly.
|
||||
|
||||
When working with CTOR/DTOR for the extension globals, only the data passed
|
||||
as parameters should be touched. For example, don't use code like
|
||||
free(MYEXT_G(vars)); inside globals destructor, as it possibly can destroy
|
||||
the data from a wrong thread. Instead use the pointer to the data delivered
|
||||
into the destructor. So the previous example could look like
|
||||
free(my_struct->vars); given the income was casted to (struct my_struct *).
|
||||
|
||||
A new macro was introduced to simplify the declaration to the extension
|
||||
globals. A simplified declaration looks as follows
|
||||
|
||||
#define MYEXT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(myext, v)
|
||||
|
||||
Another new macro ZEND_MODULE_GLOBALS_BULK(myext) delivers the corresponding
|
||||
globals struct as a whole.
|
||||
|
||||
Two new storage specifiers was introduced.
|
||||
|
||||
ZEND_EXT_TLS - expand to an appropriate thread specific storage specifier in
|
||||
the thread safe build, expands to empty in a non thread safe
|
||||
build.
|
||||
ZEND_TLS - expands to an appropriate thread specific storage specifier
|
||||
with static visibility in the thread safe build, expands to
|
||||
static specifier in a non thread safe build.
|
||||
|
||||
A set of new APIs was introduced, which allows to handle codepage
|
||||
conversions. The corresponding prototypes and macros are contained
|
||||
in win32/codepage.h.
|
||||
Variables declared with these storage specifiers can not be shared across
|
||||
threads. While ZEND_TLS enforces the local scope visibility, ZEND_EXT_TLS
|
||||
pertains to the visiblity across several compilation units. In both cases,
|
||||
there's no portable way to achieve the visibility across shared objects.
|
||||
Thus, these specifiers are not compatible with ZEND_API and PHPAPI specifiers.
|
||||
|
||||
Functions with php_win32_cp_* signatures provide handling for various
|
||||
codepage aspects. Primarily they are in use at various places in the
|
||||
I/O utils code and directly in the core where necessary, providing
|
||||
conversions to/from UTF-16. Arbitrary conversions between codepages
|
||||
are possible as well, whereby UTF-16 will be always an intermediate
|
||||
state in this case.
|
||||
q. gc_collect_cycles() is now a function pointer, and can be replaced in the
|
||||
same manner as zend_execute_ex() if needed (for example, to include the
|
||||
time spent in the garbage collector in a profiler). The default
|
||||
implementation has been renamed to zend_gc_collect_cycles(), and is
|
||||
exported with ZEND_API.
|
||||
|
||||
For input length arguments, the macro PHP_WIN32_CP_IGNORE_LEN can be
|
||||
passed, then the API will calculate the length. For output length
|
||||
arguments, the macro PHP_WIN32_CP_IGNORE_LEN_P can be passed, then
|
||||
the API won't set the output length.
|
||||
r. In accordance with general use of size_t as string length, all PDO API
|
||||
functions now use size_t for string length.
|
||||
|
||||
The mapping between encodings and codepages is provided by the predefined
|
||||
array of data contained in win32/cp_enc_map.c. To change the data,
|
||||
a generator win32/cp_enc_map_gen.c needs to be edited and run.
|
||||
s. Removed ZEND_REGISTER/FETCH_RESOURCE, use zend_fetch_resource and
|
||||
and zend_register_resource instead, zend_fetch_resource accepts a zend_resource *
|
||||
as first argument, if you still need to fetch a resource from zval, use
|
||||
zend_fetch_resource_ex. More details can be found in Zend/zend_list.c.
|
||||
|
||||
f. Path handling on Windows
|
||||
t. Optimized strings concatenation.
|
||||
ZEND_ADD_STRING/VAR/CHAR are replaced with ZEND_ROPE_INIT, ZEND_ROPE_ADD,
|
||||
ZEND_ROPE_END.
|
||||
Instead of reallocation and copying string on each ZEND_ADD_STRING/VAR/CAHR,
|
||||
collect all the strings and then allocate and construct the resulting string once.
|
||||
|
||||
A set of new APIs was introduced, which allows to handle UTF-8 paths. The
|
||||
corresponding prototypes and macros are contained in win32/ioutil.h.
|
||||
u. Streams changes
|
||||
- It is possible to do blocking reads on Windows pipes. It can be done either
|
||||
using context stream option PHP_STREAM_OPTION_PIPE_BLOCKING or
|
||||
adding STREAM_USE_BLOCKING_PIPE when opening the stream.
|
||||
|
||||
Functions with php_win32_ioutil_* signatures provide POSIX I/O analogues.
|
||||
These functions are integrated in various places across the code base to
|
||||
support Unicode filenames. While accepting char * arguments, internally
|
||||
the conversion to wchar_t * happens. Internally almost no ANSI APIs are
|
||||
used, but directly their wide equivalents. The string conversion rules
|
||||
correspond to those already present in the core and depend on the current
|
||||
encoding settings. Doing so allows to move away from the ANSI Windows API
|
||||
with its dependency on the system OEM/ANSI codepage.
|
||||
|
||||
Thanks to the wide API usage, the long paths are now supported as well. The
|
||||
PHP_WIN32_IOUTIL_MAXPATHLEN macro is defined to 2048 bytes and will override
|
||||
the MAXPATHLEN in files where the header is included.
|
||||
|
||||
The most optimal use case for scripts is utilizing UTF-8 for any I/O
|
||||
related functions. UTF-8 filenames are supported on any system disregarding
|
||||
the system OEM/ANSI codepage.
|
||||
|
||||
g. SAPI logging
|
||||
The log_message callback in the SAPI struct was extended with the severity
|
||||
argument. This allows SAPI modules to implement mapping between PHP and
|
||||
corresponding server error levels. A reference mapping implementation
|
||||
can be found in apache2handler.
|
||||
v. Sort algorithm changes
|
||||
- Improved zend_qsort(using hybrid sorting algo) for better performance,
|
||||
and also renamed zend_qsort to zend_sort.
|
||||
- Added stable sorting algo zend_insert_sort.
|
||||
|
||||
w. Tick functions internal API change
|
||||
Tick functions have different declaration now. They expect a single
|
||||
parameter while before they were parameterless. When registering the
|
||||
tick function a value for this parameter must be passed. This value will be
|
||||
provided to the tick function on every execution.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
@@ -82,10 +259,66 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
a. Unix build system changes
|
||||
|
||||
b. Windows build system changes
|
||||
Static analysis with clang and Cppcheck is supported by passing "clang" or
|
||||
"cppcheck" keyword to the --with-analyzer configure option.
|
||||
|
||||
- Besides Visual Studio, building with Clang or Intel Composer is now
|
||||
possible. To enable an alternative toolset, add the option
|
||||
--with-toolset=[vs,clang,icc] to the configure line. The default
|
||||
toolset is vs. Still clang or icc need the correct environment
|
||||
which involves many tools from the vs toolset.
|
||||
|
||||
The toolset option is supported by phpize as well.
|
||||
|
||||
AWARENESS The only recommended and supported toolset to produce production
|
||||
ready binaries is Visual Studio. Still other compilers can be used now for
|
||||
testing and analyzing purposes.
|
||||
|
||||
- configure.js now produces response files which are passed to the linker
|
||||
and library manager. This solves the issues with the long command lines
|
||||
which can exceed the OS limit.
|
||||
|
||||
- with clang toolset, an option --with-uncritical-warn-choke is available,
|
||||
which suppresses the most frequent false positive warnings
|
||||
|
||||
- the --with-mp option will by default utilize all the available cores. It's
|
||||
enabled by default for release builds and can be disabled with the special
|
||||
"disable" keyword.
|
||||
|
||||
========================
|
||||
3. Module changes
|
||||
========================
|
||||
|
||||
Session:
|
||||
|
||||
- PS_MOD_UPDATE_TIMESTAMP() session save handler definition is added. New
|
||||
save handler should use PS_MOD_UPDATE_TIMESTAMP() definition. Save handler
|
||||
must not refer/change PS() variables directly from save handler. Use
|
||||
parameters.
|
||||
- PS_MOD()/PS_MOD_SID() macro exist only for transition. Beware these
|
||||
save handlers are less secure and slower than PS_MOD_UPDATE_TIMESTAMP().
|
||||
- PS(invalid_session_id) was removed. It was never worked as it supposed.
|
||||
To report invalid session ID, use PS_VALIDATE_SID() handler.
|
||||
- PS_VALIDATE_SID() defines session ID validation handler. This handler
|
||||
must validate if requested session ID exists in session data storage or not.
|
||||
Do not access PS(id) directly, but use this handler and it's parameter.
|
||||
- PS_UPDATE_TIMESTAMP() defines timestamp updating handler. This handler
|
||||
must update session data timestamp for GC if it is needed. e.g. Memcache
|
||||
updates timestamp on read, so it does not need to update timestamp. Return
|
||||
SUCCESS simply for this case.
|
||||
- PS_CREATE_SID() should check session ID collision. Return NULL for failure.
|
||||
- More documentation can be found in ext/session/mod_files.c as comments.
|
||||
mod_files.c may be used as reference implementation.
|
||||
|
||||
Openssl:
|
||||
- several ext/openssl functions require the inclusion of the applink shim
|
||||
as documented in the OpenSSL FAQ https://www.openssl.org/support/faq.html#PROG2
|
||||
to properly work on Windows. While this primarily affects the OpenSSL
|
||||
functionality, the shim needs to be included into the executable file
|
||||
which loads the extension DLL, not into the extension DLL itself. Alternatively
|
||||
it can be compiled and linked with the main program as a separate object file.
|
||||
More information and explanation in the linked OpenSSL FAQ.
|
||||
|
||||
Thus, this primarily affects any WAMP or other redistributions bundling the
|
||||
official PHP release zipballs or building from sources. The applink shim is
|
||||
already integrated with all the PHP executables from the official distribution
|
||||
starting with 7.0.0beta1.
|
||||
|
||||
+2
-2
@@ -370,10 +370,10 @@ AC_CHECK_FUNCS(mremap)
|
||||
|
||||
|
||||
AC_ARG_ENABLE(zend-signals,
|
||||
[ --disable-zend-signals whether to enable zend signal handling],[
|
||||
[ --enable-zend-signals Use zend signal handling],[
|
||||
ZEND_SIGNALS=$enableval
|
||||
],[
|
||||
ZEND_SIGNALS=yes
|
||||
ZEND_SIGNALS=no
|
||||
])
|
||||
|
||||
AC_CHECK_FUNC(sigaction, [
|
||||
|
||||
+8
-13
@@ -17,20 +17,11 @@ function test3($a, $b) {
|
||||
|
||||
test1();
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -47,10 +38,14 @@ echo "Done\n";
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(1)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s001.php on line 27 and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
|
||||
+19
-12
@@ -23,19 +23,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -70,7 +62,14 @@ int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
@@ -85,7 +84,15 @@ bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s002.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
|
||||
+12
-12
@@ -18,19 +18,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -55,7 +47,10 @@ array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
@@ -64,7 +59,12 @@ array(2) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
+37
-1
@@ -31,4 +31,40 @@ $test->bar();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot re-assign $this in %s030.php on line 11
|
||||
object(Exception)#%d (7) {
|
||||
["message":protected]=>
|
||||
string(3) "foo"
|
||||
["string":"Exception":private]=>
|
||||
string(0) ""
|
||||
["code":protected]=>
|
||||
int(0)
|
||||
["file":protected]=>
|
||||
string(%d) "%s030.php"
|
||||
["line":protected]=>
|
||||
int(%d)
|
||||
["trace":"Exception":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s030.php"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(3) "bar"
|
||||
["class"]=>
|
||||
string(3) "foo"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
["previous":"Exception":private]=>
|
||||
NULL
|
||||
}
|
||||
'test' => '0'
|
||||
'test_2' => '1'
|
||||
'test_3' => '2'
|
||||
ok
|
||||
@@ -38,19 +38,11 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
@@ -19,13 +19,8 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Exception: Unsupported operand types
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
closure binding to anonymous class
|
||||
--FILE--
|
||||
<?php
|
||||
$class = new class {};
|
||||
$foo = function() {
|
||||
return $this;
|
||||
};
|
||||
|
||||
$closure = Closure::bind($foo, $class, $class);
|
||||
var_dump($closure());
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
anonymous class trait binding
|
||||
--FILE--
|
||||
<?php
|
||||
trait TaskTrait {
|
||||
function run() {
|
||||
return 'Running...';
|
||||
}
|
||||
}
|
||||
$class = new class() {
|
||||
use TaskTrait;
|
||||
};
|
||||
var_dump($class->run());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "Running..."
|
||||
@@ -154,7 +154,7 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
$x = $a ? $b : $c;
|
||||
$x = $a ?: $c;
|
||||
$x = $a ?? $b;
|
||||
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
|
||||
list($a, $b, $c) = [1, 2 => 'x', 'z' => 'c'];
|
||||
@foo();
|
||||
$y = clone $x;
|
||||
yield 1 => 2;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Misoptimization when variable is modified by assert()
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$i = 0;
|
||||
assert('$i = new stdClass');
|
||||
$i += 1;
|
||||
var_dump($i);
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
int(2)
|
||||
@@ -1,56 +0,0 @@
|
||||
--TEST--
|
||||
Various null return conditions of dim/obj assignments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$array = [PHP_INT_MAX => 42];
|
||||
$true = true;
|
||||
|
||||
var_dump($array[] = 123);
|
||||
var_dump($array[[]] = 123);
|
||||
var_dump($array[new stdClass] = 123);
|
||||
var_dump($true[123] = 456);
|
||||
|
||||
var_dump($array[] += 123);
|
||||
var_dump($array[[]] += 123);
|
||||
var_dump($array[new stdClass] += 123);
|
||||
var_dump($true[123] += 456);
|
||||
|
||||
var_dump($true->foo = 123);
|
||||
var_dump($true->foo += 123);
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -6,16 +6,9 @@ $a = new stdClass();
|
||||
$x = "";
|
||||
$a->$x = "string('')";
|
||||
var_dump($a);
|
||||
$a->{"\0"} = 42;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#1 (1) {
|
||||
[""]=>
|
||||
string(10) "string('')"
|
||||
}
|
||||
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %sbug29015.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
thrown in %sbug29015.php on line 4
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29368.1 (The destructor is called when an exception is thrown from the constructor).
|
||||
--FILE--
|
||||
<?php
|
||||
function throwme($arg)
|
||||
{
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
class foo {
|
||||
function __construct() {
|
||||
echo "Inside constructor\n";
|
||||
throwme($this);
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
echo "Inside destructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$bar = new foo;
|
||||
} catch(Exception $exc) {
|
||||
echo "Caught exception!\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Inside constructor
|
||||
Caught exception!
|
||||
@@ -3,7 +3,7 @@ Bug #29883 (isset gives invalid values on strings)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = "bug";
|
||||
var_dump(isset($x[-10]));
|
||||
var_dump(isset($x[-1]));
|
||||
var_dump(isset($x["1"]));
|
||||
echo $x["1"]."\n";
|
||||
?>
|
||||
|
||||
@@ -18,7 +18,7 @@ var_dump(isset($a['b']));
|
||||
$simpleString = "Bogus String Text";
|
||||
echo isset($simpleString->wrong)?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[-20])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[-1])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[0])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["0"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["16"])?"ok\n":"bug\n";
|
||||
|
||||
@@ -19,19 +19,15 @@ function NormalTest($a)
|
||||
echo "Hi!";
|
||||
}
|
||||
|
||||
try {
|
||||
NormalTest();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
try {
|
||||
FooTest();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
NormalTest();
|
||||
FooTest();
|
||||
FooTest(new Foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
|
||||
Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
|
||||
Hello!
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Hi!
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): FooTest()
|
||||
#1 {main}
|
||||
thrown in %sbug33996.php on line %d
|
||||
@@ -43,9 +43,7 @@ Non-static method A::A_ftk() should not be called statically
|
||||
1 %sbug38047.php:13 get_error_context()
|
||||
2 %sbug38047.php:36 kalus_error_handler()
|
||||
|
||||
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
|
||||
Stack trace:
|
||||
#0 %sbug38047.php(36): A::A_ftk()
|
||||
#1 {main}
|
||||
thrown in %sbug38047.php on line 7
|
||||
Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
|
||||
1 %sbug38047.php:13 get_error_context()
|
||||
2 %sbug38047.php:7 kalus_error_handler()
|
||||
3 %sbug38047.php:36 A_ftk()
|
||||
@@ -9,7 +9,7 @@ $foo[0]->bar = "xyz";
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an object in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an array in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -7,7 +7,7 @@ $b = &$a[1];
|
||||
$b = "f";
|
||||
echo $a;
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets nor overloaded objects in %sbug49866.php:3
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug49866.php on line 3
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
unset($a->$prop);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__unset('\x00')
|
||||
#0 %s(%d): A->__unset('')
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
$a->$prop = 2;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__set('\x00', 2)
|
||||
#0 %s(%d): A->__set('', 2)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
var_dump($a->$prop);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__get('\x00')
|
||||
#0 %s(%d): A->__get('')
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -8,7 +8,7 @@ class MyClass {
|
||||
$this->myRef = $value;
|
||||
}
|
||||
}
|
||||
$myGlobal=new MyClass();
|
||||
$myGlobal=new MyClass($myGlobal);
|
||||
$myGlobal->myRef=&$myGlobal;
|
||||
$myGlobal->myNonExistentProperty="ok\n";
|
||||
echo $myGlobal;
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
--TEST--
|
||||
Bug #53432: Assignment via string index access on an empty string converts to array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = '';
|
||||
var_dump($str[0] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str[5] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str[-1] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str['foo'] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[] = 'a');
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[0] += 1);
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[0][0] = 'a');
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
string(6) " a"
|
||||
|
||||
Warning: Illegal string offset: -1 in %s on line %d
|
||||
NULL
|
||||
string(0) ""
|
||||
|
||||
Warning: Illegal string offset 'foo' in %s on line %d
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
Error: [] operator not supported for strings
|
||||
string(0) ""
|
||||
Error: Cannot use assign-op operators with string offsets
|
||||
string(0) ""
|
||||
Error: Cannot use string offset as an array
|
||||
string(0) ""
|
||||
@@ -6,7 +6,7 @@ function f(callable $c) {}
|
||||
f();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): f()
|
||||
#1 {main}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62814: It is possible to stiffen child class members visibility
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private function test() { }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
protected function test() { }
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
private function test() { }
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to C::test() must be protected (as in class B) or weaker in %s on line %d
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #63734 (Garbage collector can free zvals that are still referenced)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
|
||||
@@ -57,13 +57,8 @@ $bar = foo3();
|
||||
string(9) "not catch"
|
||||
NULL
|
||||
|
||||
Fatal error: Uncaught Exception: not catched in %sbug65784.php:42
|
||||
Fatal error: Uncaught Error: Class 'NotExists' not found in %sbug65784.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug65784.php(52): foo3()
|
||||
#0 %s(%d): foo3()
|
||||
#1 {main}
|
||||
|
||||
Next Error: Class 'NotExists' not found in %sbug65784.php:46
|
||||
Stack trace:
|
||||
#0 %sbug65784.php(52): foo3()
|
||||
#1 {main}
|
||||
thrown in %sbug65784.php on line 46
|
||||
thrown in %sbug65784.php on line %d
|
||||
@@ -13,4 +13,6 @@ $x = $c->test();
|
||||
print_r($x);
|
||||
unset($c, $x);
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot unset $this in %sbug68370.php on line 4
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -28,7 +28,6 @@ class Bar {
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if (!isset(self::$instance)) return;
|
||||
Foo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69534 (Cycle leaks through declared properties on internal classes)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class Node extends SplObjectStorage {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
const A = 'Foo::A';
|
||||
const B = self::A . ' and ' . self::C;
|
||||
const C = 'Foo::C';
|
||||
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
const A = 'Bar::A';
|
||||
const C = 'Bar::C';
|
||||
}
|
||||
|
||||
var_dump(Bar::B);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(17) "Foo::A and Foo::C"
|
||||
@@ -1,69 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class P {
|
||||
const N = 'P';
|
||||
}
|
||||
class A extends P {
|
||||
const selfN = self::N;
|
||||
const parentN = parent::N;
|
||||
const N = 'A';
|
||||
}
|
||||
class B extends A {
|
||||
const N = 'B';
|
||||
}
|
||||
|
||||
var_dump(B::selfN); // A
|
||||
var_dump(B::parentN); // P
|
||||
|
||||
class A2 {
|
||||
const selfN = self::N;
|
||||
const N = 'A2';
|
||||
}
|
||||
class B2 extends A2 {
|
||||
const indSelfN = self::selfN;
|
||||
const N = 'B2';
|
||||
}
|
||||
class C2 extends B2 {
|
||||
const N = 'C2';
|
||||
}
|
||||
|
||||
var_dump(C2::indSelfN); // A2
|
||||
|
||||
class A3 {
|
||||
const selfN = self::N;
|
||||
const N = 'A3';
|
||||
}
|
||||
class B3 extends A3 {
|
||||
const exprSelfN = "expr" . self::selfN;
|
||||
const N = 'B3';
|
||||
}
|
||||
class C3 extends B3 {
|
||||
const N = 'C3';
|
||||
}
|
||||
|
||||
var_dump(C3::exprSelfN); // exprA3
|
||||
|
||||
class A4 {
|
||||
const selfN = self::N;
|
||||
const N = 'A4';
|
||||
}
|
||||
class B4 extends A4 {
|
||||
const N = 'B4';
|
||||
public $prop = self::selfN;
|
||||
}
|
||||
class C4 extends B4 {
|
||||
const N = 'C4';
|
||||
}
|
||||
|
||||
var_dump((new C4)->prop); // A4
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
string(1) "P"
|
||||
string(2) "A2"
|
||||
string(6) "exprA3"
|
||||
string(2) "A4"
|
||||
@@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
|
||||
var_dump($r->getParameters()[0]->getName());
|
||||
var_dump($r->getParameters()[0]->getClass());
|
||||
echo $r->getParameters()[0], "\n";
|
||||
echo $r->getReturnType()->getName(), "\n";
|
||||
echo $r->getReturnType(),"\n";
|
||||
echo $r,"\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Collection of some cycles on unfinished generators
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// CV
|
||||
function gen1() {
|
||||
$gen = yield;
|
||||
yield;
|
||||
}
|
||||
|
||||
$gen = gen1();
|
||||
$gen->send($gen);
|
||||
|
||||
// This
|
||||
class Test {
|
||||
public $gen;
|
||||
public function gen2() {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->gen = $test->gen2();
|
||||
|
||||
// Closure object
|
||||
$gen3 = (function() use (&$gen3) {
|
||||
yield;
|
||||
})();
|
||||
|
||||
// Yield from array
|
||||
function gen4() {
|
||||
yield from [yield];
|
||||
}
|
||||
|
||||
$gen = gen4();
|
||||
$gen->send($gen);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Generator cycle collection edge cases
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// Extra args
|
||||
function gen1() {
|
||||
yield;
|
||||
}
|
||||
$obj = new stdClass;
|
||||
$obj->gen = gen1($obj);
|
||||
|
||||
// Symtable
|
||||
function gen2() {
|
||||
$varName = 'a';
|
||||
$$varName = yield;
|
||||
yield;
|
||||
}
|
||||
$gen = gen2();
|
||||
$gen->send($gen);
|
||||
|
||||
// Symtable indirect
|
||||
function gen3() {
|
||||
$varName = 'a';
|
||||
$$varName = 42;
|
||||
$var = yield;
|
||||
yield;
|
||||
}
|
||||
$gen = gen3();
|
||||
$gen->send($gen);
|
||||
|
||||
// Yield from root
|
||||
function gen4() {
|
||||
yield from yield;
|
||||
}
|
||||
$gen = gen4();
|
||||
$gen2 = gen4($gen);
|
||||
$gen2->send([1, 2, 3]);
|
||||
$gen->send($gen2);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -34,4 +34,4 @@ try {
|
||||
string(36) "Cannot use string offset as an array"
|
||||
string(27) "Cannot unset string offsets"
|
||||
string(41) "Only variables can be passed by reference"
|
||||
string(41) "Cannot increment/decrement string offsets"
|
||||
string(64) "Cannot increment/decrement overloaded objects nor string offsets"
|
||||
@@ -53,27 +53,43 @@ string(3) "1st"
|
||||
string(3) "2nd"
|
||||
NULL
|
||||
string(3) "4th"
|
||||
array(3) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(3) "1st"
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(2) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(2) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(1) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
NULL
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
|
||||
@@ -19,8 +19,4 @@ try {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
|
||||
Stack trace:
|
||||
#0 %sbug70689.php(12): foo()
|
||||
#1 {main}
|
||||
thrown in %sbug70689.php on line 3
|
||||
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70918 (Segfault using static outside of class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
static::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
parent::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
self::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
new static;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
static::x();
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
static::$i;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access parent:: when no class scope is active"
|
||||
string(50) "Cannot access self:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71196 (Memory leak with out-of-order live ranges)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$a = "1";
|
||||
[1, (y().$a.$a) . ($a.$a)];
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(30) "Call to undefined function y()"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71266 (Missing separation of properties HT in foreach etc)
|
||||
--FILE--
|
||||
<?php
|
||||
$one = 1;
|
||||
$two = 2;
|
||||
$arr = ['foo' => $one, 'bar' => $two];
|
||||
$obj = (object) $arr;
|
||||
foreach ($obj as $val) {
|
||||
var_dump($val);
|
||||
$obj->bar = 42;
|
||||
}
|
||||
|
||||
$arr = ['foo' => $one, 'bar' => $two];
|
||||
$obj = (object) $arr;
|
||||
next($obj);
|
||||
var_dump(current($arr));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(42)
|
||||
int(1)
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
bug #71428.1: inheritance with null default values
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
@@ -9,5 +11,5 @@ class B extends A {
|
||||
public function m(array $a = []) {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 7
|
||||
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(array $a = NULL) in %sbug71428.1.php on line 7
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
bug #71428: Validation type inheritance with = NULL
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A { }
|
||||
@@ -7,5 +9,5 @@ class B { public function m(A $a = NULL, $n) { echo "B.m";} };
|
||||
class C extends B { public function m(A $a , $n) { echo "C.m";} };
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4
|
||||
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(A $a = NULL, $n) in %sbug71428.3.php on line 4
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array[0] =& $array[''];
|
||||
$array[0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.1 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = (object)['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6,'g'=>7];
|
||||
$x->h =& $x->i;
|
||||
$x->h = 42;
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (9) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
int(2)
|
||||
["c"]=>
|
||||
int(3)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["e"]=>
|
||||
int(5)
|
||||
["f"]=>
|
||||
int(6)
|
||||
["g"]=>
|
||||
int(7)
|
||||
["i"]=>
|
||||
&int(42)
|
||||
["h"]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.2 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [0,1,2,3,4,5,6];
|
||||
$a[200] =& $a[100];
|
||||
$a[100] =42;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(9) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
[5]=>
|
||||
int(5)
|
||||
[6]=>
|
||||
int(6)
|
||||
[100]=>
|
||||
&int(42)
|
||||
[200]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.3 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array[0][0] =& $array[''];
|
||||
$array[0][0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.4 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [0=>[]];
|
||||
$array[0][0] =& $array[0][''];
|
||||
$array[0][0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array['']->prop =& $array[0];
|
||||
$array[0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
&int(42)
|
||||
[""]=>
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$name = 'a';
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
if ($name != 'i') {
|
||||
$$name =& $GLOBALS;
|
||||
}
|
||||
$name++;
|
||||
}
|
||||
?>
|
||||
OK
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71572: String offset assignment from an empty string inserts null byte
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "abc";
|
||||
var_dump($str{0} = "");
|
||||
var_dump($str{1} = "");
|
||||
var_dump($str{3} = "");
|
||||
var_dump($str{10} = "");
|
||||
var_dump($str);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
string(3) "abc"
|
||||
==DONE==
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71818 (Memory leak when array altered in destructor)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class MemoryLeak
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->things[] = $this;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->things[] = null;
|
||||
}
|
||||
|
||||
private $things = [];
|
||||
}
|
||||
|
||||
ini_set('memory_limit', '10M');
|
||||
|
||||
for ($i = 0; $i < 100000; ++$i) {
|
||||
$obj = new MemoryLeak();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72107: Segfault when using func_get_args as error handler
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler('func_get_args');
|
||||
function test($a) {
|
||||
echo $undef;
|
||||
}
|
||||
test(1);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot call func_get_args() dynamically in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef in %s on line %d
|
||||
@@ -14,6 +14,5 @@ class Hello implements Foo {
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d
|
||||
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -7,4 +7,4 @@ $var11 = new StdClass();
|
||||
$var16 = error_reporting($var11);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
||||
--FILE--
|
||||
<?php
|
||||
class Child
|
||||
{
|
||||
protected $bar;
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->bar = null;
|
||||
}
|
||||
}
|
||||
|
||||
class Parnt
|
||||
{
|
||||
protected $child;
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
$this->child = new Child();
|
||||
|
||||
$prop = new \ReflectionProperty($this, 'child');
|
||||
$prop->setAccessible(true);
|
||||
$prop->setValue($this, null);
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Parnt();
|
||||
$p->doSomething();
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private $bar = 'bar';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
unset($this->bar);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
private $baz = 'baz';
|
||||
private static $tab = 'tab';
|
||||
|
||||
public function __get(string $name)
|
||||
{
|
||||
var_dump($this->baz);
|
||||
var_dump(self::$tab);
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
$r = new ReflectionProperty(Foo::class, 'bar');
|
||||
|
||||
$r->setAccessible(true);
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72188 (Nested try/finally blocks losing return value)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
try {
|
||||
return 5;
|
||||
} finally {
|
||||
try {
|
||||
echo 1;
|
||||
} finally {
|
||||
echo 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$a = test();
|
||||
if($a !== 5) {
|
||||
echo "FAILED: expected 5, received ", var_export($a), PHP_EOL;
|
||||
} else {
|
||||
echo "Passed", PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
12Passed
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$a = 1;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.1 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test(&$b) {
|
||||
$a =& $b;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
$x = 1;
|
||||
$y =& test($x);
|
||||
var_dump($y);
|
||||
$x = 3;
|
||||
var_dump($y);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.1 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test(&$b) {
|
||||
$a =& $b;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a =& $c;
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
$x = 1;
|
||||
$y =& test($x);
|
||||
var_dump($y);
|
||||
$x = 3;
|
||||
var_dump($y);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(3)
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.3 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test() {
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72216 (Return by reference with finally is not memory safe)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test() {
|
||||
$a = ["ok"];
|
||||
try {
|
||||
return $a[0];
|
||||
} finally {
|
||||
$a[""] = 42;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "ok"
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72221 (Segmentation fault in stream_get_line / zend_memnstr_ex)
|
||||
--FILE--
|
||||
<?php
|
||||
$fp = fopen("php://memory", "r+");
|
||||
fwrite($fp, str_repeat("baad", 1024*1024));
|
||||
rewind($fp);
|
||||
stream_get_line($fp, 1024*1024*2, "aaaa");
|
||||
echo "Done\n";
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Misoptimize due to type narrowing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$b = false;
|
||||
$x = (1<<53)+1;
|
||||
do {
|
||||
$x = 1.0 * ($x - (1<<53));
|
||||
} while ($b);
|
||||
return $x;
|
||||
}
|
||||
var_dump(test());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
float(1)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72347 (VERIFY_RETURN type casts visible in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() : int {
|
||||
$d = 1.5;
|
||||
try {
|
||||
return $d;
|
||||
} finally {
|
||||
var_dump($d);
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
float(1.5)
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72373: TypeError after Generator function w/declared return type finishes
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo() : Generator {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
}
|
||||
|
||||
foreach (foo() as $bar) {
|
||||
echo $bar . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72395 (list() regression)
|
||||
--FILE--
|
||||
<?php
|
||||
list(,,$a,,$b,) = array(1, 2, 3, 4, 5, 6);
|
||||
var_dump($a, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(5)
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72441 (Segmentation fault: RFC list_keys)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [];
|
||||
|
||||
list(
|
||||
'' => $foo,
|
||||
$bar
|
||||
) = $array;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot mix keyed and unkeyed array entries in assignments in %sbug72441.php on line %d
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
function create_references(&$array) {
|
||||
foreach ($array as $key => $value) {
|
||||
create_references($array[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
function change_copy($copy) {
|
||||
$copy['b']['z']['z'] = $copy['b'];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'a' => [
|
||||
'b' => [],
|
||||
],
|
||||
];
|
||||
|
||||
create_references($data);
|
||||
|
||||
$copy = $data['a'];
|
||||
var_dump($copy);
|
||||
|
||||
change_copy($copy);
|
||||
var_dump($copy); //RECURSION
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["b"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
["b"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.1 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [];
|
||||
$arr[0] = null;
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
$arr[0][0] = $arr[0];
|
||||
var_dump($arr);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.2 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [];
|
||||
$arr[0] = null;
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
$arr[0][$arr[0]] = null;
|
||||
var_dump($arr);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[""]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.3 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = new stdClass;
|
||||
$x->a = 1;
|
||||
$ref =& $x->a;
|
||||
unset($ref);
|
||||
var_dump($x->a + ($x->a = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.4 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.5 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72598 (Reference is lost after array_slice())
|
||||
--FILE--
|
||||
<?php
|
||||
function ref(&$ref) {
|
||||
var_dump($ref);
|
||||
}
|
||||
|
||||
new class {
|
||||
function __construct() {
|
||||
$args = [&$this];
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$a = array_slice($args, 0, 1);
|
||||
call_user_func_array('ref', $a);
|
||||
}
|
||||
}
|
||||
};
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72598.2 (Reference is lost after array_slice())
|
||||
--FILE--
|
||||
<?php
|
||||
function ref(&$ref) {
|
||||
var_dump($ref);
|
||||
$ref = 1;
|
||||
}
|
||||
|
||||
new class {
|
||||
function __construct() {
|
||||
$b = 0;
|
||||
$args = [&$b];
|
||||
unset($b);
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$a = array_slice($args, 0, 1);
|
||||
call_user_func_array('ref', $a);
|
||||
}
|
||||
}
|
||||
};
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
|
||||
int(0)
|
||||
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
|
||||
int(0)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72918 (negative offset inside a quoted string leads to parse error)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [-3 => 'foo'];
|
||||
$string = 'abcde';
|
||||
|
||||
echo "$array[-3]\n";
|
||||
echo "$string[-3]\n";
|
||||
echo <<<EOT
|
||||
$array[-3]
|
||||
$string[-3]
|
||||
|
||||
EOT;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
foo
|
||||
c
|
||||
foo
|
||||
c
|
||||
===DONE===
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73288 (Segfault in __clone > Exception.toString > __get)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class NoClone {
|
||||
public function __clone() {
|
||||
throw new Exception("No Cloneable");
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __get($name) {
|
||||
return new NoClone;
|
||||
}
|
||||
}
|
||||
|
||||
function test_clone() {
|
||||
$c = new C;
|
||||
$b = clone $c->x;
|
||||
}
|
||||
|
||||
test_clone();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: No Cloneable in %sbug73288.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): NoClone->__clone()
|
||||
#1 %s(%d): test_clone()
|
||||
#2 {main}
|
||||
thrown in %sbug73288.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #73900: Use After Free in unserialize() SplFixedArray
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $a;
|
||||
$c = &$b[0];
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
if (PHP_ZTS) die("skip only for no-zts build");
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=1G
|
||||
max_execution_time=1
|
||||
hard_timeout=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a1 = range(1, 1000000);
|
||||
$a2 = range(100000, 1999999);
|
||||
array_intersect($a1, $a2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Maximum execution time of 1+1 seconds exceeded %s
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
set_error_handler(function ($type, $msg) {
|
||||
throw new \Exception($msg);
|
||||
});
|
||||
|
||||
call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Parameter 1 to Foo\{closure}() expected to be a reference, value given in %sbug74164.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: Foo\{closure}(%s)
|
||||
#1 %sbug74164.php(%d): call_user_func(%s)
|
||||
#2 {main}
|
||||
thrown in %sbug74164.php on line %d
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74340: Magic function __get has different behavior in php 7.1.x
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
public function __get($var)
|
||||
{
|
||||
static $first = true;
|
||||
echo '__get '.$var.PHP_EOL;
|
||||
if ($first) {
|
||||
$first = false;
|
||||
$this->$var;
|
||||
$this->{$var.'2'};
|
||||
$this->$var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->test;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
__get test
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
||||
__get test2
|
||||
|
||||
Notice: Undefined property: Test::$test in %s on line %d
|
||||
Loaded 100 of 1872 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user