mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2874f7bf9 | ||
|
|
8978bd2ebe | ||
|
|
8773a2e820 | ||
|
|
18b6f6ee01 | ||
|
|
66c42fcf49 | ||
|
|
9ae680b065 |
No files matched your search
@@ -1,57 +0,0 @@
|
||||
|
||||
version: "{branch}.build.{build}"
|
||||
|
||||
image: Visual Studio 2015
|
||||
|
||||
branches:
|
||||
except:
|
||||
- PHP-5.6
|
||||
- PHP-7.0
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- NEWS
|
||||
- UPGRADING*
|
||||
- README.*
|
||||
|
||||
clone_depth: 64
|
||||
|
||||
cache:
|
||||
- c:\build-cache
|
||||
- c:\build-cache\sdk -> .appveyor.yml
|
||||
|
||||
environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!"
|
||||
#PDO_MYSQL_TEST_USER: root
|
||||
#PDO_MYSQL_TEST_PASS: Password12!
|
||||
#PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!"
|
||||
#PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!"
|
||||
#build permutations
|
||||
matrix:
|
||||
- THREAD_SAFE: 0
|
||||
OPCACHE: 0
|
||||
- THREAD_SAFE: 1
|
||||
OPCACHE: 1
|
||||
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql95
|
||||
|
||||
platform:
|
||||
- x64
|
||||
# - x86
|
||||
|
||||
build_script:
|
||||
- appveyor\build.bat
|
||||
|
||||
test_script:
|
||||
- appveyor\test.bat
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
; http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
charset = UTF-8
|
||||
end_of_line = LF
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
@@ -29,33 +29,22 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
set $cv_count = $cv_ex_ptr.func.op_array.last_var
|
||||
set $cv = $cv_ex_ptr.func.op_array.vars
|
||||
set $cv_idx = 0
|
||||
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
|
||||
|
||||
printf "Compiled variables count: %d\n\n", $cv_count
|
||||
while $cv_idx < $cv_count
|
||||
printf "[%d] '%s'\n", $cv_idx, $cv[$cv_idx].val
|
||||
set $zvalue = ((zval *) $cv_ex_ptr) + $callFrameSize + $cv_idx
|
||||
printzv $zvalue
|
||||
set $cv_idx = $cv_idx + 1
|
||||
end
|
||||
end
|
||||
|
||||
document print_cvs
|
||||
Prints the compiled variables and their values.
|
||||
If a zend_execute_data pointer is set this will print the compiled
|
||||
variables of that scope. If no parameter is used it will use
|
||||
current_execute_data for scope.
|
||||
|
||||
usage: print_cvs [zend_execute_data *]
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
@@ -207,17 +196,12 @@ define ____printzv_contents
|
||||
____executor_globals
|
||||
set $handle = $zvalue->value.obj.handle
|
||||
set $handlers = $zvalue->value.obj.handlers
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
set $zobj = $zvalue->value.obj
|
||||
set $cname = $zobj->ce->name->val
|
||||
printf "(%s) #%d", $cname, $handle
|
||||
if ! $arg1
|
||||
if $handlers->get_properties == &zend_std_get_properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
set $ht = $zobj->properties
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -228,7 +212,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "not found"
|
||||
echo "no properties found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -471,9 +455,9 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
set $pi = $arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
@@ -492,27 +476,16 @@ define print_pi
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
print_zstr $pi->name
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_pi
|
||||
Takes a pointer to an object's property and prints the property information
|
||||
usage: print_pi <ptr>
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
end
|
||||
|
||||
define ____print_str
|
||||
set $tmp = 0
|
||||
set $str = $arg0
|
||||
if $argc > 2
|
||||
set $maxlen = $arg2
|
||||
else
|
||||
set $maxlen = 256
|
||||
end
|
||||
|
||||
printf "\""
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -581,23 +554,6 @@ document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define print_zstr
|
||||
set $zstr = (zend_string *)$arg0
|
||||
if $argc == 2
|
||||
set $maxlen = $arg1
|
||||
else
|
||||
set $maxlen = $zstr->len
|
||||
end
|
||||
printf "string(%d) ", $zstr->len
|
||||
____print_str $zstr->val $zstr->len $maxlen
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
document print_zstr
|
||||
print the length and contents of a zend string
|
||||
usage: print_zstr <ptr> [max length]
|
||||
end
|
||||
|
||||
define zbacktrace
|
||||
____executor_globals
|
||||
dump_bt $eg.current_execute_data
|
||||
@@ -610,6 +566,79 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
@@ -148,7 +148,6 @@ tests/*/*/*.sh
|
||||
*/tests/*/*/*.sh
|
||||
*/*/tests/*.diff
|
||||
*/*/tests/*.out
|
||||
*/*/tests/*.out.png
|
||||
*/*/tests/*.php
|
||||
*/*/tests/*.exp
|
||||
*/*/tests/*.log
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ User Functions/Methods Naming Conventions
|
||||
'foobar'
|
||||
'foo_bar'
|
||||
|
||||
Internal Function Naming Conventions
|
||||
Internal Function Naming Convensions
|
||||
----------------------
|
||||
|
||||
1. Functions that are part of the external API should be named
|
||||
|
||||
+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
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -286,7 +286,7 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2017 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2016 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ install-headers:
|
||||
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
|
||||
done; \
|
||||
$(mkinstalldirs) $$paths && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
|
||||
for i in `echo $(INSTALL_HEADERS)`; do \
|
||||
if test "$(PHP_PECL_EXTENSION)"; then \
|
||||
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ The next few rules are more of a technical nature::
|
||||
should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
|
||||
not master, which is not a public released version yet.
|
||||
|
||||
3. Do not commit multiple files and dump all messages in one commit. If you
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
provide a nice commit message for each one. See example below.
|
||||
|
||||
|
||||
+15
-18
@@ -17,7 +17,7 @@ It is recommended to do so a couple of days before the packaging day, to
|
||||
have enough time to investigate failures, communicate with the authors and
|
||||
commit the fixes.
|
||||
The RM for the branch is also responsible for keeping the CI green on
|
||||
ongoing basis between the releases. Check the CI status for your branch
|
||||
ongoing bases between the releases. Check the CI status for your branch
|
||||
periodically and resolve the failures ASAP. See more in:
|
||||
https://wiki.php.net/rfc/travis_ci
|
||||
|
||||
@@ -31,7 +31,7 @@ team (Bjori) on hand.
|
||||
|
||||
6. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
7. Moving extensions from/to PECL requires write access to the destination.
|
||||
7. Moving extensions from/to PECL requires write acces to the destination.
|
||||
Most developers should have this.
|
||||
|
||||
Moving extensions from php-src to PECL
|
||||
@@ -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
|
||||
------------------------------------
|
||||
@@ -274,8 +271,8 @@ to upgrade.
|
||||
10. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
http://news.php.net/php.internals/17222.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
@@ -312,6 +309,6 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
Please make sure that the mail to php-announce@ is its own completely separate email.
|
||||
This is to make sure that replies to the announcement on php-general@ or internals@
|
||||
Please make sure that the mail to php-announce@ is its own completely seperate email.
|
||||
This is to make sure that repiles to the announcement on php-general@ or internals@
|
||||
will not accidentally hit the php-announce@ mailinglist.
|
||||
@@ -5,13 +5,12 @@ 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
|
||||
=============
|
||||
PHP accepts pull requests via github. Discussions are done on github, but
|
||||
depending on the topic can also be relayed to the official PHP developer
|
||||
mailing list internals@lists.php.net.
|
||||
mailinglist internals@lists.php.net.
|
||||
|
||||
New features require an RFC and must be accepted by the developers.
|
||||
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
|
||||
+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"
|
||||
|
||||
@@ -42,10 +42,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# if _WIN32
|
||||
# include "win32/ioutil.h"
|
||||
# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
|
||||
# elif PATH_MAX
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# elif defined(MAX_PATH)
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
|
||||
+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 |
|
||||
|
||||
+26
-79
@@ -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 |
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <Sddl.h>
|
||||
#include "tsrm_win32.h"
|
||||
#include "zend_virtual_cwd.h"
|
||||
#include "win32/ioutil.h"
|
||||
|
||||
#ifdef ZTS
|
||||
static ts_rsrc_id win32_globals_id;
|
||||
@@ -208,42 +207,29 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
|
||||
BYTE * psec_desc = NULL;
|
||||
BOOL fAccess = FALSE;
|
||||
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
|
||||
PHP_WIN32_IOUTIL_INIT_W(pathname)
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode == 1 /*X_OK*/) {
|
||||
DWORD type;
|
||||
int ret;
|
||||
|
||||
ret = GetBinaryTypeW(pathw, &type) ? 0 : -1;
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
return ret;
|
||||
return GetBinaryType(pathname, &type) ? 0 : -1;
|
||||
} else {
|
||||
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) == NULL) {
|
||||
goto Finished;
|
||||
}
|
||||
pathname = real_path;
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
|
||||
if(php_win32_ioutil_access(pathname, mode)) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(access(pathname, mode)) {
|
||||
free(real_path);
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* If only existence check is made, return now */
|
||||
if (mode == 0) {
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
free(real_path);
|
||||
return 0;
|
||||
}
|
||||
@@ -299,11 +285,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
if(bucket == NULL && real_path == NULL) {
|
||||
/* We used the pathname directly. Call tsrm_realpath */
|
||||
/* so that entry is created in realpath cache */
|
||||
real_path = (char *)malloc(MAXPATHLEN);
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path) != NULL) {
|
||||
pathname = real_path;
|
||||
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
|
||||
PHP_WIN32_IOUTIL_REINIT_W(pathname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,13 +325,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
|
||||
/* Get size of security buffer. Call is expected to fail */
|
||||
if(GetFileSecurityW(pathw, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
if(GetFileSecurity(pathname, sec_info, NULL, 0, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
psec_desc = (BYTE *)malloc(sec_desc_length);
|
||||
if(psec_desc == NULL ||
|
||||
!GetFileSecurityW(pathw, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
!GetFileSecurity(pathname, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
@@ -388,7 +373,6 @@ Finished:
|
||||
real_path = NULL;
|
||||
}
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
if(fAccess == FALSE) {
|
||||
errno = EACCES;
|
||||
return errno;
|
||||
@@ -475,15 +459,14 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, type_len, read, mode;
|
||||
STARTUPINFOW startup;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
BOOL res;
|
||||
process_pair *proc;
|
||||
char *cmd = NULL;
|
||||
wchar_t *cmdw = NULL, *cwdw = NULL, *envw = NULL;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
HANDLE thread_token = NULL;
|
||||
@@ -507,42 +490,18 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
ptype++;
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
cmdw = php_win32_cp_any_to_w(cmd);
|
||||
if (!cmdw) {
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cwd) {
|
||||
cwdw = php_win32_ioutil_any_to_w(cwd);
|
||||
if (!cwdw) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&startup, 0, sizeof(STARTUPINFOW));
|
||||
memset(&startup, 0, sizeof(STARTUPINFO));
|
||||
memset(&process, 0, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
startup.cb = sizeof(STARTUPINFOW);
|
||||
startup.cb = sizeof(STARTUPINFO);
|
||||
startup.dwFlags = STARTF_USESTDHANDLES;
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
@@ -574,28 +533,19 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
}
|
||||
}
|
||||
|
||||
envw = php_win32_cp_env_any_to_w(env);
|
||||
if (envw) {
|
||||
dwCreateFlags |= CREATE_UNICODE_ENVIRONMENT;
|
||||
} else {
|
||||
if (env) {
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
return NULL;
|
||||
}
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUserW(token_user, NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
CloseHandle(token_user);
|
||||
} else {
|
||||
res = CreateProcessW(NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
|
||||
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
}
|
||||
free(cmd);
|
||||
free(cmdw);
|
||||
free(cwdw);
|
||||
free(envw);
|
||||
|
||||
if (!res) {
|
||||
return NULL;
|
||||
@@ -721,6 +671,7 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
{
|
||||
shm_pair *shm = shm_get(key, NULL);
|
||||
int err;
|
||||
|
||||
if (!shm->segment) {
|
||||
return (void*)-1;
|
||||
@@ -728,9 +679,12 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
|
||||
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (NULL == shm->addr) {
|
||||
int err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
@@ -811,17 +765,10 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
{
|
||||
FILETIME mtime, atime;
|
||||
HANDLE hFile;
|
||||
PHP_WIN32_IOUTIL_INIT_W(filename)
|
||||
|
||||
if (!pathw) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
hFile = CreateFileW(pathw, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
|
||||
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
|
||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||
|
||||
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
|
||||
the CreateFile operation succeeds */
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
|
||||
+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 |
|
||||
|
||||
+281
-48
@@ -1,10 +1,25 @@
|
||||
PHP 7.1 INTERNALS UPGRADE NOTES
|
||||
PHP 7.0 INTERNALS UPGRADE NOTES
|
||||
|
||||
0. Wiki Examples
|
||||
1. Internal API changes
|
||||
e. Codepage handling on Windows
|
||||
f. Path handling on Windows
|
||||
g. SAPI logging
|
||||
e. New data types
|
||||
f. zend_parse_parameters() specs
|
||||
g. sprintf() formats
|
||||
h. HashTable API
|
||||
i. New portable macros for large file support
|
||||
j. New portable macros for integers
|
||||
k. get_class_entry object handler info
|
||||
l. get_class_name object handler info
|
||||
m. Other portable macros info
|
||||
n. ZEND_ENGINE_2 removal
|
||||
o. Updated final class modifier
|
||||
p. TSRM changes
|
||||
q. gc_collect_cycles() is now hookable
|
||||
r. PDO uses size_t for lengths
|
||||
s. Resource API changes
|
||||
t. Optimized strings concatenation.
|
||||
u. Streams changes
|
||||
v. Sort algorithm changes
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -24,56 +39,218 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
1. Internal API changes
|
||||
========================
|
||||
|
||||
e. Codepage handling on Windows
|
||||
e. New data types
|
||||
|
||||
String
|
||||
|
||||
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
|
||||
was introduced. It expects an argument of the type zend_string *. String lengths
|
||||
in it are bound to the size_t datatype.
|
||||
|
||||
Integer types
|
||||
|
||||
Integers do no more depend on the firm 'long' type. Instead a platform
|
||||
dependent integer type is used, it is called zend_long. That datatype is
|
||||
defined dynamically to guarantee the consistent 64 bit support. The zval
|
||||
field representing user land integer it bound to zend_long.
|
||||
|
||||
Signed integer is defined as zend_long, unsigned integer as zend_ulong
|
||||
inside Zend.
|
||||
|
||||
Other datatypes
|
||||
|
||||
zend_off_t - portable off_t analogue
|
||||
zend_stat_t - portable 'struct stat' analogue
|
||||
|
||||
These datatypes are declared to be portable across platforms. Thus, direct
|
||||
usage of the functions like fseek, stat, etc. as well as direct usage of
|
||||
off_t and struct stat is strongly not recommended. Instead the portable
|
||||
macros should be used.
|
||||
|
||||
zend_fseek - portable fseek equivalent
|
||||
zend_ftell - portable ftell equivalent
|
||||
zend_lseek - portable lseek equivalent
|
||||
zend_fstat - portable fstat equivalent
|
||||
zend_stat - portable stat equivalent
|
||||
|
||||
f. zend_parse_parameters() specs
|
||||
|
||||
The new spec 'S' introduced, which expects an argument of type zend_string *.
|
||||
The 'l' spec expects a parameter of the type zend_long, not long anymore.
|
||||
The 's' spec expects parameters of the type char * and size_t, no int anymore.
|
||||
|
||||
g. sprintf() formats
|
||||
|
||||
New printf modifier 'p' was implemented to platform independently output zend_long,
|
||||
zend_ulong and php_size_t datatypes. That modifier can be used with 'd', 'u', 'x' and 'o'
|
||||
printf format specs with spprintf, snprintf and the wrapping printf implementations.
|
||||
%pu is sufficient for both zend_ulong and php_size_t. the code using %p spec to output
|
||||
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
|
||||
'u', 'x' or 'o'.
|
||||
|
||||
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
||||
they can use the implemenations available on the system, not the PHP one. With snprintf the
|
||||
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
|
||||
|
||||
h. HashTable API
|
||||
|
||||
Datatype for array indexes was changed to zend_ulong, for string keys to zend_string *.
|
||||
|
||||
i. New portable macros for large file support
|
||||
|
||||
Function(s) Alias Comment
|
||||
stat, _stat64 zend_stat for use with zend_stat_t
|
||||
fstat, _fstat64 zend_fstat for use with zend_stat_t
|
||||
lseek, _lseeki64 zend_lseek for use with zend_off_t
|
||||
ftell, _ftelli64 zend_ftell for use with zend_off_t
|
||||
fseek, _fseeki64 zend_fseek for use with zend_off_t
|
||||
|
||||
j. New portable macros for integers
|
||||
|
||||
Function(s) Alias Comment
|
||||
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_LTOA for use with zend_long
|
||||
atol, atoll, _atoi64 ZEND_ATOL for use with zend_long
|
||||
strtol, strtoll, _strtoi64 ZEND_STRTOL for use with zend_long
|
||||
strtoul, strtoull, _strtoui64 ZEND_STRTOUL for use with zend_long
|
||||
abs, llabs, _abs64 ZEND_ABS for use with zend_long
|
||||
- ZEND_LONG_MAX replaces LONG_MAX where appropriate
|
||||
- ZEND_LONG_MIN replaces LONG_MIN where appropriate
|
||||
- ZEND_ULONG_MAX replaces ULONG_MAX where appropriate
|
||||
- SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype
|
||||
- ZEND_SIZE_MAX Max value of size_t
|
||||
- Z_L casts an integral constant to zend_long
|
||||
- Z_UL casts an integral constant to zend_ulong
|
||||
|
||||
The macro ZEND_ENABLE_ZVAL_LONG64 reveals whether zval operates on 64 or 32 bit integer.
|
||||
|
||||
k. The get_class_entry object handler is no longer available. Instead
|
||||
zend_object.ce is always used.
|
||||
|
||||
l. The get_class_name object handler is now only used for displaying class
|
||||
names in debugging functions like var_dump(). It is no longer used in
|
||||
get_class(), get_parent_class() or similar.
|
||||
|
||||
The handler is now obligatory, no longer accepts a `parent` argument and
|
||||
must return a non-NULL zend_string*, which will be released by the caller.
|
||||
|
||||
m. Other portable macros info
|
||||
|
||||
ZEND_SECURE_ZERO - zeroes chunk of memory
|
||||
ZEND_VALID_SOCKET - validates a php_socket_t variable
|
||||
|
||||
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
|
||||
ZEND_NORETURN is defined as __declspec(noreturn) on VS
|
||||
|
||||
n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.
|
||||
|
||||
o. Removed ZEND_ACC_FINAL_CLASS in favour of ZEND_ACC_FINAL, turning final class
|
||||
modifier now a different class entry flag. Update your extensions.
|
||||
|
||||
p. TSRM changes
|
||||
|
||||
The TSRM layer undergone significant changes. It is not necessary anymore to
|
||||
pass the tsrm_ls pointer explicitly. The TSRMLS_* macros should not be used
|
||||
in any new developments.
|
||||
|
||||
The recommended way accessing globals in TS builds is by implementing it
|
||||
to use a local thread unique pointer to the corresponding data pool. These
|
||||
are the new macros that serve to achieve this goal:
|
||||
|
||||
- ZEND_TSRMG - based on TSRMG and if static pointer for data pool access is
|
||||
implemented, will use it
|
||||
- ZEND_TSRMLS_CACHE_EXTERN - to be used in a header shared across multiple
|
||||
C/C++ files
|
||||
- ZEND_TSRMLS_CACHE_DEFINE - to be used in the main extension C/C++ file
|
||||
- ZEND_TSRMLS_CACHE_UPDATE - to be integrated at the top of the globals
|
||||
ctor or RINIT function
|
||||
- ZEND_ENABLE_STATIC_TSRMLS_CACHE - to be used in the config.[m4|w32] for
|
||||
enabling the globals access per thread unique pointer
|
||||
- TSRMLS_CACHE - expands to the variable name which links to the thread
|
||||
unique data pool
|
||||
|
||||
Note that usually it will work without implementing the globals access per
|
||||
a thread unique pointer, however it might cause a slowdown. The reason is
|
||||
that the access model to the extension/SAPI own globals as well as the
|
||||
access to the core globals is determined in the compilation phase depending
|
||||
on whether ZEND_ENABLE_STATIC_TSRMLS_CACHE macro is defined.
|
||||
|
||||
Due to the current compiler evolution state, the TSRMLS_CACHE pointer
|
||||
(when implemented) has to be present and updated in every binary unit which
|
||||
is not compiled statically into PHP. So any DLL, DSO, EXE, etc. has to take
|
||||
care about defining and updating it's TSRMLS cache. An update should happen
|
||||
before any globals was accessed.
|
||||
|
||||
Porting an extension or SAPI is usually as easy as removing all the TSRMLS_*
|
||||
occurrences and integrating the macros mentioned above. However if tsrm_ls
|
||||
is used explicitly, its usage can be considered obsolete in most cases.
|
||||
Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't
|
||||
be passed to that threads directly.
|
||||
|
||||
When working with CTOR/DTOR for the extension globals, only the data passed
|
||||
as parameters should be touched. For example, don't use code like
|
||||
free(MYEXT_G(vars)); inside globals destructor, as it possibly can destroy
|
||||
the data from a wrong thread. Instead use the pointer to the data delivered
|
||||
into the destructor. So the previous example could look like
|
||||
free(my_struct->vars); given the income was casted to (struct my_struct *).
|
||||
|
||||
A new macro was introduced to simplify the declaration to the extension
|
||||
globals. A simplified declaration looks as follows
|
||||
|
||||
#define MYEXT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(myext, v)
|
||||
|
||||
Another new macro ZEND_MODULE_GLOBALS_BULK(myext) delivers the corresponding
|
||||
globals struct as a whole.
|
||||
|
||||
Two new storage specifiers was introduced.
|
||||
|
||||
ZEND_EXT_TLS - expand to an appropriate thread specific storage specifier in
|
||||
the thread safe build, expands to empty in a non thread safe
|
||||
build.
|
||||
ZEND_TLS - expands to an appropriate thread specific storage specifier
|
||||
with static visibility in the thread safe build, expands to
|
||||
static specifier in a non thread safe build.
|
||||
|
||||
A set of new APIs was introduced, which allows to handle codepage
|
||||
conversions. The corresponding prototypes and macros are contained
|
||||
in win32/codepage.h.
|
||||
Variables declared with these storage specifiers can not be shared across
|
||||
threads. While ZEND_TLS enforces the local scope visibility, ZEND_EXT_TLS
|
||||
pertains to the visiblity across several compilation units. In both cases,
|
||||
there's no portable way to achieve the visibility across shared objects.
|
||||
Thus, these specifiers are not compatible with ZEND_API and PHPAPI specifiers.
|
||||
|
||||
Functions with php_win32_cp_* signatures provide handling for various
|
||||
codepage aspects. Primarily they are in use at various places in the
|
||||
I/O utils code and directly in the core where necessary, providing
|
||||
conversions to/from UTF-16. Arbitrary conversions between codepages
|
||||
are possible as well, whereby UTF-16 will be always an intermediate
|
||||
state in this case.
|
||||
q. gc_collect_cycles() is now a function pointer, and can be replaced in the
|
||||
same manner as zend_execute_ex() if needed (for example, to include the
|
||||
time spent in the garbage collector in a profiler). The default
|
||||
implementation has been renamed to zend_gc_collect_cycles(), and is
|
||||
exported with ZEND_API.
|
||||
|
||||
For input length arguments, the macro PHP_WIN32_CP_IGNORE_LEN can be
|
||||
passed, then the API will calculate the length. For output length
|
||||
arguments, the macro PHP_WIN32_CP_IGNORE_LEN_P can be passed, then
|
||||
the API won't set the output length.
|
||||
r. In accordance with general use of size_t as string length, all PDO API
|
||||
functions now use size_t for string length.
|
||||
|
||||
The mapping between encodings and codepages is provided by the predefined
|
||||
array of data contained in win32/cp_enc_map.c. To change the data,
|
||||
a generator win32/cp_enc_map_gen.c needs to be edited and run.
|
||||
s. Removed ZEND_REGISTER/FETCH_RESOURCE, use zend_fetch_resource and
|
||||
and zend_register_resource instead, zend_fetch_resource accepts a zend_resource *
|
||||
as first argument, if you still need to fetch a resource from zval, use
|
||||
zend_fetch_resource_ex. More details can be found in Zend/zend_list.c.
|
||||
|
||||
f. Path handling on Windows
|
||||
t. Optimized strings concatenation.
|
||||
ZEND_ADD_STRING/VAR/CHAR are replaced with ZEND_ROPE_INIT, ZEND_ROPE_ADD,
|
||||
ZEND_ROPE_END.
|
||||
Instead of reallocation and copying string on each ZEND_ADD_STRING/VAR/CAHR,
|
||||
collect all the strings and then allocate and construct the resulting string once.
|
||||
|
||||
A set of new APIs was introduced, which allows to handle UTF-8 paths. The
|
||||
corresponding prototypes and macros are contained in win32/ioutil.h.
|
||||
u. Streams changes
|
||||
- It is possible to do blocking reads on Windows pipes. It can be done either
|
||||
using context stream option PHP_STREAM_OPTION_PIPE_BLOCKING or
|
||||
adding STREAM_USE_BLOCKING_PIPE when opening the stream.
|
||||
|
||||
Functions with php_win32_ioutil_* signatures provide POSIX I/O analogues.
|
||||
These functions are integrated in various places across the code base to
|
||||
support Unicode filenames. While accepting char * arguments, internally
|
||||
the conversion to wchar_t * happens. Internally almost no ANSI APIs are
|
||||
used, but directly their wide equivalents. The string conversion rules
|
||||
correspond to those already present in the core and depend on the current
|
||||
encoding settings. Doing so allows to move away from the ANSI Windows API
|
||||
with its dependency on the system OEM/ANSI codepage.
|
||||
|
||||
Thanks to the wide API usage, the long paths are now supported as well. The
|
||||
PHP_WIN32_IOUTIL_MAXPATHLEN macro is defined to 2048 bytes and will override
|
||||
the MAXPATHLEN in files where the header is included.
|
||||
|
||||
The most optimal use case for scripts is utilizing UTF-8 for any I/O
|
||||
related functions. UTF-8 filenames are supported on any system disregarding
|
||||
the system OEM/ANSI codepage.
|
||||
|
||||
g. SAPI logging
|
||||
The log_message callback in the SAPI struct was extended with the severity
|
||||
argument. This allows SAPI modules to implement mapping between PHP and
|
||||
corresponding server error levels. A reference mapping implementation
|
||||
can be found in apache2handler.
|
||||
v. Sort algorithm changes
|
||||
- Improved zend_qsort(using hybrid sorting algo) for better performance,
|
||||
and also renamed zend_qsort to zend_sort.
|
||||
- Added stable sorting algo zend_insert_sort.
|
||||
|
||||
w. Tick functions internal API change
|
||||
Tick functions have different declaration now. They expect a single
|
||||
parameter while before they were parameterless. When registering the
|
||||
tick function a value for this parameter must be passed. This value will be
|
||||
provided to the tick function on every execution.
|
||||
|
||||
========================
|
||||
2. Build system changes
|
||||
@@ -82,10 +259,66 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
a. Unix build system changes
|
||||
|
||||
b. Windows build system changes
|
||||
Static analysis with clang and Cppcheck is supported by passing "clang" or
|
||||
"cppcheck" keyword to the --with-analyzer configure option.
|
||||
|
||||
- Besides Visual Studio, building with Clang or Intel Composer is now
|
||||
possible. To enable an alternative toolset, add the option
|
||||
--with-toolset=[vs,clang,icc] to the configure line. The default
|
||||
toolset is vs. Still clang or icc need the correct environment
|
||||
which involves many tools from the vs toolset.
|
||||
|
||||
The toolset option is supported by phpize as well.
|
||||
|
||||
AWARENESS The only recommended and supported toolset to produce production
|
||||
ready binaries is Visual Studio. Still other compilers can be used now for
|
||||
testing and analyzing purposes.
|
||||
|
||||
- configure.js now produces response files which are passed to the linker
|
||||
and library manager. This solves the issues with the long command lines
|
||||
which can exceed the OS limit.
|
||||
|
||||
- with clang toolset, an option --with-uncritical-warn-choke is available,
|
||||
which suppresses the most frequent false positive warnings
|
||||
|
||||
- the --with-mp option will by default utilize all the available cores. It's
|
||||
enabled by default for release builds and can be disabled with the special
|
||||
"disable" keyword.
|
||||
|
||||
========================
|
||||
3. Module changes
|
||||
========================
|
||||
|
||||
Session:
|
||||
|
||||
- PS_MOD_UPDATE_TIMESTAMP() session save handler definition is added. New
|
||||
save handler should use PS_MOD_UPDATE_TIMESTAMP() definition. Save handler
|
||||
must not refer/change PS() variables directly from save handler. Use
|
||||
parameters.
|
||||
- PS_MOD()/PS_MOD_SID() macro exist only for transition. Beware these
|
||||
save handlers are less secure and slower than PS_MOD_UPDATE_TIMESTAMP().
|
||||
- PS(invalid_session_id) was removed. It was never worked as it supposed.
|
||||
To report invalid session ID, use PS_VALIDATE_SID() handler.
|
||||
- PS_VALIDATE_SID() defines session ID validation handler. This handler
|
||||
must validate if requested session ID exists in session data storage or not.
|
||||
Do not access PS(id) directly, but use this handler and it's parameter.
|
||||
- PS_UPDATE_TIMESTAMP() defines timestamp updating handler. This handler
|
||||
must update session data timestamp for GC if it is needed. e.g. Memcache
|
||||
updates timestamp on read, so it does not need to update timestamp. Return
|
||||
SUCCESS simply for this case.
|
||||
- PS_CREATE_SID() should check session ID collision. Return NULL for failure.
|
||||
- More documentation can be found in ext/session/mod_files.c as comments.
|
||||
mod_files.c may be used as reference implementation.
|
||||
|
||||
Openssl:
|
||||
- several ext/openssl functions require the inclusion of the applink shim
|
||||
as documented in the OpenSSL FAQ https://www.openssl.org/support/faq.html#PROG2
|
||||
to properly work on Windows. While this primarily affects the OpenSSL
|
||||
functionality, the shim needs to be included into the executable file
|
||||
which loads the extension DLL, not into the extension DLL itself. Alternatively
|
||||
it can be compiled and linked with the main program as a separate object file.
|
||||
More information and explanation in the linked OpenSSL FAQ.
|
||||
|
||||
Thus, this primarily affects any WAMP or other redistributions bundling the
|
||||
official PHP release zipballs or building from sources. The applink shim is
|
||||
already integrated with all the PHP executables from the official distribution
|
||||
starting with 7.0.0beta1.
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -370,10 +370,10 @@ AC_CHECK_FUNCS(mremap)
|
||||
|
||||
|
||||
AC_ARG_ENABLE(zend-signals,
|
||||
[ --disable-zend-signals whether to enable zend signal handling],[
|
||||
[ --enable-zend-signals Use zend signal handling],[
|
||||
ZEND_SIGNALS=$enableval
|
||||
],[
|
||||
ZEND_SIGNALS=yes
|
||||
ZEND_SIGNALS=no
|
||||
])
|
||||
|
||||
AC_CHECK_FUNC(sigaction, [
|
||||
|
||||
+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)
|
||||
|
||||
+8
-13
@@ -17,20 +17,11 @@ function test3($a, $b) {
|
||||
|
||||
test1();
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -47,10 +38,14 @@ echo "Done\n";
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(1)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d
|
||||
int(0)
|
||||
int(2)
|
||||
int(0)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s001.php on line 27 and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
|
||||
|
||||
+19
-12
@@ -23,19 +23,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -70,7 +62,14 @@ int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
|
||||
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
@@ -85,7 +84,15 @@ bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s002.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
int(1)
|
||||
|
||||
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
|
||||
bool(false)
|
||||
int(1)
|
||||
int(2)
|
||||
|
||||
|
||||
+12
-12
@@ -18,19 +18,11 @@ function test3($a, $b) {
|
||||
test1();
|
||||
test1(10);
|
||||
test2(1);
|
||||
try {
|
||||
test2();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
test2();
|
||||
test3(1,2);
|
||||
|
||||
call_user_func("test1");
|
||||
try {
|
||||
call_user_func("test3", 1);
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
call_user_func("test3", 1);
|
||||
call_user_func("test3", 1, 2);
|
||||
|
||||
class test {
|
||||
@@ -55,7 +47,10 @@ array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
|
||||
|
||||
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
@@ -64,7 +59,12 @@ array(2) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
|
||||
|
||||
Warning: Missing argument 2 for test3()%s
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(1)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
+37
-1
@@ -31,4 +31,40 @@ $test->bar();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot re-assign $this in %s030.php on line 11
|
||||
object(Exception)#%d (7) {
|
||||
["message":protected]=>
|
||||
string(3) "foo"
|
||||
["string":"Exception":private]=>
|
||||
string(0) ""
|
||||
["code":protected]=>
|
||||
int(0)
|
||||
["file":protected]=>
|
||||
string(%d) "%s030.php"
|
||||
["line":protected]=>
|
||||
int(%d)
|
||||
["trace":"Exception":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s030.php"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(3) "bar"
|
||||
["class"]=>
|
||||
string(3) "foo"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
["previous":"Exception":private]=>
|
||||
NULL
|
||||
}
|
||||
'test' => '0'
|
||||
'test_2' => '1'
|
||||
'test_3' => '2'
|
||||
ok
|
||||
@@ -38,19 +38,11 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
int(75636)
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
int(951858)
|
||||
int(48550510)
|
||||
float(75661.68)
|
||||
|
||||
@@ -19,13 +19,8 @@ var_dump($c);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Exception: Unsupported operand types
|
||||
|
||||
Warning: A non-numeric value encountered in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
closure binding to anonymous class
|
||||
--FILE--
|
||||
<?php
|
||||
$class = new class {};
|
||||
$foo = function() {
|
||||
return $this;
|
||||
};
|
||||
|
||||
$closure = Closure::bind($foo, $class, $class);
|
||||
var_dump($closure());
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
anonymous class trait binding
|
||||
--FILE--
|
||||
<?php
|
||||
trait TaskTrait {
|
||||
function run() {
|
||||
return 'Running...';
|
||||
}
|
||||
}
|
||||
$class = new class() {
|
||||
use TaskTrait;
|
||||
};
|
||||
var_dump($class->run());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "Running..."
|
||||
@@ -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)
|
||||
}
|
||||
@@ -154,7 +154,7 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
$x = $a ? $b : $c;
|
||||
$x = $a ?: $c;
|
||||
$x = $a ?? $b;
|
||||
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
|
||||
list($a, $b, $c) = [1, 2 => 'x', 'z' => 'c'];
|
||||
@foo();
|
||||
$y = clone $x;
|
||||
yield 1 => 2;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Misoptimization when variable is modified by assert()
|
||||
--INI--
|
||||
zend.assertions=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$i = 0;
|
||||
assert('$i = new stdClass');
|
||||
$i += 1;
|
||||
var_dump($i);
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Object of class stdClass could not be converted to int in %s on line %d
|
||||
int(2)
|
||||
@@ -1,56 +0,0 @@
|
||||
--TEST--
|
||||
Various null return conditions of dim/obj assignments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$array = [PHP_INT_MAX => 42];
|
||||
$true = true;
|
||||
|
||||
var_dump($array[] = 123);
|
||||
var_dump($array[[]] = 123);
|
||||
var_dump($array[new stdClass] = 123);
|
||||
var_dump($true[123] = 456);
|
||||
|
||||
var_dump($array[] += 123);
|
||||
var_dump($array[[]] += 123);
|
||||
var_dump($array[new stdClass] += 123);
|
||||
var_dump($true[123] += 456);
|
||||
|
||||
var_dump($true->foo = 123);
|
||||
var_dump($true->foo += 123);
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Attempt to assign property of non-object in %s on line %d
|
||||
NULL
|
||||
@@ -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
|
||||
@@ -6,16 +6,9 @@ $a = new stdClass();
|
||||
$x = "";
|
||||
$a->$x = "string('')";
|
||||
var_dump($a);
|
||||
$a->{"\0"} = 42;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#1 (1) {
|
||||
[""]=>
|
||||
string(10) "string('')"
|
||||
}
|
||||
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %sbug29015.php:4
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
thrown in %sbug29015.php on line 4
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29368.1 (The destructor is called when an exception is thrown from the constructor).
|
||||
--FILE--
|
||||
<?php
|
||||
function throwme($arg)
|
||||
{
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
class foo {
|
||||
function __construct() {
|
||||
echo "Inside constructor\n";
|
||||
throwme($this);
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
echo "Inside destructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$bar = new foo;
|
||||
} catch(Exception $exc) {
|
||||
echo "Caught exception!\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Inside constructor
|
||||
Caught exception!
|
||||
@@ -3,7 +3,7 @@ Bug #29883 (isset gives invalid values on strings)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = "bug";
|
||||
var_dump(isset($x[-10]));
|
||||
var_dump(isset($x[-1]));
|
||||
var_dump(isset($x["1"]));
|
||||
echo $x["1"]."\n";
|
||||
?>
|
||||
|
||||
@@ -18,7 +18,7 @@ var_dump(isset($a['b']));
|
||||
$simpleString = "Bogus String Text";
|
||||
echo isset($simpleString->wrong)?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[-20])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[-1])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[0])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["0"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["16"])?"ok\n":"bug\n";
|
||||
|
||||
@@ -19,19 +19,15 @@ function NormalTest($a)
|
||||
echo "Hi!";
|
||||
}
|
||||
|
||||
try {
|
||||
NormalTest();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
try {
|
||||
FooTest();
|
||||
} catch (Throwable $e) {
|
||||
echo "Exception: " . $e->getMessage() . "\n";
|
||||
}
|
||||
NormalTest();
|
||||
FooTest();
|
||||
FooTest(new Foo());
|
||||
?>
|
||||
--EXPECTF--
|
||||
Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
|
||||
Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
|
||||
Hello!
|
||||
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
|
||||
Hi!
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): FooTest()
|
||||
#1 {main}
|
||||
thrown in %sbug33996.php on line %d
|
||||
@@ -43,9 +43,7 @@ Non-static method A::A_ftk() should not be called statically
|
||||
1 %sbug38047.php:13 get_error_context()
|
||||
2 %sbug38047.php:36 kalus_error_handler()
|
||||
|
||||
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
|
||||
Stack trace:
|
||||
#0 %sbug38047.php(36): A::A_ftk()
|
||||
#1 {main}
|
||||
thrown in %sbug38047.php on line 7
|
||||
Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
|
||||
1 %sbug38047.php:13 get_error_context()
|
||||
2 %sbug38047.php:7 kalus_error_handler()
|
||||
3 %sbug38047.php:36 A_ftk()
|
||||
@@ -9,7 +9,7 @@ $foo[0]->bar = "xyz";
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an object in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an array in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -7,7 +7,7 @@ $b = &$a[1];
|
||||
$b = "f";
|
||||
echo $a;
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets nor overloaded objects in %sbug49866.php:3
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug49866.php on line 3
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
unset($a->$prop);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__unset('\x00')
|
||||
#0 %s(%d): A->__unset('')
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
$a->$prop = 2;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__set('\x00', 2)
|
||||
#0 %s(%d): A->__set('', 2)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -10,14 +10,14 @@ class A {
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
$prop = "\0";
|
||||
$prop = null;
|
||||
|
||||
var_dump($a->$prop);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
|
||||
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): A->__get('\x00')
|
||||
#0 %s(%d): A->__get('')
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -8,7 +8,7 @@ class MyClass {
|
||||
$this->myRef = $value;
|
||||
}
|
||||
}
|
||||
$myGlobal=new MyClass();
|
||||
$myGlobal=new MyClass($myGlobal);
|
||||
$myGlobal->myRef=&$myGlobal;
|
||||
$myGlobal->myNonExistentProperty="ok\n";
|
||||
echo $myGlobal;
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
--TEST--
|
||||
Bug #53432: Assignment via string index access on an empty string converts to array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = '';
|
||||
var_dump($str[0] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str[5] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str[-1] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
var_dump($str['foo'] = 'a');
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[] = 'a');
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[0] += 1);
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
$str = '';
|
||||
try {
|
||||
var_dump($str[0][0] = 'a');
|
||||
} catch (Error $e) {
|
||||
echo "Error: {$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($str);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
string(6) " a"
|
||||
|
||||
Warning: Illegal string offset: -1 in %s on line %d
|
||||
NULL
|
||||
string(0) ""
|
||||
|
||||
Warning: Illegal string offset 'foo' in %s on line %d
|
||||
string(1) "a"
|
||||
string(1) "a"
|
||||
Error: [] operator not supported for strings
|
||||
string(0) ""
|
||||
Error: Cannot use assign-op operators with string offsets
|
||||
string(0) ""
|
||||
Error: Cannot use string offset as an array
|
||||
string(0) ""
|
||||
@@ -6,7 +6,7 @@ function f(callable $c) {}
|
||||
f();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): f()
|
||||
#1 {main}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #62814: It is possible to stiffen child class members visibility
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private function test() { }
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
protected function test() { }
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
private function test() { }
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access level to C::test() must be protected (as in class B) or weaker in %s on line %d
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #63734 (Garbage collector can free zvals that are still referenced)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
|
||||
@@ -57,13 +57,8 @@ $bar = foo3();
|
||||
string(9) "not catch"
|
||||
NULL
|
||||
|
||||
Fatal error: Uncaught Exception: not catched in %sbug65784.php:42
|
||||
Fatal error: Uncaught Error: Class 'NotExists' not found in %sbug65784.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug65784.php(52): foo3()
|
||||
#0 %s(%d): foo3()
|
||||
#1 {main}
|
||||
|
||||
Next Error: Class 'NotExists' not found in %sbug65784.php:46
|
||||
Stack trace:
|
||||
#0 %sbug65784.php(52): foo3()
|
||||
#1 {main}
|
||||
thrown in %sbug65784.php on line 46
|
||||
thrown in %sbug65784.php on line %d
|
||||
@@ -13,4 +13,6 @@ $x = $c->test();
|
||||
print_r($x);
|
||||
unset($c, $x);
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot unset $this in %sbug68370.php on line 4
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -28,7 +28,6 @@ class Bar {
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if (!isset(self::$instance)) return;
|
||||
Foo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #69534 (Cycle leaks through declared properties on internal classes)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class Node extends SplObjectStorage {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
const A = 'Foo::A';
|
||||
const B = self::A . ' and ' . self::C;
|
||||
const C = 'Foo::C';
|
||||
|
||||
}
|
||||
|
||||
class Bar extends Foo {
|
||||
const A = 'Bar::A';
|
||||
const C = 'Bar::C';
|
||||
}
|
||||
|
||||
var_dump(Bar::B);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(17) "Foo::A and Foo::C"
|
||||
@@ -1,69 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class P {
|
||||
const N = 'P';
|
||||
}
|
||||
class A extends P {
|
||||
const selfN = self::N;
|
||||
const parentN = parent::N;
|
||||
const N = 'A';
|
||||
}
|
||||
class B extends A {
|
||||
const N = 'B';
|
||||
}
|
||||
|
||||
var_dump(B::selfN); // A
|
||||
var_dump(B::parentN); // P
|
||||
|
||||
class A2 {
|
||||
const selfN = self::N;
|
||||
const N = 'A2';
|
||||
}
|
||||
class B2 extends A2 {
|
||||
const indSelfN = self::selfN;
|
||||
const N = 'B2';
|
||||
}
|
||||
class C2 extends B2 {
|
||||
const N = 'C2';
|
||||
}
|
||||
|
||||
var_dump(C2::indSelfN); // A2
|
||||
|
||||
class A3 {
|
||||
const selfN = self::N;
|
||||
const N = 'A3';
|
||||
}
|
||||
class B3 extends A3 {
|
||||
const exprSelfN = "expr" . self::selfN;
|
||||
const N = 'B3';
|
||||
}
|
||||
class C3 extends B3 {
|
||||
const N = 'C3';
|
||||
}
|
||||
|
||||
var_dump(C3::exprSelfN); // exprA3
|
||||
|
||||
class A4 {
|
||||
const selfN = self::N;
|
||||
const N = 'A4';
|
||||
}
|
||||
class B4 extends A4 {
|
||||
const N = 'B4';
|
||||
public $prop = self::selfN;
|
||||
}
|
||||
class C4 extends B4 {
|
||||
const N = 'C4';
|
||||
}
|
||||
|
||||
var_dump((new C4)->prop); // A4
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
string(1) "P"
|
||||
string(2) "A2"
|
||||
string(6) "exprA3"
|
||||
string(2) "A4"
|
||||
@@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
|
||||
var_dump($r->getParameters()[0]->getName());
|
||||
var_dump($r->getParameters()[0]->getClass());
|
||||
echo $r->getParameters()[0], "\n";
|
||||
echo $r->getReturnType()->getName(), "\n";
|
||||
echo $r->getReturnType(),"\n";
|
||||
echo $r,"\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Collection of some cycles on unfinished generators
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// CV
|
||||
function gen1() {
|
||||
$gen = yield;
|
||||
yield;
|
||||
}
|
||||
|
||||
$gen = gen1();
|
||||
$gen->send($gen);
|
||||
|
||||
// This
|
||||
class Test {
|
||||
public $gen;
|
||||
public function gen2() {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->gen = $test->gen2();
|
||||
|
||||
// Closure object
|
||||
$gen3 = (function() use (&$gen3) {
|
||||
yield;
|
||||
})();
|
||||
|
||||
// Yield from array
|
||||
function gen4() {
|
||||
yield from [yield];
|
||||
}
|
||||
|
||||
$gen = gen4();
|
||||
$gen->send($gen);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Generator cycle collection edge cases
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// Extra args
|
||||
function gen1() {
|
||||
yield;
|
||||
}
|
||||
$obj = new stdClass;
|
||||
$obj->gen = gen1($obj);
|
||||
|
||||
// Symtable
|
||||
function gen2() {
|
||||
$varName = 'a';
|
||||
$$varName = yield;
|
||||
yield;
|
||||
}
|
||||
$gen = gen2();
|
||||
$gen->send($gen);
|
||||
|
||||
// Symtable indirect
|
||||
function gen3() {
|
||||
$varName = 'a';
|
||||
$$varName = 42;
|
||||
$var = yield;
|
||||
yield;
|
||||
}
|
||||
$gen = gen3();
|
||||
$gen->send($gen);
|
||||
|
||||
// Yield from root
|
||||
function gen4() {
|
||||
yield from yield;
|
||||
}
|
||||
$gen = gen4();
|
||||
$gen2 = gen4($gen);
|
||||
$gen2->send([1, 2, 3]);
|
||||
$gen->send($gen2);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -34,4 +34,4 @@ try {
|
||||
string(36) "Cannot use string offset as an array"
|
||||
string(27) "Cannot unset string offsets"
|
||||
string(41) "Only variables can be passed by reference"
|
||||
string(41) "Cannot increment/decrement string offsets"
|
||||
string(64) "Cannot increment/decrement overloaded objects nor string offsets"
|
||||
@@ -15,7 +15,7 @@ var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
|
||||
@@ -19,8 +19,4 @@ try {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
|
||||
Stack trace:
|
||||
#0 %sbug70689.php(12): foo()
|
||||
#1 {main}
|
||||
thrown in %sbug70689.php on line 3
|
||||
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Bug #70918 (Segfault using static outside of class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
static::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
parent::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
self::x;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
new static;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
static::x();
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
static::$i;
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access parent:: when no class scope is active"
|
||||
string(50) "Cannot access self:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
string(52) "Cannot access static:: when no class scope is active"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71196 (Memory leak with out-of-order live ranges)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$a = "1";
|
||||
[1, (y().$a.$a) . ($a.$a)];
|
||||
} catch (Error $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(30) "Call to undefined function y()"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71266 (Missing separation of properties HT in foreach etc)
|
||||
--FILE--
|
||||
<?php
|
||||
$one = 1;
|
||||
$two = 2;
|
||||
$arr = ['foo' => $one, 'bar' => $two];
|
||||
$obj = (object) $arr;
|
||||
foreach ($obj as $val) {
|
||||
var_dump($val);
|
||||
$obj->bar = 42;
|
||||
}
|
||||
|
||||
$arr = ['foo' => $one, 'bar' => $two];
|
||||
$obj = (object) $arr;
|
||||
next($obj);
|
||||
var_dump(current($arr));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(42)
|
||||
int(1)
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
bug #71428.1: inheritance with null default values
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
@@ -9,5 +11,5 @@ 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
|
||||
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,5 +1,7 @@
|
||||
--TEST--
|
||||
bug #71428: Validation type inheritance with = NULL
|
||||
--XFAIL--
|
||||
This is a BC break
|
||||
--FILE--
|
||||
<?php
|
||||
class A { }
|
||||
@@ -7,5 +9,5 @@ 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, $n) in %sbug71428.3.php on line 4
|
||||
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,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array[0] =& $array[''];
|
||||
$array[0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.1 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = (object)['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6,'g'=>7];
|
||||
$x->h =& $x->i;
|
||||
$x->h = 42;
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (9) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
int(2)
|
||||
["c"]=>
|
||||
int(3)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["e"]=>
|
||||
int(5)
|
||||
["f"]=>
|
||||
int(6)
|
||||
["g"]=>
|
||||
int(7)
|
||||
["i"]=>
|
||||
&int(42)
|
||||
["h"]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.2 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [0,1,2,3,4,5,6];
|
||||
$a[200] =& $a[100];
|
||||
$a[100] =42;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(9) {
|
||||
[0]=>
|
||||
int(0)
|
||||
[1]=>
|
||||
int(1)
|
||||
[2]=>
|
||||
int(2)
|
||||
[3]=>
|
||||
int(3)
|
||||
[4]=>
|
||||
int(4)
|
||||
[5]=>
|
||||
int(5)
|
||||
[6]=>
|
||||
int(6)
|
||||
[100]=>
|
||||
&int(42)
|
||||
[200]=>
|
||||
&int(42)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.3 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array[0][0] =& $array[''];
|
||||
$array[0][0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.4 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [0=>[]];
|
||||
$array[0][0] =& $array[0][''];
|
||||
$array[0][0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(2) {
|
||||
[""]=>
|
||||
&int(42)
|
||||
[0]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$array['']->prop =& $array[0];
|
||||
$array[0] = 42;
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
&int(42)
|
||||
[""]=>
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
&int(42)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
||||
--FILE--
|
||||
<?php
|
||||
$name = 'a';
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
if ($name != 'i') {
|
||||
$$name =& $GLOBALS;
|
||||
}
|
||||
$name++;
|
||||
}
|
||||
?>
|
||||
OK
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71572: String offset assignment from an empty string inserts null byte
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "abc";
|
||||
var_dump($str{0} = "");
|
||||
var_dump($str{1} = "");
|
||||
var_dump($str{3} = "");
|
||||
var_dump($str{10} = "");
|
||||
var_dump($str);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot assign an empty string to a string offset in %s on line %d
|
||||
NULL
|
||||
string(3) "abc"
|
||||
==DONE==
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71818 (Memory leak when array altered in destructor)
|
||||
--INI--
|
||||
zend.enable_gc = 1
|
||||
--FILE--
|
||||
<?php
|
||||
class MemoryLeak
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->things[] = $this;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->things[] = null;
|
||||
}
|
||||
|
||||
private $things = [];
|
||||
}
|
||||
|
||||
ini_set('memory_limit', '10M');
|
||||
|
||||
for ($i = 0; $i < 100000; ++$i) {
|
||||
$obj = new MemoryLeak();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -79,7 +79,7 @@ Stack trace:
|
||||
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
|
||||
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
|
||||
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
|
||||
#5 {main}
|
||||
thrown in %sbug72101.php on line 61
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72107: Segfault when using func_get_args as error handler
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler('func_get_args');
|
||||
function test($a) {
|
||||
echo $undef;
|
||||
}
|
||||
test(1);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot call func_get_args() dynamically in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef in %s on line %d
|
||||
@@ -14,6 +14,5 @@ class Hello implements Foo {
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d
|
||||
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -7,4 +7,4 @@ $var11 = new StdClass();
|
||||
$var16 = error_reporting($var11);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
||||
--FILE--
|
||||
<?php
|
||||
class Child
|
||||
{
|
||||
protected $bar;
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->bar = null;
|
||||
}
|
||||
}
|
||||
|
||||
class Parnt
|
||||
{
|
||||
protected $child;
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
$this->child = new Child();
|
||||
|
||||
$prop = new \ReflectionProperty($this, 'child');
|
||||
$prop->setAccessible(true);
|
||||
$prop->setValue($this, null);
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Parnt();
|
||||
$p->doSomething();
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private $bar = 'bar';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
unset($this->bar);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
private $baz = 'baz';
|
||||
private static $tab = 'tab';
|
||||
|
||||
public function __get(string $name)
|
||||
{
|
||||
var_dump($this->baz);
|
||||
var_dump(self::$tab);
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
$r = new ReflectionProperty(Foo::class, 'bar');
|
||||
|
||||
$r->setAccessible(true);
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72188 (Nested try/finally blocks losing return value)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
try {
|
||||
return 5;
|
||||
} finally {
|
||||
try {
|
||||
echo 1;
|
||||
} finally {
|
||||
echo 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$a = test();
|
||||
if($a !== 5) {
|
||||
echo "FAILED: expected 5, received ", var_export($a), PHP_EOL;
|
||||
} else {
|
||||
echo "Passed", PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
12Passed
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$a = 1;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.1 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test(&$b) {
|
||||
$a =& $b;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
$x = 1;
|
||||
$y =& test($x);
|
||||
var_dump($y);
|
||||
$x = 3;
|
||||
var_dump($y);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(3)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.1 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test(&$b) {
|
||||
$a =& $b;
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a =& $c;
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
$x = 1;
|
||||
$y =& test($x);
|
||||
var_dump($y);
|
||||
$x = 3;
|
||||
var_dump($y);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(3)
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72215.3 (Wrong return value if var modified in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test() {
|
||||
try {
|
||||
return $a;
|
||||
} finally {
|
||||
$a = 2;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72216 (Return by reference with finally is not memory safe)
|
||||
--FILE--
|
||||
<?php
|
||||
function &test() {
|
||||
$a = ["ok"];
|
||||
try {
|
||||
return $a[0];
|
||||
} finally {
|
||||
$a[""] = 42;
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
string(2) "ok"
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72221 (Segmentation fault in stream_get_line / zend_memnstr_ex)
|
||||
--FILE--
|
||||
<?php
|
||||
$fp = fopen("php://memory", "r+");
|
||||
fwrite($fp, str_repeat("baad", 1024*1024));
|
||||
rewind($fp);
|
||||
stream_get_line($fp, 1024*1024*2, "aaaa");
|
||||
echo "Done\n";
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Misoptimize due to type narrowing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$b = false;
|
||||
$x = (1<<53)+1;
|
||||
do {
|
||||
$x = 1.0 * ($x - (1<<53));
|
||||
} while ($b);
|
||||
return $x;
|
||||
}
|
||||
var_dump(test());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
float(1)
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72347 (VERIFY_RETURN type casts visible in finally)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() : int {
|
||||
$d = 1.5;
|
||||
try {
|
||||
return $d;
|
||||
} finally {
|
||||
var_dump($d);
|
||||
}
|
||||
}
|
||||
var_dump(test());
|
||||
?>
|
||||
--EXPECT--
|
||||
float(1.5)
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72373: TypeError after Generator function w/declared return type finishes
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo() : Generator {
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
}
|
||||
|
||||
foreach (foo() as $bar) {
|
||||
echo $bar . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72395 (list() regression)
|
||||
--FILE--
|
||||
<?php
|
||||
list(,,$a,,$b,) = array(1, 2, 3, 4, 5, 6);
|
||||
var_dump($a, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(5)
|
||||
Loaded 100 of 2744 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user