mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 02:00:49 +00:00
Compare commits
283
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa587915da | ||
|
|
c51ecac617 | ||
|
|
825f006117 | ||
|
|
4d375b3bd0 | ||
|
|
5b12d08e1f | ||
|
|
ee8b5de5a0 | ||
|
|
6da475367a | ||
|
|
1f8fc0fb56 | ||
|
|
867c29caf0 | ||
|
|
eb5d4bcd4f | ||
|
|
eb13003f6c | ||
|
|
d719b46222 | ||
|
|
f5951cc81b | ||
|
|
0fb640c717 | ||
|
|
1517fdb36c | ||
|
|
1dbef2e27a | ||
|
|
bc2b500d3e | ||
|
|
6d066dc421 | ||
|
|
2e83082605 | ||
|
|
df135ffa7a | ||
|
|
53e2c9158d | ||
|
|
183cd048f1 | ||
|
|
0c8ad36d92 | ||
|
|
98f4ce9363 | ||
|
|
7fba8bda4c | ||
|
|
8be63ce0e2 | ||
|
|
b9d3dbc84e | ||
|
|
960e5cde02 | ||
|
|
ba70478a21 | ||
|
|
8e5d080d54 | ||
|
|
f0e67d1a56 | ||
|
|
411f4b1b6f | ||
|
|
760ff21bf3 | ||
|
|
53cc72ef86 | ||
|
|
17e9fc9bfe | ||
|
|
8e45583006 | ||
|
|
29ee3e3c49 | ||
|
|
c398198c0a | ||
|
|
9b16d4c999 | ||
|
|
177f87cf05 | ||
|
|
247ce052cd | ||
|
|
b224e74267 | ||
|
|
bab0b99f37 | ||
|
|
549a30d2cd | ||
|
|
648b756f35 | ||
|
|
c082c92b7e | ||
|
|
18f7e26257 | ||
|
|
c7b2c698d0 | ||
|
|
fab5ce347c | ||
|
|
cf60f26da6 | ||
|
|
61e9b7354f | ||
|
|
29333550d2 | ||
|
|
e80ea04c79 | ||
|
|
dfcb11d7d1 | ||
|
|
53a08fd07d | ||
|
|
868930e079 | ||
|
|
21a05b0418 | ||
|
|
c564924d31 | ||
|
|
008fb28eaf | ||
|
|
bbfa1b6419 | ||
|
|
eac8166bd4 | ||
|
|
9450e23b32 | ||
|
|
ff8a6b1232 | ||
|
|
cc10515056 | ||
|
|
e9873d9853 | ||
|
|
330a7b62c3 | ||
|
|
1d4eead995 | ||
|
|
015a80ef7b | ||
|
|
9eaf551c86 | ||
|
|
593a4d8fe9 | ||
|
|
bd7e5c1548 | ||
|
|
c836ad1c7e | ||
|
|
1623ef10c9 | ||
|
|
513582814b | ||
|
|
61e59db99d | ||
|
|
cf3ef36323 | ||
|
|
708973c9bd | ||
|
|
3b91ed112f | ||
|
|
5432d6f982 | ||
|
|
e79754dee3 | ||
|
|
89a5bd6750 | ||
|
|
3917350531 | ||
|
|
eb1373e509 | ||
|
|
f0519f4837 | ||
|
|
26fdebc63b | ||
|
|
01c1afa79f | ||
|
|
ee25eb0eae | ||
|
|
981c58705a | ||
|
|
7e5cf2aa19 | ||
|
|
9814be4bc2 | ||
|
|
db7c0badd4 | ||
|
|
185304a61e | ||
|
|
80c8d84af3 | ||
|
|
7a0adb4cd2 | ||
|
|
714d825b62 | ||
|
|
044dd30440 | ||
|
|
fd521a22f7 | ||
|
|
8a8aa67844 | ||
|
|
9ea0949f43 | ||
|
|
21d7878690 | ||
|
|
dcaf4da8a6 | ||
|
|
9ffc6ca62f | ||
|
|
6988d070ea | ||
|
|
4df993d89d | ||
|
|
75ad2b301a | ||
|
|
0b56ba51d0 | ||
|
|
25271feeb0 | ||
|
|
8faf5f979c | ||
|
|
dd9cf23457 | ||
|
|
acda2563ce | ||
|
|
a15bffd105 | ||
|
|
570a273807 | ||
|
|
6fc0ae638a | ||
|
|
1d7f8eb693 | ||
|
|
74c95fb3fb | ||
|
|
3446e3b749 | ||
|
|
69a2e4ece2 | ||
|
|
3f89b630b4 | ||
|
|
15e9aa1706 | ||
|
|
8dfa428ccd | ||
|
|
15404bda13 | ||
|
|
2cd0d8b711 | ||
|
|
ec43a11581 | ||
|
|
d9ca5d9637 | ||
|
|
0e21d8066b | ||
|
|
aa9742d80d | ||
|
|
163bb87897 | ||
|
|
5b5130c4ff | ||
|
|
536b3ca1e1 | ||
|
|
543141ae3b | ||
|
|
f39cabe610 | ||
|
|
bf0f53270f | ||
|
|
368958b3e4 | ||
|
|
dd227c2b23 | ||
|
|
62938bf088 | ||
|
|
4b1afc829c | ||
|
|
2b7e5468c9 | ||
|
|
df16579642 | ||
|
|
2fcf1259c6 | ||
|
|
a3d3f76827 | ||
|
|
f65ae82c55 | ||
|
|
a15c1990eb | ||
|
|
721a189742 | ||
|
|
737ee0661c | ||
|
|
c44efbbbb1 | ||
|
|
80a851b4dd | ||
|
|
d636467937 | ||
|
|
6f912f7c04 | ||
|
|
71efe9d8fd | ||
|
|
e56fe7e5e7 | ||
|
|
42d53f3bc0 | ||
|
|
f67d599a01 | ||
|
|
8da8756312 | ||
|
|
21ac79e94b | ||
|
|
2e3d68ed1b | ||
|
|
f81b7df618 | ||
|
|
cad2598fcb | ||
|
|
8c75dbc498 | ||
|
|
cf649f59cb | ||
|
|
8ba6d622e5 | ||
|
|
f9226f9bf3 | ||
|
|
fb8486f3bd | ||
|
|
280e9cb28d | ||
|
|
e7e96fe2e0 | ||
|
|
6af7753e36 | ||
|
|
6af22d0d3e | ||
|
|
a22f181736 | ||
|
|
e00c2f335c | ||
|
|
db894fa6aa | ||
|
|
3f960255f4 | ||
|
|
5d07438cb3 | ||
|
|
d2274b01cb | ||
|
|
f1b2afc9d9 | ||
|
|
b28c2e20ca | ||
|
|
e0ca519a8b | ||
|
|
6477bb724e | ||
|
|
50b38322b9 | ||
|
|
cc9893eb44 | ||
|
|
2c7909697a | ||
|
|
814966ad33 | ||
|
|
43d0f2abc5 | ||
|
|
0ab1af7d3e | ||
|
|
4f19bb7af6 | ||
|
|
60aff0bd30 | ||
|
|
fbf655afbd | ||
|
|
a4accc0e3e | ||
|
|
aaaef22db6 | ||
|
|
8e993b427c | ||
|
|
3500262b7d | ||
|
|
fd92b91188 | ||
|
|
04379bcb1d | ||
|
|
bd75f9e613 | ||
|
|
1ee1f79e27 | ||
|
|
ef42f49470 | ||
|
|
b2782c6dc5 | ||
|
|
51d487786c | ||
|
|
d9cd2876d9 | ||
|
|
13edec75a3 | ||
|
|
07340553a5 | ||
|
|
291e3f0762 | ||
|
|
ad9c552b12 | ||
|
|
15837bab8c | ||
|
|
6a9efa2d3e | ||
|
|
dcaed51ba0 | ||
|
|
1bdffee820 | ||
|
|
125ee6a68e | ||
|
|
69fbe3a9ad | ||
|
|
69058f35f8 | ||
|
|
14c72cc582 | ||
|
|
9ad3413190 | ||
|
|
7e49e8e797 | ||
|
|
28f2959b83 | ||
|
|
f1ad170a15 | ||
|
|
add4f43f0e | ||
|
|
ef7e5e0d69 | ||
|
|
4f1b24d974 | ||
|
|
63e08cbef7 | ||
|
|
b655f2d632 | ||
|
|
f7cb79431f | ||
|
|
8dd523a216 | ||
|
|
8c653c163a | ||
|
|
b8215c0817 | ||
|
|
47007455dc | ||
|
|
5b5483dc8e | ||
|
|
7f1247004e | ||
|
|
c75287dc85 | ||
|
|
eb02876e74 | ||
|
|
5df97b339e | ||
|
|
b36f4ac708 | ||
|
|
ec1b7b933d | ||
|
|
5146d9f8ac | ||
|
|
a46bbdda2e | ||
|
|
f346bd6ee6 | ||
|
|
2cb8950cc2 | ||
|
|
fc777296bf | ||
|
|
486fc0424a | ||
|
|
80a5ae4f53 | ||
|
|
49a0c166f3 | ||
|
|
d0279242ce | ||
|
|
b351ec8baf | ||
|
|
21f287915c | ||
|
|
574f7bc3d4 | ||
|
|
98c2cd4311 | ||
|
|
41c1d0291c | ||
|
|
3401f553b9 | ||
|
|
f98d8f6c15 | ||
|
|
4568618030 | ||
|
|
71e84e2c36 | ||
|
|
1516132167 | ||
|
|
826122fa8e | ||
|
|
e55e93a1e3 | ||
|
|
699ab98f9d | ||
|
|
62e9e1fecd | ||
|
|
9a0dac124e | ||
|
|
053b966134 | ||
|
|
ad08aa3956 | ||
|
|
ba0751a915 | ||
|
|
2d42423953 | ||
|
|
3a79f35fdc | ||
|
|
ff6b309c6f | ||
|
|
b0ff9ee688 | ||
|
|
6a03b43e5f | ||
|
|
a49aaf9ab0 | ||
|
|
12bbeaa45e | ||
|
|
8e39a27b76 | ||
|
|
4f1335cd4c | ||
|
|
49b2cbf763 | ||
|
|
81fb61f97c | ||
|
|
782b84c6d5 | ||
|
|
66b698c3cf | ||
|
|
db890956ec | ||
|
|
a7c444b939 | ||
|
|
a43a3798d3 | ||
|
|
3b14d7b84b | ||
|
|
372144508c | ||
|
|
183a34a5cf | ||
|
|
995ecffbb2 | ||
|
|
e7f23e164b | ||
|
|
c36ce04dd3 | ||
|
|
650e073f7a | ||
|
|
2edf296a92 | ||
|
|
a2c461d58a | ||
|
|
2ece3ea699 |
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0beta2
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -29,22 +29,33 @@ document ____executor_globals
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____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
|
||||
if $argc == 0
|
||||
____executor_globals
|
||||
set $cv_ex_ptr = $eg.current_execute_data
|
||||
else
|
||||
set $cv_ex_ptr = (zend_execute_data *)$arg0
|
||||
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
|
||||
@@ -196,12 +207,17 @@ 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
|
||||
set $ht = $zobj->properties
|
||||
if $zobj->properties
|
||||
set $ht = $zobj->properties
|
||||
else
|
||||
set $ht = &$zobj->ce->properties_info
|
||||
end
|
||||
printf "\nProperties "
|
||||
if $ht
|
||||
set $ind = $ind + 1
|
||||
____print_ht $ht 1
|
||||
@@ -212,7 +228,7 @@ define ____printzv_contents
|
||||
set $i = $i - 1
|
||||
end
|
||||
else
|
||||
echo "no properties found"
|
||||
echo "not found"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -455,9 +471,9 @@ define print_inh
|
||||
end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
set $pi = (zend_property_info *)$arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
printf "ZEND_ACC_PUBLIC"
|
||||
@@ -476,16 +492,27 @@ define print_pi
|
||||
end
|
||||
printf ")\n"
|
||||
printf " name = "
|
||||
____print_str $pi->name $pi->name_length
|
||||
printf "\n}\n"
|
||||
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>
|
||||
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 < 256
|
||||
if $str[$tmp] > 32 && $str[$tmp] < 127
|
||||
while $tmp < $arg1 && $tmp < $maxlen
|
||||
if $str[$tmp] > 31 && $str[$tmp] < 127
|
||||
printf "%c", $str[$tmp]
|
||||
else
|
||||
printf "\\%o", $str[$tmp]
|
||||
@@ -554,6 +581,23 @@ 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
|
||||
@@ -566,79 +610,6 @@ document zbacktrace
|
||||
> (gdb) dump_bt $eg.current_execute_data
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename->val, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename->val
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
define lookup_root
|
||||
set $found = 0
|
||||
if gc_globals->roots
|
||||
|
||||
+1
-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
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
|
||||
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
+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.
|
||||
|
||||
|
||||
+18
-15
@@ -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,24 +93,27 @@ 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. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
|
||||
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
|
||||
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.
|
||||
|
||||
14. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
15. Now the RC can be found on http://downloads.php.net/yourname,
|
||||
f.e. http://downloads.php.net/derick/
|
||||
|
||||
15. Once the release has been tagged, contact the PHP Windows development team
|
||||
16. 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 (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".
|
||||
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``.
|
||||
|
||||
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``.
|
||||
@@ -190,8 +193,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 the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created.
|
||||
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.
|
||||
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
@@ -271,8 +274,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)
|
||||
@@ -309,6 +312,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.
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
+22
-76
@@ -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;
|
||||
@@ -731,7 +681,10 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
|
||||
err = GetLastError();
|
||||
if (err) {
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
/* Catch more errors */
|
||||
if (ERROR_NOT_ENOUGH_MEMORY == err) {
|
||||
_set_errno(ENOMEM);
|
||||
}
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
@@ -812,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) {
|
||||
|
||||
+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_FUNCS(finite isfinite isinf isnan)
|
||||
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
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_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#define HAVE_DECL_ISNAN 1
|
||||
#define HAVE_DECL_ISINF 1
|
||||
#define HAVE_DECL_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#if HAVE_DECL_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) 0
|
||||
#define zend_isnan(a) ((a) != (a))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#if HAVE_DECL_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)?1:0)
|
||||
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#if HAVE_DECL_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)
|
||||
|
||||
+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..."
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
--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
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,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,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #71818 (Memory leak when array altered in destructor)
|
||||
--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
|
||||
@@ -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)
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72441 (Segmentation fault: RFC list_keys)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [];
|
||||
|
||||
list(
|
||||
'' => $foo,
|
||||
$bar
|
||||
) = $array;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot mix keyed and unkeyed array entries in assignments in %sbug72441.php on line %d
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
function create_references(&$array) {
|
||||
foreach ($array as $key => $value) {
|
||||
create_references($array[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
function change_copy($copy) {
|
||||
$copy['b']['z']['z'] = $copy['b'];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'a' => [
|
||||
'b' => [],
|
||||
],
|
||||
];
|
||||
|
||||
create_references($data);
|
||||
|
||||
$copy = $data['a'];
|
||||
var_dump($copy);
|
||||
|
||||
change_copy($copy);
|
||||
var_dump($copy); //RECURSION
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["b"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
["b"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.1 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [];
|
||||
$arr[0] = null;
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
$arr[0][0] = $arr[0];
|
||||
var_dump($arr);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.2 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [];
|
||||
$arr[0] = null;
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
$arr[0][$arr[0]] = null;
|
||||
var_dump($arr);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[""]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.3 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = new stdClass;
|
||||
$x->a = 1;
|
||||
$ref =& $x->a;
|
||||
unset($ref);
|
||||
var_dump($x->a + ($x->a = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.4 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
unset($ref);
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72543.5 (different references behavior comparing to PHP 5)
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = [1];
|
||||
$ref =& $arr[0];
|
||||
var_dump($arr[0] + ($arr[0] = 2));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72598 (Reference is lost after array_slice())
|
||||
--FILE--
|
||||
<?php
|
||||
function ref(&$ref) {
|
||||
var_dump($ref);
|
||||
}
|
||||
|
||||
new class {
|
||||
function __construct() {
|
||||
$args = [&$this];
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$a = array_slice($args, 0, 1);
|
||||
call_user_func_array('ref', $a);
|
||||
}
|
||||
}
|
||||
};
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
|
||||
object(class@anonymous)#1 (0) {
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72598.2 (Reference is lost after array_slice())
|
||||
--FILE--
|
||||
<?php
|
||||
function ref(&$ref) {
|
||||
var_dump($ref);
|
||||
$ref = 1;
|
||||
}
|
||||
|
||||
new class {
|
||||
function __construct() {
|
||||
$b = 0;
|
||||
$args = [&$b];
|
||||
unset($b);
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$a = array_slice($args, 0, 1);
|
||||
call_user_func_array('ref', $a);
|
||||
}
|
||||
}
|
||||
};
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
|
||||
int(0)
|
||||
|
||||
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
|
||||
int(0)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #72918 (negative offset inside a quoted string leads to parse error)
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [-3 => 'foo'];
|
||||
$string = 'abcde';
|
||||
|
||||
echo "$array[-3]\n";
|
||||
echo "$string[-3]\n";
|
||||
echo <<<EOT
|
||||
$array[-3]
|
||||
$string[-3]
|
||||
|
||||
EOT;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
foo
|
||||
c
|
||||
foo
|
||||
c
|
||||
===DONE===
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73288 (Segfault in __clone > Exception.toString > __get)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class NoClone {
|
||||
public function __clone() {
|
||||
throw new Exception("No Cloneable");
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __get($name) {
|
||||
return new NoClone;
|
||||
}
|
||||
}
|
||||
|
||||
function test_clone() {
|
||||
$c = new C;
|
||||
$b = clone $c->x;
|
||||
}
|
||||
|
||||
test_clone();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: No Cloneable in %sbug73288.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): NoClone->__clone()
|
||||
#1 %s(%d): test_clone()
|
||||
#2 {main}
|
||||
thrown in %sbug73288.php on line %d
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73916 (zend_print_flat_zval_r doesn't consider reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = array('a');
|
||||
class b{};
|
||||
$b = new b;
|
||||
$test[] =& $a;
|
||||
$test[] =& $b;
|
||||
test($test);
|
||||
function test() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 test(Array ([0] => Array ([0] => a),[1] => b Object ())) called at [%sbug73916.php:%d]
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #73954 (NAN check fails on Alpine Linux with musl)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(NAN);
|
||||
var_dump(is_nan(NAN));
|
||||
|
||||
function takes_int(int $int) {
|
||||
}
|
||||
|
||||
takes_int(log(tan(3.14)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
float(NAN)
|
||||
bool(true)
|
||||
|
||||
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
|
||||
Stack trace:
|
||||
#0 %s(9): takes_int(NAN)
|
||||
#1 {main}
|
||||
thrown in %s on line 6
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73960: Leak with instance method calling static method with referenced return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$value = 'one';
|
||||
$array = array($value);
|
||||
$array = $ref =& $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "one"
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #73989 (PHP 7.1 Segfaults within Symfony test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cycle
|
||||
{
|
||||
private $thing;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$obj = $this;
|
||||
$this->thing = function() use($obj) {};
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
($this->thing)();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; ++$i) {
|
||||
$obj = new Cycle();
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #73998 (array_key_exists fails on arrays created by get_object_vars)
|
||||
--DESCRIPTION--
|
||||
Properties of objects with numeric names should be accessible
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new stdClass;
|
||||
$a->{1234} = "Numeric";
|
||||
$a->a1234 = "String";
|
||||
|
||||
$properties = get_object_vars($a);
|
||||
var_dump(array_key_exists(1234, $properties));
|
||||
echo "Value: {$properties[1234]}\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Value: Numeric
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #74084 (Out of bound read - zend_mm_alloc_small)
|
||||
--INI--
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
$$A += $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A -= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A *= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A /= $$B->a = &$$C;
|
||||
unset($$A);
|
||||
$$A **= $$B->a = &$$C;
|
||||
var_dump($$A);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func() should error on reference arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
|
||||
function bar(&$ref) {
|
||||
$ref = 24;
|
||||
}
|
||||
|
||||
$x = 42;
|
||||
$ref =& $x;
|
||||
\call_user_func('Foo\bar', $x);
|
||||
var_dump($x);
|
||||
|
||||
$y = 42;
|
||||
$ref =& $y;
|
||||
call_user_func('Foo\bar', $y);
|
||||
var_dump($y);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
|
||||
int(42)
|
||||
|
||||
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
|
||||
int(42)
|
||||
@@ -1,54 +0,0 @@
|
||||
--TEST--
|
||||
call_user_func() behavior with references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(&$ref1, &$ref2) {
|
||||
$ref1 += 42;
|
||||
$ref2 -= 42;
|
||||
return true;
|
||||
}
|
||||
|
||||
$i = $j = 0;
|
||||
var_dump(call_user_func('test', $i, $j));
|
||||
var_dump($i, $j);
|
||||
|
||||
var_dump(call_user_func_array('test', [$i, $j]));
|
||||
var_dump($i, $j);
|
||||
|
||||
$x =& $i; $y =& $j;
|
||||
var_dump(call_user_func('test', $i, $j));
|
||||
var_dump($i, $j);
|
||||
|
||||
var_dump(call_user_func_array('test', [$i, $j]));
|
||||
var_dump($i, $j);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
|
||||
bool(true)
|
||||
int(0)
|
||||
int(0)
|
||||
|
||||
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
|
||||
bool(true)
|
||||
int(0)
|
||||
int(0)
|
||||
|
||||
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
|
||||
bool(true)
|
||||
int(0)
|
||||
int(0)
|
||||
|
||||
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
|
||||
bool(true)
|
||||
int(0)
|
||||
int(0)
|
||||
Loaded 100 of 1853 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user