mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 02:00:49 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
249a8fd9ae | ||
|
|
2b7c1bed1d | ||
|
|
8197532f68 | ||
|
|
a380163014 | ||
|
|
8b6cf164b8 |
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
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -5,6 +5,7 @@ Installing PHP
|
||||
|
||||
* General Installation Considerations
|
||||
* Installation on Unix systems
|
||||
+ Apache 1.3.x on Unix systems
|
||||
+ Apache 2.x on Unix systems
|
||||
+ Lighttpd 1.4 on Unix systems
|
||||
+ Sun, iPlanet and Netscape servers on Sun Solaris
|
||||
@@ -102,6 +103,7 @@ Installation on Unix systems
|
||||
|
||||
Table of Contents
|
||||
|
||||
* Apache 1.3.x on Unix systems
|
||||
* Apache 2.x on Unix systems
|
||||
* Lighttpd 1.4 on Unix systems
|
||||
* Sun, iPlanet and Netscape servers on Sun Solaris
|
||||
@@ -161,6 +163,208 @@ Table of Contents
|
||||
you can't figure out why, see the Problems section.
|
||||
__________________________________________________________________
|
||||
|
||||
Apache 1.3.x on Unix systems
|
||||
|
||||
This section contains notes and hints specific to Apache installs of
|
||||
PHP on Unix platforms. We also have instructions and notes for Apache 2
|
||||
on a separate page.
|
||||
|
||||
You can select arguments to add to the configure on line 10 below from
|
||||
the list of core configure options and from extension specific options
|
||||
described at the respective places in the manual. The version numbers
|
||||
have been omitted here, to ensure the instructions are not incorrect.
|
||||
You will need to replace the 'xxx' here with the correct values from
|
||||
your files.
|
||||
|
||||
Example #1 Installation Instructions (Apache Shared Module Version) for
|
||||
PHP
|
||||
1. gunzip apache_xxx.tar.gz
|
||||
2. tar -xvf apache_xxx.tar
|
||||
3. gunzip php-xxx.tar.gz
|
||||
4. tar -xvf php-xxx.tar
|
||||
5. cd apache_xxx
|
||||
6. ./configure --prefix=/www --enable-module=so
|
||||
7. make
|
||||
8. make install
|
||||
9. cd ../php-xxx
|
||||
|
||||
10. Now, configure your PHP. This is where you customize your PHP
|
||||
with various options, like which extensions will be enabled. Do a
|
||||
./configure --help for a list of available options. In our example
|
||||
we'll do a simple configure with Apache 1 and MySQL support. Your
|
||||
path to apxs may differ from our example.
|
||||
|
||||
./configure --with-mysql --with-apxs=/www/bin/apxs
|
||||
|
||||
11. make
|
||||
12. make install
|
||||
|
||||
If you decide to change your configure options after installation,
|
||||
you only need to repeat the last three steps. You only need to
|
||||
restart apache for the new module to take effect. A recompile of
|
||||
Apache is not needed.
|
||||
|
||||
Note that unless told otherwise, 'make install' will also install PEAR,
|
||||
various PHP tools such as phpize, install the PHP CLI, and more.
|
||||
|
||||
13. Setup your php.ini file:
|
||||
|
||||
cp php.ini-development /usr/local/lib/php.ini
|
||||
|
||||
You may edit your .ini file to set PHP options. If you prefer your
|
||||
php.ini in another location, use --with-config-file-path=/some/path in
|
||||
step 10.
|
||||
|
||||
If you instead choose php.ini-production, be certain to read the list
|
||||
of changes within, as they affect how PHP behaves.
|
||||
|
||||
14. Edit your httpd.conf to load the PHP module. The path on the right hand
|
||||
side of the LoadModule statement must point to the path of the PHP
|
||||
module on your system. The make install from above may have already
|
||||
added this for you, but be sure to check.
|
||||
|
||||
LoadModule php7_module libexec/libphp7.so
|
||||
|
||||
15. And in the AddModule section of httpd.conf, somewhere under the
|
||||
ClearModuleList, add this:
|
||||
|
||||
AddModule mod_php7.c
|
||||
|
||||
16. Tell Apache to parse certain extensions as PHP. For example,
|
||||
let's have Apache parse the .php extension as PHP. You could
|
||||
have any extension(s) parse as PHP by simply adding more, with
|
||||
each separated by a space. We'll add .phtml to demonstrate.
|
||||
|
||||
AddType application/x-httpd-php .php .phtml
|
||||
|
||||
It's also common to setup the .phps extension to show highlighted PHP
|
||||
source, this can be done with:
|
||||
|
||||
AddType application/x-httpd-php-source .phps
|
||||
|
||||
17. Use your normal procedure for starting the Apache server. (You must
|
||||
stop and restart the server, not just cause the server to reload by
|
||||
using a HUP or USR1 signal.)
|
||||
|
||||
Alternatively, to install PHP as a static object:
|
||||
|
||||
Example #2 Installation Instructions (Static Module Installation for
|
||||
Apache) for PHP
|
||||
1. gunzip -c apache_1.3.x.tar.gz | tar xf -
|
||||
2. cd apache_1.3.x
|
||||
3. ./configure
|
||||
4. cd ..
|
||||
|
||||
5. gunzip -c php-5.x.y.tar.gz | tar xf -
|
||||
6. cd php-5.x.y
|
||||
7. ./configure --with-mysql --with-apache=../apache_1.3.x
|
||||
8. make
|
||||
9. make install
|
||||
|
||||
10. cd ../apache_1.3.x
|
||||
|
||||
11. ./configure --prefix=/www --activate-module=src/modules/php7/libphp7.a
|
||||
(The above line is correct! Yes, we know libphp7.a does not exist at this
|
||||
stage. It isn't supposed to. It will be created.)
|
||||
|
||||
12. make
|
||||
(you should now have an httpd binary which you can copy to your Apache bin d
|
||||
ir if
|
||||
it is your first install then you need to "make install" as well)
|
||||
|
||||
13. cd ../php-5.x.y
|
||||
14. cp php.ini-development /usr/local/lib/php.ini
|
||||
|
||||
15. You can edit /usr/local/lib/php.ini file to set PHP options.
|
||||
Edit your httpd.conf or srm.conf file and add:
|
||||
AddType application/x-httpd-php .php
|
||||
|
||||
Depending on your Apache install and Unix variant, there are many
|
||||
possible ways to stop and restart the server. Below are some typical
|
||||
lines used in restarting the server, for different apache/unix
|
||||
installations. You should replace /path/to/ with the path to these
|
||||
applications on your systems.
|
||||
|
||||
Example #3 Example commands for restarting Apache
|
||||
1. Several Linux and SysV variants:
|
||||
/etc/rc.d/init.d/httpd restart
|
||||
|
||||
2. Using apachectl scripts:
|
||||
/path/to/apachectl stop
|
||||
/path/to/apachectl start
|
||||
|
||||
3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
|
||||
/path/to/httpsdctl stop
|
||||
/path/to/httpsdctl start
|
||||
|
||||
4. Using mod_ssl, or another SSL server, you may want to manually
|
||||
stop and start:
|
||||
/path/to/apachectl stop
|
||||
/path/to/apachectl startssl
|
||||
|
||||
The locations of the apachectl and http(s)dctl binaries often vary. If
|
||||
your system has locate or whereis or which commands, these can assist
|
||||
you in finding your server control programs.
|
||||
|
||||
Different examples of compiling PHP for apache are as follows:
|
||||
./configure --with-apxs --with-pgsql
|
||||
|
||||
This will create a libphp7.so shared library that is loaded into Apache
|
||||
using a LoadModule line in Apache's httpd.conf file. The PostgreSQL
|
||||
support is embedded into this library.
|
||||
|
||||
./configure --with-apxs --with-pgsql=shared
|
||||
|
||||
This will create a libphp7.so shared library for Apache, but it will
|
||||
also create a pgsql.so shared library that is loaded into PHP either by
|
||||
using the extension directive in php.ini file or by loading it
|
||||
explicitly in a script using the dl() function.
|
||||
|
||||
./configure --with-apache=/path/to/apache_source --with-pgsql
|
||||
|
||||
This will create a libmodphp7.a library, a mod_php7.c and some
|
||||
accompanying files and copy this into the src/modules/php7 directory in
|
||||
the Apache source tree. Then you compile Apache using
|
||||
--activate-module=src/modules/php7/libphp7.a and the Apache build
|
||||
system will create libphp7.a and link it statically into the httpd
|
||||
binary. The PostgreSQL support is included directly into this httpd
|
||||
binary, so the final result here is a single httpd binary that includes
|
||||
all of Apache and all of PHP.
|
||||
|
||||
./configure --with-apache=/path/to/apache_source --with-pgsql=shared
|
||||
|
||||
Same as before, except instead of including PostgreSQL support directly
|
||||
into the final httpd you will get a pgsql.so shared library that you
|
||||
can load into PHP from either the php.ini file or directly using dl().
|
||||
|
||||
When choosing to build PHP in different ways, you should consider the
|
||||
advantages and drawbacks of each method. Building as a shared object
|
||||
will mean that you can compile apache separately, and don't have to
|
||||
recompile everything as you add to, or change, PHP. Building PHP into
|
||||
apache (static method) means that PHP will load and run faster. For
|
||||
more information, see the Apache » web page on DSO support.
|
||||
|
||||
Note:
|
||||
|
||||
Apache's default httpd.conf currently ships with a section that
|
||||
looks like this:
|
||||
|
||||
User nobody
|
||||
Group "#-1"
|
||||
|
||||
Unless you change that to "Group nogroup" or something like that
|
||||
("Group daemon" is also very common) PHP will not be able to open
|
||||
files.
|
||||
|
||||
Note:
|
||||
|
||||
Make sure you specify the installed version of apxs when using
|
||||
--with-apxs=/path/to/apxs . You must NOT use the apxs version that
|
||||
is in the apache sources but the one that is actually installed on
|
||||
your system.
|
||||
__________________________________________________________________
|
||||
__________________________________________________________________
|
||||
|
||||
Apache 2.x on Unix systems
|
||||
|
||||
This section contains notes and hints specific to Apache 2.x installs
|
||||
|
||||
@@ -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
|
||||
=============
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
# =================================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
|
||||
# =================================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_FUNC_WHICH_GETHOSTBYNAME_R
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Determines which historical variant of the gethostbyname_r() call
|
||||
# (taking three, five, or six arguments) is available on the system and
|
||||
# defines one of the following macros accordingly:
|
||||
#
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_6
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_5
|
||||
# HAVE_FUNC_GETHOSTBYNAME_R_3
|
||||
#
|
||||
# as well as
|
||||
#
|
||||
# HAVE_GETHOSTBYNAME_R
|
||||
#
|
||||
# If used in conjunction with gethostname.c, the API demonstrated in
|
||||
# test.c can be used regardless of which gethostbyname_r() is available.
|
||||
# These example files can be found at
|
||||
# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
|
||||
#
|
||||
# based on David Arnold's autoconf suggestion in the threads faq
|
||||
#
|
||||
# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for
|
||||
# Autoconf 2.5x, and updated for 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
|
||||
# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 7
|
||||
|
||||
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
|
||||
|
||||
AC_LANG_PUSH([C])
|
||||
AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
|
||||
|
||||
AC_CACHE_VAL([ac_cv_func_which_gethostbyname_r], [
|
||||
|
||||
################################################################
|
||||
|
||||
ac_cv_func_which_gethostbyname_r=unknown
|
||||
|
||||
#
|
||||
# ONE ARGUMENT (sanity check)
|
||||
#
|
||||
|
||||
# This should fail, as there is no variant of gethostbyname_r() that takes
|
||||
# a single argument. If it actually compiles, then we can assume that
|
||||
# netdb.h is not declaring the function, and the compiler is thereby
|
||||
# assuming an implicit prototype. In which case, we're out of luck.
|
||||
#
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
(void)gethostbyname_r(name) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=no])
|
||||
|
||||
#
|
||||
# SIX ARGUMENTS
|
||||
# (e.g. Linux)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret, *retp;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=six])
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# FIVE ARGUMENTS
|
||||
# (e.g. Solaris)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=five])
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# THREE ARGUMENTS
|
||||
# (e.g. AIX, HP-UX, Tru64)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
|
||||
[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
struct hostent_data data;
|
||||
(void)gethostbyname_r(name, &ret, &data) /* ; */
|
||||
])],
|
||||
[ac_cv_func_which_gethostbyname_r=three])
|
||||
|
||||
fi
|
||||
|
||||
################################################################
|
||||
|
||||
]) dnl end AC_CACHE_VAL
|
||||
|
||||
case "$ac_cv_func_which_gethostbyname_r" in
|
||||
three|five|six)
|
||||
AC_DEFINE([HAVE_GETHOSTBYNAME_R], [1],
|
||||
[Define to 1 if you have some form of gethostbyname_r().])
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$ac_cv_func_which_gethostbyname_r" in
|
||||
three)
|
||||
AC_MSG_RESULT([three])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_3], [1],
|
||||
[Define to 1 if you have the three-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
five)
|
||||
AC_MSG_RESULT([five])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_5], [1],
|
||||
[Define to 1 if you have the five-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
six)
|
||||
AC_MSG_RESULT([six])
|
||||
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_6], [1],
|
||||
[Define to 1 if you have the six-argument form of gethostbyname_r().])
|
||||
;;
|
||||
|
||||
no)
|
||||
AC_MSG_RESULT([cannot find function declaration in netdb.h])
|
||||
;;
|
||||
|
||||
unknown)
|
||||
AC_MSG_RESULT([can't tell])
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([internal error])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_LANG_POP
|
||||
|
||||
]) dnl end AC_DEFUN
|
||||
|
||||
+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
-3
@@ -1,4 +1,3 @@
|
||||
m4_include([TSRM/m4/gethostbyname.m4])
|
||||
|
||||
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
||||
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
|
||||
@@ -33,8 +32,6 @@ AC_CHECK_HEADERS(stdarg.h)
|
||||
|
||||
AC_CHECK_FUNCS(sigprocmask)
|
||||
|
||||
AX_FUNC_WHICH_GETHOSTBYNAME_R()
|
||||
|
||||
])
|
||||
|
||||
|
||||
@@ -92,6 +89,7 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([TSRM_THREADS_CHECKS],[
|
||||
|
||||
dnl For the thread implementations, we always use --with-*
|
||||
|
||||
+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:
|
||||
|
||||
@@ -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
|
||||
#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,43 +0,0 @@
|
||||
--TEST--
|
||||
Using indirect append on ArrayAccess object
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class AA implements ArrayAccess {
|
||||
private $data = [];
|
||||
public function &offsetGet($name) {
|
||||
if (null === $name) {
|
||||
return $this->data[];
|
||||
} else {
|
||||
return $this->data[$name];
|
||||
}
|
||||
}
|
||||
public function offsetSet($name, $value) {
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
public function offsetUnset($name) {}
|
||||
public function offsetExists($name) {}
|
||||
}
|
||||
|
||||
$aa = new AA;
|
||||
$aa[3] = 1;
|
||||
$aa[][][0] = 2;
|
||||
var_dump($aa);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(AA)#1 (1) {
|
||||
["data":"AA":private]=>
|
||||
array(2) {
|
||||
[3]=>
|
||||
int(1)
|
||||
[4]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -23,4 +23,4 @@ class B extends A {
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of B::foo($var) must be compatible with I::foo() in %sbug62358.php on line 17
|
||||
Warning: Declaration of B::foo($var) should be compatible with A::foo() in %sbug62358.php on line %d
|
||||
@@ -18,4 +18,4 @@ $test = new Foo();
|
||||
var_dump($test instanceof Baz);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to Foo::bad() must be public (as in class Baz) in %sbug69467.php on line %d
|
||||
Fatal error: Access level to Bar::bad() must be public (as in class Baz) in %sbug69467.php on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69537 (__debugInfo with empty string for key gives error)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
|
||||
public function __debugInfo(){
|
||||
return ['' => 1];
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(new Foo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(Foo)#%d (%d) {
|
||||
[""]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
@@ -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 ]
|
||||
@@ -27,6 +27,8 @@ $c10 = new C10;
|
||||
var_dump($c10[] += 5);
|
||||
--EXPECTF--
|
||||
Inside C10::offsetGet
|
||||
|
||||
Notice: Undefined variable: offset in %sbug69955.php on line 10
|
||||
NULL
|
||||
|
||||
Inside C10::offsetSet
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71359: Null coalescing operator and magic
|
||||
--FILE--
|
||||
<?php
|
||||
class AA {
|
||||
private $data = [];
|
||||
public function __isset($name) {
|
||||
echo "__isset($name)\n";
|
||||
return array_key_exists($name, $this->data);
|
||||
}
|
||||
public function &__get($name) {
|
||||
echo "__get($name)\n";
|
||||
if (!array_key_exists($name, $this->data)) {
|
||||
throw new Exception('Unknown offset');
|
||||
}
|
||||
return $this->data[$name];
|
||||
}
|
||||
public function __set($name, $value) {
|
||||
echo "__set($name)\n";
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
public function __unset($name) {
|
||||
echo "__unset($name)\n";
|
||||
unset($this->data[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$aa = new AA;
|
||||
var_dump(isset($aa->zero->one->two));
|
||||
var_dump(isset($aa->zero->foo));
|
||||
var_dump($aa->zero ?? 42);
|
||||
var_dump($aa->zero->one->two ?? 42);
|
||||
$aa->zero = new AA;
|
||||
$aa->zero->one = new AA;
|
||||
var_dump(isset($aa->zero->one->two));
|
||||
var_dump($aa->zero->one->two ?? 42);
|
||||
?>
|
||||
--EXPECT--
|
||||
__isset(zero)
|
||||
bool(false)
|
||||
__isset(zero)
|
||||
bool(false)
|
||||
__isset(zero)
|
||||
int(42)
|
||||
__isset(zero)
|
||||
int(42)
|
||||
__set(zero)
|
||||
__get(zero)
|
||||
__set(one)
|
||||
__isset(zero)
|
||||
__get(zero)
|
||||
__isset(one)
|
||||
__get(one)
|
||||
__isset(two)
|
||||
bool(false)
|
||||
__isset(zero)
|
||||
__get(zero)
|
||||
__isset(one)
|
||||
__get(one)
|
||||
__isset(two)
|
||||
int(42)
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71414 (Interface method override inherited method and implemented in a trait causes fatal error)
|
||||
--FILE--
|
||||
<?php
|
||||
interface InterfaceY {
|
||||
public function z(): string;
|
||||
}
|
||||
|
||||
trait TraitY {
|
||||
public function z(): string {
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
public function z() {
|
||||
}
|
||||
}
|
||||
|
||||
class Y extends X implements InterfaceY {
|
||||
use TraitY;
|
||||
}
|
||||
|
||||
echo "ok";
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
bug #71428.1: inheritance with null default values
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function m(array $a = null) {}
|
||||
}
|
||||
class B extends A {
|
||||
public function m(array $a = []) {}
|
||||
}
|
||||
--EXPECTF--
|
||||
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(array $a = NULL) in %sbug71428.1.php on line 7
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
bug #71428.2: inheritance of ye olde dynamic interfaces
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('pdo')) die("skip PDO is not available"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
interface StatementInterface {
|
||||
public function fetch($first = null, $second, $third);
|
||||
}
|
||||
|
||||
class Statement extends PDOStatement implements StatementInterface {}
|
||||
|
||||
interface StatementInterface1 {
|
||||
public function fetch($first = null, $second = null, $third = null);
|
||||
}
|
||||
|
||||
class Statement1 extends PDOStatement implements StatementInterface1 {}
|
||||
|
||||
echo "ok";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
bug #71428: Validation type inheritance with = NULL
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A { }
|
||||
class B { public function m(A $a = NULL, $n) { echo "B.m";} };
|
||||
class C extends B { public function m(A $a , $n) { echo "C.m";} };
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(A $a = NULL, $n) in %sbug71428.3.php on line 4
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71731: Null coalescing operator and ArrayAccess
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class AA implements ArrayAccess {
|
||||
private $data = [];
|
||||
public function offsetExists($name) {
|
||||
echo "offsetExists($name)\n";
|
||||
return array_key_exists($name, $this->data);
|
||||
}
|
||||
public function &offsetGet($name) {
|
||||
echo "offsetGet($name)\n";
|
||||
if (!array_key_exists($name, $this->data)) {
|
||||
throw new Exception('Unknown offset');
|
||||
}
|
||||
return $this->data[$name];
|
||||
}
|
||||
public function offsetSet($name, $value) {
|
||||
echo "offsetSet($name)\n";
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
public function offsetUnset($name) {
|
||||
echo "offsetUnset($name)\n";
|
||||
unset($this->data[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$aa = new AA;
|
||||
var_dump(isset($aa[0][1][2]));
|
||||
var_dump(isset($aa[0]->foo));
|
||||
var_dump($aa[0] ?? 42);
|
||||
var_dump($aa[0][1][2] ?? 42);
|
||||
|
||||
$aa[0] = new AA;
|
||||
$aa[0][1] = new AA;
|
||||
var_dump(isset($aa[0][1][2]));
|
||||
var_dump($aa[0][1][2] ?? 42);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
offsetExists(0)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
int(42)
|
||||
offsetExists(0)
|
||||
int(42)
|
||||
offsetSet(0)
|
||||
offsetGet(0)
|
||||
offsetSet(1)
|
||||
offsetExists(0)
|
||||
offsetGet(0)
|
||||
offsetExists(1)
|
||||
offsetGet(1)
|
||||
offsetExists(2)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
offsetGet(0)
|
||||
offsetExists(1)
|
||||
offsetGet(1)
|
||||
offsetExists(2)
|
||||
int(42)
|
||||
@@ -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,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71841 (EG(error_zval) is not handled well)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
$z = unserialize('O:1:"A":0:{}');
|
||||
var_dump($z->e.=0);
|
||||
var_dump(++$z->x);
|
||||
var_dump($z->y++);
|
||||
|
||||
$y = array(PHP_INT_MAX => 0);
|
||||
var_dump($y[] .= 0);
|
||||
var_dump(++$y[]);
|
||||
var_dump($y[]++);
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71859 (zend_objects_store_call_destructors operates on realloced memory, crashing)
|
||||
--FILE--
|
||||
<?php
|
||||
class constructs_in_destructor {
|
||||
public function __destruct() {
|
||||
//We are now in zend_objects_store_call_destructors
|
||||
//This causes a realloc in zend_objects_store_put
|
||||
for ($i = 0; $i < 10000; ++$i) {
|
||||
$GLOBALS["a$i"] = new stdClass;
|
||||
}
|
||||
//Returns to zend_objects_store_call_destructors, to access freed memory.
|
||||
}
|
||||
}
|
||||
|
||||
$a = new constructs_in_destructor;
|
||||
//Create cycle so destructors are ran only in zend_objects_store_call_destructors
|
||||
$a->a = $a;
|
||||
|
||||
// Create some objects so zend_objects_store_call_destructors has something
|
||||
// to do after constructs_in_destructor is destroyed.
|
||||
for ($i = 0; $i < 200; ++$i) {
|
||||
$GLOBALS["b$i"] = new stdClass;
|
||||
}
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71871: Interfaces allow final and abstract functions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface test {
|
||||
final function test();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71871: Interfaces allow final and abstract functions
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface test {
|
||||
abstract function test();
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71914 (Reference is lost in "switch")
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function bug(&$value) {
|
||||
switch ($value) {
|
||||
case "xxxx":
|
||||
$value = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function returnArray() {
|
||||
$array = array();
|
||||
$array["str"] = "xxxx";
|
||||
return $array;
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public $array = array("str" => "xxxx");
|
||||
}
|
||||
|
||||
function test($arr, &$dummy) {
|
||||
bug($arr["str"]);
|
||||
var_dump($arr["str"]);
|
||||
}
|
||||
|
||||
$foo = new Foo();
|
||||
$arr = returnArray();
|
||||
|
||||
$array = array("str" => "xxxx");
|
||||
test($array, $array["str"]);
|
||||
test($arr, $arr["str"]);
|
||||
test($foo->array, $foo->array["str"]);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71922: Crash on assert(new class{});
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
assert.exception=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
assert(0 && new class {
|
||||
} && new class(42) extends stdclass {
|
||||
});
|
||||
} catch (AssertionError $e) {
|
||||
echo "Assertion failure: ", $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Assertion failure: assert(0 && new class {
|
||||
} && new class(42) extends stdclass {
|
||||
})
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
die("skip Require a resource which is able to hold a callbck");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public static function dummy() {
|
||||
}
|
||||
}
|
||||
|
||||
$a = array();
|
||||
$a[] = "A";
|
||||
$a[] = "dummy";
|
||||
|
||||
$ch1 = curl_init();
|
||||
curl_setopt($ch1, CURLOPT_HEADERFUNCTION, $a);
|
||||
|
||||
set_error_handler($a);
|
||||
set_error_handler(function()use($ch1){});
|
||||
set_error_handler(function(){});
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71980: Decorated/Nested Generator is Uncloseable in Finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Dtor {
|
||||
public function __destruct() {
|
||||
echo "Dtor\n";
|
||||
}
|
||||
}
|
||||
|
||||
function gen1() {
|
||||
try {
|
||||
foreach ([42, new Dtor] as $value) {
|
||||
yield $value;
|
||||
}
|
||||
} finally {
|
||||
echo "Finally\n";
|
||||
}
|
||||
}
|
||||
|
||||
function gen2() {
|
||||
try {
|
||||
var_dump(new Dtor, yield);
|
||||
} finally {
|
||||
echo "Finally\n";
|
||||
}
|
||||
}
|
||||
|
||||
$gen = gen1();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
|
||||
$gen = gen2();
|
||||
$gen->rewind();
|
||||
unset($gen);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Dtor
|
||||
Finally
|
||||
Dtor
|
||||
Finally
|
||||
@@ -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(52): 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,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)
|
||||
Loaded 100 of 2184 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user