mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 17:50:50 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a36407215f | ||
|
|
5abfbc647d | ||
|
|
305d93c7e5 | ||
|
|
b4d54923c5 | ||
|
|
03106e8c5e | ||
|
|
a21202a604 | ||
|
|
8fb3f06ef5 |
No files matched your search
@@ -1,56 +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
|
||||
|
||||
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.13
|
||||
# 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
|
||||
- postgresql96
|
||||
|
||||
platform:
|
||||
- x64
|
||||
# - x86
|
||||
|
||||
build_script:
|
||||
- appveyor\build.bat
|
||||
|
||||
test_script:
|
||||
- appveyor\test.bat
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{yml,m4,sh}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
@@ -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
|
||||
|
||||
@@ -15,8 +15,11 @@ ext/dba/libflatfile/flatfile.c ident
|
||||
ext/dba/libcdb/cdb_make.c ident
|
||||
ext/dba/libcdb/cdb.c ident
|
||||
ext/filter/filter.c ident
|
||||
ext/zip/php_zip.c ident
|
||||
README.input_filter ident
|
||||
run-tests.php ident
|
||||
sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
@@ -29,6 +32,7 @@ UPGRADING.INTERNALS merge=NEWS
|
||||
/ext/bz2/tests/with_strings.phpt -crlf
|
||||
/ext/dom/tests/bug40836.phpt -crlf
|
||||
/ext/dom/tests/domelement.phpt -crlf
|
||||
/ext/ereg/tests/eregi_basic_002.phpt -crlf
|
||||
/ext/iconv/tests/iconv004.phpt -crlf
|
||||
/ext/iconv/tests/iconv_basic.phpt -crlf
|
||||
/ext/iconv/tests/iconv_strpos.phpt -crlf
|
||||
|
||||
+2
-1
@@ -148,7 +148,6 @@ tests/*/*/*.sh
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
@@ -262,7 +261,9 @@ pear/phpize
|
||||
pear/run-tests
|
||||
pear/php-config
|
||||
pear/scripts
|
||||
sapi/apache/libphp7.module
|
||||
sapi/apache2handler/libphp7.module
|
||||
sapi/apache_hooks/libphp7.module
|
||||
sapi/cgi/php-cgi
|
||||
sapi/cgi/php-cgi.1
|
||||
sapi/cli/php.1
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
|
||||
+5
-5
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fpm
|
||||
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.3.3
|
||||
@@ -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
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
|
||||
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
|
||||
|
||||
all: $(all_targets)
|
||||
all: $(all_targets)
|
||||
@echo
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@@ -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"`; \
|
||||
@@ -112,13 +112,13 @@ test: all
|
||||
clean:
|
||||
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php7.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
@@ -135,7 +135,7 @@ prof-gen:
|
||||
|
||||
prof-clean:
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
|
||||
+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
-18
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -676,21 +670,12 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
/* 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:
|
||||
|
||||
@@ -800,7 +772,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 +815,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
|
||||
#if 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
|
||||
|
||||
#if 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 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,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
|
||||
@@ -18,7 +18,7 @@ object(ReflectionClass)#4 (1) {
|
||||
}
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
stdClass
|
||||
Method [ <internal> public method __invoke ] {
|
||||
Method [ <internal, prototype Closure> public method __invoke ] {
|
||||
|
||||
- Parameters [1] {
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
@@ -53,43 +53,27 @@ string(3) "1st"
|
||||
string(3) "2nd"
|
||||
NULL
|
||||
string(3) "4th"
|
||||
array(4) {
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "1st"
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
array(2) {
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
NULL
|
||||
[2]=>
|
||||
NULL
|
||||
array(1) {
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ 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(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(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,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,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73900: Use After Free in unserialize() SplFixedArray
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $a;
|
||||
$c = &$b[0];
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
@@ -1,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,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73960: Leak with instance method calling static method with referenced return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$value = 'one';
|
||||
$array = array($value);
|
||||
$array = $ref =& $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "one"
|
||||
}
|
||||
@@ -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,14 +0,0 @@
|
||||
--TEST--
|
||||
Fixes bug 74188 (undeclared static variables emit a warning with ?? operator)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Test
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
static::$a ?? true;
|
||||
}
|
||||
}
|
||||
Test::get();
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74408 (Endless loop bypassing execution time limit)
|
||||
--INI--
|
||||
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
|
||||
|
||||
class ErrorHandling {
|
||||
|
||||
public function error_handler($errno, $errstr, $errfile, $errline) {
|
||||
$bla = new NonExistingClass2();
|
||||
}
|
||||
|
||||
public function exception_handler(Error $e) {
|
||||
echo "Caught, exception: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
set_error_handler('ErrorHandling::error_handler');
|
||||
set_exception_handler('ErrorHandling::exception_handler');
|
||||
|
||||
$blubb = new NonExistingClass();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
|
||||
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
|
||||
|
||||
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
|
||||
|
||||
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
|
||||
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
|
||||
#2 {main}
|
||||
thrown in %sbug74408.php on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
|
||||
--FILE--
|
||||
<?php
|
||||
"000000"[0]::d;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class '0' not found in %sbug74546.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74546.php on line %d
|
||||
@@ -1 +0,0 @@
|
||||
0=0&~2000000000
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "0"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74657 (Undefined constants in array properties result in broken properties)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
}
|
||||
|
||||
class C {
|
||||
const FOO = I::FOO;
|
||||
|
||||
public $options = [self::FOO => "bar"];
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump((new C)->options);
|
||||
} catch (Throwable $e) {}
|
||||
|
||||
var_dump((new C)->options);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74657.php on line %d
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74840: Opcache overwrites argument of GENERATOR_RETURN within finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$g = (function($a) {
|
||||
try {
|
||||
return $a + 1;
|
||||
} finally {
|
||||
$b = $a + 2;
|
||||
var_dump($b);
|
||||
}
|
||||
yield; // Generator
|
||||
})(1);
|
||||
$g->next();
|
||||
var_dump($g->getReturn());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(2)
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74947 (Segfault in scanner on INF number)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
INF-INF
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
|
||||
--FILE--
|
||||
<?php
|
||||
function eh(){}
|
||||
|
||||
set_error_handler('eh');
|
||||
|
||||
$d->d = &$d + $d->d/=0;
|
||||
var_dump($d);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(INF)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75252: Incorrect token formatting on two parse errors in one request
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$code = <<<'CODE'
|
||||
function test_missing_semicolon() : string {
|
||||
$x = []
|
||||
FOO
|
||||
}
|
||||
CODE;
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
eval($code);
|
||||
} catch (ParseError $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump((new ReflectionFunction('sin'))->getClosure());
|
||||
|
||||
var_dump(function ($someThing) {});
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$number"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
object(Closure)#2 (1) {
|
||||
["parameter"]=>
|
||||
array(1) {
|
||||
["$someThing"]=>
|
||||
string(10) "<required>"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.1 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.10 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.11 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.12 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.13 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.14 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj[$name]));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.15 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj[$name] = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.16 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { }
|
||||
public function offsetGet($x) { }
|
||||
public function offsetSet($x, $y) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj[$name] = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.2 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(42)
|
||||
int(24)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.3 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.4 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
var_dump(empty($obj->$name));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
bool(false)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.5 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.6 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
|
||||
public function __get($x) { var_dump($this); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump(empty($obj->$name));
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
bool(false)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.7 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["name"] = 24; var_dump($x); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$name = str_repeat($name, 2);
|
||||
$obj->$name = 1;
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foofoo"
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.8 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function __set($x,$v) { $GLOBALS["obj"] = 24; var_dump($this); }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
$obj->$name = 1;
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Test)#1 (0) {
|
||||
}
|
||||
int(24)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420.9 (Indirect modification of magic method argument)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test implements ArrayAccess {
|
||||
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function offsetGet($x) { var_dump($x); return 42; }
|
||||
public function offsetSet($x, $y) { }
|
||||
public function offsetUnset($x) { }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj[$name] ?? 12);
|
||||
var_dump($name);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
|
||||
public function __get($x) { var_dump($x); return 42; }
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$name = "foo";
|
||||
var_dump($obj->$name ?? 12);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(42)
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
var $_stdObject;
|
||||
function initialize($properties = FALSE) {
|
||||
$this->_stdObject = $properties ? (object) $properties : new stdClass();
|
||||
parent::initialize();
|
||||
}
|
||||
function &__get($property)
|
||||
{
|
||||
if (isset($this->_stdObject->{$property})) {
|
||||
$retval =& $this->_stdObject->{$property};
|
||||
return $retval;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
function &__set($property, $value)
|
||||
{
|
||||
return $this->_stdObject->{$property} = $value;
|
||||
}
|
||||
function __isset($property_name)
|
||||
{
|
||||
return isset($this->_stdObject->{$property_name});
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
function initialize($properties = array())
|
||||
{
|
||||
parent::initialize($properties);
|
||||
}
|
||||
function &__get($property)
|
||||
{
|
||||
if (isset($this->settings) && isset($this->settings[$property])) {
|
||||
$retval =& $this->settings[$property];
|
||||
return $retval;
|
||||
} else {
|
||||
return parent::__get($property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B();
|
||||
$b->settings = [ "foo" => "bar", "name" => "abc" ];
|
||||
var_dump($b->name);
|
||||
var_dump($b->settings);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Creating default object from empty value in %sbug75573.php on line %d
|
||||
|
||||
Notice: Only variable references should be returned by reference in %sbug75573.php on line %d
|
||||
string(3) "abc"
|
||||
array(2) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
["name"]=>
|
||||
string(3) "abc"
|
||||
}
|
||||
@@ -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,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,7 +1,5 @@
|
||||
--TEST--
|
||||
Testing __debugInfo() magic method with bad returns RESOURCE
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Use of non-literals in declare ticks values crashes compiler
|
||||
--FILE--
|
||||
<?php
|
||||
declare(ticks = UNKNOWN_CONST) {
|
||||
echo 'Done';
|
||||
}
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74954 (crash after update of generator yielding from finished generator)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from() {
|
||||
yield 1;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function gen($gen) {
|
||||
try {
|
||||
var_dump(yield from $gen);
|
||||
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
|
||||
}
|
||||
|
||||
$gen = from();
|
||||
$gens[] = gen($gen);
|
||||
$gens[] = gen($gen);
|
||||
|
||||
foreach ($gens as $g) {
|
||||
$g->current();
|
||||
}
|
||||
|
||||
do {
|
||||
foreach ($gens as $i => $g) {
|
||||
$g->next();
|
||||
}
|
||||
} while($gens[0]->valid());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Caught exception!
|
||||
Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): from()
|
||||
#1 [internal function]: gen(Object(Generator))
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->next()
|
||||
#2 {main}
|
||||
@@ -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,24 +0,0 @@
|
||||
--TEST--
|
||||
yield from parses too greedily
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from1234($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function bar() {
|
||||
yield 24;
|
||||
}
|
||||
|
||||
function foo() {
|
||||
yield from1234(42);
|
||||
yield from(bar());
|
||||
}
|
||||
|
||||
foreach (foo() as $value) {
|
||||
var_dump($value);
|
||||
}
|
||||
--EXPECT--
|
||||
int(42)
|
||||
int(24)
|
||||
@@ -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===
|
||||
@@ -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"
|
||||
}
|
||||
Loaded 100 of 1973 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user