Compare commits

..
6 Commits
Author SHA1 Message Date
Anatol Belski 4e1b870157 reapply the sysconf error check patch 2016-02-02 15:17:09 +01:00
Anatol Belski 6a48256752 fix dir separator 2016-02-02 09:59:00 +01:00
Anatol Belski bbde901c6d fix directory separator in test 2016-02-02 09:58:38 +01:00
Anatol Belski 569dae22dc update libs version 2016-02-02 09:05:46 +01:00
Anatol Belski a5f38da057 set release version 2016-02-02 08:36:10 +01:00
Anatol Belski 315bf08de1 update NEWS 2016-02-02 08:35:20 +01:00
2099 changed files with 43626 additions and 129171 deletions

No files matched your search

-57
View File
@@ -1,57 +0,0 @@
version: "{branch}.build.{build}"
image: Visual Studio 2015
branches:
except:
- PHP-5.6
- PHP-7.0
skip_commits:
files:
- NEWS
- UPGRADING*
- README.*
clone_depth: 64
cache:
- c:\build-cache
- c:\build-cache\sdk -> .appveyor.yml
environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.4
# 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
-16
View File
@@ -1,16 +0,0 @@
; http://editorconfig.org/
root = true
[*.{c,h}]
charset = UTF-8
end_of_line = LF
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
[*.yml]
indent_size = 2
indent_style = space
+98 -69
View File
@@ -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
-1
View File
@@ -148,7 +148,6 @@ tests/*/*/*.sh
*/tests/*/*/*.sh
*/*/tests/*.diff
*/*/tests/*.out
*/*/tests/*.out.png
*/*/tests/*.php
*/*/tests/*.exp
*/*/tests/*.log
+1 -1
View File
@@ -178,7 +178,7 @@ Internal Function Naming Convensions
Unexposed module function should be static and should not be defined in
'php_modulename.h'.
static int php_session_destroy()
static int php_session_destroy(TSRMLS_D)
2. Main module source file must be named 'modulename.c'.
+4 -4
View File
@@ -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
-------------------------------------------------------------------------------
+204
View File
@@ -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 -1
View File
@@ -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
+16 -1527
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -172,7 +172,7 @@ PHP_FUNCTION(module_name_drawtext)
zval *image = NULL;
zval *font = NULL;
if (zend_parse_parameters(argc, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
if (zend_parse_parameters(argc TSRMLS_CC, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE)
return;
if (image) {
+37 -37
View File
@@ -8,98 +8,98 @@ API adjustment to the old output control code:
Checking output control layers status:
// Using OG()
php_output_get_status();
php_output_get_status(TSRMLS_C);
Starting the default output handler:
// php_start_ob_buffer(NULL, 0, 1);
php_output_start_default();
// php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
php_output_start_default(TSRMLS_C);
Starting an user handler by zval:
// php_start_ob_buffer(zhandler, chunk_size, erase);
php_output_start_user(zhandler, chunk_size, flags);
// php_start_ob_buffer(zhandler, chunk_size, erase TSRMLS_CC);
php_output_start_user(zhandler, chunk_size, flags TSRMLS_CC);
Starting an internal handler whithout context:
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase);
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags);
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase TSRMLS_CC);
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags TSRMLS_CC);
Starting an internal handler with context:
// not possible with old API
php_output_handler *h;
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags);
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags TSRMLS_CC);
php_output_handler_set_context(h, my_context, my_context_dtor);
php_output_handler_start(h);
php_output_handler_start(h TSRMLS_CC);
Testing whether a certain output handler has already been started:
// php_ob_handler_used("output handler name");
php_output_handler_started(handler_name, handler_name_len);
// php_ob_handler_used("output handler name" TSRMLS_CC);
php_output_handler_started(handler_name, handler_name_len TSRMLS_CC);
Flushing one output buffer:
// php_end_ob_buffer(1, 1);
php_output_flush();
// php_end_ob_buffer(1, 1 TSRMLS_CC);
php_output_flush(TSRMLS_C);
Flushing all output buffers:
// not possible with old API
php_output_flush_all();
php_output_flush_all(TSRMLS_C);
Cleaning one output buffer:
// php_ob_end_buffer(0, 1);
php_output_clean();
// php_ob_end_buffer(0, 1 TSRMLS_CC);
php_output_clean(TSRMLS_C);
Cleaning all output buffers:
// not possible with old API
php_output_clean_all();
php_output_clean_all(TSRMLS_C);
Discarding one output buffer:
// php_ob_end_buffer(0, 0);
php_output_discard();
// php_ob_end_buffer(0, 0 TSRMLS_CC);
php_output_discard(TSRMLS_C);
Discarding all output buffers:
// php_ob_end_buffers(0);
php_output_discard_all();
// php_ob_end_buffers(0 TSRMLS_CC);
php_output_discard_all(TSRMLS_C);
Stopping (and dropping) one output buffer:
// php_ob_end_buffer(1, 0)
php_output_end();
// php_ob_end_buffer(1, 0 TSRMLS_CC)
php_output_end(TSRMLS_C);
Stopping (and dropping) all output buffers:
// php_ob_end_buffers(1, 0);
php_output_end_all();
// php_ob_end_buffers(1, 0 TSRMLS_CC);
php_output_end_all(TSRMLS_C);
Retrieving output buffers contents:
// php_ob_get_buffer(zstring);
php_output_get_contents(zstring);
// php_ob_get_buffer(zstring TSRMLS_CC);
php_output_get_contents(zstring TSRMLS_CC);
Retrieving output buffers length:
// php_ob_get_length(zlength);
php_output_get_length(zlength);
// php_ob_get_length(zlength TSRMLS_CC);
php_output_get_length(zlength TSRMLS_CC);
Retrieving output buffering level:
// OG(nesting_level);
php_output_get_level();
php_output_get_level(TSRMLS_C);
Issue a warning because of an output handler conflict:
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name");
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len);
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name" TSRMLS_CC);
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len TSRMLS_CC);
Registering a conflict checking function, which will be checked prior starting the handler:
// not possible with old API, unless hardcoding into output.c
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t);
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler:
// not possible with old API
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t);
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t TSRMLS_CC);
Facilitating a context from within an output handler callable with ob_start():
// not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr);
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr TSRMLS_CC);
Disabling of the output handler by itself:
//not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL);
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL TSRMLS_CC);
Marking an output handler immutable by itself because of irreversibility of its operation:
// not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
Restarting the output handler because of a CLEAN operation:
// not possible with old API
+16 -16
View File
@@ -13,8 +13,8 @@ meaningful error messages.
Prototypes
----------
/* Implemented. */
int zend_parse_parameters(int num_args, char *type_spec, ...);
int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
The zend_parse_parameters() function takes the number of parameters
passed to the extension function, the type specifier string, and the
@@ -30,7 +30,7 @@ resources cannot be auto-converted.
PHP 5.5 includes a new function:
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg, const char *spec, ...);
This function behaves like zend_parse_parameters_ex() except that instead of
reading the arguments from the stack, it receives a single zval to convert
@@ -63,10 +63,10 @@ Type specifiers
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
p - valid path (string without null bytes in the middle) and its length (char*, size_t)
P - valid path (string without null bytes in the middle) as zend_string (zend_string*)
P - valid path (string without null bytes in the middle) as zend_string (zend_string)
r - resource (zval*)
s - string (with possible null bytes) and its length (char*, size_t)
S - string (with possible null bytes) as zend_string (zend_string*)
S - string (with possible null bytes) as zend_string (zend_string)
z - the actual zval (zval*)
* - variable arguments list (0 or more)
+ - variable arguments list (1 or more)
@@ -97,11 +97,11 @@ Both mistakes might cause memory corruptions and segfaults:
1)
char *str;
long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */
zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len)
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
2)
int num; /* XXX THIS IS WRONG!! Use zend_long instead. */
zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num)
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num)
If you're in doubt, use check_parameters.php script to the parameters
and their types (it can be found in ./scripts/dev/ directory of PHP sources):
@@ -116,7 +116,7 @@ zend_long l;
char *s;
size_t s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
&l, &s, &s_len, &param) == FAILURE) {
return;
}
@@ -126,7 +126,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
zval *obj;
double d = 0.5;
zend_class_entry *my_ce;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
&obj, my_ce, &d) == FAILURE) {
return;
}
@@ -136,7 +136,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
If null is passed for object, obj will be set to NULL. */
zval *obj;
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a",
&obj, &arr) == FAILURE) {
return;
}
@@ -144,7 +144,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
/* Gets a separated array which can also be null. */
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
&arr) == FAILURE) {
return;
}
@@ -161,10 +161,10 @@ char *s;
*/
size_t length;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"s", &s, &length) == SUCCESS) {
/* manipulate string */
} else {
@@ -180,7 +180,7 @@ int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &varargs, &num_varargs) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) {
return;
}
@@ -200,7 +200,7 @@ size_t str_len;
int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
return;
}
@@ -214,7 +214,7 @@ zval *array;
int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
return;
}
+44 -19
View File
@@ -5,16 +5,17 @@
5. ext/standard crypt
6. ext/standard crypt's blowfish implementation
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
8. ext/standard/rand
9. ext/standard/scanf
10. ext/standard/strnatcmp.c
11. ext/standard/uuencode
12. libxmlrpc ext/xmlrpc
13. libzip ext/zip
14. main/snprintf.c
15. main/strlcat
16. main/strlcpy
17. libgd see ext/gd/libgd/COPYING
8. ext/json/json_parser
9. ext/standard/rand
10. ext/standard/scanf
11. ext/standard/strnatcmp.c
12. ext/standard/uuencode
13. libxmlrpc ext/xmlrpc
14. libzip ext/zip
15. main/snprintf.c
16. main/strlcat
17. main/strlcpy
18. libgd see ext/gd/libgd/COPYING
5. ext/standard crypt
@@ -103,7 +104,31 @@ a legal notice, here is a blessing:
May you share freely, never taking more than you give.
8. ext/standard/rand
8. ext/json/json_parser
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9. ext/standard/rand
The following php_mt_...() functions are based on a C++ class MTRand by
Richard J. Wagner. For more information see the web page at
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
@@ -156,7 +181,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9. ext/standard/scanf
10. ext/standard/scanf
scanf.c --
This file contains the base code which implements sscanf and by extension
@@ -202,7 +227,7 @@ authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
10. ext/standard/strnatcmp.c
11. ext/standard/strnatcmp.c
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
@@ -223,7 +248,7 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
11. ext/standard/uuencode
12. ext/standard/uuencode
Portions of this code are based on Berkeley's uuencode/uudecode
implementation.
@@ -259,7 +284,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
12. libxmlrpc ext/xmlrpc
13. libxmlrpc ext/xmlrpc
Copyright 2000 Epinions, Inc.
@@ -283,7 +308,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
DAMAGES.
13. libzip ext/zip
14. libzip ext/zip
zip.h -- exported declarations.
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
@@ -315,7 +340,7 @@ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14. main/snprintf.c
15. main/snprintf.c
Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
Permission to use, copy, modify, and distribute this software for any
@@ -388,8 +413,8 @@ This code is based on, and used with the permission of, the
SIO stdio-replacement strx_* functions by Panos Tsirigotis
<panos@alumni.cs.colorado.edu> for xinetd.
15. main/strlcat
16. main/strlcpy
16. main/strlcat
17. main/strlcpy
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.
+9 -12
View File
@@ -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
------------------------------------
+3 -3
View File
@@ -28,7 +28,7 @@ The main functions are:
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
count);
PHPAPI size_t php_stream_printf(php_stream * stream,
PHPAPI size_t php_stream_printf(php_stream * stream TSRMLS_DC,
const char * fmt, ...);
PHPAPI int php_stream_eof(php_stream * stream);
PHPAPI int php_stream_getc(php_stream * stream);
@@ -47,7 +47,7 @@ Opening Streams
In most cases, you should use this API:
PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode,
int options, char **opened_path);
int options, char **opened_path TSRMLS_DC);
Where:
path is the file or resource to open.
@@ -80,7 +80,7 @@ PHPAPI php_stream *php_stream_fopen_tmpfile(void);
Open a FILE * with tmpfile() and convert into a stream.
PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir,
const char *pfx, char **opened_path);
const char *pfx, char **opened_path TSRMLS_DC);
Generate a temporary file name and open it.
There are some network enabled relatives in php_network.h:
+2 -2
View File
@@ -138,7 +138,7 @@ SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter)
strcpy(raw_var, "RAW_");
strlcat(raw_var,var,var_len+5);
php_register_variable_ex(raw_var, &new_var, array_ptr);
php_register_variable_ex(raw_var, &new_var, array_ptr TSRMLS_DC);
php_strip_tags(*val, val_len, NULL, NULL, 0);
@@ -154,7 +154,7 @@ PHP_FUNCTION(my_get_raw)
zval **tmp;
zval *array_ptr = NULL;
if(zend_parse_parameters(2, "ls", &arg, &var, &var_len) == FAILURE) {
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
return;
}
-1
View File
@@ -5,7 +5,6 @@ This is the github mirror of the official PHP repository located at
http://git.php.net.
[![Build Status](https://secure.travis-ci.org/php/php-src.svg?branch=master)](http://travis-ci.org/php/php-src)
[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy?svg=true)](https://ci.appveyor.com/project/php/php-src)
Pull Requests
=============
+2 -2
View File
@@ -170,8 +170,8 @@ TSRM_API void *tsrm_get_ls_cache(void);
#define TSRMG_STATIC(id, type, element) (TSRMG_BULK_STATIC(id, type)->element)
#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE;
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL
#if ZEND_DEBUG
#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
#else
-197
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
+2 -2
View File
@@ -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 |
@@ -72,7 +72,7 @@ typedef struct {
#ifdef ZTS
# define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v)
TSRMLS_CACHE_EXTERN()
TSRMLS_CACHE_EXTERN();
#else
# define TWG(v) (win32_globals.v)
#endif
-41
View File
@@ -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
View File
@@ -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
View File
@@ -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)
+4
View File
@@ -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)
}
-12
View File
@@ -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
-11
View File
@@ -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
+1 -2
View File
@@ -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);
}
+2 -1
View File
@@ -10,4 +10,5 @@ class foo {
$obj = new foo("Hello world");
?>
--EXPECTF--
Fatal error: Cannot use $this as parameter in %s on line %d
Fatal error: Cannot re-assign $this in %sbug41117_1.php on line 3
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
-19
View File
@@ -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)
}
+2
View File
@@ -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
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #69989: Cycle collection for yielded values
--FILE--
<?php
function gen() {
yield yield;
}
$gen = gen();
$gen->send($gen);
?>
===DONE===
--EXPECT--
===DONE===
-61
View File
@@ -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)
-25
View File
@@ -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
-15
View File
@@ -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
-23
View File
@@ -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
-13
View File
@@ -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
-13
View File
@@ -1,13 +0,0 @@
--TEST--
Bug #71470: Leaked 1 hashtable iterators
--FILE--
<?php
$array = [1, 2, 3];
foreach ($array as &$v) {
die("foo\n");
}
?>
--EXPECT--
foo
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #71474: Crash because of VM stack corruption on Magento2
--FILE--
<?php
class foo {
function __call($name, $args) {
$a = $b = $c = $d = $e = $f = 1;
}
}
function test($n, $x) {
// var_dump($n);
if ($n > 0) {
$x->bug();
test($n - 1, $x);
}
}
test(3000, new foo());
echo "OK\n";
?>
--EXPECT--
OK
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #71529: Variable references on array elements don't work when using count
--FILE--
<?php
$a = [1];
$a[] = &$a[out(count($a) - 1)];
var_dump($a);
function out($what) {
var_dump($what);
return $what;
}
?>
--EXPECT--
int(0)
array(2) {
[0]=>
&int(1)
[1]=>
&int(1)
}
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #71622 (Strings used in pass-as-reference cannot be used to invoke C::$callable())
--FILE--
<?php
function getMethodName(&$methodName) {
$methodName = Abc::METHOD_NAME;
}
class Abc {
const METHOD_NAME = "goal";
private static function goal() {
echo "success\n";
}
public static function run() {
$method = "foobar";
getMethodName($method);
var_dump(is_callable("self::$method"));
self::$method();
}
}
Abc::run();
?>
--EXPECT--
bool(true)
success
-17
View File
@@ -1,17 +0,0 @@
--TEST--
Bug #71695 (Global variables are reserved before execution)
--FILE--
<?php
function provideGlobals() {
var_dump(array_key_exists("foo", $GLOBALS));
var_dump(isset($GLOBALS["foo"]));
$GLOBALS += array("foo" => "foo");
}
provideGlobals();
echo $foo;
?>
--EXPECT--
bool(false)
bool(false)
foo
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #71724: yield from does not count EOLs
--FILE--
<?php
function test()
{
yield
from [__LINE__];
}
var_dump(test()->current());
?>
--EXPECT--
int(10)
-64
View File
@@ -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)
-16
View File
@@ -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
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #71756 (Call-by-reference widens scope to uninvolved functions when used in switch)
--FILE--
<?php
function a ($option) {
b($option['bla']);
c($option);
var_dump($option);
}
function b (&$string) {
$string = 'changed';
}
function c ($option) {
switch ($option['bla']) {
case 'changed':
$copy = $option;
$copy['bla'] = 'copy';
break;
}
}
a(array('bla' => 'false'));
?>
--EXPECTF--
array(1) {
["bla"]=>
string(7) "changed"
}
-23
View File
@@ -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
-28
View File
@@ -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
-12
View File
@@ -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
-12
View File
@@ -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
-40
View File
@@ -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)
-21
View File
@@ -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 {
})
-30
View File
@@ -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
-43
View File
@@ -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
-27
View File
@@ -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)
-21
View File
@@ -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
-85
View File
@@ -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
-18
View File
@@ -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
-10
View File
@@ -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
-43
View File
@@ -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
-28
View File
@@ -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"
}
-17
View File
@@ -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}"
-33
View File
@@ -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
}
-16
View File
@@ -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===
-43
View File
@@ -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
)
)
)
-18
View File
@@ -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===
-17
View File
@@ -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
-20
View File
@@ -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)
-12
View File
@@ -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
-50
View File
@@ -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) {
}
}
}
}
-22
View File
@@ -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
-20
View File
@@ -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) ""
}
-12
View File
@@ -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
-18
View File
@@ -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
-27
View File
@@ -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,
))
-73
View File
@@ -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)
}
-29
View File
@@ -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"
-20
View File
@@ -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
-16
View File
@@ -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]
-23
View File
@@ -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
-16
View File
@@ -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"
}
-28
View File
@@ -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
-19
View File
@@ -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
-19
View File
@@ -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)
-14
View File
@@ -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--
-38
View File
@@ -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
-11
View File
@@ -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
-18
View File
@@ -1,18 +0,0 @@
--TEST--
call_user_func() should not use FUNC_ARG fetches
--FILE--
<?php
function foo(&$ref) { $ref = 24; }
$a = [];
call_user_func('foo', $a[0][0]);
var_dump($a);
?>
--EXPECTF--
Notice: Undefined offset: 0 in %s on line %d
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
array(0) {
}
@@ -1,73 +0,0 @@
--TEST--
call_user_func_array() passes value to prefer-ref arg if element wasn't a reference
--FILE--
<?php
namespace {
call_user_func_array('array_multisort', [[3, 2, 1]]);
$args = [[3, 2, 1]];
call_user_func_array('array_multisort', $args);
var_dump($args);
unset($args);
$array = [3, 2, 1];
call_user_func('array_multisort', $array);
var_dump($array);
unset($array);
}
namespace Foo {
call_user_func_array('array_multisort', [[3, 2, 1]]);
$args = [[3, 2, 1]];
call_user_func_array('array_multisort', $args);
var_dump($args);
unset($args);
$array = [3, 2, 1];
call_user_func('array_multisort', $array);
var_dump($array);
unset($array);
}
?>
--EXPECT--
array(1) {
[0]=>
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
}
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
array(1) {
[0]=>
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
}
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
@@ -1,16 +0,0 @@
--TEST--
Closure::__invoke() is case insensitive
--FILE--
<?php
$inc = function(&$n) {
$n++;
};
$n = 1;
$inc->__INVOKE($n);
var_dump($n);
?>
--EXPECT--
int(2)
Loaded 100 of 2099 files, more files were not shown because too many files have changed in this diff. Show more