mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de3cc93543 | ||
|
|
83b22e0f56 |
No files matched your search
@@ -1,57 +0,0 @@
|
||||
|
||||
version: "{branch}.build.{build}"
|
||||
|
||||
image: Visual Studio 2015
|
||||
|
||||
branches:
|
||||
except:
|
||||
- PHP-5.6
|
||||
- PHP-7.0
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- NEWS
|
||||
- UPGRADING*
|
||||
- README.*
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
- c:\build-cache\sdk -> .appveyor.yml
|
||||
|
||||
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.0beta1
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!"
|
||||
#PDO_MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_PASS: Password12!
|
||||
#PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!"
|
||||
#PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!"
|
||||
#build permutations
|
||||
matrix:
|
||||
- THREAD_SAFE: 0
|
||||
OPCACHE: 0
|
||||
- THREAD_SAFE: 1
|
||||
OPCACHE: 1
|
||||
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql95
|
||||
|
||||
platform:
|
||||
- x64
|
||||
# - x86
|
||||
|
||||
build_script:
|
||||
- appveyor\build.bat
|
||||
|
||||
test_script:
|
||||
- appveyor\test.bat
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -29,33 +29,22 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
set $cv_count = $cv_ex_ptr.func.op_array.last_var
|
||||
set $cv = $cv_ex_ptr.func.op_array.vars
|
||||
set $cv_idx = 0
|
||||
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
|
||||
|
||||
printf "Compiled variables count: %d\n\n", $cv_count
|
||||
while $cv_idx < $cv_count
|
||||
printf "[%d] '%s'\n", $cv_idx, $cv[$cv_idx].val
|
||||
set $zvalue = ((zval *) $cv_ex_ptr) + $callFrameSize + $cv_idx
|
||||
printzv $zvalue
|
||||
set $cv_idx = $cv_idx + 1
|
||||
end
|
||||
end
|
||||
|
||||
document print_cvs
|
||||
Prints the compiled variables and their values.
|
||||
If a zend_execute_data pointer is set this will print the compiled
|
||||
variables of that scope. If no parameter is used it will use
|
||||
current_execute_data for scope.
|
||||
|
||||
usage: print_cvs [zend_execute_data *]
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -207,17 +196,12 @@ define ____printzv_contents
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
set $ht = $zobj->properties
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -228,7 +212,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "not found"
|
||||
echo "no properties found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -471,9 +455,9 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
set $pi = $arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
@@ -492,27 +476,16 @@ define print_pi
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
print_zstr $pi->name
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_pi
|
||||
Takes a pointer to an object's property and prints the property information
|
||||
usage: print_pi <ptr>
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
if $argc > 2
|
||||
set $maxlen = $arg2
|
||||
else
|
||||
set $maxlen = 256
|
||||
end
|
||||
|
||||
printf "\""
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -581,23 +554,6 @@ document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define print_zstr
|
||||
set $zstr = (zend_string *)$arg0
|
||||
if $argc == 2
|
||||
set $maxlen = $arg1
|
||||
else
|
||||
set $maxlen = $zstr->len
|
||||
end
|
||||
printf "string(%d) ", $zstr->len
|
||||
____print_str $zstr->val $zstr->len $maxlen
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
document print_zstr
|
||||
print the length and contents of a zend string
|
||||
usage: print_zstr <ptr> [max length]
|
||||
end
|
||||
|
||||
define zbacktrace
|
||||
____executor_globals
|
||||
dump_bt $eg.current_execute_data
|
||||
@@ -610,6 +566,79 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
@@ -148,7 +148,6 @@ tests/*/*/*.sh
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
|
||||
+4
-4
@@ -108,8 +108,8 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_dblib
|
||||
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -132,7 +132,7 @@ STATUS: Working
|
||||
SINCE: 5.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdo_oci
|
||||
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
|
||||
PRIMARY MAINTAINER: Unknown
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
SINCE: 5.1
|
||||
@@ -286,7 +286,7 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2017 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2016 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ install-headers:
|
||||
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
|
||||
done; \
|
||||
$(mkinstalldirs) $$paths && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
if test "$(PHP_PECL_EXTENSION)"; then \
|
||||
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
|
||||
|
||||
+9
-12
@@ -93,27 +93,24 @@ Commit the changes to the main branch.
|
||||
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
|
||||
and build three tarballs (gz, bz2 and xz).
|
||||
|
||||
13. run ``scripts/dev/gen_verify_stub <version> [identity]``, this will sign the tarballs
|
||||
and output verification information to be included in announcement email
|
||||
|
||||
14. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
13. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
directory "downloads/". Copy them into there, so that the system can generate
|
||||
MD5 sums. If you do not have this directory, talk to Derick or Dan.
|
||||
|
||||
15. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
16. Once the release has been tagged, contact the PHP Windows development team
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be placed into the same directory as the source snapshots.
|
||||
|
||||
Getting the non stable release (alpha/beta/RC) announced
|
||||
--------------------------------------------------------
|
||||
|
||||
1. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
|
||||
lists pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release". Include in this information the verification
|
||||
information output by ``gen_verify_stub``.
|
||||
1. Send an email (see example here: http://news.php.net/php.internals/19486)
|
||||
**To** ``internals@lists.php.net`` and ``php-general@lists.php.net`` lists
|
||||
pointing out "the location of the release" and "the possible release date of
|
||||
either the next RC, or the final release".
|
||||
|
||||
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
|
||||
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
|
||||
@@ -193,8 +190,8 @@ Check if the pear files are updated (phar).
|
||||
This is to fetch the last commit id from php-distributions.git and commit this
|
||||
last commit id to web/php.git, then, mirrors will now sync
|
||||
|
||||
12. Once the release has been tagged, contact release managers, windows builders, and package maintainers
|
||||
so that they can build releases. Do not send this announcement to any public lists.
|
||||
12. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
@@ -5,7 +5,6 @@ This is the github mirror of the official PHP repository located at
|
||||
http://git.php.net.
|
||||
|
||||
[](http://travis-ci.org/php/php-src)
|
||||
[](https://ci.appveyor.com/project/php/php-src)
|
||||
|
||||
Pull Requests
|
||||
=============
|
||||
|
||||
+30
-27
@@ -66,7 +66,7 @@ dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
|
||||
AC_LINK_IFELSE([ AC_LANG_SOURCE([
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -80,11 +80,18 @@ int main() {
|
||||
int data = 1;
|
||||
pthread_mutexattr_init(&mattr);
|
||||
return pthread_create(&thd, NULL, thread_routine, &data);
|
||||
} ]) ], [
|
||||
pthreads_checked=yes
|
||||
} ], [
|
||||
pthreads_working=yes
|
||||
], [
|
||||
pthreads_checked=no
|
||||
]
|
||||
pthreads_working=no
|
||||
], [
|
||||
dnl For cross compiling running this test is of no use. NetWare supports pthreads
|
||||
pthreads_working=no
|
||||
case $host_alias in
|
||||
*netware*)
|
||||
pthreads_working=yes
|
||||
esac
|
||||
]
|
||||
) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
@@ -122,34 +129,30 @@ else
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_cflags=$flag
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_checked" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
|
||||
pthreads_working="yes"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save=$LIBS
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS=$ac_save
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_lib=$lib
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
threads_result="POSIX-Threads found"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+3
-19
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -622,12 +622,6 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
}
|
||||
} else {
|
||||
if (flags & IPC_EXCL) {
|
||||
if (shm_handle) {
|
||||
CloseHandle(shm_handle);
|
||||
}
|
||||
if (info_handle) {
|
||||
CloseHandle(info_handle);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -671,27 +665,17 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->descriptor->shm_atime = time(NULL);
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch++;
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
return shm->addr;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -442,8 +442,6 @@ Other
|
||||
- Curl:
|
||||
. Removed support for disabling the CURLOPT_SAFE_UPLOAD option. All curl file
|
||||
uploads must use the curl_file / CURLFile APIs.
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 5.6.25)
|
||||
|
||||
- Date:
|
||||
. Removed $is_dst parameter from mktime() and gmmktime().
|
||||
@@ -484,7 +482,6 @@ Other
|
||||
is defined in the interface.
|
||||
. session.lazy_write(default=On) INI setting enables only write session data when
|
||||
session data is updated.
|
||||
. session_regenerate_id() saves current $_SESSION before creating new session ID.
|
||||
|
||||
- Opcache
|
||||
. Removed opcache.load_comments configuration directive. Now doc comments
|
||||
@@ -518,10 +515,6 @@ Other
|
||||
- Stream:
|
||||
. Removed set_socket_blocking() in favor of its alias stream_set_blocking().
|
||||
|
||||
- XML:
|
||||
. xml_set_object() now requires to manually unset the $parser when finished,
|
||||
to avoid memory leaks.
|
||||
|
||||
- XSL:
|
||||
. Removed xsl.security_prefs ini option. Use XsltProcessor::setSecurityPrefs()
|
||||
instead.
|
||||
@@ -648,15 +641,6 @@ Other
|
||||
- debug_zval_dump
|
||||
It prints now "int" instead of "long", and "float" instead of "double".
|
||||
|
||||
- getenv()
|
||||
Since 7.0.9, getenv() has optional second parameter, making it only
|
||||
consider local environment and not SAPI environment if true.
|
||||
|
||||
- fopen()
|
||||
Since 7.0.16, mode 'e' was added, which sets the close-on-exec flag
|
||||
on the opened file descriptor. This mode is only available in PHP compiled on
|
||||
POSIX.1-2008 conform systems.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
@@ -727,22 +711,12 @@ out, that the corresponding SDK isn't available anymore.
|
||||
Mhash is not an extension anymore, use function_exists("mhash") to check whether
|
||||
it is avaliable.
|
||||
|
||||
- PDO_Firebird
|
||||
As of PHP 7.0.16, the fetched data for integer fields is aware of the Firebird
|
||||
datatypes. Previously all integers was fetched as strings, starting with the
|
||||
aforementioned PHP version integer fields are translated to the PHP integer
|
||||
datatype. The 64-bit integers are still fetched as strings in 32-bit PHP
|
||||
builds.
|
||||
|
||||
- GD
|
||||
The bundled libgd requires libwebp instead of libvpx for the WebP functionality.
|
||||
|
||||
- Openssl
|
||||
minimum supported OpenSSL version series was raised to 0.9.8
|
||||
|
||||
- Shmop
|
||||
The shmop identifiers have been changed from ints to resources of type shmop.
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
@@ -766,8 +740,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
. ZLIB_FINISH
|
||||
|
||||
- GD
|
||||
. IMG_WEBP (>= 7.0.10)
|
||||
|
||||
. T1Lib support removed, thus lifting the optional dependency on T1Lib, the
|
||||
following is therefore not available anymore:
|
||||
|
||||
@@ -784,14 +756,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
- 'gd PS font'
|
||||
- 'gd PS encoding'
|
||||
|
||||
- Zip
|
||||
. Filename encoding flags, as of 7.0.8
|
||||
- ZipArchive::FL_ENC_GUESS
|
||||
- ZipArchive::FL_ENC_RAW
|
||||
- ZipArchive::FL_ENC_STRICT
|
||||
- ZipArchive::FL_ENC_UTF_8
|
||||
- ZipArchive::FL_ENC_CP437
|
||||
|
||||
========================================
|
||||
11. Changes to INI File Handling
|
||||
========================================
|
||||
@@ -800,7 +764,6 @@ out, that the corresponding SDK isn't available anymore.
|
||||
. Removed asp_tags ini directive. Trying to enable it will result in a fatal
|
||||
error.
|
||||
. Removed always_populate_raw_post_data ini directive.
|
||||
. realpath_cache_size set to 4096k by default
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
@@ -844,7 +807,3 @@ out, that the corresponding SDK isn't available anymore.
|
||||
of aditional information with internal functions. In PHP-5 it was possible
|
||||
to use zend_function.op_array.reserved[] even for internal functions, but
|
||||
now we don't allocate extra space.
|
||||
|
||||
- CURL
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 7.0.10)
|
||||
+1
-1
@@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
|
||||
+8
-8
@@ -64,33 +64,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_DECL_ISNAN
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DECL_ISINF
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DECL_ISFINITE)
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_FINITE)
|
||||
#define zend_finite(a) finite(a)
|
||||
|
||||
@@ -26,6 +26,7 @@ var_dump(count(get_defined_constants()));
|
||||
function test () {
|
||||
}
|
||||
|
||||
var_dump(get_defined_functions(true));
|
||||
var_dump(gettype(get_defined_functions()));
|
||||
var_dump(count(get_defined_functions()));
|
||||
|
||||
@@ -64,6 +65,9 @@ NULL
|
||||
string(5) "array"
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
Warning: get_defined_functions() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
string(5) "array"
|
||||
int(%d)
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Array must be separated if unpacking by reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function inc(&... $args) {
|
||||
foreach ($args as &$arg) {
|
||||
$arg++;
|
||||
}
|
||||
}
|
||||
|
||||
$arr = [1, 2];
|
||||
$arr[] = 3;
|
||||
$arr2 = $arr;
|
||||
inc(...$arr);
|
||||
var_dump($arr);
|
||||
var_dump($arr2);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(2)
|
||||
[1]=>
|
||||
int(3)
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Next free element may overflow in array literals
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$i = PHP_INT_MAX;
|
||||
$array = [$i => 42, new stdClass];
|
||||
var_dump($array);
|
||||
|
||||
const FOO = [PHP_INT_MAX => 42, "foo"];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Assign to $this leaks when $this not defined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$this->a = new stdClass;
|
||||
} catch (Error $e) { echo $e->getMessage(), "\n"; }
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Using $this when not in object context
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
ZEND_POW_ASSIGN
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && ($a **= 2));
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Serialization of backtick literal is incorrect
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
assert_options(ASSERT_WARNING);
|
||||
assert(false && `echo -n ""`);
|
||||
--EXPECTF--
|
||||
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
|
||||
@@ -8,8 +8,7 @@ class Thing {}
|
||||
function boom()
|
||||
{
|
||||
$reader = xml_parser_create();
|
||||
$thing = new Thing();
|
||||
xml_set_object($reader, $thing);
|
||||
xml_set_object($reader, new Thing());
|
||||
die("ok\n");
|
||||
xml_parser_free($reader);
|
||||
}
|
||||
|
||||
@@ -10,4 +10,5 @@ class foo {
|
||||
$obj = new foo("Hello world");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use $this as parameter in %s on line %d
|
||||
Fatal error: Cannot re-assign $this in %sbug41117_1.php on line 3
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
bug #71428.1: inheritance with null default values
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
bug #71428.2: inheritance of ye olde dynamic interfaces
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('pdo')) die("skip PDO is not available"); ?>
|
||||
<?php if (!extension_loaded('pdo')) ?>
|
||||
--FILE--
|
||||
<?php
|
||||
interface StatementInterface {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
bug #71428: Validation type inheritance with = NULL
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A { }
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71737: Memory leak in closure with parameter named $this
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function method() {
|
||||
return function($this) {};
|
||||
}
|
||||
}
|
||||
|
||||
(new Test)->method()(new stdClass);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use $this as parameter in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
test($foo = new stdClass);
|
||||
var_dump($foo);
|
||||
test($bar = 2);
|
||||
var_dump($bar);
|
||||
test($baz = &$bar);
|
||||
var_dump($baz);
|
||||
|
||||
function test(&$param) {
|
||||
$param = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Notice: Only variables should be passed by reference in %s on line %d
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
|
||||
Notice: Only variables should be passed by reference in %s on line %d
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72057 (PHP hangs when user error handler throws exception after Notice from type coercion)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(
|
||||
function() {
|
||||
throw new Exception("My custom error");
|
||||
}
|
||||
);
|
||||
|
||||
(function (int $i) { bar(); })("7as");
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Uncaught Exception: My custom error in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array)
|
||||
#1 %s(%d): {closure}('7as')
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,85 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72101 (crash on complex code)
|
||||
--FILE--
|
||||
<?php
|
||||
class PHPUnit_Framework_MockObject_Stub_ReturnCallback {
|
||||
protected $callback;
|
||||
public function __construct($callback) {
|
||||
$this->callback = $callback;
|
||||
}
|
||||
public function invoke($invocation) {
|
||||
return call_user_func_array($this->callback, $invocation->parameters);
|
||||
}
|
||||
}
|
||||
|
||||
class PHPUnit_Framework_MockObject_InvocationMocker {
|
||||
protected $matchers = [];
|
||||
public function addMatcher( $matcher) {
|
||||
$this->matchers[] = $matcher;
|
||||
}
|
||||
public function invoke( $invocation) {
|
||||
foreach ($this->matchers as $match) {
|
||||
$match->invoked($invocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PHPUnit_Framework_MockObject_Matcher {
|
||||
public $stub = null;
|
||||
public function invoked($invocation) {
|
||||
return $this->stub->invoke($invocation);
|
||||
}
|
||||
}
|
||||
|
||||
class MethodCallbackByReference {
|
||||
public function bar(&$a, &$b, $c) {
|
||||
Legacy::bar($a, $b, $c);
|
||||
}
|
||||
public function callback(&$a, &$b, $c) {
|
||||
$b = 1;
|
||||
}
|
||||
}
|
||||
class PHPUnit_Framework_MockObject_Invocation_Static {
|
||||
public $parameters;
|
||||
public function __construct(array $parameters) {
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
}
|
||||
|
||||
class Mock_MethodCallbackByReference_7b180d26 extends MethodCallbackByReference {
|
||||
public $inv_mocker;
|
||||
public function bar(&$a, &$b, $c) {
|
||||
$arguments = array($a, $b, $c);
|
||||
$result = $this->inv_mocker->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
$arguments
|
||||
)
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
set_error_handler(function() {
|
||||
// var_dump(func_get_args());
|
||||
DoesNotExists::$nope = true;
|
||||
}, E_ALL | E_STRICT);
|
||||
|
||||
$foo = new Mock_MethodCallbackByReference_7b180d26();
|
||||
$InvMocker = new PHPUnit_Framework_MockObject_InvocationMocker();
|
||||
$foo->inv_mocker = $InvMocker;
|
||||
$OuterMatcher = new PHPUnit_Framework_MockObject_Matcher();
|
||||
$InvMocker->addMatcher($OuterMatcher);
|
||||
$OuterMatcher->methodNameMatcher = null;
|
||||
$OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']);
|
||||
$a = $b = $c = 0;
|
||||
$foo->bar($a, $b, $c);
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61
|
||||
Stack trace:
|
||||
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
|
||||
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
|
||||
#5 {main}
|
||||
thrown in %sbug72101.php on line 61
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72119 (Interface declaration compatibility regression with default values)
|
||||
--FILE--
|
||||
<?php
|
||||
interface Foo {
|
||||
public function bar(array $baz = null);
|
||||
}
|
||||
|
||||
class Hello implements Foo {
|
||||
public function bar(array $baz = [])
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72162 (use-after-free - error_reporting)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
$var11 = new StdClass();
|
||||
$var16 = error_reporting($var11);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private function getFoo()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
|
||||
private function getBar()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
|
||||
private function getBaz()
|
||||
{
|
||||
return 'Baz';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public function getFoo($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
protected function getBar($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
private function getBaz($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
}
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72508 (strange references after recursive function call and "switch" statement)
|
||||
--FILE--
|
||||
<?php
|
||||
function a ($option) {
|
||||
b($option['bla']);
|
||||
c($option);
|
||||
var_dump($option);
|
||||
}
|
||||
function b (&$string) {
|
||||
$string = 'changed';
|
||||
}
|
||||
function c ($option) {
|
||||
switch ($option['bla']) {
|
||||
default:
|
||||
$copy = $option;
|
||||
$copy['bla'] = 'copy';
|
||||
break;
|
||||
}
|
||||
}
|
||||
a(array('bla' => 'fasel'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["bla"]=>
|
||||
string(7) "changed"
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72581 (previous property undefined in Exception after deserialization)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$e = new Exception('aaa', 200);
|
||||
|
||||
$a = serialize($e);
|
||||
|
||||
$b = unserialize($a);
|
||||
|
||||
var_dump($b->__toString());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%s) "Exception: aaa in %sbug72581.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
if (isset($runtime)) {
|
||||
return new class {
|
||||
public $bar;
|
||||
public function bing($foo = null) {
|
||||
if ($foo) $foo->bing();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$runtime = 1;
|
||||
$oldFoo = require(__FILE__);
|
||||
$newFoo = require(__FILE__);
|
||||
|
||||
var_dump(get_class_methods($oldFoo));
|
||||
var_dump(get_object_vars($oldFoo));
|
||||
|
||||
$newFoo->bing($oldFoo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(4) "bing"
|
||||
}
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72767: PHP Segfaults when trying to expand an infinite operator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {}
|
||||
$iterator = new LimitIterator(
|
||||
new InfiniteIterator(new ArrayIterator([42])),
|
||||
0, 17000
|
||||
);
|
||||
test(...$iterator);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72813 (Segfault with __get returned by ref)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test
|
||||
{
|
||||
private $props = ['a' => 'text', 'b' => 1];
|
||||
|
||||
public function &__get($prop)
|
||||
{
|
||||
return $this->props[$prop];
|
||||
}
|
||||
|
||||
public function __set($prop, $value)
|
||||
{
|
||||
if ($prop === 'b') $value = [$value];
|
||||
$this->props[$prop] = $value;
|
||||
}
|
||||
|
||||
public function getProperties()
|
||||
{
|
||||
return [$this->props];
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->b = $obj->b;
|
||||
print_r($obj->getProperties());
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[a] => text
|
||||
[b] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72854: PHP Crashes on duplicate destructor call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
|
||||
$i = 42;
|
||||
get()->prop =& $i;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = 0;
|
||||
|
||||
$b = $a->b->i -= 0;
|
||||
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
|
||||
|
||||
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
|
||||
NULL
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72943 (assign_dim on string doesn't reset hval)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = array("test" => 1);
|
||||
|
||||
$a = "lest";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "f";
|
||||
var_dump($array[$a]);
|
||||
$a[0] = "t";
|
||||
var_dump($array[$a]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined index: lest in %sbug72943.php on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined index: fest in %sbug72943.php on line %d
|
||||
NULL
|
||||
int(1)
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72944 (Null pointer deref in zval_delref_p).
|
||||
--FILE--
|
||||
<?php
|
||||
"a"== e & $A = $A? 0 : 0 ?:0;
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
|
||||
|
||||
Notice: Undefined variable: A in %sbug72944.php on line 2
|
||||
OK
|
||||
@@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73156 (segfault on undefined function)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __call($name, $args) {
|
||||
eval('$args = array(); var_dump(debug_backtrace());');
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
|
||||
$a->test("test");
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(4)
|
||||
["function"]=>
|
||||
string(4) "eval"
|
||||
}
|
||||
[1]=>
|
||||
array(7) {
|
||||
["file"]=>
|
||||
string(%d) "%sbug73156.php"
|
||||
["line"]=>
|
||||
int(10)
|
||||
["function"]=>
|
||||
string(6) "__call"
|
||||
["class"]=>
|
||||
string(1) "A"
|
||||
["object"]=>
|
||||
object(A)#%d (0) {
|
||||
}
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "test"
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73163 (PHP hangs if error handler throws while accessing undef const in default value)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function doSomething(string $value = UNDEFINED) {
|
||||
}
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
throw new Exception($errstr);
|
||||
});
|
||||
|
||||
doSomething();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): {closure}(%s)
|
||||
#1 %s(%d): doSomething()
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73181: parse_str() without a second argument leads to crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function x() {
|
||||
parse_str("1&x");
|
||||
var_dump(get_defined_vars());
|
||||
}
|
||||
|
||||
x();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(0) ""
|
||||
["x"]=>
|
||||
string(0) ""
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73337 (try/catch not working with two exceptions inside a same operation)
|
||||
--FILE--
|
||||
<?php
|
||||
class d { function __destruct() { throw new Exception; } }
|
||||
try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; }
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
|
||||
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
|
||||
Exception properly caught
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73338: Ensure exceptions in function init opcodes are cleaned properly
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try { call_user_func(new class { function __destruct () { throw new Error; } }); } catch (Error $e) {}
|
||||
|
||||
set_error_handler(function() { throw new Error; });
|
||||
|
||||
try { var_dump(new stdClass, call_user_func("fail")); } catch (Error $e) {}
|
||||
|
||||
try { (function() { call_user_func("fail"); })(); } catch (Error $e) {}
|
||||
|
||||
try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73350 (Exception::__toString() cause circular references)
|
||||
--FILE--
|
||||
<?php
|
||||
$e = new Exception();
|
||||
|
||||
// This line cause problem :(
|
||||
// Comment it to see the difference.
|
||||
(string) $e;
|
||||
|
||||
// This line show the clue (PHP Warning: ...).
|
||||
var_export($e);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Exception::__set_state(array(
|
||||
'message' => '',
|
||||
'string' => 'Exception in %sbug73350.php:%d
|
||||
Stack trace:
|
||||
#0 {main}',
|
||||
'code' => 0,
|
||||
'file' => '%sbug73350.php',
|
||||
'line' => %d,
|
||||
'trace' =>
|
||||
array (
|
||||
),
|
||||
'previous' => NULL,
|
||||
))
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list())
|
||||
--FILE--
|
||||
<?php
|
||||
function change(&$ref) {
|
||||
$ref = range(1, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
$func = function (&$ref) {
|
||||
return change($ref);
|
||||
};
|
||||
|
||||
$array = [1];
|
||||
var_dump(list($val) = $array); // NG: Invalid opcode
|
||||
|
||||
change(list($val) = $array);
|
||||
var_dump($array);
|
||||
|
||||
$array = [1];
|
||||
|
||||
$func(list($val) = $array);
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(10) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
[6]=>
|
||||
int(7)
|
||||
[7]=>
|
||||
int(8)
|
||||
[8]=>
|
||||
int(9)
|
||||
[9]=>
|
||||
int(10)
|
||||
}
|
||||
array(10) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
[3]=>
|
||||
int(4)
|
||||
[4]=>
|
||||
int(5)
|
||||
[5]=>
|
||||
int(6)
|
||||
[6]=>
|
||||
int(7)
|
||||
[7]=>
|
||||
int(8)
|
||||
[8]=>
|
||||
int(9)
|
||||
[9]=>
|
||||
int(10)
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73753 Non packed arrays and duplication
|
||||
--FILE--
|
||||
<?php
|
||||
function iterate($current, $a, $result = null) {
|
||||
if (!$current) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
return iterate(getNext($a), $a, $current);
|
||||
}
|
||||
|
||||
function getNext(&$a) {
|
||||
return next($a);
|
||||
}
|
||||
|
||||
function getCurrent($a) {
|
||||
return current($a);
|
||||
}
|
||||
|
||||
function traverse($a) {
|
||||
return iterate(getCurrent($a), $a);
|
||||
}
|
||||
|
||||
$arr = array(1 => 'foo', 'b' => 'bar', 'baz');
|
||||
var_dump(traverse($arr));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "baz"
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73792 (invalid foreach loop hangs script)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = 'aaa';
|
||||
|
||||
foreach ($a['bbb'] as &$value) {
|
||||
echo 'loop';
|
||||
}
|
||||
|
||||
unset($value);
|
||||
echo 'done';
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Illegal string offset 'bbb' in %sbug73792.php on line 4
|
||||
|
||||
Fatal error: Uncaught Error: Cannot iterate on string offsets by reference in %sbug73792.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug73792.php on line 4
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73916 (zend_print_flat_zval_r doesn't consider reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array('a');
|
||||
class b{};
|
||||
$b = new b;
|
||||
$test[] =& $a;
|
||||
$test[] =& $b;
|
||||
test($test);
|
||||
function test() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 test(Array ([0] => Array ([0] => a),[1] => b Object ())) called at [%sbug73916.php:%d]
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73954 (NAN check fails on Alpine Linux with musl)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(NAN);
|
||||
var_dump(is_nan(NAN));
|
||||
|
||||
function takes_int(int $int) {
|
||||
}
|
||||
|
||||
takes_int(log(tan(3.14)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
float(NAN)
|
||||
bool(true)
|
||||
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
|
||||
Stack trace:
|
||||
#0 %s(9): takes_int(NAN)
|
||||
#1 {main}
|
||||
thrown in %s on line 6
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73989 (PHP 7.1 Segfaults within Symfony test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cycle
|
||||
{
|
||||
private $thing;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$obj = $this;
|
||||
$this->thing = function() use($obj) {};
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
($this->thing)();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; ++$i) {
|
||||
$obj = new Cycle();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73998 (array_key_exists fails on arrays created by get_object_vars)
|
||||
--DESCRIPTION--
|
||||
Properties of objects with numeric names should be accessible
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass;
|
||||
$a->{1234} = "Numeric";
|
||||
$a->a1234 = "String";
|
||||
|
||||
$properties = get_object_vars($a);
|
||||
var_dump(array_key_exists(1234, $properties));
|
||||
echo "Value: {$properties[1234]}\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Value: Numeric
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74084 (Out of bound read - zend_mm_alloc_small)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
$$A += $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A -= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A *= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A /= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A **= $$B->a = &$$C;
|
||||
var_dump($$A);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func() should not use FUNC_ARG fetches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(&$ref) { $ref = 24; }
|
||||
|
||||
$a = [];
|
||||
call_user_func('foo', $a[0][0]);
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined offset: 0 in %s on line %d
|
||||
|
||||
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func_array() passes value to prefer-ref arg if element wasn't a reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace {
|
||||
call_user_func_array('array_multisort', [[3, 2, 1]]);
|
||||
|
||||
$args = [[3, 2, 1]];
|
||||
call_user_func_array('array_multisort', $args);
|
||||
var_dump($args);
|
||||
unset($args);
|
||||
|
||||
$array = [3, 2, 1];
|
||||
call_user_func('array_multisort', $array);
|
||||
var_dump($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
namespace Foo {
|
||||
call_user_func_array('array_multisort', [[3, 2, 1]]);
|
||||
|
||||
$args = [[3, 2, 1]];
|
||||
call_user_func_array('array_multisort', $args);
|
||||
var_dump($args);
|
||||
unset($args);
|
||||
|
||||
$array = [3, 2, 1];
|
||||
call_user_func('array_multisort', $array);
|
||||
var_dump($array);
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
--TEST--
|
||||
Behavior of failing compound assignment
|
||||
--INI--
|
||||
opcache.optimization_level=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$a = 1;
|
||||
$a %= 0;
|
||||
} catch (Error $e) { var_dump($a); }
|
||||
|
||||
try {
|
||||
$a = 1;
|
||||
$a >>= -1;
|
||||
} catch (Error $e) { var_dump($a); }
|
||||
|
||||
try {
|
||||
$a = 1;
|
||||
$a <<= -1;
|
||||
} catch (Error $e) { var_dump($a); }
|
||||
|
||||
set_error_handler(function($type, $msg) { throw new Exception($msg); });
|
||||
|
||||
try {
|
||||
$a = [];
|
||||
$a .= "foo";
|
||||
} catch (Throwable $e) { var_dump($a); }
|
||||
|
||||
try {
|
||||
$a = "foo";
|
||||
$a .= [];
|
||||
} catch (Throwable $e) { var_dump($a); }
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x += 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x += new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x -= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x -= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x *= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x *= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x /= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x /= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x %= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x %= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x **= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x **= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x ^= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x ^= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x &= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x &= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x |= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x |= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x <<= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x <<= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = new stdClass;
|
||||
try { $x >>= 1; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
|
||||
$x = 1;
|
||||
try { $x >>= new stdClass; }
|
||||
catch (Exception $e) {}
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(1)
|
||||
int(1)
|
||||
array(0) {
|
||||
}
|
||||
string(3) "foo"
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
int(1)
|
||||
+28
-14
@@ -2,37 +2,51 @@
|
||||
Concatenating many small strings should not slowdown allocations
|
||||
--SKIPIF--
|
||||
<?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
|
||||
--INI--
|
||||
memory_limit=256m
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* To note is that memory usage can vary depending on whether opcache is on. The actual
|
||||
measuring that matters is timing here. */
|
||||
|
||||
$time = microtime(TRUE);
|
||||
|
||||
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
|
||||
$t_max = 1.0;
|
||||
$t0_max = 0.1;
|
||||
$t1_max = 0.4;
|
||||
|
||||
$datas = [];
|
||||
for ($i = 0; $i < 220000; $i++)
|
||||
{
|
||||
$datas[] = [
|
||||
'000.000.000.000',
|
||||
'000.255.255.255',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
];
|
||||
}
|
||||
|
||||
$t0 = microtime(TRUE) - $time;
|
||||
var_dump($t0 < $t0_max);
|
||||
|
||||
$datas = array_fill(0, 220000, [
|
||||
'000.000.000.000',
|
||||
'000.255.255.255',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
]);
|
||||
|
||||
$time = microtime(TRUE);
|
||||
$texts = '';
|
||||
foreach ($datas AS $data)
|
||||
{
|
||||
$texts .= implode("\t", $data) . "\r\n";
|
||||
}
|
||||
|
||||
$t = microtime(TRUE) - $time;
|
||||
var_dump($t < $t_max);
|
||||
$t1 = microtime(TRUE) - $time;
|
||||
var_dump($t1 < $t1_max);
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
+++DONE+++
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Constexpr arrays should be able to handle resource keys
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const FOO = [STDIN => 42];
|
||||
var_dump(FOO);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
||||
array(1) {
|
||||
[%d]=>
|
||||
int(42)
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Constant expressions with null coalescing operator ??
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const A = [1 => [[]]];
|
||||
|
||||
const T_1 = null ?? A[1]['undefined']['index'] ?? 1;
|
||||
const T_2 = null ?? A['undefined']['index'] ?? 2;
|
||||
const T_3 = null ?? A[1][0][2] ?? 3;
|
||||
const T_4 = A[1][0][2] ?? 4;
|
||||
const T_5 = null ?? __LINE__;
|
||||
const T_6 = __LINE__ ?? "bar";
|
||||
|
||||
var_dump(T_1);
|
||||
var_dump(T_2);
|
||||
var_dump(T_3);
|
||||
var_dump(T_4);
|
||||
var_dump(T_5);
|
||||
var_dump(T_6);
|
||||
|
||||
var_dump((function(){ static $var = null ?? A[1]['undefined']['index'] ?? 1; return $var; })());
|
||||
var_dump((function(){ static $var = null ?? A['undefined']['index'] ?? 2; return $var; })());
|
||||
var_dump((function(){ static $var = null ?? A[1][0][2] ?? 3; return $var; })());
|
||||
var_dump((function(){ static $var = A[1][0][2] ?? 4; return $var; })());
|
||||
|
||||
var_dump((new class { public $var = null ?? A[1]['undefined']['index'] ?? 1; })->var);
|
||||
var_dump((new class { public $var = null ?? A['undefined']['index'] ?? 2; })->var);
|
||||
var_dump((new class { public $var = null ?? A[1][0][2] ?? 3; })->var);
|
||||
var_dump((new class { public $var = A[1][0][2] ?? 4; })->var);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Constant expressions with empty dimension fetch on coalesce
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const A = [][] ?? 1;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use [] for reading in %s.php on line %d
|
||||
|
||||
@@ -35,12 +35,10 @@ const T_19 = [
|
||||
false => false,
|
||||
true => true,
|
||||
];
|
||||
eval("const T_20x = 'a';");
|
||||
const T_20 = null ?: (T_20x . 'bc');
|
||||
|
||||
var_dump(
|
||||
T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9, T_10,
|
||||
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19, T_20
|
||||
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -77,4 +75,3 @@ array(6) {
|
||||
[1]=>
|
||||
bool(true)
|
||||
}
|
||||
string(3) "abc"
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns RESOURCE
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Crash when using dynamic call syntax with fully qualified name in a namespace
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
try {
|
||||
('\bar')();
|
||||
} catch (\Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function bar()
|
||||
@@ -3,12 +3,10 @@ Testing each() with array and object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$foo = each($a);
|
||||
$foo = each(new stdClass);
|
||||
var_dump($foo);
|
||||
|
||||
$a = new stdClass;
|
||||
var_dump(each($a));
|
||||
var_dump(each(new stdClass));
|
||||
|
||||
$a = array(new stdClass);
|
||||
var_dump(each($a));
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Calling generator through magic __call()
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __call($name, $args) {
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
foreach ($a->gen() as $n) {
|
||||
var_dump($n);
|
||||
}
|
||||
$a->gen();
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
@@ -40,10 +40,11 @@ Stack trace:
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Generator 1
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
|
||||
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->current()
|
||||
#2 {main}
|
||||
NULL
|
||||
thrown in %s on line %d
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Cannot "yield from" from force closed generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen1() {
|
||||
echo "gen1\n";
|
||||
yield 1;
|
||||
}
|
||||
|
||||
function gen2() {
|
||||
try {
|
||||
echo "try\n";
|
||||
yield from gen1();
|
||||
} finally {
|
||||
echo "finally\n";
|
||||
yield from gen1();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$gen = gen2();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
} catch (Error $e) {
|
||||
echo $e, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
try
|
||||
gen1
|
||||
finally
|
||||
Error: Cannot use "yield from" in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): gen2()
|
||||
#1 {main}
|
||||
@@ -3,7 +3,7 @@ Test get_defined_functions() function : error conditions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : array get_defined_functions ( $exclude_disabled = false )
|
||||
/* Prototype : array get_defined_functions ( void )
|
||||
* Description: Gets an array of all defined functions.
|
||||
* Source code: Zend/zend_builtin_functions.c
|
||||
*/
|
||||
@@ -14,8 +14,7 @@ echo "*** Testing get_defined_functions() : error conditions ***\n";
|
||||
|
||||
echo "\n-- Testing get_defined_functions() function with more than expected no. of arguments --\n";
|
||||
$extra_arg = 10;
|
||||
$extra_arg2 = 20;
|
||||
var_dump( get_defined_functions($extra_arg, $extra_arg2) );
|
||||
var_dump( get_defined_functions($extra_arg) );
|
||||
|
||||
?>
|
||||
===Done===
|
||||
@@ -24,7 +23,7 @@ var_dump( get_defined_functions($extra_arg, $extra_arg2) );
|
||||
|
||||
-- Testing get_defined_functions() function with more than expected no. of arguments --
|
||||
|
||||
Warning: get_defined_functions() expects at most 1 parameter, 2 given in %s on line %d
|
||||
Warning: get_defined_functions() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
===Done===
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Leak when using an invalid parent:: reference in a constant definition
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
const B = parent::C;
|
||||
}
|
||||
|
||||
try {
|
||||
A::B;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot access parent:: when current class scope has no parent
|
||||
@@ -2,13 +2,6 @@
|
||||
int memory_get_peak_usage ([ bool $real_usage = false ] );
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
|
||||
if ($zend_mm_enabled === "0") {
|
||||
die("skip Zend MM disabled");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=-1
|
||||
--FILE--
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Indirect modification of isref by-value return value not possible
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public $b;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
$a = new A;
|
||||
$a->b =& $arr;
|
||||
|
||||
(new ReflectionProperty('A', 'b'))->getValue($a)[] = 42;
|
||||
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(A)#1 (1) {
|
||||
["b"]=>
|
||||
&array(0) {
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Class declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
class Bar {}
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use Foo\Bar;
|
||||
class Bar {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare class Bazzle\Bar because the name is already in use in %s on line %d
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Function declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
function bar() {}
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use function Foo\bar;
|
||||
function bar() {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare function Bazzle\bar because the name is already in use in %s on line %d
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Class declaration colliding with import (in namespace)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo {
|
||||
const BAR = 42;
|
||||
}
|
||||
|
||||
namespace Bazzle {
|
||||
use const Foo\BAR;
|
||||
const BAR = 24;
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare const Bazzle\BAR because the name is already in use in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Leak in QM_ASSIGN when unwrapping references (rc=1)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function &ref() {
|
||||
$str = "str";
|
||||
$str .= "str";
|
||||
return $str;
|
||||
}
|
||||
|
||||
var_dump(true ? ref() : ref());
|
||||
var_dump(ref() ?: ref());
|
||||
var_dump(ref() ?? ref());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "strstr"
|
||||
string(6) "strstr"
|
||||
string(6) "strstr"
|
||||
@@ -6,8 +6,6 @@ ANDing strings
|
||||
$s = "123";
|
||||
$s1 = "test";
|
||||
$s2 = "45345some";
|
||||
$s3 = str_repeat("f", 1);
|
||||
$s4 = str_repeat("f", 2);
|
||||
|
||||
$s &= 22;
|
||||
var_dump($s);
|
||||
@@ -18,18 +16,10 @@ var_dump($s1);
|
||||
$s2 &= 33;
|
||||
var_dump($s2);
|
||||
|
||||
$s3 &= " ";
|
||||
var_dump($s3);
|
||||
|
||||
$s4 &= " ";
|
||||
var_dump($s4);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(18)
|
||||
int(0)
|
||||
int(33)
|
||||
string(1) " "
|
||||
string(2) " "
|
||||
Done
|
||||
@@ -6,8 +6,6 @@ ORing strings
|
||||
$s = "123";
|
||||
$s1 = "test";
|
||||
$s2 = "45345some";
|
||||
$s3 = str_repeat("f", 1);
|
||||
$s4 = str_repeat("f", 2);
|
||||
|
||||
$s |= 22;
|
||||
var_dump($s);
|
||||
@@ -18,18 +16,10 @@ var_dump($s1);
|
||||
$s2 |= 33;
|
||||
var_dump($s2);
|
||||
|
||||
$s3 |= " ";
|
||||
var_dump($s3);
|
||||
|
||||
$s4 |= " ";
|
||||
var_dump($s4);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(127)
|
||||
int(11)
|
||||
int(45345)
|
||||
string(1) "f"
|
||||
string(2) "ff"
|
||||
Done
|
||||
@@ -6,8 +6,6 @@ XORing strings
|
||||
$s = "123";
|
||||
$s1 = "test";
|
||||
$s2 = "45345some";
|
||||
$s3 = str_repeat("f", 1);
|
||||
$s4 = str_repeat("f", 2);
|
||||
|
||||
$s ^= 22;
|
||||
var_dump($s);
|
||||
@@ -18,18 +16,10 @@ var_dump($s1);
|
||||
$s2 ^= 33;
|
||||
var_dump($s2);
|
||||
|
||||
$s3 ^= " ";
|
||||
var_dump($s3);
|
||||
|
||||
$s4 ^= " ";
|
||||
var_dump($s4);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(109)
|
||||
int(11)
|
||||
int(45312)
|
||||
string(1) "F"
|
||||
string(2) "FF"
|
||||
Done
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69579 (Internal trait double-free)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!PHP_DEBUG) die("skip only run in debug version");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Bar{
|
||||
use _ZendTestTrait;
|
||||
}
|
||||
|
||||
$bar = new Bar();
|
||||
var_dump($bar->testMethod());
|
||||
// destruction causes a double-free and explodes
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -12,8 +12,8 @@ final class e { }
|
||||
var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -13,8 +13,8 @@ namespace test {
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(6) "test\c"
|
||||
}
|
||||
@@ -13,15 +13,13 @@ var_dump(get_declared_traits());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
string(1) "a"
|
||||
%astring(1) "a"
|
||||
[%d]=>
|
||||
string(1) "d"
|
||||
[%d]=>
|
||||
string(1) "e"
|
||||
}
|
||||
array(%d) {%A
|
||||
[%d]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72629 (Caught exception assignment to variables ignores references)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$var = null;
|
||||
$e = &$var;
|
||||
|
||||
try {
|
||||
throw new Exception;
|
||||
} catch (Exception $e) { }
|
||||
|
||||
var_dump($var === $e);
|
||||
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
"use function" should not conflict with class names
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
class Bar {}
|
||||
|
||||
use function bar;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Use conflicts should not occur across files
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/use_no_file_conflict_1.inc';
|
||||
require __DIR__ . '/use_no_file_conflict_2.inc';
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
class A {}
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
use A;
|
||||
+5
-21
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -152,12 +152,11 @@ ZEND_TSRMLS_CACHE_DEFINE()
|
||||
#endif
|
||||
|
||||
ZEND_API zend_utility_values zend_uv;
|
||||
ZEND_API zend_bool zend_dtrace_enabled;
|
||||
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
static uint zend_version_info_length;
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2017 Zend Technologies\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2016 Zend Technologies\n"
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
|
||||
@@ -313,9 +312,6 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
|
||||
ZEND_PUTS(")");
|
||||
break;
|
||||
}
|
||||
case IS_REFERENCE:
|
||||
zend_print_flat_zval_r(Z_REFVAL_P(expr));
|
||||
break;
|
||||
default:
|
||||
zend_print_variable(expr);
|
||||
break;
|
||||
@@ -567,7 +563,6 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
|
||||
#ifdef ZEND_WIN32
|
||||
zend_get_windows_version_info(&executor_globals->windows_version_info);
|
||||
#endif
|
||||
executor_globals->valid_symbol_table = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -683,20 +678,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
|
||||
#if HAVE_DTRACE
|
||||
/* build with dtrace support */
|
||||
{
|
||||
char *tmp = getenv("USE_ZEND_DTRACE");
|
||||
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_dtrace_enabled = 1;
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
} else {
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
}
|
||||
}
|
||||
zend_compile_file = dtrace_compile_file;
|
||||
zend_execute_ex = dtrace_execute_ex;
|
||||
zend_execute_internal = dtrace_execute_internal;
|
||||
#else
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
|
||||
+1
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -299,8 +299,6 @@ extern ZEND_API zend_class_entry *zend_standard_class_def;
|
||||
extern ZEND_API zend_utility_values zend_uv;
|
||||
extern ZEND_API zval zval_used_for_init;
|
||||
|
||||
/* If DTrace is available and enabled */
|
||||
extern ZEND_API zend_bool zend_dtrace_enabled;
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_UV(name) (zend_uv.name)
|
||||
|
||||
+6
-23
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -197,6 +197,7 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
|
||||
{
|
||||
zend_function *active_function = EG(current_execute_data)->func;
|
||||
@@ -290,6 +291,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
|
||||
{
|
||||
@@ -1859,7 +1861,7 @@ static int zend_startup_module_zval(zval *zv) /* {{{ */
|
||||
{
|
||||
zend_module_entry *module = Z_PTR_P(zv);
|
||||
|
||||
return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
return zend_startup_module_ex(module);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3098,13 +3100,13 @@ get_function_via_handler:
|
||||
|
||||
if (retval) {
|
||||
if (fcc->calling_scope && !call_via_handler) {
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
if (!fcc->object && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (error) {
|
||||
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
return 0;
|
||||
}
|
||||
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
int severity;
|
||||
@@ -3356,7 +3358,6 @@ again:
|
||||
memcpy(ZSTR_VAL(*callable_name), ZSTR_VAL(ce->name), ZSTR_LEN(ce->name));
|
||||
memcpy(ZSTR_VAL(*callable_name) + ZSTR_LEN(ce->name), "::__invoke", sizeof("::__invoke"));
|
||||
}
|
||||
fcc->initialized = 1;
|
||||
return 1;
|
||||
}
|
||||
if (callable_name) {
|
||||
@@ -3847,24 +3848,6 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
|
||||
{
|
||||
zval property;
|
||||
zend_class_entry *old_scope = EG(scope);
|
||||
|
||||
EG(scope) = scope;
|
||||
|
||||
if (!Z_OBJ_HT_P(object)->unset_property) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
|
||||
}
|
||||
ZVAL_STRINGL(&property, name, name_length);
|
||||
Z_OBJ_HT_P(object)->unset_property(object, &property, 0);
|
||||
zval_ptr_dtor(&property);
|
||||
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
|
||||
{
|
||||
zval tmp;
|
||||
|
||||
+9
-5
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -343,7 +343,6 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
|
||||
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
|
||||
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
|
||||
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
|
||||
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
|
||||
|
||||
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
|
||||
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
|
||||
@@ -477,7 +476,8 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
|
||||
|
||||
/** Build zend_call_info/cache from a zval*
|
||||
*
|
||||
* Caller is responsible to provide a return value (fci->retval), otherwise the we will crash.
|
||||
* Caller is responsible to provide a return value, otherwise the we will crash.
|
||||
* fci->retval_ptr_ptr = NULL;
|
||||
* In order to pass parameters the following members need to be set:
|
||||
* fci->param_count = 0;
|
||||
* fci->params = NULL;
|
||||
@@ -666,11 +666,13 @@ END_EXTERN_C()
|
||||
|
||||
/* Fast parameter parsing API */
|
||||
|
||||
/* Fast ZPP is always enabled now; this define is left in for compatibility
|
||||
* with any existing conditional compilation blocks.
|
||||
/* This API should be used only for really often used functions.
|
||||
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
|
||||
*/
|
||||
#define FAST_ZPP 1
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
|
||||
#define Z_EXPECTED_TYPES(_) \
|
||||
_(Z_EXPECTED_LONG, "integer") \
|
||||
_(Z_EXPECTED_BOOL, "boolean") \
|
||||
@@ -1033,6 +1035,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
|
||||
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
|
||||
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
|
||||
|
||||
#endif /* FAST_ZPP */
|
||||
|
||||
/* End of new parameter parsing API */
|
||||
|
||||
/* Inlined implementations shared by new and old parameter parsing APIs */
|
||||
|
||||
+35
-33
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -897,7 +897,6 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, int pages_count ZEND_FILE_L
|
||||
{
|
||||
zend_mm_chunk *chunk = heap->main_chunk;
|
||||
int page_num, len;
|
||||
int steps = 0;
|
||||
|
||||
while (1) {
|
||||
if (UNEXPECTED(chunk->free_pages < pages_count)) {
|
||||
@@ -1074,20 +1073,10 @@ get_chunk:
|
||||
goto found;
|
||||
} else {
|
||||
chunk = chunk->next;
|
||||
steps++;
|
||||
}
|
||||
}
|
||||
|
||||
found:
|
||||
if (steps > 2 && pages_count < 8) {
|
||||
/* move chunk into the head of the linked-list */
|
||||
chunk->prev->next = chunk->next;
|
||||
chunk->next->prev = chunk->prev;
|
||||
chunk->next = heap->main_chunk->next;
|
||||
chunk->prev = heap->main_chunk;
|
||||
chunk->prev->next = chunk;
|
||||
chunk->next->prev = chunk;
|
||||
}
|
||||
/* mark run as allocated */
|
||||
chunk->free_pages -= pages_count;
|
||||
zend_mm_bitset_set_range(chunk->free_map, page_num, pages_count);
|
||||
@@ -1483,7 +1472,7 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
@@ -1559,21 +1548,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
|
||||
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
|
||||
if (info & ZEND_MM_IS_SRUN) {
|
||||
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
int old_bin_num, bin_num;
|
||||
|
||||
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
|
||||
old_size = bin_data_size[old_bin_num];
|
||||
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
|
||||
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
|
||||
if (old_bin_num == bin_num) {
|
||||
#if ZEND_DEBUG
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
dbg = zend_mm_get_debug_info(heap, ptr);
|
||||
dbg->size = real_size;
|
||||
dbg->filename = __zend_filename;
|
||||
dbg->orig_filename = __zend_orig_filename;
|
||||
dbg->lineno = __zend_lineno;
|
||||
dbg->orig_lineno = __zend_orig_lineno;
|
||||
#endif
|
||||
return ptr;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
|
||||
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
|
||||
@@ -1751,7 +1740,7 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
@@ -2343,7 +2332,7 @@ ZEND_API int is_zend_mm(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P)
|
||||
#if !ZEND_DEBUG && (!defined(_WIN32) || defined(__clang__))
|
||||
#undef _emalloc
|
||||
|
||||
#if ZEND_MM_CUSTOM
|
||||
@@ -2511,24 +2500,37 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
|
||||
return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
int overflow;
|
||||
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
|
||||
|
||||
if (UNEXPECTED(overflow)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return emalloc_rel(zend_safe_address_guarded(nmemb, size, offset));
|
||||
return emalloc_rel(safe_address(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return pemalloc(zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
return pemalloc(safe_address(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
|
||||
return erealloc_rel(ptr, safe_address(nmemb, size, offset));
|
||||
}
|
||||
|
||||
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
|
||||
{
|
||||
return perealloc(ptr, zend_safe_address_guarded(nmemb, size, offset), 1);
|
||||
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -2644,9 +2646,9 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
|
||||
memset(alloc_globals->mm_heap, 0, sizeof(zend_mm_heap));
|
||||
alloc_globals->mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = __zend_malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._malloc = malloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._free = free;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = __zend_realloc;
|
||||
alloc_globals->mm_heap->custom_heap.std._realloc = realloc;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2017 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
Loaded 100 of 1726 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user