Skip to content

Commit 0f9f0c0

Browse files
author
George Wang
committed
Merge branch 'master' of git.php.net:php-src
2 parents dce692d + 8904fbc commit 0f9f0c0

File tree

222 files changed

+9857
-6397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+9857
-6397
lines changed

NEWS

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 20??, PHP 7.0.0
44

5-
-Fileinfo:
6-
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
7-
85
- CLI server:
96
. Refactor MIME type handling to use a hash table instead of linear search.
107
(Adam)
@@ -22,35 +19,42 @@ PHP NEWS
2219
. Implemented the RFC `Catchable "Call to a member function bar() on a
2320
non-object"` (Timm)
2421

25-
- Reflection
26-
. Fixed inheritance chain of Reflector interface (Tjerk)
27-
2822
- DBA:
2923
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
3024

31-
- FPM:
32-
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
33-
34-
- Standard:
35-
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
36-
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
37-
. Added intdiv() function. (Andrea)
38-
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
39-
40-
- XSL:
41-
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
25+
- DOM:
26+
. Made DOMNode::textContent writeable. (Tjerk)
4227

4328
- GD:
4429
. Made fontFetch's path parser thread-safe. (Sara)
4530

31+
- Fileinfo:
32+
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
33+
34+
- FPM:
35+
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
36+
37+
- Reflection
38+
. Fixed inheritance chain of Reflector interface (Tjerk)
39+
4640
- Session:
4741
. Fixed bug #67694 (Regression in session_regenerate_id()). (Tjerk)
4842

43+
- SOAP:
44+
. Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
45+
(Laruence)
46+
4947
- SPL:
5048
. Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags
5149
nor curruption state). (Julien)
5250

53-
- DOM:
54-
. Made DOMNode::textContent writeable. (Tjerk)
51+
- Standard:
52+
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
53+
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
54+
. Added intdiv() function. (Andrea)
55+
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
56+
57+
- XSL:
58+
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
5559

5660
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

README.TESTING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ [email protected]
123123
TMPDIR=/var/tmp
124124
TODAY=`date +"%Y%m%d"`
125125

126-
# Make sure compilation enviroment is correct
126+
# Make sure compilation environment is correct
127127
CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
128128
export MAKE=gmake
129129
export CC=gcc

TSRM/tsrm_win32.c

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,35 @@ TSRM_API void tsrm_win32_shutdown(void)
106106
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
107107
{
108108
PSID pSid = TWG(impersonation_token_sid);
109-
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
110109
TCHAR *ptcSid = NULL;
111110
char *bucket_key = NULL;
111+
size_t ptc_sid_len, pathname_len;
112+
113+
pathname_len = strlen(pathname);
112114

113115
if (!pSid) {
114-
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
116+
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
115117
if (!bucket_key) {
116118
return NULL;
117119
}
118-
memcpy(bucket_key, pathname, strlen(pathname));
120+
memcpy(bucket_key, pathname, pathname_len);
119121
return bucket_key;
120122
}
121123

122124
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
123125
return NULL;
124126
}
125127

126-
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
128+
129+
ptc_sid_len = strlen(ptcSid);
130+
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + ptc_sid_len + 1);
127131
if (!bucket_key) {
128132
LocalFree(ptcSid);
129133
return NULL;
130134
}
131135

132-
memcpy(bucket_key, ptcSid, strlen(ptcSid));
133-
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
136+
memcpy(bucket_key, ptcSid, ptc_sid_len);
137+
memcpy(bucket_key + ptc_sid_len, pathname, pathname_len + 1);
134138

135139
LocalFree(ptcSid);
136140
return bucket_key;
@@ -139,11 +143,8 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
139143

140144
PSID tsrm_win32_get_token_sid(HANDLE hToken)
141145
{
142-
BOOL bSuccess = FALSE;
143146
DWORD dwLength = 0;
144147
PTOKEN_USER pTokenUser = NULL;
145-
PSID sid;
146-
PSID *ppsid = &sid;
147148
DWORD sid_len;
148149
PSID pResultSid = NULL;
149150

@@ -204,7 +205,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
204205
BYTE * psec_desc = NULL;
205206
BOOL fAccess = FALSE;
206207

207-
BOOL bucket_key_alloc = FALSE;
208208
realpath_cache_bucket * bucket = NULL;
209209
char * real_path = NULL;
210210

@@ -242,7 +242,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
242242
was impersonating already, this function uses that impersonation context.
243243
*/
244244
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
245-
DWORD err = GetLastError();
246245
if (GetLastError() == ERROR_NO_TOKEN) {
247246
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
248247
TWG(impersonation_token) = NULL;
@@ -722,4 +721,52 @@ TSRM_API char *realpath(char *orig_path, char *buffer)
722721
return buffer;
723722
}
724723

724+
#if HAVE_UTIME
725+
static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
726+
{
727+
// Note that LONGLONG is a 64-bit value
728+
LONGLONG ll;
729+
730+
ll = Int32x32To64(t, 10000000) + 116444736000000000;
731+
pft->dwLowDateTime = (DWORD)ll;
732+
pft->dwHighDateTime = ll >> 32;
733+
}
734+
/* }}} */
735+
736+
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
737+
{
738+
FILETIME mtime, atime;
739+
HANDLE hFile;
740+
741+
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
742+
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
743+
744+
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
745+
the CreateFile operation succeeds */
746+
if (GetLastError() == ERROR_ALREADY_EXISTS) {
747+
SetLastError(0);
748+
}
749+
750+
if ( hFile == INVALID_HANDLE_VALUE ) {
751+
return -1;
752+
}
753+
754+
if (!buf) {
755+
SYSTEMTIME st;
756+
GetSystemTime(&st);
757+
SystemTimeToFileTime(&st, &mtime);
758+
atime = mtime;
759+
} else {
760+
UnixTimeToFileTime(buf->modtime, &mtime);
761+
UnixTimeToFileTime(buf->actime, &atime);
762+
}
763+
if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
764+
CloseHandle(hFile);
765+
return -1;
766+
}
767+
CloseHandle(hFile);
768+
return 1;
769+
}
770+
/* }}} */
771+
#endif
725772
#endif

TSRM/tsrm_win32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
#include "TSRM.h"
2525
#include <windows.h>
26+
#if HAVE_UTIME
27+
# include <sys/utime.h>
28+
#endif
2629

2730
struct ipc_perm {
2831
int key;

UPGRADING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ PHP X.Y UPGRADE NOTES
126126
========================================
127127

128128
- Core
129-
. Instead of being undefined and platform-dependant, NaN and Infinity will
129+
. Instead of being undefined and platform-dependent, NaN and Infinity will
130130
always be zero when casted to integer.
131131
. Calling a method on a non-object no longer raises a fatal error; see
132132
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object

UPGRADING.INTERNALS

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PHP 7.0 INTERNALS UPGRADE NOTES
99
h. HashTable API
1010
i. New portable macros for large file support
1111
j. New portable macros for integers
12+
k. get_class_entry object handler info
13+
l. get_class_name object handler info
14+
m. Other portable macros info
1215

1316
2. Build system changes
1417
a. Unix build system changes
@@ -110,8 +113,34 @@ PHP 7.0 INTERNALS UPGRADE NOTES
110113
The handler is now obligatory, no longer accepts a `parent` argument and
111114
must return a non-NULL zend_string*, which will be released by the caller.
112115

116+
m. Other portable macros info
117+
118+
ZEND_SECURE_ZERO - zeroes chunk of memory
119+
ZEND_VALID_SOCKET - validates a php_socket_t variable
120+
121+
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
122+
ZEND_NORETURN is defined as __declspec(noreturn) on VS
123+
113124
========================
114125
2. Build system changes
115126
========================
116127

117-
128+
a. Unix build system changes
129+
130+
b. Windows build system changes
131+
132+
- Besides Visual Studio, building with Clang or Intel Composer is now
133+
possible. To enable an alternative toolset, add the option
134+
--with-toolset=[vs,clang,icc] to the configure line. The default
135+
toolset is vs. Still clang or icc need the correct environment
136+
which involves many tools from the vs toolset.
137+
138+
The toolset option is supported by phpize as well.
139+
140+
AWARENESS The only recommended and supported toolset to produce production
141+
ready binaries is Visual Studio. Still other compilers can be used now for
142+
testing and analyzing purposes.
143+
144+
- configure.js now produces response files which are passed to the linker
145+
and library manager. This solves the issues with the long command lines
146+
which can exceed the OS limit.

Zend/ZEND_CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ Changes in the Zend Engine 1.0
11031103
Use ob_start() to begin output buffering, ob_end_flush() to end
11041104
buffering and send out the buffered contents, ob_end_clean() to
11051105
end buffering without sending the buffered contents, and
1106-
ob_get_contents() to retreive the current contents of the output
1106+
ob_get_contents() to retrieve the current contents of the output
11071107
buffer. Header information (header(), content type, cookies) are
11081108
not buffered. By turning on output buffering, you can
11091109
effectively send header information all throughout your file,

Zend/tests/bug21478.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ stream_filter_append($fp, "myfilter");
2727
fwrite($fp, "This is a test.\n");
2828
print "Done.\n";
2929
fclose($fp);
30-
// Uncommenting the following 'print' line causes the segfault to stop occuring
30+
// Uncommenting the following 'print' line causes the segfault to stop occurring
3131
// print "2\n";
3232
readfile(dirname(__FILE__)."/test.txt");
3333
unlink(dirname(__FILE__)."/test.txt");

Zend/tests/bug33512.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TheObj {
5353
unset($SomeObj->Virtual1);
5454
unset($SomeObj->{'Virtual'.(3)});
5555

56-
//but, these variables are still available??? eventhough they're "unset"-ed
56+
//but, these variables are still available??? even though they're "unset"-ed
5757
print $SomeObj->Virtual1."\n";
5858
print $SomeObj->{'Virtual'.(3)}."\n";
5959
?>

Zend/tests/bug38779_1.phpt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ include $filename;
3939

4040
echo "Done\n";
4141
?>
42+
--CLEAN--
43+
<?php
44+
45+
$filename = dirname(__FILE__)."/bug38779.txt";
46+
if (file_exists($filename)) {
47+
@unlink(dirname(__FILE__)."/bug38779.txt");
48+
}
49+
?>
4250
--EXPECTF--
4351
Parse error: %s error%sin %s on line %d
4452
string(6) "flush!"

Zend/tests/bug40809.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Bug #40809 (Poor perfomance of ".=")
2+
Bug #40809 (Poor performance of ".=")
33
--FILE--
44
<?php
55
error_reporting(E_ALL|E_STRICT);

Zend/tests/bug43200.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
2+
Bug #43200 (Interface implementation / inheritance not possible in abstract classes)
33
--FILE--
44
<?php
55

Zend/tests/bug43200_2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
2+
Bug #43200.2 (Interface implementation / inheritance not possible in abstract classes)
33
--FILE--
44
<?php
55

Zend/tests/bug68370.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #68370 "unset($this)" can make the program crash
3+
--FILE--
4+
<?php
5+
class C {
6+
public function test() {
7+
unset($this);
8+
return get_defined_vars();
9+
}
10+
}
11+
$c = new C();
12+
$x = $c->test();
13+
print_r($x);
14+
unset($c, $x);
15+
--EXPECTF--
16+
Array
17+
(
18+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Const class properties(runtime cache)
3+
--FILE--
4+
<?php
5+
class A {
6+
}
7+
8+
$a = new A;
9+
10+
echo "runtime\n";
11+
var_dump($a->{array()});
12+
var_dump($a->{1});
13+
var_dump($a->{function(){}});
14+
?>
15+
--EXPECTF--
16+
Notice: Array to string conversion in %sclass_properties_const.php on line %d
17+
runtime
18+
19+
Notice: Undefined property: A::$Array in %sclass_properties_const.php on line %d
20+
NULL
21+
22+
Notice: Undefined property: A::$1 in %sclass_properties_const.php on line %d
23+
NULL
24+
25+
Catchable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d

Zend/tests/debug_backtrace_with_include_and_this.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ set_error_handler(function($code, $msg, $file, $line) {
2323
});
2424

2525
try {
26-
(new CL())->load('class://non.existant.Class');
26+
(new CL())->load('class://non.existent.Class');
2727
} catch (CLException $e) {
2828
echo $e."\n";
2929
}
3030
--EXPECTF--
31-
ERR#2: include(class://non.existant.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
32-
ERR#2: include(): Failed opening 'class://non.existant.Class' for inclusion (include_path='%s') @ include
31+
ERR#2: include(class://non.existent.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
32+
ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
3333

34-
Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existant.Class' in %s
34+
Fatal error: Uncaught exception 'Exception' with message 'Failed loading class://non.existent.Class' in %s
3535
Stack trace:
3636
#0 %s(%d): CL->load('class://non.exi...')
3737
#1 {main}

Zend/tests/traits/bug54441.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class Boo {
1616

1717
?>
1818
--EXPECTF--
19-
Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statment in which the alias is defined. Error in %s on line %d
19+
Fatal error: The modifiers for the trait alias dontKnow() need to be changed in the same statement in which the alias is defined. Error in %s on line %d

0 commit comments

Comments
 (0)