Compare commits

..
Author SHA1 Message Date
Christoph M. Becker 0eda1aeca3 Update versions for PHP 7.3.0beta3 2018-08-28 10:07:30 +00:00
Remi Collet 584ffa5f6e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  bump to 7.2.11-dev
2018-08-28 10:19:08 +02:00
Remi Collet 7353dae815 bump to 7.2.11-dev 2018-08-28 10:17:33 +02:00
Jakub Zelenka 014b1b3aad Store zlog stream in each child so it can be reused
This change results in using the same buffer for multiple
stdio events which should fix inconsistencies of handling
messages that are not ended with a new line and possibly
very long messages that are split to multiple events.
2018-08-27 14:58:39 +01:00
Christoph M. Becker 4d6b0b5031 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:23:51 +02:00
Christoph M. Becker 20849b0b0f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:21:22 +02:00
Christoph M. Becker efb86aef12 Fix #68180: iconv_mime_decode can return extra characters in a header
Basically, the algorithm to append a converted string to an existing
`smart_str` works by increasing the `smart_str` buffer, to let `iconv`
convert characters until there is no more space, to set the new length
of the `smart_str` and to repeat until there is no more input.

Formerly, the new length calculation has been wrong, though, since we
would have to take the old `out_len` into account (`buf_growth -
old_out_len - out_len`).  However, since there is no need to take the
old `out_len` into account when increasing the `smart_str` buffer, we
can simplify the fix, avoiding an additional variable.
2018-08-26 13:18:35 +02:00
Christoph M. Becker b5afc99afb Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:52:16 +02:00
Christoph M. Becker 314b8ecf8b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:47:29 +02:00
Christoph M. Becker e29c946c29 Fix #60494: iconv_mime_decode does ignore special characters
We must not ignore erroneous characters in mime headers, but rather let
iconv_mime_decode() fail in this case, issuing the usual notice
regarding illegal characters.
2018-08-25 17:40:39 +02:00
Christoph M. Becker 065eee16b5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:54:32 +02:00
Christoph M. Becker 7e176ddb57 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:52:54 +02:00
Christoph M. Becker 8754d44167 Fix #63839: iconv_mime_decode_headers function is skipping headers
We have to cater to the possibility that `=?` is not the start of an
encoded-word, but rather a literal `=?`.  If a line break is found
while we're still looking for the charset, we can safely assume that
it's a literal `=?`, and act accordingly.
2018-08-25 14:51:13 +02:00
Christoph M. Becker 50fec3be0e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:43:13 +02:00
Christoph M. Becker 6922cae4ae Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:41:38 +02:00
Christoph M. Becker 6e1980e152 Fix #55146: iconv_mime_decode_headers() skips some headers
If we're expecting the start of an encoded word (`=?`), but instead of
the question mark get a line break (CR or LF), we must not append it to
the `pretval`.
2018-08-25 14:40:07 +02:00
Christoph M. Becker eb03290754 Fix #53891: iconv_mime_encode() fails to Q-encode UTF-8 string
The minimum length of an encoded-word is actually the pure encoding
overhead plus the length of the `output-charset` plus the minimum unit
of encoded text, which is 4 for B-encoding and (for simplicity) 3 for
Q-encoding.  We also cater to the possibility that we need further
encoded words, which would be split by the `line-break-chars` followed
by a space character.  Obviously, the former `out_charset_len + 12` is
too simplistic and wrong in the given case (where the magic number
would be 13).

These simplifications are somewhat wasteful, but iconv_mime_encode()
with Q-encoding is wasteful anyway (see bug 66828[1]), and the proper
solution to convert the whole input to the desired output charset
upfront, and applying the encoding afterwards appears too much a change
for the stable releases.

[1] <https://bugs.php.net/66828>
2018-08-25 14:30:07 +02:00
Christoph M. Becker 692e5d5c88 Fix #76712: Assignment of empty string creates extraneous text node
We work around this peculiarity of libxml by using xmlNodeSetContent(),
which does not exhibit this behavior.  This also saves us from manually
calculating the string length.
2018-08-25 14:24:09 +02:00
Peter Kokot fcf4088d3f Remove some old parts of the php
Since ba138a3746 the generate-phpt library
has been unbundled from the php-src. This patch cleans two remaining
parts.
2018-08-25 11:58:17 +02:00
Anatol Belski f15fc8ea1e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  mkdist.php: recursively check dll dependencies
2018-08-23 21:27:43 +02:00
Anatol Belski 8f43ec1e83 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  mkdist.php: recursively check dll dependencies
2018-08-23 21:26:40 +02:00
Dylan K. Taylor b9bf9ddce6 mkdist.php: recursively check dll dependencies
Fix duplication of recursively checked deps
2018-08-23 21:25:54 +02:00
Christoph M. Becker 5fe8e49baa Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Simplify regression test
2018-08-23 12:51:11 +02:00
Christoph M. Becker 1c3d5659bd Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Simplify regression test
2018-08-23 12:49:26 +02:00
Christoph M. Becker 6644bd005f Simplify regression test
There's no need to actually try to trigger an out-of-memory condition
to proof the leak; instead we can simply rely on the Zend MM to report
the memory leaks in debug mode (at least on Linux).  Therefore we
simplify the regression test, which also makes it run much faster.
2018-08-23 12:48:09 +02:00
Christoph M. Becker 3278b3347c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #68825: Exception in DirectoryIterator::getLinkTarget()
2018-08-22 15:40:03 +02:00
Christoph M. Becker 36946f5c45 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #68825: Exception in DirectoryIterator::getLinkTarget()
2018-08-22 15:38:30 +02:00
Christoph M. Becker 32a728d351 Fix #68825: Exception in DirectoryIterator::getLinkTarget()
intern->file_name may not have been properly set when
DirectoryIterator::getLinkTarget() is called, so we make sure it is
before using it.
2018-08-22 15:37:02 +02:00
Christoph M. Becker 6cf382b667 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Increase memory_limit to prevent test failures
2018-08-22 14:31:36 +02:00
Christoph M. Becker 10661e28d1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Increase memory_limit to prevent test failures
2018-08-22 14:30:23 +02:00
Christoph M. Becker 5fb01a3a42 Increase memory_limit to prevent test failures 2018-08-22 14:29:28 +02:00
Chris Wright 9ace33b9c5 Fix #76773 - Methods with a concrete scope need to be added again 2018-08-22 14:08:15 +02:00
Ondřej Surý 02b0bc8bb1 Fix #76767: ‘asm’ operand has impossible constraints in zend_operators.h
We disable assembly code with gcc 4.8 on i386.
2018-08-22 13:57:21 +02:00
Christoph M. Becker 1de17428f6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76778: array_reduce leaks memory if callback throws exception
2018-08-22 13:51:16 +02:00
Christoph M. Becker cdd9eb8c4a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76778: array_reduce leaks memory if callback throws exception
2018-08-22 13:49:35 +02:00
Nikita Popov dd07f17f97 Merge branch 'PHP-7.2' into PHP-7.3 2018-08-22 13:43:23 +02:00
Christoph M. Becker 70b2fca220 Fix #76778: array_reduce leaks memory if callback throws exception
We have to release the result variable in the error case, too.
2018-08-22 13:40:24 +02:00
Massimiliano Braglia 2527a0fcfd Fixed bug #75797
Fix zend_register_class_alias_ex() to use non-persistent strings
for (non-persistent) userland classes.
2018-08-22 13:39:08 +02:00
Christoph M. Becker 138671f2f4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #76777 and added test
2018-08-22 12:54:39 +02:00
Christoph M. Becker 7ad0595712 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76777 and added test
2018-08-22 12:52:41 +02:00
Ville Hukkamaki cf2fc66b02 Fixed bug #76777 and added test
Set undefined values to null rather than undefined.
2018-08-22 12:51:06 +02:00
David Carlier 446b5b15d3 Don't report mmap failure if it is expected
When using mmap with MAP_FIXED_NOREPLACE or MAP_FIXED|MAP_EXCL
an mmap failure is not an error condition, so do not print an
error message in this case.
2018-08-22 11:19:52 +02:00
Dmitry Stogov 8d95f561e4 Stop using zend_function->reserved[] space. 2018-08-22 10:43:51 +03:00
David Carlier 0f68ff5c92 Support fixed address mmap without replacement
We did not use MAP_FIXED here, because it may replace an existing
mapping. This commit adds support for MAP_FIXED_NOREPLACE (available
on newer Linux kernels) and MAP_FIXED|MAP_EXCL (available on FreeBSD),
which avoid this issue.
2018-08-21 08:31:31 +02:00
Dmitry Stogov 5e5311e0ba Removed dead code 2018-08-21 09:01:54 +03:00
David Carlier 16a9dd74f4 Avoid directly adding to string literal
This fixes a Clang warning.
2018-08-21 06:25:41 +02:00
Dmitry Stogov b8828926f2 Avoid hash lookups in BIND_STATIC and BIND_LEXICAL opcode handlers.
Encode static variable offset into opline->extended_value.
2018-08-20 16:10:09 +03:00
Aaron Stone 1621f1739d [ci skip] Correct minor typo (GC_GLAGS to GC_FLAGS) 2018-08-20 12:56:34 +02:00
Gabriel Caruso efbf846fd2 Make array parsing parameters error messages consistency with ZPP failure 2018-08-19 21:27:57 -03:00
Jakub Zelenka 52ea129efb Merge branch 'PHP-7.2' into PHP-7.3 2018-08-19 20:19:48 +01:00
Jakub Zelenka 73a8f72617 Merge branch 'PHP-7.1' into PHP-7.2 2018-08-19 20:19:01 +01:00
Jakub Zelenka 4c542e6c13 Fix bug #76705 (unusable ssl => peer_fingerprint in stream_context_create()) 2018-08-19 20:14:26 +01:00
Anatol Belski 9708083779 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Use stable deps on AppVeyor for now
2018-08-18 20:05:51 +02:00
Anatol Belski b0da1745be Use stable deps on AppVeyor for now
as long as the latest image is not synced with VC++ 15.8
2018-08-18 20:04:19 +02:00
Christoph M. Becker be2447fb7c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add regression test for bug #68175
  Fix #68175: RegexIterator pregFlags are NULL instead of 0
2018-08-18 14:39:15 +02:00
Christoph M. Becker 41d2102c77 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add regression test for bug #68175
  Fix #68175: RegexIterator pregFlags are NULL instead of 0
2018-08-18 14:37:48 +02:00
Christoph M. Becker 4c448334bd Add regression test for bug #68175 2018-08-18 14:36:16 +02:00
Tim Siebels 3257d22fea Fix #68175: RegexIterator pregFlags are NULL instead of 0 2018-08-18 14:33:39 +02:00
Anatol Belski 990a404c2d Add test for bug #76738
Original repro. It's unwieldy, but it's otherwise hard to trigger
the wrong buffer handling behavior.
2018-08-17 18:31:58 +02:00
Anatol Belski 0414fff205 Fix memory leak 2018-08-17 16:22:35 +02:00
Anatol Belski aa7777d36c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update binary SDK version for AppVeyor
2018-08-17 15:46:28 +02:00
Anatol Belski 4aa5065bb0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update binary SDK version for AppVeyor
2018-08-17 15:45:31 +02:00
Anatol Belski 837ed71c65 Update binary SDK version for AppVeyor 2018-08-17 15:44:10 +02:00
Christoph M. Becker a097f926c8 [ci skip] Update NEWS
Bug #76285 was supposed to have been fixed for 7.3.0alpha3, but that
has been reverted for 7.3.0beta2 due to bug #76738.  Now that we have a
working fix in master, we backport the respective commits.
2018-08-17 13:06:27 +02:00
Anatol Belski 0c2327b472 Cleanup
(cherry picked from commit 8b3174f256)
2018-08-17 13:01:57 +02:00
Anatol Belski ddd73d4fa8 Followup fix for ef9ed19e, see also bug #76738
(cherry picked from commit 083285f22a)
2018-08-17 13:01:56 +02:00
Xinchen Hui 10d724d82d Fixed build
(cherry picked from commit 36f05a80d7)
2018-08-17 13:01:55 +02:00
Andrew Nester 2072d377d3 DOMDocument::formatOutput attribute sometimes ignored
(cherry picked from commit ef9ed19ec7)
2018-08-17 13:01:55 +02:00
Xinchen Hui 5c1a2d8375 Fixed same bug #76755 in setrawcookie 2018-08-17 16:19:26 +08:00
Xinchen Hui 0a16af043e Cheaper checking 2018-08-17 15:21:48 +08:00
Xinchen Hui 751bbaa41f Micro optimization & fixed invalid key handling 2018-08-17 14:56:24 +08:00
Xinchen Hui d61ff37f45 Fixed bug #76755 (setcookie does not accept "double" type for expire time) 2018-08-17 13:45:43 +08:00
Xinchen Hui 2aa3733daa Update NEWS 2018-08-17 13:36:12 +08:00
Xinchen Hui 3131ebcea8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fixed bug #76754 (parent private constant in extends class memory leak)
2018-08-17 13:36:03 +08:00
Xinchen Hui acd4264f7b Update NEWS 2018-08-17 13:35:46 +08:00
Xinchen Hui ca103b415e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76754 (parent private constant in extends class memory leak)
2018-08-17 13:35:31 +08:00
Xinchen Hui 04c4854fdf Fixed bug #76754 (parent private constant in extends class memory leak) 2018-08-17 13:35:15 +08:00
Xinchen Hui fd463a9a60 Fixed bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in _get_zval_ptr_tmp failed). 2018-08-17 12:19:31 +08:00
Xinchen Hui ae926d8961 Merge branch 'PHP-7.3' of git.php.net:/php-src into PHP-7.3
* 'PHP-7.3' of git.php.net:/php-src:
  fix man page installation
2018-08-16 14:02:03 +08:00
Xinchen Hui a158fb958f Merge branch 'PHP-7.2' of git.php.net:/php-src into PHP-7.2
* 'PHP-7.2' of git.php.net:/php-src:
  fix man page installation
2018-08-16 14:01:17 +08:00
Xinchen Hui 64c88c1e16 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  fix man page installation
2018-08-16 14:00:30 +08:00
Xinchen Hui 6e7b381270 Update NEWS 2018-08-16 13:57:40 +08:00
Xinchen Hui 1ea2395712 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file)
2018-08-16 13:57:05 +08:00
Xinchen Hui eb7fca9546 Update NEWS 2018-08-16 13:56:52 +08:00
Xinchen Hui a879f4dd22 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file)
2018-08-16 13:56:37 +08:00
Xinchen Hui 8c92442b49 Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file) 2018-08-16 13:56:20 +08:00
Remi Collet 32477dea70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix man page installation
2018-08-16 06:55:14 +02:00
Remi Collet 2cdde35d0f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  fix man page installation
2018-08-16 06:54:57 +02:00
Remi Collet 1f2f2c6b96 fix man page installation
Since 91996e7ee5
phpdbg.1 is in buildir, not in srcdir
2018-08-16 06:53:56 +02:00
Xinchen Hui e4276aeb98 Added NEWs 2018-08-15 11:02:59 +08:00
Christoph M. Becker 66a4362914 [ci skip] Update NEWS wrt. php-7.3.0beta2 tagging 2018-08-14 13:36:15 +02:00
Christoph M. Becker 819cf5283b Revert "DOMDocument::formatOutput attribute sometimes ignored"
This reverts commit ef9ed19ec7 and its
follow-up 36f05a80d7, since these caused
a serious regression (see bug #76738).
2018-08-14 12:14:33 +02:00
Xinchen Hui 78d823d9c3 Fixed zend_read_static_property 2018-08-14 13:01:50 +08:00
Tyson Andre dcd4b32185 Fix arginfo for tidy::__construct()
This was split out of PR #3439

Previously, the arginfo was wrong for these methods.
getNumberOfRequiredParameters() was 4 for that method.
Compare with http://php.net/manual/en/tidy.construct.php)

This fixes the arginfo added to PHP 7.3 in 97353cda99
2018-08-13 16:09:32 +02:00
Christoph M. Becker 8270c7d947 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix arginfo for bzcompress
2018-08-13 16:02:13 +02:00
Christoph M. Becker 56abfd2798 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix arginfo for bzcompress
2018-08-13 16:00:25 +02:00
Tyson Andre e20baee136 Fix arginfo for bzcompress
bzcompress() has 1 required parameter, not 2.

See http://php.net/manual/en/function.bzcompress.php or invoke
bzcompress with 1 parameter.
2018-08-13 15:59:08 +02:00
Anatol Belski fdaa540fd8 Sync with e0fe6674 2018-08-13 09:18:38 +02:00
Anatol Belski 9eb51ce364 Update NEWS [ci skip] 2018-08-13 09:14:26 +02:00
Anatol Belski 4a3fccb0f5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-08-13 09:13:51 +02:00
Anatol Belski dd0fb4fd9b Update NEWS [ci skip] 2018-08-13 09:13:05 +02:00
Anatol Belski dc3f4f7342 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS [ci skip]
2018-08-13 09:12:32 +02:00
Anatol Belski 859f7fce1f Update NEWS [ci skip] 2018-08-13 09:11:57 +02:00
Pedro Magalhães a16aee6cee Fix #76688: Disallow excessive parameters after options array 2018-08-12 15:49:13 +02:00
Peter Kokot 326d3d480c [ci skip] Update NEWS 2018-08-12 11:29:02 +02:00
Cristian Rodríguez e0fe667421 Fix bug #76030 RE2C_FLAGS rarely honoured
Since PHP 5.3 the default lexer generator is RE2C. On Unix-alike build
systems there is also optional configure option --enable-re2c-cgoto
which enables optimized conditional jumps using non-standard computed
goto extension. It is available since RE2C 0.10.3 so it's well covered
by RE2C versions PHP uses. This patch syncs usage of -g option accross
the PHP Unix-alike build system.
2018-08-12 11:15:18 +02:00
Anatol Belski 3cef5a2476 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:09:21 +02:00
Anatol Belski 9cc74ba229 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:08:30 +02:00
Anatol Belski 45a05f3841 Fixed bug #74484 MessageFormatter::formatMessage memory corruption
with 11+ named placeholder
2018-08-09 22:07:24 +02:00
Christoph M. Becker d22ddd8cf1 [ci skip] Update NEWS regarding SameSite cookie support 2018-08-09 00:53:42 +02:00
Pedro Magalhães 887235773d Fix #76700 - Methods with altered visibility need to be added again 2018-08-07 14:22:37 +08:00
Xinchen Hui 2b1d79ce66 Fixed bug #76713 (Segmentation fault caused by property corruption) 2018-08-07 12:36:36 +08:00
Anatol Belski b053beee7e Fix stack underflow in phar
The checks can issue reads below and above the temporary buffer. A read
itself doesn't seem dangerous, but the condition result can be
arbitrary. Such reads have to be avoided. Likely this patch should be
backported.
2018-08-06 22:43:45 +02:00
Anatol Belski 3082600326 Update libmagic.patch [ci skip] 2018-08-06 14:28:32 +02:00
Richard Fussenegger 35cb353dd5 [ci skip] Extended class naming rule 2018-08-06 13:31:02 +02:00
Peter Kokot 1c1567c9bc [ci skip] Update NEWS 2018-08-06 09:43:03 +02:00
Peter Kokot a6ab19375a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 09:42:42 +02:00
Peter Kokot 0b9a540dd7 [ci skip] Update NEWS 2018-08-06 09:42:32 +02:00
Peter Kokot f4777c6a51 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-06 09:41:54 +02:00
Peter Kokot 935625f1b8 [ci skip] Update NEWS 2018-08-06 09:41:38 +02:00
Peter Kokot fefaeae49c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #76709: Minimal required zlib library is 1.2.0.4
2018-08-06 09:39:52 +02:00
Peter Kokot fab7d9f577 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #76709: Minimal required zlib library is 1.2.0.4
2018-08-06 09:39:33 +02:00
Peter Kokot a3e3d914ed Fix bug #76709: Minimal required zlib library is 1.2.0.4
The minimal required version of zlib system library is 1.2.0.4 instead
of 1.0.9 as reported in the ./configure --help.
2018-08-06 09:37:16 +02:00
Peter Kokot 2c72673986 [ci skip] Update NEWS 2018-08-06 06:20:08 +02:00
Peter Kokot 51d3896fd7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 06:19:45 +02:00
Peter Kokot fa07b8bbb7 [ci skip] Update NEWS 2018-08-06 06:19:33 +02:00
Peter Kokot 86e9965c87 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-06 06:17:59 +02:00
Peter Kokot 4d5edcb4ac [ci skip] Update NEWS 2018-08-06 06:17:45 +02:00
Peter Kokot 523cf6e2e7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #65988: Zlib version check fails
2018-08-06 06:16:07 +02:00
Peter Kokot eceecb6900 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #65988: Zlib version check fails
2018-08-06 06:15:51 +02:00
Jay Bonci c8a90606c1 Fix bug #65988: Zlib version check fails
When an 'include/zlib/' style dir is passed to --with-zlib configure
option the zlib version check fails.
2018-08-06 06:14:11 +02:00
Peter Kokot ee2d2f78c4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 01:44:49 +02:00
Peter Kokot 8cbb381068 [ci skip] Update NEWS 2018-08-06 01:44:37 +02:00
Peter Kokot 6b092bcaae Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-06 01:44:07 +02:00
Peter Kokot b4b14d2106 [ci skip] Update NEWS 2018-08-06 01:43:37 +02:00
Peter Kokot c9ff518665 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #72443: Generate enabled extension
2018-08-06 01:34:31 +02:00
Peter Kokot 68ab719baa Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #72443: Generate enabled extension
2018-08-06 01:28:39 +02:00
Peter Kokot 45a3c0e596 Fix bug #72443: Generate enabled extension
The PHP extension generator script now generates enabled extension with
less required steps for using the newly generated files.
2018-08-06 01:22:17 +02:00
Christoph M. Becker d4053cee6b [ci skip] Fix UPGRADING
The “Allow a trailing comma in function calls” RFC has not been
mentioned there, yet.
2018-08-05 23:12:29 +02:00
David Carlier 9b462f332e fpm process name, FreeBSD 12.x using new setproctitle_fast 2018-08-05 20:36:41 +01:00
Jakub Zelenka 86d472e249 Use php_openlog instead of openlog in FPM
Fix incorrect port in the previous commit
2018-08-05 20:35:58 +01:00
Jakub Zelenka f9d9c5ebd9 Fix FPM logging when log pipe is closed 2018-08-05 20:35:40 +01:00
Peter Kokot 1012416a1c [ci skip] Update NEWS 2018-08-05 20:37:51 +02:00
Peter Kokot f9c8a003dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-05 20:37:21 +02:00
Peter Kokot 6680d5f875 [ci skip] Update NEWS 2018-08-05 20:36:59 +02:00
Peter Kokot b9c3c1441a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-05 20:36:33 +02:00
Peter Kokot 169a98319a [ci skip] Update NEWS 2018-08-05 20:35:23 +02:00
Peter Kokot 024232e94d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed incorrect restoring of LDFLAGS
2018-08-05 20:32:05 +02:00
Peter Kokot 8d91e82871 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed incorrect restoring of LDFLAGS
2018-08-05 20:27:33 +02:00
sji 0f557756dd Fixed incorrect restoring of LDFLAGS 2018-08-05 20:26:40 +02:00
Christoph M. Becker a003af5b62 Add missing skip conditions
mbstring can be built without mbregex support, in which case these
tests would fail.  Thus we add respective skip conditions.
2018-08-05 00:01:35 +02:00
Christoph M. Becker 70ecb6e50b Fix #76706: mbstring.http_output_conv_mimetypes is ignored
_php_mb_match_regex() is supposed to return != 0 on success, and 0 on
failure.  pcre2_match() returns >= 0 on success, and < 0 on failure.
We map the result accordingly.

Since this patch fixes four failing tests, there is no need to add
another.
2018-08-04 23:24:04 +02:00
Peter Kokot 99020cc085 Remove outdated comment with PEAR xmlrpc dependency
The xmlrpc extension is not required to install PEAR anymore.
2018-08-04 18:22:08 +02:00
Anatol Belski e1af7a794a Fix possible stack buffer overflow 2018-08-04 16:56:08 +02:00
Peter Kokot 655658bbfa Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
2018-08-04 16:20:52 +02:00
Peter Kokot 827abb843f [ci skip] Update NEWS
Bug fix #76595 has been done after the 7.2.9RC1 release and should go
to appropriate NEWS location then.
2018-08-04 16:19:47 +02:00
Peter Kokot 889df3087b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
2018-08-04 16:18:10 +02:00
Peter Kokot 18db1ce211 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-04 16:17:26 +02:00
Peter Kokot fd0fc20d35 [ci skip] Update NEWS
Bug fix #76595 has been done after RC release and should go to
appropriate NEWS location then.
2018-08-04 16:16:07 +02:00
Christoph M. Becker 5dc74d9e70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76704: mb_detect_order return value varies based on argument type
2018-08-04 13:50:48 +02:00
Christoph M. Becker 81ebe930f3 [ci skip] Fix NEWS
beta1 has already been released, but does not contain the fix for bug
76595.
2018-08-04 13:46:32 +02:00
Christoph M. Becker db8bcdba80 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76704: mb_detect_order return value varies based on argument type
2018-08-04 12:57:05 +02:00
Christoph M. Becker c00f5e6531 Fix #76704: mb_detect_order return value varies based on argument type
php_mb_parse_encoding_list() and php_mb_parse_encoding_array() are
supposed to return SUCCESS and FAILURE, not 1 and 0, respectively.
2018-08-04 12:51:57 +02:00
Peter Kokot bb92808794 [ci skip] Update NEWS 2018-08-04 06:41:34 +02:00
Peter Kokot ad0f73cbfd Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
2018-08-04 06:40:44 +02:00
Peter Kokot ffae3fb25d [ci skip] Update NEWS 2018-08-04 06:40:31 +02:00
Peter Kokot 7b2af47236 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  [ci skip] Update NEWS
2018-08-04 06:39:46 +02:00
Peter Kokot fa59dc550d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-08-04 06:39:33 +02:00
Peter Kokot b71a503844 [ci skip] Update NEWS 2018-08-04 06:39:19 +02:00
Peter Kokot 0f57a7f259 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug 76595: Update phpdbg man page
2018-08-04 06:37:15 +02:00
Peter Kokot 9286681bac Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug 76595: Update phpdbg man page
2018-08-04 06:35:40 +02:00
Kevin Abel 91996e7ee5 Fix bug 76595: Update phpdbg man page
Send phpdbg.1 man page through configure replacements
Update phpdbg.1 man page to include all options
Fixes formatting to be more consistent with php.1
Fix paragraph whitespace and ignore phpdbg.1
2018-08-04 06:34:40 +02:00
Anatol Belski 2ea7222440 Remove asan incompatible options 2018-08-03 14:10:37 +02:00
Christoph M. Becker 4faf135d90 Update UPGRADING.INTERNALS wrt. Same Site Cookies 2018-08-03 10:52:31 +02:00
Anatol Belski 7aca2bdbb1 Update maintainer info [skip ci] 2018-08-03 07:49:29 +02:00
Anatol Belski 4bb44e0f44 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Improve cleanup
2018-08-03 07:11:23 +02:00
Anatol Belski 0872e80dd8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Improve cleanup
2018-08-03 07:10:27 +02:00
Anatol Belski 41c69766a4 Improve cleanup
The persistent connection locks the file which might prevent deletion.
2018-08-03 07:08:53 +02:00
Anatol Belski cd07fa48ba Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix callbacks
  bump version
2018-08-02 21:40:50 +02:00
Anatol Belski 91a0a10f71 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix callbacks
  bump version
2018-08-02 21:20:04 +02:00
Anatol Belski 19592519c2 Fix callbacks
The signatures wasn't synced in 7.0
2018-08-02 18:59:34 +02:00
Anatol Belski 9d7c510893 Cleanup unused items 2018-08-02 18:28:56 +02:00
Sara Golemon ba1a90ea89 Merge branch 'PHP-7.2' into HEAD
* PHP-7.2:
  Roll NEWS for 7.2.10
2018-08-02 11:23:14 -04:00
Sara Golemon 0ba49597b9 Roll NEWS for 7.2.10 2018-08-02 11:21:40 -04:00
Michael Moravec 196e5f0e06 [ci skip] Fix wrong dash character in UPGRADING 2018-08-02 14:13:09 +02:00
Anatol Belski d53978bd59 Suppress more irrelevant clang warnings 2018-08-01 18:18:37 +02:00
Xinchen Hui 642bb9f376 Unused var 2018-08-01 16:45:15 +02:00
Anatol Belski 36857ab52b Fix clang compilation
By usage of -fmodules, all the intrinsic items are loaded automatically.
The headers included come however from Visual Studio, thus bringing some
conflicting declarations. On the other hand, -fmodules is needed to
mitigate linking issues with clang in VS compatibility mode.
2018-08-01 16:19:54 +02:00
Anatol Belski b1d2a89ac1 Fix length to copy 2018-07-31 17:31:57 +02:00
Joe Watkins 74988eed99 bump version 2018-07-31 16:38:35 +02:00
Christoph M. Becker f6ee308143 Fix ZEND_EXTENSION_API_NO 2018-07-31 14:11:39 +02:00
Christoph M. Becker 144e8d1f83 Update API version numbers
These are supposed to be final now for PHP 7.3.
2018-07-31 13:33:48 +02:00
Christoph M. Becker bf5cf79456 Fix UPGRADING 2018-07-31 13:31:28 +02:00
Christoph M. Becker 974abd8b43 Update UPGRADING wrt. samesite cookie RFC
Cf. <https://wiki.php.net/rfc/same-site-cookie>.
2018-07-31 12:48:33 +02:00
Pedro Magalhães 2b58ab23c6 Support for samesite cookies with array syntax
Allows using an alternative array argument with
support for the samesite option on the following
functions:
setcookie
setrawcookie
session_set_cookie_params
2018-07-31 12:40:26 +02:00
Frederik Bosch 08b9310e6d implement same site cookie see https://bugs.php.net/bug.php?id=72230 see https://tools.ietf.org/html/draft-west-first-party-cookies-07 see https://scotthelme.co.uk/csrf-is-dead/ 2018-07-31 12:40:24 +02:00
Dmitry Stogov 3ccd985478 Improved method visibility checks 2018-07-31 13:05:57 +03:00
Dmitry Stogov 57527455eb Simplified property name to string conversion 2018-07-31 12:24:53 +03:00
Dmitry Stogov c42f0ba4f7 Removed useless IS_UNDEF checks 2018-07-31 12:23:46 +03:00
Peter Kokot 7c1e0930c4 Remove TSRM_CHECK_GCC_ARG and LIBZEND_CPLUSPLUS_CHECKS
This removes two old Autoconf macro definitions since they are not used
anymore.
2018-07-31 05:59:05 +02:00
Peter Kokot b719aa41f4 Fix minor Autoconf coding style
This fixes two minor Autoconf coding styles. Double quotes in arguments
don't need to be escaped. This removes warning given by autoreconf:
- warning: back quotes and double quotes must not be escaped in...
2018-07-31 03:09:44 +02:00
Anatol Belski 160353688b Update NEWS [ci skip] 2018-07-30 19:44:59 +02:00
Anatol Belski b49891aa90 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-07-30 19:44:01 +02:00
Anatol Belski 095a30e11b Update NEWS [ci skip] 2018-07-30 19:43:23 +02:00
Anatol Belski e111ef5626 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS [ci skip]
2018-07-30 19:42:45 +02:00
Anatol Belski 2870178720 Update NEWS [ci skip] 2018-07-30 19:42:10 +02:00
Anatol Belski 093cb1d7c6 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
2018-07-30 18:29:40 +02:00
Anatol Belski d207d6a57f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
2018-07-30 18:28:53 +02:00
Anatol Belski cc69950b15 Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option 2018-07-30 18:27:59 +02:00
Dmitry Stogov 5674cf888d Use better macros 2018-07-30 16:48:34 +03:00
Dmitry Stogov 909f943fe5 Loop optimization 2018-07-30 16:08:45 +03:00
Gabriel Caruso 9c8b3ae43f Make more tests run on 64bit plataforms 2018-07-30 09:43:09 -03:00
Gabriel Caruso 4a1336de7c Give a reason why the test was skipped 2018-07-30 09:03:21 -03:00
Gabriel Caruso 745f6627bd Remove superfluous SKIPIF sections of always available functions 2018-07-30 09:01:39 -03:00
Dmitry Stogov be805f146c Added missing define 2018-07-30 13:29:09 +03:00
Dmitry Stogov 3ced766da9 Removed duplicate code. zend_fetch_dimension_address_LIST_w() was a copy of zend_fetch_dimension_address_W(), ZEND_FETCH_LIST_W_SPEC_CV_... a copy of ZEND_FETCH_DIM_W_SPEC_CV_... 2018-07-30 10:53:39 +03:00
Peter Kokot f2e4de8b56 Fix AC_RUN_IFELSE calls when cross-compiling
AC_RUN_IFELSE program can't be run when cross-compiling. This fix removes
warnings given by autotools scripts.
2018-07-30 06:38:59 +02:00
Peter Kokot 6399fa1eea [ci skip] Fix typo 2018-07-30 06:28:40 +02:00
Gabriel Caruso d88bbcea82 Remove superfluous SKIPIF sections of always available constants 2018-07-30 00:53:28 -03:00
Peter Kokot 4371945b8b Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including
the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead:
- AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE
- AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM
- AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version therefore systems
should be well supported by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-07-30 02:36:38 +02:00
Gabriel Caruso aac5cdc7d7 Remove superfluous SKIPIF sections of always available interfaces 2018-07-29 18:03:34 -03:00
Peter Kokot 72551dd89e [ci skip] Document RETSIGTYPE 2018-07-29 21:32:35 +02:00
Gabriel Caruso 1461f8ef0d Remove superfluous SKIPIF sections of always available functions 2018-07-29 15:42:19 -03:00
Gabriel Caruso f2b5ac7963 [ci skip] Fix typo 2018-07-29 13:48:35 -03:00
Gabriel Caruso a61756252a Run tokenizer_data_gen.sh to reorganize tokens
This will help us in future PRs, reducing the numbers of changed lines
2018-07-29 13:21:33 -03:00
Peter Kokot 17de277a2f Remove obsolete AC_TYPE_SIGNAL
The AC_TYPE_SIGNAL macro defined the RETSIGTYPE based on the signal
type defined in the signal.h. On pre C89 sistems (K&R C) it could be
void or int. Since C89 it can be safely assumed that the signal and
therefore the RETSIGTYPE is always void, so the RETSIGTYPE can be
replaced with void in the code if it uses it. PHP doesn't use the
RETSIGTYPE in current code anyway.

Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2018-07-29 16:06:46 +02:00
Peter Kokot daaf706df0 Upgrade deprecated AC_OUTPUT macro calls
Autoconf 2.50 made several changes to macro calls. These include also
arguments passed to AC_OUTPUT macro. The upgrading chapter in Autoconf
documentation include an example of using AC_OUTPUT with
AC_CONFIG_FILES and AC_CONFIG_COMMANDS:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

PHP 5.4 to 7.1 require Autoconf 2.59+, PHP 7.2+ require Autoconf 2.64+,
and PHP 7.2 phpize script requires Autoconf 2.59+ which are all greater
than above mentioned 2.50 version. Systems out there should well support
this by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

More info on where exactly this got deprecated:
- ftp://ftp.gnu.org/old-gnu/Manuals/autoconf-2.13/html_mono/autoconf.html
- ftp://ftp.auckland.ac.nz/pub/gnu/Manuals/autoconf-2.52/html_chapter/autoconf_15.html
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
2018-07-29 16:04:39 +02:00
Peter Kokot 7394879adf Upgrade AX_FUNC_WHICH_GETHOSTBYNAME_R to serial 8
The AX_FUNC_WHICH_GETHOSTBYNAME_R macro is from the Autoconf Archive.
Latest version of the file has few docs changes. File is also renamed
as is a pattern of other m4 Autoconf Archive files.

Refs:
- http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_func_which_gethostbyname_r.m4
2018-07-29 15:59:33 +02:00
Peter Kokot ab702e4fde Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files in
Zend and TSRM folders.
2018-07-29 15:46:43 +02:00
Peter Kokot 209f05a878 [ci skip] Note HAVE_ST_BLKSIZE and HAVE_ST_RDEV 2018-07-29 14:44:56 +02:00
Peter Kokot d2184efb7b Replace obsolete AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV
Autoconf 2.50 released in 2001 has made several macros obsolete. Instead
of the AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV the new
AC_CHECK_MEMBERS should be used.

When checking for the presence of stat struct members st_blkzize and
st_rdev the new AC_CHECK_MEMBERS macro defines new constants
HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_RDEV.

Old constants HAVE_ST_BLKSIZE and HAVE_ST_RDEV need to be replaced
respectively in PHP code (this patch) and in PHP extenstions if they use
them.

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version.
2018-07-29 13:59:40 +02:00
Peter Kokot d7ad4babe0 [ci skip] Note removal of PHP_PROG_LEX 2018-07-29 13:37:48 +02:00
Peter Kokot 03b717d4cc Remove unused PHP_PROG_LEX macro
Since PHP 5.3 flex lexer has been replaced with re2c. Commit
0f9e2b1753 made PHP_PROG_LEX macro still
available for BC.

In commit df6bd506d4 it was updated. Since
this macro is entirely not used in PHP source code anymore from PHP 5.3
and up, this patch removes it together with some old traces of warnings
suppression and comments.
2018-07-29 10:53:21 +02:00
Peter Kokot 255e29f3bc Remove unused libmbfl build system related files
PHP build system already builds necessary files also from libmbfl
directory using the mbstring config.m4 file.
2018-07-29 10:07:32 +02:00
Peter Kokot b12cece8d5 Replace obsolete AC_AIX with AC_USE_SYSTEM_EXTENSIONS
Since Autoconf 2.62 the AC_AIX macro has been made obsolete and should
be replaced with the AC_USE_SYSTEM_EXTENSIONS instead.

Both macro behaviors are the same since the old one is just a wrapper
around the new AC_USE_SYSTEM_EXTENSIONS:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/specific.m4

PHP 7.2+ and the main configure.ac script require minimum Autoconf 2.64+.

Refs:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2018-07-29 08:00:15 +02:00
Peter Kokot 0a01eae039 Fix typo in config.m4
The AC_CHECK_FUNCS has the following synopsis:
AC_CHECK_FUNCS(function..., [action-if-found], [action-if-not-found]).

Fourth argument doesn't exist.
2018-07-29 06:10:16 +02:00
Peter Kokot cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Peter Kokot b60d8ab2e2 Upgrade AX_CHECK_COMPILE_FLAG macro to serial 6
The AX_CHECK_COMPILE_FLAG macro is from the Autoconf Archive. Latest
version of the file has a new All-permissive license for even more
convenience for usage.

Refs:
- http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_compile_flag.m4
- https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html
2018-07-28 01:40:02 +02:00
Peter Kokot cf8ef08e20 Fix typos in code 2018-07-27 16:27:41 +02:00
Peter Kokot 0eabd5231b Remove unused Git ident attributes from zip extension
$Id attributes were used with SVN. With Git most of the Git ident
attributes in source code files are not used anymore.
2018-07-27 15:49:34 +02:00
Gabriel Caruso 1359ff8052 Reverts some changes from 7ec64a83
Checking for the PHP_VERSION_ID here is actually part of the test
2018-07-27 08:01:43 -03:00
Dmitry Stogov a588b825d6 Improved assignment to "next" element of array ($a[] = ...) 2018-07-27 13:15:22 +03:00
Xinchen Hui a7746d10a5 Fixed bug #76667 (Segfault with divide-assign op and __get + __set) 2018-07-27 13:00:14 +08:00
Gabriel Caruso 7ec64a831d Remove superfluous check for PHP 7+ tests 2018-07-27 00:48:30 -03:00
Christoph M. Becker d035bc2bfe Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
2018-07-26 14:23:40 +02:00
Kalle Sommer Nielsen ba8f0615e1 Fixed ZTS build 2018-07-26 14:01:49 +02:00
Anatol Belski 6059ecee3a Sync with ab8094c6 2018-07-26 13:58:08 +02:00
Christoph M. Becker ce66492a13 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
2018-07-26 13:26:58 +02:00
Christoph M. Becker ed7e3bc70a Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
We need to ensure that a zval IS_DOUBLE before we access it as such.
In this case we apply common type juggling to do so.
2018-07-26 13:15:19 +02:00
Dmitry Stogov f374e93762 Use better check 2018-07-26 14:13:33 +03:00
Gabriel Caruso 562150906a Remove extra semicolons 2018-07-26 12:38:22 +02:00
Dmitry Stogov ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Dmitry Stogov 7a41e4c0d0 Documented ZEND_ACC_* flags (values are kept unchanged, except for ZEND_ACC_IMMUTABLE, that was introduced in 7.3 anyway) 2018-07-26 10:42:57 +03:00
Gabriel Caruso fb966b9825 Remove unused variables 2018-07-25 22:05:41 -03:00
Gabriel Caruso 9e4d590b19 Remove extra semicolons 2018-07-25 21:47:04 -03:00
Peter Kokot 8d18d631b6 Replace obsolete AC_TRY_CPP with AC_PREPROC_IFELSE
The AC_TRY_CPP macro is obsolete since Autoconf 2.50 in 2001:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2018-07-25 23:00:20 +02:00
Dmitry Stogov 57c4ae393c typo 2018-07-25 23:00:33 +03:00
Dmitry Stogov f950128cd6 Encode parent class name as IS_CONST operand in DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS opcodes (eliminate FETCH_CLAS
S opcode).
2018-07-25 13:40:47 +03:00
Peter Kokot a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Dmitry Stogov a29a800cb0 Regenerate scanners using re2c version >= 1.0.0 (newer version, at least, produce less code) 2018-07-25 12:49:03 +03:00
Dmitry Stogov aed3de1bc5 Split add/sub_function(s) into fast and slow parts 2018-07-25 12:48:16 +03:00
Peter Kokot df6bd506d4 Remove obsolete macro AC_DECL_YYTEXT
The macro AC_DECL_YYTEXT has been obsolete since Autoconf 2.50 released
in 2001. Now it is included in the AC_PROG_LEX macro.

Autoconf news info about obsoletion:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS

Docs:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version. Systems out there should
well support this by now.
2018-07-25 03:09:14 +02:00
Peter Kokot 8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Christoph M. Becker dcd6a6ff36 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76643: Segmentation fault when using `output_add_rewrite_var`
2018-07-24 12:41:35 +02:00
Christoph M. Becker a96ca13963 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76643: Segmentation fault when using `output_add_rewrite_var`
2018-07-24 12:28:22 +02:00
Christoph M. Becker 40bd84d3e3 Fix #76643: Segmentation fault when using output_add_rewrite_var
We have to check whether _SERVER is actually an array before we're
going to use it as such.
2018-07-24 12:20:13 +02:00
Dmitry Stogov d775fe33d1 Better name: ZEND_PROPERTY_HAS => ZEND_PROPERTY_NOT_EMPTY 2018-07-24 09:31:57 +03:00
Xinchen Hui 1638a6e118 Give a meaningful name 2018-07-24 12:51:36 +08:00
Xinchen Hui 4aada3993c Micro-optmization 2018-07-24 12:16:35 +08:00
Xinchen Hui d31d4d1392 Update NEWs 2018-07-24 11:37:30 +08:00
Xinchen Hui 3ca9aaf24e Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWs
  Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result)

Conflicts:
	ext/standard/array.c
2018-07-24 11:37:09 +08:00
Xinchen Hui 033dac7a6f Update NEWs 2018-07-24 11:35:43 +08:00
Xinchen Hui 2a181b5ea0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result)
2018-07-24 11:35:22 +08:00
Xinchen Hui 38d97557da Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result) 2018-07-24 11:34:57 +08:00
Xinchen Hui 4799cde613 Merge branch 'master' of https://github.com/oerdnj/php-src
* 'master' of https://github.com/oerdnj/php-src:
  Use __cpuid_count() from cpuid.h instead of custom assembly
2018-07-24 10:48:07 +08:00
Kalle Sommer Nielsen 0b7686584e Merge branch 'master' of git.php.net:/php-src 2018-07-23 17:38:52 +02:00
Kalle Sommer Nielsen ba138a3746 Removed the generated-tests library, this is a left Zöe's phpruntests repository it seems and never fully implemented. The only times this part of the code has been touched throughout the years has been minor PRs and entire php-src grep commits.
If anything this belongs to the phpruntests.git repository.
2018-07-23 17:38:26 +02:00
Dmitry Stogov 7ef8e3f87f Fixed tests 2018-07-23 17:00:33 +03:00
Dmitry Stogov d4e60a1ffd Avoid code duplication 2018-07-23 16:53:44 +03:00
Kalle Sommer Nielsen b1864b0178 Fix HKEY registry path (not that it should matter, dead code, Anatol?) 2018-07-23 15:37:02 +02:00
Kalle Sommer Nielsen 08f10ef47a Remove some dead code
sapi/*: Remove Windows code from FPM and LiteSpeed, as we don't support these SAPIs on Windows anyway
ext/com_dotnet: Remove non Windows code, as ext/com_dotnet is only supported on Windows
2018-07-23 15:26:39 +02:00
Dmitry Stogov b121405960 Use better destructor (key may be only IS_STRING or IS_LONG). 2018-07-23 15:57:06 +03:00
Dmitry Stogov ebd1f5af3e API cleanup.
Removed useless filename and lineno arguments, used in DEBUG build.
The patch doesn't break source compatibility of public API (only binary compatibility).
2018-07-23 15:24:07 +03:00
Dmitry Stogov afc82e243c Micro-optimization 2018-07-23 10:52:00 +03:00
Xinchen Hui 850c67e957 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed pefree_size (efree_size will be expaned to do {} while () form)
2018-07-23 15:49:04 +08:00
Xinchen Hui c20a97df6d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed pefree_size (efree_size will be expaned to do {} while () form)
2018-07-23 15:48:52 +08:00
Xinchen Hui 2139c2c2de Fixed pefree_size (efree_size will be expaned to do {} while () form) 2018-07-23 15:48:14 +08:00
Gabriel Caruso c93aba042f Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00
Gabriel Caruso 8ca1f47a7a Use variables that already received ZEND_NUM_ARGS() 2018-07-22 15:54:00 -03:00
Jakub Zelenka 26cd84d19f Return bool from zlog_stream_set_msg_{prefix,suffix} 2018-07-22 17:40:38 +01:00
Christoph M. Becker 89e2202cb5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #52974: jewish.c: compile error under Windows with GBK charset
2018-07-22 18:18:19 +02:00
Christoph M. Becker 33eb30274f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #52974: jewish.c: compile error under Windows with GBK charset
2018-07-22 17:59:38 +02:00
Christoph M. Becker 99fdf5916e Fix #52974: jewish.c: compile error under Windows with GBK charset
jewish.c includes ISO-8859-8 encoded Hebrew Hebrew month names, which
may cause compile errors, and is generally confusing.  We replace the
literal month names with appropriate escape sequences.
2018-07-22 17:42:10 +02:00
Jakub Zelenka e5a9956336 Update NEWS and UPGRADING with info about syslog.filter 2018-07-22 16:36:36 +01:00
Jakub Zelenka c85504386d Rename none syslog.filter to all and update ini description 2018-07-22 16:29:35 +01:00
Philip Prindeville 2010c02e5c Add syslog.filter INI for filtering syslog messages
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-07-22 15:36:47 +01:00
Nikita Popov 4a528d46f5 Add UPGRADING notes for deprecations 2018-07-21 22:48:42 +02:00
Nikita Popov fb0e8c65b9 Deprecate pdo_odbc.db2_instance_name
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:39 +02:00
Nikita Popov 4a5b2101e5 Deprecate string.strip_tags filter
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:39 +02:00
Nikita Popov d9acfa45b8 Deprecate fgetss() and gzgetss()
SplFileObject::fgetss() will also generate a deprecation notice
through an internal call to fgetss().

Part of RFC https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:35 +02:00
Nikita Popov 5c4047b339 Deprecate defining a free-standing assert() function
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Nikita Popov f4a9da389b Deprecate non-string needles in string search functions
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Nikita Popov e6016ab20d Deprecate undocumented mbereg_* aliases
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Peter Kokot fef2029614 Move GMP bug 74670 test file to tests dir 2018-07-20 19:43:09 +02:00
Nikita Popov ee561ff2a2 Fix off-by-one allocation
The return value of this function is pretty meaningless, but
leaving it alone for now.
2018-07-20 17:52:56 +02:00
Nikita Popov 6e2c54d3e7 Fix incorrect length calculation
sizeof char pointer != sizeof string literal.
2018-07-20 17:47:53 +02:00
Trevor Rowbotham fb0faf0208 [ci skip] Add new global MBString constants to UPGRADING
The constants are mentioned further up in the New Features section,
but weren't explicitly listed under the New Global Constants section.
2018-07-20 13:17:48 +02:00
Gabriel Caruso 6ac48425a8 Removed and fixed unused variables 2018-07-19 22:51:37 -03:00
Anatol Belski 8d041e171b Merge branch 'PHP-7.2'
* PHP-7.2:
  Update binary SDK version for AppVeyor
2018-07-19 18:38:19 +02:00
Anatol Belski 2073e96ec5 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update binary SDK version for AppVeyor
2018-07-19 18:37:38 +02:00
Anatol Belski 9e54d9d692 Update binary SDK version for AppVeyor 2018-07-19 18:35:54 +02:00
Ferenc Kovacs 5345ddee99 Merge branch 'PHP-7.2' 2018-07-19 16:59:00 +02:00
Ferenc Kovacs ca618a4f10 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-19 16:57:50 +02:00
Ferenc Kovacs 0510b47894 Merge branch 'PHP-7.0' into PHP-7.1 2018-07-19 16:57:18 +02:00
Ferenc Kovacs e5b27b9916 Merge branch 'PHP-5.6' into PHP-7.0 2018-07-19 16:56:32 +02:00
Ferenc Kovacs 1ba3314335 5.6.38 will be next 2018-07-19 16:54:58 +02:00
Dmitry Stogov 5be44312f8 Removed redundand code 2018-07-19 15:47:15 +03:00
Dmitry Stogov 54ebebd686 Matching loops optimization 2018-07-19 15:28:31 +03:00
Dmitry Stogov b81d712961 Micro optimizations 2018-07-19 11:19:28 +03:00
Dmitry Stogov d77aa8fa6d Fixed typo 2018-07-19 09:41:15 +03:00
Hongbo a76661a4a2 fix ext_skel continue
"continue" inside switch is ambiguous, should be "continue 2".
2018-07-18 20:49:12 +02:00
Dmitry Stogov 1820f2f2f3 Reorder conditions 2018-07-18 17:46:48 +03:00
Dmitry Stogov 29f942b3d0 Move "/e" modifier check into regex compiler 2018-07-18 16:35:17 +03:00
Dmitry Stogov 5d60651165 Merge "no_utf_check" and "g_notempty" into single "options". 2018-07-18 16:10:41 +03:00
Dmitry Stogov e8a04b387e Allocate array of proper size 2018-07-18 14:49:52 +03:00
Dmitry Stogov 412dd75e05 Perform checks for propertis started with '\\0' only for dynamic properties 2018-07-18 14:49:00 +03:00
Christoph M. Becker 583616deb1 [ci skip] Fix typo in comment 2018-07-18 11:29:05 +02:00
Remi Collet 0c3561892b add info about zend_class_entry.iterator_funcs 2018-07-18 11:17:53 +02:00
Dmitry Stogov 3b6e1ee4ee Improved "Fast Shutdown". 2018-07-17 17:31:04 +03:00
Christoph M. Becker 7db988cc30 Update NEWS for 7.3.0beta1 2018-07-17 16:02:50 +02:00
Ondřej Surý 1a078117b5 Use __cpuid_count() from cpuid.h instead of custom assembly 2018-07-17 13:59:53 +00:00
Anatol Belski 53ef61bcae Merge branch 'PHP-7.2'
* PHP-7.2:
  7.0.32 next
2018-07-17 12:38:21 +02:00
Anatol Belski b494d94f16 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  7.0.32 next
2018-07-17 12:37:51 +02:00
Anatol Belski dfc2e3a2ac Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  7.0.32 next
2018-07-17 12:37:02 +02:00
Anatol Belski d011da9d1a 7.0.32 next 2018-07-17 12:36:13 +02:00
Dmitry Stogov df60566671 Inline FETCH_CONST and DEFINED handlers into "hybrid" executor. 2018-07-17 13:30:55 +03:00
Anatol Belski ca50aa9ca8 Merge branch 'master' of git.php.net:php-src 2018-07-17 12:01:14 +02:00
Anatol Belski b1f4f5c80c Merge branch 'PHP-7.2'
* PHP-7.2:
  [ci skip] Update NEWS
2018-07-17 12:00:11 +02:00
Anatol Belski c4106d4569 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-17 11:59:17 +02:00
Dmitry Stogov 88dd38ee81 Reduce overhead of case-insensitive constants deprecation for "fast path" 2018-07-17 12:58:58 +03:00
Anatol Belski 1127163996 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] Update NEWS
2018-07-17 11:58:43 +02:00
Anatol Belski b52c4fcbcd [ci skip] Update NEWS 2018-07-17 11:58:00 +02:00
Christoph M. Becker 9f957fd303 Improve implementation of array_key_first() and array_key_last()
Firstly, we must not separate the $stack argument for performance
reasons.  Secondly, we prefer `Z_ARRVAL_P` over `HASH_OF` to clarify
our intention.

Thanks to Nikita, for catching these issues!
2018-07-17 11:53:06 +02:00
Enno Woortmann 50516a6e1f Add implementation and tests for new methods - array_key_first(array $a) Returns the key of the first element or null - array_key_last(array $a) Returns the key of the last element or null 2018-07-17 11:31:00 +02:00
Christoph M. Becker 79a27ccf3f FILTER_FLAG_(SCHEME|HOST)_REQUIRED are now deprecated 2018-07-17 11:01:44 +02:00
Christoph M. Becker c0407d95f7 Deprecate explicit use of FILTER_FLAG_SCHEME|HOST_REQUIRED
As of PHP 5.2.1 FILTER_VALIDATE_URL implies FILTER_FLAG_SCHEME_REQUIRED
| FILTER_FLAG_HOST_REQUIRED, which makes these constants useless at
best, if not even misleading.  Therefore we deprecate the explicit use
of these constants for FILTER_VALIDATE_URL, to pave the way for their
eventual removal.

See <https://wiki.php.net/rfc/deprecations_php_7_3#filter_flag_scheme_required_and_filter_flag_host_required>.
2018-07-17 10:45:46 +02:00
Remi Collet ffa41787d5 Merge branch 'PHP-7.2'
* PHP-7.2:
  NEWS
2018-07-17 06:07:43 +02:00
Remi Collet e069b0beba NEWS 2018-07-17 06:07:28 +02:00
Stanislav Malyshev 2abdcae886 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix test
2018-07-16 18:52:14 -07:00
Stanislav Malyshev ebd5f56442 Fix test 2018-07-16 18:52:01 -07:00
Stanislav Malyshev 28d8b8de71 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:54:31 -07:00
Stanislav Malyshev a536d6d61b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:53:57 -07:00
Stanislav Malyshev 4e92cd172a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:52:36 -07:00
Stanislav Malyshev bddf8140e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 15:13:13 -07:00
Anatol Belski f151e048ed Fixed bug #76459 windows linkinfo lacks openbasedir check 2018-07-16 15:11:56 -07:00
Stanislav Malyshev b73a108543 Add NEWS 2018-07-16 14:26:31 -07:00
Anatol Belski 289cb0f77c Fixed bug #76459 windows linkinfo lacks openbasedir check 2018-07-16 14:21:02 -07:00
Stanislav Malyshev 3462efa386 Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
Use MAKERNOTE length as data size.
2018-07-16 14:17:51 -07:00
Stanislav Malyshev 1baeae4270 Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c 2018-07-16 14:16:58 -07:00
Nikita Popov 3588d8af12 Deprecate case-insensitive constants
RFC: https://wiki.php.net/rfc/case_insensitive_constant_deprecation
2018-07-16 19:16:55 +02:00
Nikita Popov a632ecd224 Remove use of case-insensitive constants in tests 2018-07-16 19:16:55 +02:00
Dmitry Stogov 70d0175a13 Fixed error messages. 2018-07-16 17:08:11 +03:00
Dmitry Stogov 5cf6474277 Flatten strip_tags state machine (GCC overoptimized this function, producing enormpous amount of code). 2018-07-16 13:22:17 +03:00
Gabriel Caruso 49c193eeb3 Make more tests run and fix SKIPIF sections 2018-07-16 00:01:46 -03:00
Gabriel Caruso 59456974f2 Test http_response_code function 2018-07-15 23:51:16 -03:00
Gabriel Caruso cf5f26b260 Fix failing test upstream
There was a trailing tab when a error message was generated. Removing
it, test is passing now.
2018-07-15 23:40:00 -03:00
Christoph M. Becker 9c2b4985b1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #73817: Incorrect entries in get_html_translation_table
2018-07-15 23:41:15 +02:00
Christoph M. Becker 8efd3c3387 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #73817: Incorrect entries in get_html_translation_table
2018-07-15 23:19:37 +02:00
Christoph M. Becker 0f8c1ee76d Fix #73817: Incorrect entries in get_html_translation_table
Due to incorrect string termination and length handling, several HTML
entities missed the trailing semicolon.

We also fix the obviously wrong expectations in two already existing
tests.
2018-07-15 23:06:38 +02:00
Gabriel Caruso 96f83e40c8 Small tweaks to php scripts 2018-07-14 19:37:12 -03:00
Gabriel Caruso c7d1c14b5c Small tweaks to php scripts 2018-07-14 19:33:35 -03:00
Gemorroj 233cbb53b3 [ci skip] Update php.ini-production
remove duplicated strings
2018-07-14 13:32:46 +02:00
Anatol Belski bf8b5b2269 Regroup the ifdef'd occurrences 2018-07-14 12:51:37 +02:00
Anatol Belski f6440c3aa6 Trail long path support also for deletion 2018-07-14 11:44:38 +02:00
Anatol Belski b9963969fd Merge branch 'PHP-7.2'
* PHP-7.2:
  Improve test
2018-07-13 20:15:17 +02:00
Anatol Belski dee191ee07 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Improve test
2018-07-13 20:14:44 +02:00
Anatol Belski 141072a838 Improve test
Ensure the filename is non existent indeed.
2018-07-13 20:13:51 +02:00
Anatol Belski dbabb35ff9 Distinguish two error messages 2018-07-13 19:01:43 +02:00
Anatol Belski 1bcc2fcb4e Avoid early allocation 2018-07-13 07:35:33 +02:00
Stanislav Malyshev 54f920d661 [ci skip] Add dates to maintainer names
The dates are initialized from oldest and newest commit
that can be attributed to that person.
2018-07-12 23:34:36 +02:00
Anatol Belski 644ab58d0f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:58:43 +02:00
Anatol Belski f28aeaee05 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:57:08 +02:00
Anatol Belski 99fe18503a Fixed RecursiveDirectoryIterator with long path or with edge case length
The search path needs to be appended with the wild card. Till now, an
edge case existed, so then if a path is 259 bytes long, which is smaller
_MAX_PATH, the suffix would cause the final search path to become longer
than _MAX_PATH. It is an edge case, when the starting path happens to
have a specific length. If the starting path was longer than _MAX_PATH
or the addition of "\\*" would not exceed _MAX_PATH, the function was
correct. Except for rewind, which was broken in the case of the long
path.
2018-07-12 19:49:32 +02:00
Dmitry Stogov 571dac8c8f Fixed tests 2018-07-12 17:17:09 +03:00
Dmitry Stogov 5e8977bd62 Merge zend_class_entry.create_object and zend_class_entry.interface_gets_implemented into the same memory lacation. The first used only by classes, the second only by magic interfaces. 2018-07-12 17:09:40 +03:00
Christoph M. Becker 432c4e77a8 [ci skip] Update next version
According to <https://externals.io/message/102762>.
2018-07-12 15:22:26 +02:00
Christoph M. Becker 6c630eefcb Fix #33502: Some nullary functions don't check the number of arguments
We add the missing zend_parse_parameters_none() checks for:

* output_reset_rewrite_vars()
* func_num_args()
* gc_status()
* gc_disable()
* gc_enable()
* gc_enabled()
* gc_collect_cycles()
* gc_mem_caches()
* zend_version()
2018-07-12 15:05:56 +02:00
Christoph M. Becker 5f5cf8cb94 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix Travis build
2018-07-12 13:47:11 +02:00
Christoph M. Becker 77ced46dea Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix Travis build
2018-07-12 13:46:10 +02:00
Christoph M. Becker 236ae06e0b Fix Travis build
As of commit f9d1d1f[1] we require `sudo`, so we tell Travis about it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=f9d1d1f>
2018-07-12 13:45:30 +02:00
Andrea Faulds e4e9cd8355 Export stdClass objects using (object) cast (fixes #48016)
Before this change, var_export()'s output for stdClass objects calls
the non-existent stdClass::__set_state method, and is therefore useless.

This commit makes var_export() output an (object) cast from an array
instead, which when evaluated, will produce a stdClass object. Other
classes see unchanged output.
2018-07-12 13:22:26 +02:00
Dmitry Stogov 7d4e18b05d Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build. 2018-07-12 14:04:14 +03:00
Anatol Belski 0834679e40 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix macro
2018-07-12 11:38:18 +02:00
Anatol Belski 9443c61928 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix macro
2018-07-12 11:37:13 +02:00
Anatol Belski cc7b000d2c Fix macro 2018-07-12 11:35:00 +02:00
Anatol Belski 129c5c1181 Support long path also when reading from file cache 2018-07-12 09:26:50 +02:00
Anatol Belski 81eb8e7507 Mark conditions unexpected 2018-07-11 18:05:28 +02:00
Dmitry Stogov 85ee47eda0 Changed structure of zend_class_entry.trait_aliases and zend_class_entry.trait_precedences to avoid keeping "intermediate" trait references, that are used only during inheritance. 2018-07-11 18:56:10 +03:00
Anatol Belski 2367e649bc Make error messages more speaking 2018-07-11 14:34:18 +02:00
Anatol Belski 9ac133a0b3 Switch to ioutil routines to support long path in file cache 2018-07-11 14:28:57 +02:00
Anatol Belski 871d0aa5cd Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix condition
2018-07-11 13:16:04 +02:00
Anatol Belski cc266045a5 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix condition
2018-07-11 13:13:56 +02:00
Anatol Belski 98102648cb Fix condition
It looks like the real length limit is 247 bytes, not 248 as documented.
2018-07-11 13:09:20 +02:00
Anatol Belski 14db98825a Fix build with ZEND_RC_DEBUG 2018-07-11 12:19:20 +02:00
Dmitry Stogov 956ac5cbf5 Fixed possible assertion/crash when PHP script can't be stored in SHM (e.g. because another process already did this) 2018-07-11 10:35:36 +03:00
Kalle Sommer Nielsen 2aff1cb226 Remove these two old and outdated files we never use:
* OBJECTS2_HOWTO is rather outdated and the wiki contains much of this
 * ZendCore.dep is an old leftover from the previous Windows build system
2018-07-10 21:24:54 +02:00
Christoph M. Becker 0896a3abd1 [ci skip] Fix typos 2018-07-10 17:03:48 +02:00
Christoph M. Becker 091c0a8a59 [ci skip] Document changes to php_add[c]slashes 2018-07-10 16:04:14 +02:00
Christoph M. Becker 271ae3eb2b Fix #76574: use of undeclared identifiers INT_MAX and LONG_MAX
As of Oniguruma 6.4.0 <limits.h> is required, so we have to add a check
for this header file to set the respective macro.
2018-07-10 14:28:28 +02:00
Dmitry Stogov 4182b0855f Avoid copying 2018-07-10 13:17:33 +03:00
Anatol Belski bf5a81364c [skip ci] Update NEWS 2018-07-10 11:53:04 +02:00
Anatol Belski a5cb84c82e Merge branch 'PHP-7.2'
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-07-10 11:52:24 +02:00
Anatol Belski a766f65ca3 [ci skip] Update NEWS 2018-07-10 11:51:49 +02:00
Anatol Belski c23736216d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-10 11:51:11 +02:00
Anatol Belski 9026562c79 [ci skip] Update NEWS 2018-07-10 11:50:33 +02:00
Anatol Belski d82cb24e19 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix bug #76524 - ZipArchive memory leak
2018-07-10 11:20:50 +02:00
Anatol Belski ebb590b625 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #76524 - ZipArchive memory leak
2018-07-10 11:19:54 +02:00
timurib 08f08858f3 Fix bug #76524 - ZipArchive memory leak
Bugfix #76524: Free up zip internal state and adjust the tests for Windows

Bugfix #76524: Fix possible use after free for libzip 1.3.1

Bugfix #76524: Make the test independent of platform
2018-07-10 11:18:37 +02:00
Dmitry Stogov 7da042cbd8 Use ZVAL_COPY_DEREF() 2018-07-10 12:11:10 +03:00
Dmitry Stogov 0db8c974a5 Avoid useless copying 2018-07-10 12:03:32 +03:00
Dmitry Stogov 62b3464871 Removed deprecated condition 2018-07-10 11:04:10 +03:00
Dmitry Stogov 6c61f15408 Optimization 2018-07-10 00:04:44 +03:00
Anatol Belski 90edf754c5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Sync callback signature with libxml2 2.9.8
2018-07-09 21:25:19 +02:00
Anatol Belski 474292c3e4 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync callback signature with libxml2 2.9.8
2018-07-09 21:24:51 +02:00
Anatol Belski a820aab9da Sync callback signature with libxml2 2.9.8 2018-07-09 21:21:41 +02:00
Anatol Belski cce87471b1 Skip test on incompatible servers 2018-07-09 16:39:58 +02:00
Dmitry Stogov dbb9867b3e Avoid useless checks for public functions 2018-07-09 17:30:14 +03:00
Dmitry Stogov e4be6ce0fa Combined few checks into one 2018-07-09 17:29:34 +03:00
Dmitry Stogov 797e87060c Avoid reloading 2018-07-09 16:28:13 +03:00
Anatol Belski 117c37da76 Merge branch 'PHP-7.2'
* PHP-7.2:
  Add missing flag
2018-07-09 15:15:08 +02:00
Anatol Belski a6e8c73c43 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add missing flag
2018-07-09 15:14:30 +02:00
Anatol Belski 2c43fb49d6 Add missing flag 2018-07-09 15:12:52 +02:00
Dmitry Stogov a34fedb723 Eliminated check 2018-07-09 15:18:09 +03:00
Anatol Belski c90f1964f9 Move to size_t for string length 2018-07-09 13:34:04 +02:00
Anatol Belski 3e1e3ab728 Remove conflicting declaration 2018-07-09 12:32:45 +02:00
Dmitry Stogov 40551e0255 Eliminated reference-counting and EG(exception) check 2018-07-09 13:20:46 +03:00
Dmitry Stogov ad2719cf9c Fixed test 2018-07-09 12:49:19 +03:00
Dmitry Stogov 67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Kalle Sommer Nielsen 094c2aaf83 The session_array global is not used at all, so comment it out for now 2018-07-09 04:21:46 +02:00
Kalle Sommer Nielsen 529baa9a3d Added test to accompany the FILTER_SANITIZE_ADD_SLASHES filter 2018-07-09 03:59:35 +02:00
Kalle Sommer Nielsen a8dce31957 Added the 'add_slashes' sanitization filter (FILTER_SANITIZE_ADD_SLASHES) as an alias to 'magic_quotes' (FILTER_SANITIZE_MAGIC_QUOTES) so we can move past our "magical" legacy. 2018-07-09 03:58:20 +02:00
Christoph M. Becker 1c01b1ab48 Fix #76594: Bus Error due to unaligned access in zend_ini.c OnUpdateLong
Since commit ea83b69[1] changed the type of mbstring.strict_detection
from `long` to `zend_bool`, we have to update the `on_modify` callback
as well.

[1] http://git.php.net/?p=php-src.git;a=commit;h=ea83b69883f3f77fd27e4663fa854c88f141ab41
2018-07-09 00:54:36 +02:00
Anatol Belski d664d1e959 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix C++11 and up compatibility for zend_finite and more
2018-07-08 20:34:58 +02:00
Anatol Belski 545a29d0cb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix C++11 and up compatibility for zend_finite and more
2018-07-08 20:32:52 +02:00
Anatol Belski ad790bea2e Fix C++11 and up compatibility for zend_finite and more
C++11 puts isfinite, isinf, isnan and a lot of other stuff into the
std namespace. Thus, if a C++11 or newer source is compiled, these
symbols won't be available. A good solution would be to include cmath,
but depending on a particular compiler that might remove even more
stuff from the global namespace, so such a fix should only target master.
For now, just keep these defines same for C++11 and upper, as the actual
C++ code should use symbols from the std namespace anyway. This
especially concerns older GCC versions like at least 4 and 5, which are
used by default in the LTS Linux distros.
2018-07-08 20:20:08 +02:00
Anatol Belski e4a2cdb564 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed regex for checking libzip static lib
2018-07-07 17:33:47 +02:00
Dylan K. Taylor 77a841db48 Fixed regex for checking libzip static lib
This bug caused linking issues in debug mode (see bug [#76564](https://bugs.php.net/bug.php?id=76564))

This issue affects PHP 7.2 and master.
2018-07-07 17:32:16 +02:00
Anatol Belski 0fbbdd3aa1 [ci skip] Fix EOL 2018-07-07 17:14:54 +02:00
Jakub Zelenka 3b10e9ccf1 Update NEWS for log related changes in FPM 2018-07-07 13:16:16 +01:00
Jakub Zelenka 3e5afbf0a8 Refactore FPM logging 2018-07-07 13:01:44 +01:00
Jakub Zelenka 2a78006adb Update NEWS and UPGRADING for fpm_get_status addition 2018-07-07 12:53:08 +01:00
Jakub Zelenka f86f3edeef Migrate fpm_get_status test 2018-07-07 12:48:16 +01:00
Till Backhaus 140def4ac7 Implement fpm_get_status 2018-07-07 12:33:11 +01:00
Peter Kokot b585f043cb Add missing INI directives to curl phpinfo 2018-07-07 12:11:49 +02:00
Peter Kokot 956446bdfa Bump Autoconf version in configure.ac to 2.64
Since PHP 7.2 the minimum autoconf version is 2.64. The configure.ac
script file includes also AX_CHECK_COMPILE_FLAG macro call so besides
only checking it in buildconf script this bumps the autoconf here too.

The phpize.m4 script is for now still relaxed to 2.59 version since some
still supported systems such as CentOS 6 still include autoconf 2.63
version and might require calling phpize on some old extensions.
2018-07-07 12:11:14 +02:00
Peter Kokot 491f1477be Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS
Autoconf doesn't mention the AC_CONFIG_HEADER macro since the v2.13
released in 1999 anywhere in the documentation. Future of this macro is
unclear and commented as possible candidate for obsoletion in the
autoconf source code. Since it is just a wrapper around the main
AC_CONFIG_HEADERS macro, the functionality is the same, and also more
clear to find it in the autoconf documentation and avoid possible future
obsoletion.
2018-07-07 12:10:53 +02:00
Nikita Popov 9aeeecc47c Merge branch 'PHP-7.2' 2018-07-07 12:08:27 +02:00
Nikita Popov 5d0d812a53 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-07 12:08:02 +02:00
cdoco 47fb17b108 Fixed bug #76366 (references in sub-array for filtering breaks the filter) 2018-07-07 12:07:43 +02:00
seliver 95013042bf Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)
The IPv6 IP of a socket is provided by inet_ntop() as a string, but
this function doesn't enclose the IP in brackets. This patch adds
them in the php_network_populate_name_from_sockaddr() function.
2018-07-07 11:47:50 +02:00
Peter Kokot 67352cb2c0 Fix bug #76392
On systems without glibc, such as Alpine with Musl libc, the function attributes
are not supported. GCC 6 doesn't properly omit some systems. This is
already fixed in GCC 7 but for systems with GCC 6 and ones without
glibc, this additional check fixes this bug.
2018-07-07 11:31:44 +02:00
Nikita Popov 04e3523b7d Warn if continue is used on switch
Supersedes RFC https://wiki.php.net/rfc/continue_on_switch_deprecation
by generating a warning instead of deprecating and removing this
functionality.
2018-07-07 11:12:48 +02:00
Nikita Popov 41a6625c09 Add UPGRADING for mb_ereg changes
Also some minor code cleanup.
2018-07-07 11:06:29 +02:00
ju1ius 8f1782678e adds support for named subpatterns to mb_ereg_replace
Named subpatterns are now passed to `mb_ereg_replace_callback`.

This commit also adds a subset of the oniguruma back-reference syntax
for replacements:
* `\k<name>` and `\k'name'` for named subpatterns.
* `\k<n>` and `\k'n'` for numbered subpatterns
These last two notations allow referencing numbered groups where n > 9.
2018-07-06 23:34:54 +02:00
ju1ius 212f56b7ca adds support for named captures to mb_ereg & mb_ereg_search
`mb_ereg`, `mb_ereg_search_regs` & `mb_ereg_search_getregs`
returned only numbered capturing groups.
Now they return both numbered and named capturing groups.
Fixes Bug #72704.
2018-07-06 23:34:54 +02:00
Zenju 69a49af0d3 Fix out-of bounds access
Test case: strnatcmp_ex(L"333", 3, L"333 ", 4, true)
The reason this bug didn't come up earlier is probably because most input strings are null-terminated.
2018-07-06 19:02:19 +02:00
Christoph M. Becker b37dafcc23 Add test for PR #2382 2018-07-06 18:59:04 +02:00
Anatol Belski 1870a61a91 Fix coding style 2018-07-06 17:57:08 +02:00
David Carlier 9da4e30c75 random_bytes improvements for FreeBSD (from 12.x serie)
giving the possiblity to pre-fill the buffer. A new getrandom
function was added for future version with a similar interface
than Linux's syscall.
2018-07-06 17:47:59 +02:00
Anatol Belski 0b94534e93 [ci skip] Update NEWS 2018-07-06 17:46:04 +02:00
Anatol Belski 903f41aef7 Merge branch 'PHP-7.2'
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-07-06 17:45:38 +02:00
Anatol Belski d207fd449c [ci skip] Update NEWS 2018-07-06 17:45:01 +02:00
Anatol Belski 1ae888d984 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-07-06 17:44:37 +02:00
Anatol Belski ea24847620 [ci skip] Update NEWS 2018-07-06 17:43:48 +02:00
Anatol Belski ed23cea9de Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix event log handling in startup phase
  Fix bug #76488 Memory leak when fetching a BLOB field
2018-07-06 16:08:57 +02:00
Anatol Belski d85651d58d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix event log handling in startup phase
  Fix bug #76488 Memory leak when fetching a BLOB field
  Fix year
  Bump version
2018-07-06 16:08:17 +02:00
Anatol Belski 246cb03e26 Fix event log handling in startup phase
The log header can be saved in the globals on startup. At the same
time, the log header can be changed per request. In case that
happened, wrong pointer will be free'd on shutdown. It can happen at
any point when zend_error() or similar is called at startup, like for
example in the case of the ini deprecation warnings. Thus, ZMM cannot
be used here.
2018-07-06 16:07:28 +02:00
sim1984 3847a6fcb6 Fix bug #76488 Memory leak when fetching a BLOB field
Add a phpt test
2018-07-06 16:07:28 +02:00
Sara Golemon b0ca997405 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix year
  Bump version
2018-07-06 10:05:17 -04:00
Sara Golemon 137f22ad36 Fix year 2018-07-06 10:02:20 -04:00
Sara Golemon 268e801cb1 Bump version 2018-07-06 10:02:00 -04:00
Xinchen Hui 4c67f7e012 Forgotten one replacement 2018-07-06 19:18:06 +08:00
Xinchen Hui 9d1e9b73c5 rename ref_dtor_func to rc_dtor_func 2018-07-06 19:15:26 +08:00
Xinchen Hui f9297387f4 Rename zval_dtor_func and ref_dotr_func 2018-07-06 18:47:30 +08:00
Xinchen Hui e3355ac5ec Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6b12.
2018-07-06 18:37:45 +08:00
Xinchen Hui a362ae6b12 Rename _zval_dtor_func to _ref_dtor_func 2018-07-06 18:32:27 +08:00
Yousif Masoud 9a21aa77af fixes typo in daemonization DEBUG message after fork: acknoledge -> acknowledge 2018-07-06 11:25:08 +02:00
Dmitry Stogov bd8e76761f Use zval_ptr_dtor() instead of zval_dtor() in in-place array/object conversion functions 2018-07-06 12:07:13 +03:00
Mike 6a4e1e8b8e [ci skip] Fix typo 2018-07-06 09:55:47 +02:00
Dmitry Stogov 41db5f73ce Fixed reference-counting in zend_parse_arg_str_weak() 2018-07-06 03:11:20 +03:00
Dmitry Stogov dcf7592076 Optimize array to object casting 2018-07-06 03:10:05 +03:00
Dmitry Stogov ca40664ad6 Conversion related optimizations 2018-07-06 01:26:43 +03:00
Dmitry Stogov 85b2bc38e1 Optimize object to array casting 2018-07-06 01:25:24 +03:00
Dmitry Stogov 8361c0a9a7 Avoid useless checks in object_init() 2018-07-06 01:24:15 +03:00
Nikita Popov 606de9e4a9 Fix inverted stristr() argument order in mysqli test 2018-07-05 21:25:21 +02:00
Nikita Popov a057384113 Merge branch 'PHP-7.2' 2018-07-05 19:11:43 +02:00
Nikita Popov f3dc67b255 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-05 19:11:25 +02:00
Nikita Popov 0c4ab798de Merge branch 'PHP-7.2' 2018-07-05 19:10:24 +02:00
Nikita Popov 0504594a28 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-05 19:09:40 +02:00
Nikita Popov 791f07e4f0 Fix string.strip_tags filter
Was segfaulting if no allowed tags are specified and performing an
out of bounds read if they were.
2018-07-05 19:08:00 +02:00
Anatol Belski 0630e3bc03 Reduce error buffer size
120 bytes is ample, the doc says.
2018-07-05 17:24:38 +02:00
Dmitry Stogov 169d454593 Use zval_ptr_dtor() imstead of zval_dtor() 2018-07-05 17:55:54 +03:00
Dmitry Stogov 43d5a3665d It's safer to use zval_ptr_dtor() for iterator keys. 2018-07-05 16:56:52 +03:00
Dmitry Stogov d0a6b1009f Use zval_ptr_dtor() to replace bound variables (original values nay be circular structures). 2018-07-05 16:46:38 +03:00
Dmitry Stogov 5f83904a5d Use zval_ptr_dtor_nogc() instead of zval_dtor() inplaces where circular-references are not possible 2018-07-05 15:25:55 +03:00
Dmitry Stogov 918a9f09f8 Use zval_ptr_dtor_nogc() in JSON parser (it can't produce circular data structures) 2018-07-05 15:07:16 +03:00
Dmitry Stogov 3780b027dd Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 14:25:17 +03:00
Dmitry Stogov 91fc0d1a41 Replace zval_dtor() with specialized destructors 2018-07-05 14:17:53 +03:00
Dmitry Stogov 83f6f8563c Use zval_ptr_dtor() instead of legacy zval_dtor(), to destroy unused values returned from PHP functions (they may be circular data structures). 2018-07-05 14:09:47 +03:00
Dmitry Stogov 273e194df5 Replace zval_dtor() with specialized destructors 2018-07-05 13:55:56 +03:00
Dmitry Stogov 77c6ca7b62 Fixed wrong zval_dtor() usage 2018-07-05 13:37:59 +03:00
Dmitry Stogov b01d9e826c Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  [ci skip] Fix a typo. RANGE_RANGE should be RAND_RANGE
2018-07-05 13:33:18 +03:00
Dmitry Stogov b6fb584505 Replace zval_dtor() with specialized destructors 2018-07-05 13:32:39 +03:00
Tyson Andre 5bbe6080b4 [ci skip] Fix a typo. RANGE_RANGE should be RAND_RANGE 2018-07-05 12:11:56 +02:00
Dmitry Stogov 0d235517a3 Don't keep dangling pointer to function_name 2018-07-05 12:20:50 +03:00
Dmitry Stogov b6cc4d2009 Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 11:54:26 +03:00
Dmitry Stogov 265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +03:00
Remi Collet 587ab00698 NEW and UPGRADING 2018-07-05 06:34:08 +02:00
Remi Collet 0ea4013f10 Fixed bug #62596 add getallheaders (apache_request_headers) missing function in FPM add sapi_add_request_header in public API (was add_request_header) fix arginfo for fastcgi_finish_request fucntion 2018-07-05 06:30:58 +02:00
Dmitry Stogov 6c0ddcda47 Removed legacy zval_dtor() usage. It doesn't work with zvals with refcount == 0, anyway. 2018-07-05 02:28:00 +03:00
Dmitry Stogov 5898583e94 Fixed some incorrect zval_dtor() usages 2018-07-04 23:48:39 +03:00
Dmitry Stogov 3a8f26060c Argument unpacking with Traversables and non-integer keys.
Changed error message, added UPGRADING note and test.
2018-07-04 22:34:36 +03:00
Kalle Sommer Nielsen 6337af09dc Added test case for bug #76539 for master only as the behavior has been restored 2018-07-04 19:50:34 +02:00
Dmitry Stogov 4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Christoph M. Becker d798fd491b [ci skip] Document GC_C() → zend_gc_get_status() 2018-07-04 12:19:29 +02:00
Dmitry Stogov af341213f7 se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0) 2018-07-04 12:08:07 +03:00
Dmitry Stogov 5f19816f53 concat_function() micro optimization 2018-07-04 12:05:51 +03:00
Dmitry Stogov d84ef96742 SEND_UNPACK should throw exception on Traversable with non-integer keys 2018-07-04 09:35:12 +03:00
Xinchen Hui a6467af8a5 Fixed test skip 2018-07-04 11:20:28 +08:00
Xinchen Hui 36f05a80d7 Fixed build 2018-07-04 11:15:32 +08:00
Kalle Sommer Nielsen c49f0fd9ac Fixed bug #76501 (Funny message with fatal error) 2018-07-04 03:04:31 +02:00
Dmitry Stogov 2edf94a637 Avoid useless copying and conversion 2018-07-04 01:09:00 +03:00
Dmitry Stogov 7eb045d31a API cleanup. Removed unused functions (kept compatibility macros). 2018-07-04 00:50:57 +03:00
Nikita Popov e080fb6d92 Do not continue extract()ing after an exception has been thrown
Make behavior consistent with a loop of normal assignments.

This is not a big issue now, because $this is the only case that
may generate an error. However typed references introduce additional
error conditions, which would be silenced by this kind of behavior.
2018-07-03 22:45:35 +02:00
Anatol Belski 2af3234a09 [ci skip] Update NEWS 2018-07-03 20:03:11 +02:00
Peter Kokot b7368fe0d0 Add missing autoconf m4 quotes
Two macro calls were missing quotes and in order to be able to run the
autoupdate script, this patch adds them.
2018-07-03 19:12:44 +02:00
Anatol Belski eb41eba3fe Remove BOM 2018-07-03 19:06:14 +02:00
Anatol Belski 682ca5fccd Fix compilation with Firebird < 3 2018-07-03 19:04:11 +02:00
Dorin Marcoci 78f23a6dd4 Boolean data type support, added in Firebird 3. Fixes #74462. 2018-07-03 19:04:11 +02:00
Christoph M. Becker e51b364a50 [ci skip] Document zend_parse_parameters_none() 2018-07-03 18:58:37 +02:00
Peter Kokot 29000091b2 Remove sqlite and xmlrpc extension versions from phpinfo output
The rest of the core extensions don't display the extension versions in
the phpinfo output since they in most cases match the PHP release version.
2018-07-03 17:01:17 +02:00
Dmitry Stogov 14e6c0cb8c str_replace() micro-optimization 2018-07-03 17:47:08 +03:00
Anatol Belski 7cdd732aca Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76564 ext/zip link issues
2018-07-03 15:46:48 +02:00
Anatol Belski e5ef7cbe87 Fixed bug #76564 ext/zip link issues
Add zlib for linking directly, so then ext/zlib is not required.
2018-07-03 15:45:01 +02:00
Christoph M. Becker a0b9f8d411 Update NEWS for 7.3.0beta1 2018-07-03 12:52:48 +00:00
Remi Collet cb52bbfdfa Merge branch 'PHP-7.2'
* PHP-7.2:
  bump to 7.2.9-dev
2018-07-03 13:53:33 +02:00
Remi Collet 8bf21adb8c bump to 7.2.9-dev 2018-07-03 13:52:04 +02:00
Dmitry Stogov 004a0568f4 Eliminated REFCOUNTED checks on persistent constant operands in SEND_VAL[_EX] and QM_ASSIGN. 2018-07-03 13:10:22 +03:00
Dmitry Stogov 177c7e3a72 Merge branch 'bug63217'
* bug63217:
  Another fix for bug #63217
  Partial revert of 30156d588c
2018-07-03 12:58:50 +03:00
Dmitry Stogov 3fd97a5b1f Better hot/cold code splitting 2018-07-03 11:07:39 +03:00
Dmitry Stogov 28b03f9605 Another fix for bug #63217 2018-07-03 01:09:58 +03:00
Nikita Popov 23ae6ca405 Fix check for invoking abstract method 2018-07-02 21:33:09 +02:00
Nikita Popov 826e403d2c Add $ before property name in error message 2018-07-02 21:24:38 +02:00
Dmitry Stogov 57af94c8b9 Partial revert of 30156d588c 2018-07-02 20:54:44 +03:00
Nikita Popov 04824aa263 Merge branch 'PHP-7.2' 2018-07-02 18:58:01 +02:00
Nikita Popov 9bbb9e537c Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 18:57:25 +02:00
Nikita Popov c97b8bbf82 Fixed bug #75231
The behavior is now consistent with ReflectionMethod.
2018-07-02 18:56:27 +02:00
Nikita Popov 1b66ba17ad Remove unnecessary explicit argc check
Instead specify a default value for the argument, which is more
idiomatic.
2018-07-02 18:29:30 +02:00
Nikita Popov 76f1d98a0c Remove METHOD_NOTSTATIC checks in reflection
PHP does not allow static calls to non-static internal methods
anyway, so these checks are redundant.
2018-07-02 18:26:48 +02:00
Nikita Popov 2cc6922cbf Merge branch 'PHP-7.2' 2018-07-02 17:59:33 +02:00
Nikita Popov 3a236d0587 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:59:15 +02:00
Nikita Popov 787593b708 Fix test after serialization change
And move it to a more appropriate location.
2018-07-02 17:58:26 +02:00
Nikita Popov a57b5e82a9 Merge branch 'PHP-7.2' 2018-07-02 17:30:07 +02:00
Nikita Popov 09bb2527e9 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:29:32 +02:00
Nikita Popov c793885b76 Fixed bug #74670
Validate that "C" serialization payload is followed by "}" prior to
calling the unserialize() handler. This mitigates issues caused by
unserialize() not correctly handling strings that are not NUL
terminated. Making sure that there is a "}" at the end avoids the
problem.
2018-07-02 17:27:43 +02:00
Rudi Theunissen 30156d588c Fixed bug #63217
Don't automatically convert literal string keys to integers on
array access, as we may be dealing with an ArrayAccess object,
rather than a plain array.
2018-07-02 16:41:59 +02:00
Anatol Belski 6d61814d0e Remove the forked test and adjust the original one 2018-07-02 16:08:09 +02:00
Dmitry Stogov 091d77f28a Avoid magic method hash lookups 2018-07-02 17:03:50 +03:00
Dmitry Stogov 43aca3118a Avoid string comparisons for magic methods (all magic methods start with "__") 2018-07-02 17:03:02 +03:00
Anatol Belski a63e834b66 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update libs_version.txt
2018-07-02 12:12:39 +02:00
Anatol Belski 26a33a96fa Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update libs_version.txt
2018-07-02 12:12:02 +02:00
Anatol Belski f8258325b4 Update libs_version.txt 2018-07-02 12:09:54 +02:00
Jakub Zelenka d404b5e255 Add ssl/tls streams options for min and max proto version 2018-07-01 18:46:52 +01:00
Jakub Zelenka ce0721bee5 Update NEWS, UPGRADING and default php.ini files with syslog changes 2018-07-01 18:27:36 +01:00
Philip Prindeville 2475337bd8 Add syslog's ident and facility parameters to config
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-07-01 18:08:07 +01:00
Christoph M. Becker 0c4f4481f5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Make newly introduced bug76556.phpt more resilient
2018-07-01 00:23:06 +02:00
Christoph M. Becker 39d668e927 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Make newly introduced bug76556.phpt more resilient
2018-07-01 00:21:34 +02:00
Christoph M. Becker a72bab1b9a Make newly introduced bug76556.phpt more resilient
Obviously, different compilers mangle the C++ class name differently.
We should neither expect a prefix nor a suffix.
2018-07-01 00:20:32 +02:00
Christoph M. Becker 1b61c3b210 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76556: get_debug_info handler for BreakIterator shows wrong type
2018-06-30 23:22:20 +02:00
Christoph M. Becker ae163d9a36 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76556: get_debug_info handler for BreakIterator shows wrong type
2018-06-30 23:17:54 +02:00
Christoph M. Becker 1118fca75d Fix #76556: get_debug_info handler for BreakIterator shows wrong type
We use the retrieved type for the "type" element instead of the text.
This has been confused during the PHP 7 upgrade[1].

[1] http://git.php.net/?p=php-src.git;a=commit;h=1d793348067e5769144c0f7efd86428a4137baec
2018-06-30 23:15:02 +02:00
Nikita Popov 8faa6ef30e Add test for void return type on internal function 2018-06-30 20:14:15 +02:00
Nikita Popov 7909d4532c Merge branch 'PHP-7.2' 2018-06-30 20:11:59 +02:00
Nikita Popov 0f1726e45d Merge branch 'PHP-7.1' into PHP-7.2 2018-06-30 20:11:39 +02:00
Nikita Popov 9b0df97a42 Fix handling of void return type on internal functions 2018-06-30 20:10:57 +02:00
Nikita Popov 5d7be2c2bc Merge branch 'PHP-7.2' 2018-06-30 19:50:56 +02:00
Nikita Popov 34deda13a8 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-30 19:50:40 +02:00
Nikita Popov 2eb6a541a9 Fix typo in compound dim assign op inference
Thankfully a harmless one, just makes inference results worse.
2018-06-30 19:50:07 +02:00
Christoph M. Becker abbc1e683c Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #71848: getimagesize with $imageinfo returns false
2018-06-30 16:50:49 +02:00
Christoph M. Becker e2285eb542 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #71848: getimagesize with $imageinfo returns false
2018-06-30 16:40:32 +02:00
Christoph M. Becker ae04110032 Fix #71848: getimagesize with $imageinfo returns false
Some JFIF images contain empty APP segments, i.e. those which consist
only of the marker bytes and the length, but without actual content.
It appears to be doubtful to have empty APP segments, but we should
apply the robustness principle, and accept these, instead of simply
failing in this case.

We choose to add empty APP segments to $imageinfo with an empty string
as value, instead of NULL, or even to omit these segments altogether.

This patch also fixes the potential issue that php_stream_read() might
not read the supposed number of bytes, which could result in garbage to
be added to the read value.
2018-06-30 16:29:30 +02:00
Peter Kokot 7c04219098 Fix pecl vs ext typo in phar
Phar phpinfo output lists also info about bz2 extension if it's
disabled and a quick info about installation. Instead of not maintained
pecl package bz2 the ext/bz2 should be mentioned. Also some outdated
pecl/phar are updated to ext/phar instead in test comments.
2018-06-30 15:35:43 +02:00
Christoph M. Becker 8bc2163c8a Add ext/sodium to php.ini-* 2018-06-30 14:52:30 +02:00
Nikita Popov 43c533d799 Merge branch 'PHP-7.2' 2018-06-29 23:23:08 +02:00
Nikita Popov deb1bad80f Merge branch 'PHP-7.1' into PHP-7.2 2018-06-29 23:23:02 +02:00
Nikita Popov 962706d16c Fix nullable type pretty-printing 2018-06-29 23:22:41 +02:00
Nikita Popov 7ac06d66d4 Add zend_update_static_property_ex API
And cleanup the implementation to perform a normal by-value
assignment.
2018-06-29 22:56:59 +02:00
Nikita Popov 813b6fc950 Add zend_read_static_property_ex API
For symmetry with zend_read_property_ex.
2018-06-29 22:49:15 +02:00
Nikita Popov 10b484e624 Fix build
These were changed in 6e77a60a75.
2018-06-29 22:44:58 +02:00
Anatol Belski 7a6dc29605 [ci skip] Update NEWS 2018-06-29 20:12:45 +02:00
Anatol Belski efdf4a83b1 Merge branch 'PHP-7.2'
* PHP-7.2:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-06-29 20:12:24 +02:00
Anatol Belski 15ad5d31d1 [ci skip] Update NEWS 2018-06-29 20:11:55 +02:00
Anatol Belski ef274e0b60 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  [ci skip] Update NEWS
2018-06-29 20:11:23 +02:00
Anatol Belski fb09f1341f [ci skip] Update NEWS 2018-06-29 20:10:54 +02:00
Anatol Belski ff8f2710f6 Check return value of pcre2_maketables() 2018-06-29 19:15:38 +02:00
Anatol Belski 4ff6c0cb44 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76548 pg_fetch_result did not fetch the next row
2018-06-29 18:36:22 +02:00
Anatol Belski 486f18f09e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76548 pg_fetch_result did not fetch the next row
2018-06-29 18:35:44 +02:00
Anatol Belski cb97fd3097 Fixed bug #76548 pg_fetch_result did not fetch the next row 2018-06-29 18:34:53 +02:00
Dmitry Stogov 6e77a60a75 Removed INIT_OVERLOADED_CLASS... macros 2018-06-29 14:41:35 +03:00
Dmitry Stogov d6ab163be8 cleanup 2018-06-29 12:35:14 +03:00
Dmitry Stogov dd932f7e63 Changed php_add[c]slashes prototypes (removed should_free argument) 2018-06-29 00:19:16 +03:00
Nikita Popov a7101415cb Merge branch 'PHP-7.2' 2018-06-28 23:06:08 +02:00
Nikita Popov 00c0d7702c Merge branch 'PHP-7.1' into PHP-7.2 2018-06-28 23:05:09 +02:00
Marcus Schwarz bf5a802f5a Fixed bug #76532 (excessive memory usage in mb_strimwidth) 2018-06-28 23:02:28 +02:00
Nikita Popov db7ead0768 Fix ReflectionProperty::get/setValue() on internal static property
This was broken by 6dc0cd868d, which
moved static property initialization outside of constant updating.

Instead of replicating logic, use zend_get_static_property() API
in the reflection implementation, just like we're using
read_property for non-static proprety access.
2018-06-28 22:45:26 +02:00
Anatol Belski e1e0176e68 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update SDK version for AppVeyor
2018-06-28 15:59:10 +02:00
Anatol Belski c5276ad380 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update SDK version for AppVeyor
2018-06-28 15:58:20 +02:00
Anatol Belski f6430e3fe2 Update SDK version for AppVeyor 2018-06-28 15:56:27 +02:00
Anatol Belski 95a71caab1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Sync versions for VC++ 15.8
2018-06-28 13:29:32 +02:00
Anatol Belski e835916f65 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync versions for VC++ 15.8
2018-06-28 13:28:46 +02:00
Anatol Belski 88b5df91f6 Sync versions for VC++ 15.8 2018-06-28 13:23:19 +02:00
Christoph M. Becker 2ff26bdf73 [ci skip] Document new typedef zif_handler 2018-06-28 12:52:36 +02:00
Christoph M. Becker 3ab920a911 [ci skip] Announce emails should not be cross-posted
Otherwise answers may be send to all the lists which might be
irrelevant for particular participants only subscribed to one of them.
2018-06-28 12:36:53 +02:00
Anatol Belski a1ae9d5f9e [ci skip] Update NEWS 2018-06-28 11:41:49 +02:00
Anatol Belski eeab21b6d7 Merge branch 'PHP-7.2'
* PHP-7.2:
  Don't ignore commits on NEWS, etc. on AppVeyor
2018-06-28 10:55:35 +02:00
Anatol Belski b35f45ded2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Don't ignore commits on NEWS, etc. on AppVeyor
2018-06-28 10:54:59 +02:00
Anatol Belski 19b4fa17d3 Don't ignore commits on NEWS, etc. on AppVeyor
[ci skip] can be used explicitly, and otherwise it might ignore commits
with a code change.
2018-06-28 10:53:23 +02:00
Andrew Nester ef9ed19ec7 DOMDocument::formatOutput attribute sometimes ignored 2018-06-28 10:38:20 +02:00
Xinchen Hui f1c0500fda Update NEWS 2018-06-28 12:38:40 +08:00
Xinchen Hui 8e940654e1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
2018-06-28 12:38:26 +08:00
Xinchen Hui 809a7b5f8f Update NEWS 2018-06-28 12:38:14 +08:00
Xinchen Hui 5d7f9dcca7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
2018-06-28 12:37:58 +08:00
Xinchen Hui 1f6b842af4 Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence) 2018-06-28 12:37:33 +08:00
Nikita Popov bddb085a68 Store unmangled name in ReflectionProperty
Avoid redundant unmangles and string copies, where possible.
2018-06-27 23:52:21 +02:00
Nikita Popov ce7fc2e308 Fix typos... 2018-06-27 23:22:29 +02:00
Nikita Popov 78f2a1b81d Optimize ReflectionProperty constructor
Perform HT lookups using a zend_string. Don't copy the name for
the "name" property. We can always use the original name directly,
as properties case case-sensitive, so the original name should
always match the unmangled name of the fetched property info.
2018-06-27 23:21:06 +02:00
Nikita Popov 9b02ee0bba Fixed bug #76538 2018-06-27 23:06:25 +02:00
Christoph M. Becker 3f241f3caa Update UPGRADING wrt. PCRE2
The upgrade to PCRE2 should mostly be transparent to existing code, but
apparently there are some minor differences, which warrant a note in
UPGRADING (and consequently, in the migration guide).
2018-06-27 15:19:41 +02:00
Nikita Popov 17afe6430f Fixed bug #76439 2018-06-27 14:15:56 +02:00
Dmitry Stogov 716bbd3480 Remove duplicated code (keep destroy_zend_function() for compatibility) 2018-06-27 14:54:42 +03:00
Dmitry Stogov 56450c6e65 Moved very rare exception check into a single place. 2018-06-27 13:34:15 +03:00
Peter Kokot 32489322a1 Remove outdated comments about PHP 3 2018-06-27 11:53:40 +02:00
Dmitry Stogov 6dc0cd868d Fixed ZTS race condition (zend_class_entry->ce_flags of internal classes must not be modified, because internal class enties are shared between threads) 2018-06-27 12:33:20 +03:00
Xinchen Hui 1231b49271 Add test for issue #1400 2018-06-27 16:49:05 +08:00
Xinchen Hui a394e1554c Update NEWS 2018-06-27 13:09:54 +08:00
Xinchen Hui 3d8c82c353 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)

Conflicts:
	Zend/zend_vm_execute.h
2018-06-27 13:08:47 +08:00
Xinchen Hui 7b98d056d3 Update NEWS 2018-06-27 13:07:53 +08:00
Xinchen Hui 3521661bd1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)

Conflicts:
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2018-06-27 13:07:36 +08:00
Xinchen Hui d1b1866a3a Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler) 2018-06-27 13:05:11 +08:00
Kalle Sommer Nielsen 76827e39ba Minor cleanup in regards to magic_quotes in tests:
- dba008.phpt never runs anyway, no need to keep it
- bug75357.phpt has a branch that is never hit, which should not change the bug behavior in anyway
- bug55371.phpt added a simple 'done' test to not let the EXPECT section be empty
2018-06-26 22:38:00 +02:00
Dmitry Stogov 1b80de93b8 Cleanup conditions 2018-06-26 16:18:30 +03:00
Dmitry Stogov ff97ba253f Merge branch 'fetch_r_tmp'
* fetch_r_tmp:
  Make FETCH_R/IS, FETCH_DIM_R/IS, FETCH_OBJ_R/IS, FETCH_STATIC_PROP_R/IS return TMP_VAR, instead of VAR.
2018-06-26 14:48:53 +03:00
Dmitry Stogov 54f171cdc0 Restored zend_array_element_type() prototype 2018-06-26 11:23:37 +03:00
Dmitry Stogov 8c22d3e729 Make FETCH_R/IS, FETCH_DIM_R/IS, FETCH_OBJ_R/IS, FETCH_STATIC_PROP_R/IS return TMP_VAR, instead of VAR. 2018-06-25 23:43:23 +03:00
Nikita Popov f2c4f06f84 Remove unnecessary uses of z/ parameters 2018-06-25 22:27:42 +02:00
Dmitry Stogov 49a4e69584 Fixed ability to call plain functions through zend_call_method() 2018-06-25 23:01:21 +03:00
Dmitry Stogov b89ce98129 typo 2018-06-25 22:43:19 +03:00
Dmitry Stogov 7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +03:00
Christoph M. Becker 30f7997762 [ci skip] Remove obsolete task
INSTALL points to the online docs and win32/install.txt is removed as
of commit 1e9e7d4[1].

[1] http://git.php.net/?p=php-src.git;a=commit;h=1e9e7d4dc4949b67908e55ab3f3e44528923c029
2018-06-25 18:00:26 +02:00
Dmitry Stogov c8f355b12c Micro-optimization 2018-06-25 17:32:13 +03:00
Nikita Popov 73f07738b9 Fix off-by-one error 2018-06-25 15:26:10 +02:00
Nikita Popov 2543e61aed Fixed bug #76509
In PHP static properties are shared between inheriting classes,
unless they are explicitly overwritten. However, because this
functionality was implemented using reference, it was possible
to break the implementation by reassigning the static property
reference.

This is fixed by switching the implementation from using references
to using INDIRECTs, which cannot be affected by userland code.
2018-06-25 15:04:09 +02:00
Nikita Popov 102bcb5c05 Update array_element_type inference for previous change
LIST_R and DIM_IS return value can't be MAY_BE_REF anymore.
2018-06-25 14:27:02 +02:00
Nikita Popov 490a49d0bb Use COPY_DEREF for DIM_IS and LIST_R as well
Also add an upgrading note for the behavior change, not that we
expect anyone to be affected...
2018-06-25 14:23:06 +02:00
Markus Staab a0a4232ae3 [ci skip] fixed typos 2018-06-25 13:14:55 +02:00
Dmitry Stogov ecce21169e Added note about zend_function.reserved[] fields usage 2018-06-25 13:35:14 +03:00
Dmitry Stogov 7793bc8ee6 Improved type inference. Result of opcodes using ZVAL_COPY_DEREF can't be MAY_BE_REF. 2018-06-25 13:07:44 +03:00
Christoph M. Becker 0778359223 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix arginfo wrt. optional/required parameters
2018-06-25 11:57:25 +02:00
Christoph M. Becker 2458dab466 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix arginfo wrt. optional/required parameters
2018-06-25 11:54:45 +02:00
Christoph M. Becker 6b5597f7d8 Fix arginfo wrt. optional/required parameters
All parameters of phpdbg_color(), phpdbg_exec() and phpdbg_prompt() are
required.  We mark them as such.
2018-06-25 11:52:17 +02:00
Christoph M. Becker d169d06d30 Remove useless PHPDBG_* constants
The sole purpose of `PHPDBG_FILE`, `PHPDBG_METHOD`, `PHPDBG_LINENO` and
`PHPDBG_FUNC` has been to be passed as first argument to `phpdbg_break`.
However, this functions is replaced as of PHP 5.6.3 by
`phpdbg_break_file`, `phpdbg_break_method` and 'phpdbg_break_func`,
respectively.  Therefore, we're finally removing the useless constants.
2018-06-25 11:42:54 +02:00
Anatol Belski 836f329114 Merge branch 'PHP-7.2'
* PHP-7.2:
  Prepare tests for ICU 62.1
2018-06-25 11:32:03 +02:00
Anatol Belski 096fd88dcb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Prepare tests for ICU 62.1
2018-06-25 11:31:21 +02:00
Anatol Belski 5af0db88fa Prepare tests for ICU 62.1 2018-06-25 11:30:14 +02:00
Nikita Popov 61d00a6cf3 Use COPY_DEREF instead of COPY_UNREF
This fixes the behavior when the storage location of the fetch is
modified before the operand is dereferenced by the using VM opcode.

Furthermore it elimiates references as a possible return value from
*_R opcodes, which will give us more opportunities for inferences,
in particular in regard to typed properties.
2018-06-25 11:23:59 +02:00
Dusta da82719f20 Update http to https 2018-06-25 08:31:32 +02:00
COFFEE 19b42bd6b3 numner => number 2018-06-25 08:29:36 +02:00
Nikita Popov 4abf423d75 Merge branch 'PHP-7.2' 2018-06-24 22:29:19 +02:00
Nikita Popov 14b22704c7 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-24 22:28:57 +02:00
Nikita Popov 701460ba84 Fixed bug #76502 2018-06-24 22:26:45 +02:00
Nikita Popov 66cf76ee54 Remove expr_without_variable
We no longer need this distinction.
2018-06-24 13:44:54 +02:00
Anatol Belski e03739d4ab Remove obsolete version checks in tests 2018-06-22 17:56:18 +02:00
Anatol Belski 8c92318677 [ci skip] Update NEWS 2018-06-22 17:33:57 +02:00
Anatol Belski aa92d42018 If there's no setlocale, char tables are not used 2018-06-22 17:31:26 +02:00
Nikita Popov b592cd7b98 Merge branch 'PHP-7.2' 2018-06-22 16:23:25 +02:00
Nikita Popov ed9d1b708b Fixed bug #76520 2018-06-22 16:22:04 +02:00
Anatol Belski 8b58b2aac6 Don't discard char tables just generated 2018-06-22 15:18:39 +02:00
Remi Collet 3b9ecb2d65 add note about php_url struct changes 2018-06-22 14:58:30 +02:00
Anatol Belski 684ce24eec Improve locale character tables handling and reduce pattern cache size
If a locale other than C is active, character tables are saved into the
compile context. Every compiled pattern will have a pointer to the
character table, that was present in the context at the time of the
pattern compilation. Thus, the cache entries don't need to carry char
tables pointer, which reduces their size to 8 bytes on 64-bit. Instead,
the generated character tables are tracked in a separate HashTable. If a
character table was generated before, it'll be assigned to the compile
context when the locale changes. Otherwise a new char table will be
generated and cached.
2018-06-22 14:45:29 +02:00
Dmitry Stogov 34e58a6447 Reduced overhead of magic method calls (__get/__set/__unset/__isset/__dectructor/__clone). 2018-06-22 14:29:54 +03:00
Dmitry Stogov 3c600e2d61 retval shouldn't be NULL 2018-06-22 14:28:29 +03:00
Dmitry Stogov 9b2d708f21 Reduce spl_autoload() overhead 2018-06-22 13:19:53 +03:00
Anatol Belski bb2f1a6830 Fixed bug #76514 Regression in preg_match makes it fail with PREG_JIT_STACKLIMIT_ERROR
Looks like some patterns might require more stack for JIT execution. It
is a regression, as the same pattern was passing using JIT.
2018-06-22 11:05:30 +02:00
Dmitry Stogov 71e18471f2 Merge branch 'PHP-7.2'
* PHP-7.2:
  Added parenthesis
2018-06-22 12:04:49 +03:00
Dmitry Stogov 4a4c72a82a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Added parenthesis
2018-06-22 12:04:39 +03:00
Dmitry Stogov 1f726c9925 Added parenthesis 2018-06-22 12:04:23 +03:00
Dmitry Stogov 73b675a988 Avoid duplication of "shadow" property_info 2018-06-22 02:46:59 +03:00
Christoph M. Becker 23ca95aa3e Fix line endings in new PHPT 2018-06-22 00:01:51 +02:00
Christoph M. Becker 71d16feebb Fix #76512: \w no longer includes unicode characters
The migration from PCRE to PCRE2 missed to rename once occurrence of
`PCRE_UCP` to `PCRE2_UCP`.  We fix that.  We also revert the changes to
bug52971.phpt which had been incorrectly made in commit a5bc5ae[1].

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d>
2018-06-21 22:45:08 +02:00
Jakub Zelenka c2a3ab070b Merge branch 'PHP-7.2' 2018-06-21 17:03:07 +01:00
Jakub Zelenka d95ee27551 Make new openssl ext tests in 7.2 consitent 2018-06-21 17:02:44 +01:00
Jakub Zelenka 5f349b728e Merge branch 'PHP-7.2' 2018-06-21 16:50:45 +01:00
Jakub Zelenka 77bd405959 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-21 16:47:08 +01:00
Jakub Zelenka b20bcbc363 Use unix NL in all openssl ext tests 2018-06-21 16:43:32 +01:00
Jakub Zelenka 3c42f64e6e Make code in openssl ext tests more consistent
Mainly use spaces for indent and fix some other CS issues. Also
drop checks for unsupported OpenSSL library versions.
2018-06-21 16:38:19 +01:00
Charles R. Portwood II 55277a6684 RFC: Argon2 Password Hash Enhancements Implementation of Argon2id per RFC https://wiki.php.net/rfc/argon2_password_hash_enhancements
- m4 and Windows configure scripts now forces Argon2 reference library version >= 20161029
- Implementation tested against 20161029 and 20171227 for Argon2id support
- Updates Argon2 ext/standard/password/tests to run tests for both Argon2i and Argon2id
2018-06-21 13:26:57 +02:00
Peter Kokot 3f96f01e9e Bump phar and hash extension version to match PHP version 2018-06-21 13:15:32 +02:00
Dmitry Stogov 4418d61ca3 Avoid reusing zend_function.common.prototype for magic things (use reserved fields instead). 2018-06-21 13:09:25 +03:00
Anatol Belski f87cc89f4d Gereralize VA macro expansion mechanism
Avoids code duplication and makes in usable elsewhere.
2018-06-21 11:50:48 +02:00
Xinchen Hui 4bd6be8a5f Update NEWS 2018-06-21 17:27:18 +08:00
Xinchen Hui 8b2f40724b Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys)
2018-06-21 17:26:57 +08:00
Xinchen Hui e62c6e7dbe Update NEWS 2018-06-21 17:26:45 +08:00
Xinchen Hui 939e1095f2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys)
2018-06-21 17:26:27 +08:00
Xinchen Hui 6531719da5 Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys) 2018-06-21 17:26:05 +08:00
Stanislav Malyshev 3f53b02a53 Merge branch 'PHP-7.2'
* PHP-7.2:
  Revert "ICU 59+ requires C++11 and errors out without the option"
2018-06-20 10:42:04 -07:00
Stanislav Malyshev 011be49dda Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Revert "ICU 59+ requires C++11 and errors out without the option"
2018-06-20 10:41:59 -07:00
Stanislav Malyshev bcf2e10ae7 Revert "ICU 59+ requires C++11 and errors out without the option"
This reverts commit 5dd1ef90ca.
2018-06-20 10:41:41 -07:00
Nikita Popov 22ce955b95 Remove unnnecessary DEREF parameter 2018-06-20 16:03:50 +02:00
Nikita Popov e357f67faf Remove code duplication
And fix indentation
2018-06-20 15:05:08 +02:00
Nikita Popov 8e2f0824f7 Merge branch 'PHP-7.2' 2018-06-20 12:32:20 +02:00
Nikita Popov 44f4d2be01 Merge branch 'PHP-7.1' into PHP-7.2 2018-06-20 12:30:19 +02:00
Nikita Popov 69dee5c732 Fixed bug #73342
Directly listen on socket, instead of duping it to STDIN and
listening on that.
2018-06-20 12:28:15 +02:00
Stanislav Malyshev 2825c82076 Merge branch 'pull-request/3281'
* pull-request/3281:
  Revert braces inside condition
  Use .= where possible
  Remove unncecessary parantheses
  Remove unused variable old_php
  Fix property name
2018-06-19 22:43:20 -07:00
Stanislav Malyshev 3346659f2a Merge branch 'pull-request/3274'
* pull-request/3274:
  Added const modifier
  76363: added jsm extension to list of mime types
2018-06-19 16:50:16 -07:00
Stanislav Malyshev f61e1d28fe Merge branch 'pull-request/3288'
* pull-request/3288:
  Fix bug #75481: makedev warning
2018-06-19 16:43:52 -07:00
Stanislav Malyshev 30bdc09129 Merge branch 'pull-request/3309'
* pull-request/3309:
  phar module, unsignedness check changes. while at it, correcting seemingly subtle bug when checking extension validity.
2018-06-19 16:42:28 -07:00
Sara Golemon 1108b5a19b Move class constant definition to the right enum file 2018-06-19 18:21:08 -04:00
Christoph M. Becker 963998f0ab Update NEWS for 7.3.0alpha3 2018-06-19 15:36:31 +02:00
David Carlier 80bb649ad1 phar module, unsignedness check changes.
while at it, correcting seemingly subtle bug when checking
extension validity.
2018-06-18 14:08:50 +00:00
Nat Zimmermann 4ac531afb3 Revert braces inside condition 2018-06-13 23:37:14 +01:00
Peter Kokot 97f2ce4031 Fix bug #75481: makedev warning
To use makedev the sys/sysmacros.h needs to be included on newer
systems.
2018-06-13 04:36:55 +02:00
Nat Zimmermann 3c3ef6dd26 Use .= where possible 2018-06-09 17:02:35 +01:00
Nat Zimmermann 1b767ac26b Remove unncecessary parantheses 2018-06-09 17:01:31 +01:00
Nat Zimmermann e5043d06c9 Remove unused variable old_php 2018-06-09 16:59:25 +01:00
Nat Zimmermann a91d5a8194 Fix property name 2018-06-09 16:58:41 +01:00
pmukhin 57e72dc198 Added const modifier 2018-06-06 21:34:18 +07:00
pmukhin 48c954ca46 76363: added jsm extension to list of mime types 2018-06-06 21:04:42 +07:00
1705 changed files with 30383 additions and 26450 deletions

No files matched your search

+1 -7
View File
@@ -8,12 +8,6 @@ branches:
- PHP-5.6
- PHP-7.0
skip_commits:
files:
- NEWS
- UPGRADING*
- README.*
clone_depth: 64
cache:
@@ -23,7 +17,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.1.5
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.8
PHP_BUILD_CRT: vc15
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
+1 -17
View File
@@ -114,6 +114,7 @@ sapi/fpm/www.conf
sapi/phpdbg/phpdbg_parser.c
sapi/phpdbg/phpdbg_parser.h
sapi/phpdbg/phpdbg
sapi/phpdbg/phpdbg.1
sapi/phpdbg/build
sapi/phpdbg/*.output
scripts/php-config
@@ -156,22 +157,6 @@ ext/iconv/php_have_iconv.h
ext/iconv/php_iconv_supports_errno.h
ext/iconv/php_iconv_broken_ignore.h
ext/iconv/php_iconv_aliased_libiconv.h
ext/mbstring/libmbfl/Makefile.in
ext/mbstring/libmbfl/autoscan.log
ext/mbstring/libmbfl/config.sub
ext/mbstring/libmbfl/depcomp
ext/mbstring/libmbfl/ltmain.sh
ext/mbstring/libmbfl/stamp-h1
ext/mbstring/libmbfl/*.dll
ext/mbstring/libmbfl/*.lib
ext/mbstring/libmbfl/*.RES
ext/mbstring/libmbfl/*.res
ext/mbstring/libmbfl/*.obj
ext/mbstring/libmbfl/*.tds
ext/mbstring/libmbfl/filters/Makefile.in
ext/mbstring/libmbfl/mbfl/Makefile.in
ext/mbstring/libmbfl/mbfl/EastAsianWidth.txt
ext/mbstring/libmbfl/nls/Makefile.in
ext/mbstring/oniguruma/oniguruma.h
ext/oci8/tests/*.vglog
ext/pdo/conftest*
@@ -223,5 +208,4 @@ ext/sqlite3/tests/phpsql*
# Special cases to invert previous ignore rules
!ext/fileinfo/libmagic.patch
!ext/mbstring/oniguruma.patch
!scripts/dev/generate-phpt/tests/*.php
!ext/pcre/pcre2lib/config.h
+1 -1
View File
@@ -1,6 +1,6 @@
dist: trusty
language: c
sudo: false
sudo: required
addons:
apt:
packages:
+27 -7
View File
@@ -150,19 +150,39 @@ User Functions/Methods Naming Conventions
'buildsomewidget'
'getI()'
7. Classes should be given descriptive names. Avoid using abbreviations where
7. Class names should be descriptive nouns in PascalCase and as short as
possible. Each word in the class name should start with a capital letter,
without underscore delimiters (CamelCaps starting with a capital letter).
The class name should be prefixed with the name of the 'parent set' (e.g.
the name of the extension)::
without underscore delimiters. The class name should be prefixed with the
name of the "parent set" (e.g. the name of the extension) if no namespaces
are used. Abbreviations and acronyms as well as initialisms should be
avoided wherever possible, unless they are much more widely used than the
long form (e.g. HTTP or URL). Abbreviations start with a capital letter
followed by lowercase letters, whereas acronyms and initialisms are written
according to their standard notation. Usage of acronyms and initialisms is
not allowed if they are not widely adopted and recognized as such.
Good:
'Curl'
'FooBar'
'CurlResponse'
'HTTPStatusCode'
'URL'
'BTreeMap' (B-tree Map)
'Id' (Identifier)
'ID' (Identity Document)
'Char' (Character)
'Intl' (Internationalization)
'Radar' (Radio Detecting and Ranging)
Bad:
'foobar'
'foo_bar'
'curl'
'curl_response'
'HttpStatusCode'
'Url'
'BtreeMap'
'ID' (Identifier)
'CHAR'
'INTL'
'RADAR' (Radio Detecting and Ranging)
Internal Function Naming Conventions
----------------------
+2 -1
View File
@@ -1,2 +1,3 @@
For the list of people who've put work into PHP, please see
http://www.php.net/credits.php
https://www.php.net/credits.php
+108 -63
View File
@@ -3,7 +3,6 @@
Maintenance legend
------------------
Supported: Someone is actually paid to look after this.
Maintained: Someone actually looks after it.
Odd Fixes: It has a maintainer but they don't have time to do
much other than throw the odd patch in. See below.
@@ -68,59 +67,71 @@ STATUS: 5.6
-------------------------------------------------------------------------------
EXTENSION: dba
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>,Christopher Jones <sixd@php.net>, Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2002 - 2007)
Christopher Jones <sixd@php.net> (2008 - 2013)
Pierre-Alain Joye <pajoye@php.net> (2011 - 2011)
MAINTENANCE: Maintained
STATUS: Working
COMMENT: DBM abstraction for db2, db3, db4, dbm, ndbm, gdbm, ini
-------------------------------------------------------------------------------
EXTENSION: interbase
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu>
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu> (2003 - 2005)
MAINTENANCE: Odd fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mysqli
PRIMARY MAINTAINER: Georg Richter <georg@php.net>, Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
PRIMARY MAINTAINER: Georg Richter <georg@php.net> (2003 - 2006)
Andrey Hristov <andrey@php.net> (2003 - 2016)
Johannes Schlüter <johannes@php.net> (2008 - 2014)
Ulf Wendel <uw@php.net> (2007 - 2013)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: mysqlnd
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net>, Johannes Schlüter <johannes@php.net>, Ulf Wendel <uw@php.net>
PRIMARY MAINTAINER: Andrey Hristov <andrey@php.net> (2007 - 2017)
Johannes Schlüter <johannes@php.net> (2008 - 2018)
Ulf Wendel <uw@php.net> (2009 - 2011)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: oci8
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>, Antony Dovgal <tony2001@php.net>
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net> (2007 - 2017)
Antony Dovgal <tony2001@php.net> (2003 - 2009)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: odbc
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net> (2000 - 2004)
MAINTENANCE: Maintained
STATUS: Working
COMMENT: Working
-------------------------------------------------------------------------------
EXTENSION: pdo
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Wez Furlong <wez@php.net>
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2011)
Wez Furlong <wez@php.net> (2004 - 2006)
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_dblib
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net> (2016 - 2017)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_firebird
PRIMARY MAINTAINER: Lars Westermann <lwe@php.net>
PRIMARY MAINTAINER: Lars Westermann <lwe@php.net> (2007 - 2007)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_mysql
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>, Johannes Schlüter <johannes@php.net>, Andrey Hristov <andrey@php.net>, Ulf Wendel <uw@php.net>
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2010)
Johannes Schlüter <johannes@php.net> (2008 - 2014)
Andrey Hristov <andrey@php.net> (2005 - 2015)
Ulf Wendel <uw@php.net> (2008 - 2012)
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
@@ -132,31 +143,32 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_oci
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net> (2007 - 2017)
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_pgsql
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2004 - 2011)
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_sqlite
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2005 - 2011)
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pgsql
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Yasuo Ohgaki <yohgaki@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2002 - 2007)
Yasuo Ohgaki <yohgaki@php.net> (2001 - 2015)
MAINTENANCE: Maintained
STATUS: Working
COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug.
-------------------------------------------------------------------------------
EXTENSION: sqlite3
PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net>
PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net> (2008 - 2011)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
@@ -168,34 +180,38 @@ COMMENT: Integrates SQLite 3 embeddable SQL database engine.
-------------------------------------------------------------------------------
EXTENSION: dom
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Börger <helly@php.net>
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net> (2003 - 2011)
Rob Richards <rrichards@php.net> (2003 - 2012)
Marcus Börger <helly@php.net> (2003 - 2006)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: simplexml
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2008)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: soap
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2004 - 2018)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: wddx
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (1999 - 2003)
MAINTENANCE: Orphaned
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xml
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>, Rob Richards <rrichards@php.net>
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net> (1999 - 2002)
Rob Richards <rrichards@php.net> (2003 - 2013)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: libxml
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2003 - 2009)
Christian Stocker <chregu@php.net> (2004 - 2011)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -205,17 +221,19 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xmlrpc
PRIMARY MAINTAINER: Dan Libby
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Orphaned
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: xmlwriter
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2004 - 2010)
Christian Stocker <chregu@php.net> (2004 - 2004)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xsl
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net> (2003 - 2011)
Rob Richards <rrichards@php.net> (2003 - 2010)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
@@ -226,39 +244,41 @@ SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: bcmath
MAINTENANCE: Andi Gutmans <andi@zend.com>
MAINTENANCE: Andi Gutmans <andi@zend.com> (2000 - 2004)
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: bz2
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2004 - 2004)
MAINTENANCE: Odd Fixes
STATUS: Working
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: calendar
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2000 - 2004)
MAINTENANCE: Odd Fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: com_dotnet
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
PRIMARY MAINTAINER: Wez Furlong <wez@php.net> (2003 - 2005)
MAINTENANCE: Maintained
STATUS: Windows
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: ctype
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net>
PRIMARY MAINTAINER: Hartmut Holzgraefe <hholzgra@php.net> (2000 - 2004)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: curl
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>, Ilia Alshanetsky <iliaa@php.net>, Pierrick Charron <pierrick@php.net>
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net> (2000 - 2004)
Ilia Alshanetsky <iliaa@php.net> (2002 - 2011)
Pierrick Charron <pierrick@php.net> (2010 - 2016)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: date
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2005 - 2018)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -269,19 +289,22 @@ STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: exif
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net>
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net> (2010 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.2
-------------------------------------------------------------------------------
EXTENSION: fileinfo
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2004 - 2008)
Anatol Belski <ab@php.net> (2012 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: filter
PRIMARY MAINTAINER: Derick Rethans <derick@php.net>, Pierre-Alain Joye <pajoye@php.net>, Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2006 - 2006)
Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
Ilia Alshanetsky <iliaa@php.net> (2006 - 2011)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.2
@@ -292,7 +315,8 @@ MAINTENANCE: Odd fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: gd
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>, Christoph M. Becker <cmb@php.net>
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net> (2002 - 2016)
Christoph M. Becker <cmb@php.net> (2015 - 2018)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -301,84 +325,98 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: gmp
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net>, Antony Dovgal <tony2001@php.net>
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2000 - 2018)
Antony Dovgal <tony2001@php.net> (2005 - 2010)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: hash
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net> (2005 - 2017)
Mike Wallner <mike@php.net> (2005 - 2013)
Anatol Belski <ab@php.net> (2014 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1.2
-------------------------------------------------------------------------------
EXTENSION: iconv
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net> (2002 - 2010)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: intl
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net>
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2008 - 2018)
Anatol Belski <ab@php.net> (2017 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: imap
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>, Ilia Alshanetsky <iliaa@php.net>, Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org> (1999 - 2004)
Ilia Alshanetsky <iliaa@php.net> (2002 - 2010)
Pierre-Alain Joye <pajoye@php.net> (2008 - 2010)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: json
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net> (2014 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.2
-------------------------------------------------------------------------------
EXTENSION: ldap
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>, Douglas Goldstein <cardoe@php.net>, Pierre-Alain Joye <pajoye@php.net>, Côme Bernigaud <mcmic@php.net>
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net> (2000 - 2002)
Douglas Goldstein <cardoe@php.net> (2007 - 2007)
Pierre-Alain Joye <pajoye@php.net> (2008 - 2010)
Côme Bernigaud <mcmic@php.net> (2015 - 2017)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mbstring
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net>
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net> (2001 - 2013)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: opcache
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com> (2013 - 2018)
Xinchen Hui <laruence@php.net> (2013 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.5.0
-------------------------------------------------------------------------------
EXTENSION: openssl
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Wez Furlong <wez@php.net> (2001 - 2006)
Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: pcntl
PRIMARY MAINTAINER: Arnaud Le Blanc <lbarnaud@php.net>
PRIMARY MAINTAINER: Arnaud Le Blanc <lbarnaud@php.net> (2008 - 2010)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: pcre
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>, Nuno Lopes <nlopess@php.net>
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (1999 - 2006)
Nuno Lopes <nlopess@php.net> (2006 - 2009)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: phar
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net>, Marcus Börger <helly@php.net>, Steph Fox <sfox@php.net>
PRIMARY MAINTAINER: Greg Beaver <cellog@php.net> (2008 - 2009)
Marcus Börger <helly@php.net> (2008 - 2008)
Steph Fox <sfox@php.net> (2008 - 2008)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: posix
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de> (2000 - 2000)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: pspell
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com>
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com> (2000 - 2004)
MAINTENANCE: Unknown
STATUS: Working
SINCE: 4.0.2
@@ -388,45 +426,50 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: recode
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de> (2000 - 2000)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: reflection
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2009)
Johannes Schlüter <johannes@php.net> (2006 - 2014)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: session
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx> (1999 - 2004)
Ilia Alshanetsky <iliaa@php.net> (2002 - 2012)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: shmop
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net> (2002 - 2008)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: snmp
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net>, Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net> (2011 - 2013)
Rasmus Lerdorf <rasmus@php.net> (1999 - 2002)
Pierre-Alain Joye <pajoye@php.net> (2010 - 2011)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sockets
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org> (2000 - 2000)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: sodium
PRIMARY MAINTAINER: Frank Denis <jedisct1@php.net>
PRIMARY MAINTAINER: Frank Denis <jedisct1@php.net> (2017 - 2017)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 7.2.0
-------------------------------------------------------------------------------
EXTENSION: spl
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Etienne Kneuss <colder@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2009)
Etienne Kneuss <colder@php.net> (2008 - 2014)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0.0
@@ -444,22 +487,24 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: tidy
PRIMARY MAINTAINER: John Coggeshall <john@php.net>, Ilia Alshanetsky <iliaa@php.net>, Nuno Lopes <nlopess@php.net>
PRIMARY MAINTAINER: John Coggeshall <john@php.net> (2003 - 2006)
Ilia Alshanetsky <iliaa@php.net> (2003 - 2009)
Nuno Lopes <nlopess@php.net> (2006 - 2012)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: tokenizer
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (2002 - 2002)
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: zip
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net>
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: zlib
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de> (1999 - 2003)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
+1 -1
View File
@@ -1,3 +1,3 @@
For installation of PHP, please refer to the online documentation available at:
http://php.net/install
https://php.net/install
+1 -1
View File
@@ -121,7 +121,7 @@ distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f php7.spec main/build-defs.h scripts/phpize
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
rm -f ext/phar/phar.phar ext/phar/phar.php
+235
View File
@@ -1,5 +1,240 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 Aug 2018, PHP 7.3.0beta3
- Core:
. Fixed #76773 (Traits used on the parent are ignored for child classes).
(daverandom)
. Fixed #76767 (‘asm’ operand has impossible constraints in zend_operators.h).
(ondrej)
. Fixed bug #76754 (parent private constant in extends class memory leak).
(Laruence)
. Fixed bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in
_get_zval_ptr_tmp failed). (Laruence)
- DOM:
. Fixed bug #76285 (DOMDocument::formatOutput attribute sometimes ignored).
(Andrew Nester, Laruence, Anatol)
- iconv:
. Fixed bug #68180 (iconv_mime_decode can return extra characters in a
header). (cmb)
. Fixed bug #63839 (iconv_mime_decode_headers function is skipping headers).
(cmb)
. Fixed bug #60494 (iconv_mime_decode does ignore special characters). (cmb)
. Fixed bug #55146 (iconv_mime_decode_headers() skips some headers). (cmb)
. Fixed bug #53891 (iconv_mime_encode() fails to Q-encode UTF-8 string). (cmb)
- libxml:
. Fixed bug #76777 ("public id" parameter of libxml_set_external_entity_loader
callback undefined). (Ville Hukkamäki)
- Opcache:
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
file). (Laruence)
- SimpleXML:
. Fixed bug #76712 (Assignment of empty string creates extraneous text node).
(cmb)
- SPL:
. Fixed bug #68825 (Exception in DirectoryIterator::getLinkTarget()). (cmb)
. Fixed bug #68175 (RegexIterator pregFlags are NULL instead of 0). (Tim
Siebels)
- Standard:
. Fixed bug #76778 (array_reduce leaks memory if callback throws exception).
(cmb)
. Fixed bug #76755 (setcookie does not accept "double" type for expire time).
(Laruence)
. Fixed bug #76674 (improve array_* failure messages exposing what was passed
instead of an array). (carusogabriel)
16 Aug 2018, PHP 7.3.0beta2
- Core:
. Fixed bug #76030 (RE2C_FLAGS rarely honoured) (Cristian Rodríguez)
. Fixed broken zend_read_static_property (Laruence)
- Bz2:
. Fixed arginfo for bzcompress. (Tyson Andre)
- DOM:
. Reverted fix for bug #76285 (DOMDocument::formatOutput attribute sometimes
ignored). (cmb)
- gettext:
. Fixed bug #76517 (incorrect restoring of LDFLAGS). (sji)
- intl:
. Fixed bug #74484 (MessageFormatter::formatMessage memory corruption with
11+ named placeholders). (Anatol)
- mbstring:
. Fixed bug #76704 (mb_detect_order return value varies based on argument
type). (cmb)
. Fixed bug #76706 (mbstring.http_output_conv_mimetypes is ignored). (cmb)
- OpenSSL:
. Fixed bug #76705 (unusable ssl => peer_fingerprint in
stream_context_create()). (Jakub Zelenka)
- phpdbg:
. Fixed bug #76595 (phpdbg man page contains outdated information).
(Kevin Abel)
- Standard:
. Fixed bug #76688 (Disallow excessive parameters after options array).
(pmmaga)
. Fixed bug #76713 (Segmentation fault caused by property corruption).
(Laruence)
- Tidy:
. Fixed arginfo for tidy::__construct(). (Tyson Andre)
- zlib:
. Fixed bug #65988 (Zlib version check fails when an include/zlib/ style dir
is passed to the --with-zlib configure option). (Jay Bonci)
. Fixed bug #76709 (Minimal required zlib library is 1.2.0.4). (petk)
02 Aug 2018, PHP 7.3.0beta1
- Core:
. Fixed bug #76667 (Segfault with divide-assign op and __get + __set).
(Laruence)
- PDO_PgSQL:
. Fixed bug #75402 (Possible Memory Leak using PDO::CURSOR_SCROLL option).
(Anatol)
- SQLite3:
. Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle).
(cmb)
- Standard:
. Fixed bug #68553 (array_column: null values in $index_key become incrementing
keys in result). (Laruence)
. Fixed bug #76643 (Segmentation fault when using `output_add_rewrite_var`).
(cmb)
. Added support for the SameSite cookie directive, including an alternative
signature for setcookie(), setrawcookie() and session_set_cookie_params().
(Frederik Bosch, pmmaga)
19 Jul 2018, PHP 7.3.0alpha4
- Core:
. Fixed bug #33502 (Some nullary functions don't check the number of
arguments). (cmb)
. Fixed bug #76392 (Error relocating sapi/cli/php: unsupported relocation
type 37). (Peter Kokot)
. The declaration and use of case-insensitive constants has been deprecated.
(Nikita)
. Added syslog.filter INI entry for syslog filtering. (Philip Prindeville)
- Calendar:
. Fixed bug #52974 (jewish.c: compile error under Windows with GBK charset).
(cmb)
- Filter:
. Added the 'add_slashes' sanitization mode (FILTER_SANITIZE_ADD_SLASHES).
(Kalle)
. Fixed bug #76366 (References in sub-array for filtering breaks the filter).
(ZiHang Gao)
- FPM:
. Fixed bug #62596 (getallheaders() missing with PHP-FPM). (Remi)
. Added fpm_get_status function. (Till Backhaus)
. Fixed bug #69031 (Long messages into stdout/stderr are truncated
incorrectly) - added new log related FPM configuration options:
log_limit, log_buffering and decorate_workers_output. (Jakub Zelenka)
- mbstring:
. Fixed bug #76574 (use of undeclared identifiers INT_MAX and LONG_MAX). (cmb)
. Fixed bug #76594 (Bus Error due to unaligned access in zend_ini.c
OnUpdateLong). (cmb, Nikita)
- PDO_Firebird:
. Fixed bug #74462 (PDO_Firebird returns only NULLs for results with boolean
for FIREBIRD >= 3.0). (Dorin Marcoci)
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
- Standard:
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
. Fixed bug #76136 (stream_socket_get_name should enclose IPv6 in brackets).
(seliver)
- Zip:
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
(Timur Ibragimov)
05 Jul 2018, PHP 7.3.0alpha3
- Core:
. Fixed bug #76534 (PHP hangs on 'illegal string offset on string references
with an error handler). (Laruence)
. Fixed bug #76520 (Object creation leaks memory when executed over HTTP).
(Nikita)
. Fixed bug #76502 (Chain of mixed exceptions and errors does not serialize
properly). (Nikita)
. Fixed bug #76509 (Inherited static properties can be desynchronized from
their parent by ref). (Nikita)
. Fixed bug #76439 (Changed behaviour in unclosed HereDoc). (Nikita, tpunt)
. Added syslog.facility and syslog.ident INI entries for customizing syslog
logging. (Philip Prindeville)
. Fixed bug #63217 (Constant numeric strings become integers when used as
ArrayAccess offset). (Rudi Theunissen, Dmitry)
- DOM:
. Fixed bug #76285 (DOMDocument::formatOutput attribute sometimes ignored).
(Andrew Nester)
- FPM:
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
non-blocking). (Nikita)
- GMP:
. Fixed bug #74670 (Integer Underflow when unserializing GMP and possible
other classes). (Nikita)
- intl:
. Fixed bug #76556 (get_debug_info handler for BreakIterator shows wrong
type). (cmb)
- mbstring:
. Fixed bug #76532 (Integer overflow and excessive memory usage
in mb_strimwidth). (MarcusSchwarz)
- OpenSSL:
. Add min_proto_version and max_proto_version ssl stream options as well as
related constants for possible TLS protocol values. (Jakub Zelenka)
- PCRE:
. Fixed bug #76512 (\w no longer includes unicode characters). (cmb)
. Fixed bug #76514 (Regression in preg_match makes it fail with
PREG_JIT_STACKLIMIT_ERROR). (Anatol)
- PGSQL:
. Fixed bug #76548 (pg_fetch_result did not fetch the next row). (Anatol)
- phpdbg:
. Fix arginfo wrt. optional/required parameters. (cmb)
- Reflection:
. Fixed bug #76536 (PHP crashes with core dump when throwing exception in
error handler). (Laruence)
. Fixed bug #75231 (ReflectionProperty#getValue() incorrectly works with
inherited classes). (Nikita)
- Standard:
. Fixed bug #76505 (array_merge_recursive() is duplicating sub-array keys).
(Laruence)
. Fixed bug #71848 (getimagesize with $imageinfo returns false). (cmb)
. Fixed bug #48016 (stdClass::__setState is not defined although var_export() uses it). (Andrea)
- Tokenizer:
. Fixed bug #76538 (token_get_all with TOKEN_PARSE flag fails to recognise
close tag with newline). (Nikita)
21 Jun 2018, PHP 7.3.0alpha2
- Core:
+12
View File
@@ -28,6 +28,13 @@ Both functions return SUCCESS or FAILURE depending on the result.
The auto-conversions are performed as necessary. Arrays, objects, and
resources cannot be auto-converted.
PHP 5.3 includes a new function (actually implemented as macro):
int zend_parse_parameters_none();
This returns SUCCESS if no argument has been passed to the function,
FAILURE otherwise.
PHP 5.5 includes a new function:
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
@@ -221,3 +228,8 @@ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
/* Function that doesn't accept any arguments */
if (zend_parse_parameters_none() == FAILURE) {
return;
}
+3 -6
View File
@@ -140,14 +140,14 @@ to upgrade.
*Wait for web and qa sites to update with new information before sending announce*
5. Send an email **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
5. Send **separate** emails **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``.
6. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
6. Send **separate** emails (see example here http://news.php.net/php.pear.qa/5201) **To**
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
This email is to notify the selected projects about a new release so that they
These emails are to notify the selected projects about a new release so that they
can make sure their projects keep working. Make sure that you have been setup
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
Derick) run the following commands for you:
@@ -156,9 +156,6 @@ Derick) run the following commands for you:
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
7. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
Rolling a stable release
------------------------
-3
View File
@@ -1,6 +1,3 @@
$Id$
=============================================================================
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
A self-contained extension can be distributed independently of
-1
View File
@@ -1,6 +1,5 @@
An Overview of the PHP Streams abstraction
==========================================
$Id$
WARNING: some prototypes in this file are out of date.
The information contained here is being integrated into
+2 -2
View File
@@ -2,7 +2,7 @@ The PHP Interpreter
===================
This is the github mirror of the official PHP repository located at
http://git.php.net.
https://git.php.net.
[![Build Status](https://secure.travis-ci.org/php/php-src.svg?branch=master)](http://travis-ci.org/php/php-src)
[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy?svg=true)](https://ci.appveyor.com/project/php/php-src)
@@ -28,7 +28,7 @@ open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
time. The patch removes this warning
We do not merge pull requests directly on github. All PRs will be
pulled and pushed through http://git.php.net.
pulled and pushed through https://git.php.net.
Guidelines for contributors
-3
View File
@@ -4,9 +4,6 @@
# make -f build.mk
#
# Written by Sascha Schumann
#
# $Id$
LT_TARGETS = ltmain.sh ltconfig
-1
View File
@@ -1,5 +1,4 @@
// vim:ft=javascript
// $Id$
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+4 -4
View File
@@ -1,4 +1,3 @@
dnl $Id$
dnl
dnl Minimalistic configure.ac for TSRM.
dnl
@@ -12,10 +11,10 @@ AH_TOP([
])
sinclude(tsrm.m4)
TSRM_BASIC_CHECKS
TSRM_THREADS_CHECKS
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
@@ -32,4 +31,5 @@ unistd.h \
limits.h
)
AC_OUTPUT(Makefile)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
@@ -1,6 +1,6 @@
# =================================================================================
# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
# =================================================================================
# ==================================================================================
# https://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
# ==================================================================================
#
# SYNOPSIS
#
@@ -46,7 +46,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@@ -61,7 +61,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 7
#serial 8
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
@@ -194,4 +194,3 @@ esac
AC_LANG_POP
]) dnl end AC_DEFUN
+3 -25
View File
@@ -1,26 +1,4 @@
m4_include([TSRM/m4/gethostbyname.m4])
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
echo 'void somefunc() { };' > conftest.c
cmd='$CC $1 -c conftest.c'
if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
ac_result=no
else
ac_result=yes
fi
eval $gcc_arg_name=$ac_result
rm -f conftest.*
])
if eval test "\$$gcc_arg_name" = "yes"; then
$2
else
:
$3
fi
])
m4_include([TSRM/m4/ax_func_which_gethostbyname_r.m4])
AC_DEFUN([TSRM_BASIC_CHECKS],[
@@ -75,9 +53,9 @@ AC_DEFUN([TSRM_CHECK_ST],[
sinclude(threads.m4)
AC_DEFUN([TSRM_CHECK_PTHREADS],[
PTHREADS_CHECK
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
fi
-2
View File
@@ -16,8 +16,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
-2
View File
@@ -16,8 +16,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef TSRM_WIN32_H
#define TSRM_WIN32_H
+220 -3
View File
@@ -44,6 +44,67 @@ Core:
the following "FOO;" will cause a syntax error. This issue can always be
resolved by choosing an ending label that does not occur within the contents
of the string.
. "continue" statements targeting "switch" control flow structures will now
generate a warning. In PHP such "continue" statements are equivalent to
"break", while they behave as "continue 2" in other languages.
while ($foo) {
switch ($bar) {
case "baz":
continue;
// Warning: "continue" targeting switch is equivalent to
"break". Did you mean to use "continue 2"?
}
}
. Array accesses of type $obj["123"], where $obj implements ArrayAccess and
"123" is an integral string literal will no longer result in an implicit
conversion to integer, i.e., $obj->offsetGet("123") will be called instead
of $obj->offsetGet(123). This matches existing behavior for non-literals.
The behavior of arrays is not affected in any way, they continue to
implicitly convert integeral string keys to integers.
. In PHP, static properties are shared between inheriting classes, unless the
static property is explicitly overridden in a child class. However, due to
an implementation artifact it was possible to separate the static properties
by assigning a reference. This loophole has been fixed.
class Test {
public static $x = 0;
}
class Test2 extends Test { }
Test2::$x = &$x;
$x = 1;
var_dump(Test::$x, Test2::$x);
// Previously: int(0), int(1)
// Now: int(1), int(1)
. References returned by array and property accesses are now unwrapped as
part of the access. This means that it is no longer possible to modify the
reference between the access and the use of the accessed value:
$arr = [1];
$ref =& $arr[0];
var_dump($arr[0] + ($arr[0] = 2));
// Previously: int(4), Now: int(3)
This makes the behavior of references and non-references consistent. Please
note that reading and writing a value inside a single expression remains
undefined behavior and may change again in the future.
. Argument unpacking stopped working with Traversables with non-integer keys.
The following code worked in PHP 7.0-7.2 by accident.
function foo(...$args) {
var_dump($args);
}
function gen() {
yield 1.23 => 123;
}
foo(...gen());
Now it generates an exception.
BCMath:
. All warnings thrown by BCMath functions are now using PHP's error handling.
@@ -51,6 +112,12 @@ BCMath:
. bcmul() and bcpow() now return numbers with the requested scale. Formerly,
the returned numbers may have omitted trailing decimal zeroes.
MBString:
. Due to added support for named captures, mb_ereg_*() patterns using named
captures will behave differently. In particular named captures will be part
of matches and mb_ereg_replace() will interpret additional syntax. See
"New Features" section for more information.
mysqli:
. Prepared statements now properly report the fractional seconds for DATETIME/
TIME/TIMESTAMP columns with decimals specifier (e.g. TIMESTAMP(6) when using
@@ -85,8 +152,10 @@ SimpleXML:
Standard:
. Undefined variables passed to compact() will now be reported as a notice.
. getimagesize() and related functions now report the mime type of BMP images
as image/bmp instead of image/x-ms-bmp, since the former has been registered
with the IANA (see RFC 7903).
as image/bmp instead of image/x-ms-bmp, since the former has been registered
with the IANA (see RFC 7903).
. stream_socket_get_name() will now return IPv6 addresses wrapped in brackets.
For example "[::1]:1337" will be returned instead of "::1:1337".
========================================
2. New Features
@@ -108,6 +177,8 @@ Core:
of generating a fatal error. Currently this only affects compilation errors
that may be thrown by token_get_all() in TOKEN_PARSE mode, but more errors
may be converted in the future.
. Trailing commas in function and method calls are now allowed.
(RFC: https://wiki.php.net/rfc/trailing-comma-function-calls)
BCMath:
. bcscale() can now also be used as getter to retrieve the current scale in use.
@@ -144,25 +215,112 @@ MBString:
. Mbstring now correctly supports strings larger than 2GB.
. Performance of the mbstring extension has been significantly improved
across the board. The largest improvements are in case conversion functions.
. mb_ereg_*() functions now support named captures. Matching functions like
mb_ereg() will now return named captures both using their group number and
their name, similar to PCRE:
mb_ereg('(?<word>\w+)', '国', $matches);
// => [0 => "国", 1 => "国", "word" => "国"];
Additionally, mb_ereg_replace() now supports the \k<> and \k'' notations
to reference named captures in the replacement string:
mb_ereg_replace('\s*(?<word>\w+)\s*', "_\k<word>_\k'word'_", ' foo ');
// => "_foo_foo_"
\k<> and \k'' can also be used for numbered references, which also works
with group numbers greater than 9.
readline:
. Support for the completion_append_character and completion_suppress_append
options has been added to readline_info(). These options are only available
if PHP is linked against libreadline (rather than libedit).
Standard:
. The --with-password-argon2[=dir] configure argument now provides support for
both Argon2i and Argon2id hashes in the password_hash(), password_verify(),
password_get_info(), and password_needs_rehash() functions. Passwords may be
hashed and verified using the PASSWORD_ARGON2ID constant.
Support for both Argon2i and Argon2id in the password_* functions now requires
PHP be linked against libargon2 reference library >= 20161029.
(RFC: https://wiki.php.net/rfc/argon2_password_hash_enhancements).
========================================
3. Changes in SAPI modules
========================================
phpdbg:
. The unused constants PHPDBG_FILE, PHPDBG_METHOD, PHPDBG_LINENO and
PHPDBG_FUNC have been removed.
FPM:
. The getallheaders function is now also available.
========================================
4. Deprecated Functionality
========================================
Core:
. The declaration of case-insensitive constants has been deprecated. Passing
true as the third argument to define() will now generate a deprecation
warning. The use of case-insensitive constants with a case that differs from
the declaration is also deprecated.
(RFC: https://wiki.php.net/rfc/case_insensitive_constant_deprecation)
. Declaring a function called assert() inside a namespace is deprecated.
The assert() function is subject to special handling by the engine, which
may lead to inconsistent behavior when defining a namespaced function with
the same name.
Filter:
. The explicit usage of the constants FILTER_FLAG_SCHEME_REQUIRED and
FILTER_FLAG_HOST_REQUIRED is now deprecated; both are implied for
FILTER_VALIDATE_URL anyway.
GD:
. image2wbmp() has been deprecated.
Intl:
. Usage of the Normalizer::NONE form throws a deprecation warning, if PHP is linked with ICU >= 56.
. Usage of the Normalizer::NONE form throws a deprecation warning, if PHP is
linked with ICU >= 56.
Mbstring:
. The following undocumented mbereg_*() aliases have been deprecated. Use the
corresponding mb_ereg_*() variants instead.
. mbregex_encoding()
. mbereg()
. mberegi()
. mbereg_replace()
. mberegi_replace()
. mbsplit()
. mbereg_match()
. mbereg_search()
. mbereg_search_pos()
. mbereg_search_regs()
. mbereg_search_init()
. mbereg_search_getregs()
. mbereg_search_getpos()
. mbereg_search_setpos()
PDO ODBC:
. The pdo_odbc.db2_instance_name ini setting has been formally deprecated. It
has already been deprecated in the documentation since PHP 5.1.1.
Standard:
. Passing a non-string needle to string search functions is deprecated. In the
future the needle will be interpreted as a string instead of an ASCII codepoint.
Depending on the intended behavior, you should either explicitly cast the
needle to string or perform an explicit call to ord(). The following functions
are affected:
. strpos()
. strrpos()
. stripos()
. strripos()
. strstr()
. strchr()
. strrchr()
. stristr()
. The fgetss() function and the string.strip_tags stream filter have been deprecated.
This also affects the SplFileObject::fgetss() method and gzgetss() function.
========================================
5. Changed Functions
@@ -176,11 +334,23 @@ JSON:
precedence over JSON_THROW_ON_ERROR.
(RFC: https://wiki.php.net/rfc/json_throw_on_error)
Session:
. session_set_cookie_params() now also supports the following signature:
session_set_cookie_params(array $options)
where $options is an associative array which may have any of the keys
"lifetime", "path", "domain", "secure", "httponly" and "samesite".
Accordingly, the return value of session_get_cookie_params() now also has an
element with the key "samesite".
Standard:
. debug_zval_dump() was changed to display recursive arrays and objects
in the same way as var_dump(). Now, it doesn't display them twice.
. array_push() and array_unshift() can now also be called with a single
argument, which is particularly convenient wrt. the spread operator.
. setcookie() and setrawcookie() now also support the following signature:
set(raw)cookie(string $name, [string $value, [array $options]])
where $options is an associative array which may have any of the keys
"expires", "path", "domain", "secure", "httponly" and "samesite".
PCRE:
. preg_quote() now also escapes the '#' character.
@@ -204,6 +374,9 @@ Date:
. Added the DateTime::createFromImmutable() method, which mirrors
DateTimeImmutable::createFromMutable().
FPM:
. Added fpm_get_status() function which returns FPM status info array.
GMP:
. Added gmp_binomial(n, k) for calculating binomial coefficients.
. Added gmp_lcm(a, b) for calculating the least common multiple.
@@ -248,6 +421,9 @@ Standard:
. Added is_countable() function, to check whether a value may be passed to
count().
(RFC: https://wiki.php.net/rfc/is-countable)
. Added array_key_first() and array_key_last() which retrieve the first and
last key of an array, respectively.
(RFC: <https://wiki.php.net/rfc/array_key_first_last>)
========================================
7. New Classes and Interfaces
@@ -271,6 +447,9 @@ JSON:
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
defines the set of allowed thousand separator chars. The default (`"',."`)
is fully backward compatible with former PHP versions.
. FILTER_SANITIZE_ADD_SLASHES has been added as an alias of the 'magic_quotes'
filter (FILTER_SANITIZE_MAGIC_QUOTES). The 'magic_quotes' filter is subject
to removal in future versions of PHP.
FTP:
. Set default transfer mode to binary
@@ -287,6 +466,16 @@ JSON:
. Support for ODBCRouter has been removed.
. Support for Birdstep has been removed.
PCRE:
. The PCRE extension has been upgraded to PCRE2, which may cause minor
behavioral changes, and augments the existing regular expression syntax.
See <https://wiki.php.net/rfc/pcre2-migration> for details.
Standard:
. var_export() now exports stdClass objects as an array casted to an object
(`(object) array( ... )`), rather than using the nonexistent method
stdClass::__setState().
ZIP:
. Bundled libzip has been dropped,
system library is now required.
@@ -301,6 +490,13 @@ Curl:
JSON:
. JSON_THROW_ON_ERROR
MBString:
. MB_CASE_FOLD
. MB_CASE_LOWER_SIMPLE
. MB_CASE_UPPER_SIMPLE
. MB_CASE_TITLE_SIMPLE
. MB_CASE_FOLD_SIMPLE
PGSQL:
. Requires Postgres 9.3
- PGSQL_DIAG_SCHEMA_NAME
@@ -311,6 +507,9 @@ PGSQL:
. Requires Postgres 9.6
- PGSQL_DIAG_SEVERITY_NONLOCALIZED
Standard:
. PASSWORD_ARGON2ID
========================================
11. Changes to INI File Handling
========================================
@@ -322,6 +521,24 @@ PGSQL:
. This INI directive has been removed. The value has already been ignored
since PHP 5.3.0.
- session.cookie_samesite
. New INI option to allow to set the SameSite directive for cookies. Defaults
to "" (empty string), so no SameSite directive is set. Can be set to "Lax"
or "Strict", which sets the respective SameSite directive.
- syslog.facility
- New INI to set syslog facility which specifies what type of program is
logging the message. It is used only when error_log is set to syslog.
- syslog.filter
. New INI to set syslog filter type to filter the logged messages. There are
3 supported filter types - all, no-ctrl and ascii. It is used only when
error_log is set to syslog.
- syslog.ident
. New INI to set syslog ident string which is prepended to every message. It
is used only when error_log is set syslog.
========================================
12. Windows Support
========================================
+61 -4
View File
@@ -18,6 +18,17 @@ PHP 7.3 INTERNALS UPGRADE NOTES
o. IS_UNUSED
p. VM instruction operands (FETCH_CLASS, FETCH_CONSTANT, CATCH)
q. sapi_cli_single_write()
r. php_url
s. zend_function.reserved[]
t. zif_handler
u. GC_G
v. php_add[c]slashes
w. zend_class_entry.iterator_funcs
x. Class declaration opcodes (DECLARE_INHERITED_CLASS ...)
y. zend_constant
z. HAVE_ST_BLKSIZE and HAVE_ST_RDEV
aa. RETSIGTYPE
bb. php_setcookie
2. Build system changes
a. Unix build system changes
@@ -46,8 +57,8 @@ PHP 7.3 INTERNALS UPGRADE NOTES
As result some related macros were removed (ZEND_EX_USE_LITERALS,
EX_LOAD_LITERALS, EX_LITERALS, RT_CONSTANT_EX, EX_CONSTANT) or changed
(RT_CONSTANT, ZEND_PASS_TWO_UPDATE_CONSTANT, ZEND_PASS_TWO_UNDO_CONSTANT).
This change way affect only some "system" extensions. EX_LITERALS,
RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT than now
This change may affect only some "system" extensions. EX_LITERALS,
RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT, and now
use "opline" (instead of "op_array") as first argument.
c. Protection from recursion during processing circular data structures was
@@ -61,7 +72,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
HASH_FLAG_APPLY_PROTECTION flag and ZEND_HASH_APPLY_PROTECTION() macro
are removed. All mutable arrays should use recursion protection.
Corresponding checks should be replaced by Z_REFCOUNTED() or
!(GC_GLAGS(p) & GC_IMMUTABLE).
!(GC_FLAGS(p) & GC_IMMUTABLE).
d. HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into
GC_FLAGS (to be consistent with IS_STR_PERSISTENT).
@@ -91,7 +102,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
zend_register_persistent_resource_ex() should beused to register
persistent resources, instead of manual insertion into EG(persistent_list).
i. The RANGE_RANGE() macro has been removed. php_mt_rand_range() should be
i. The RAND_RANGE() macro has been removed. php_mt_rand_range() should be
used instead.
j. The cast_object() object handler now also accepts the _IS_NUMBER type. The
@@ -126,11 +137,57 @@ PHP 7.3 INTERNALS UPGRADE NOTES
q. sapi_cli_single_write() now returns ssize_t instead of size_t.
r. fields of php_url struct change from char * to zend_string *
s. Special purpose zend_functions marked by ZEND_ACC_CALL_VIA_TRAMPOLINE or
ZEND_ACC_FAKE_CLOSURE flags use reserved[0] for internal purpose.
Third party extensions must not modify reserved[] fields of these functions.
t. For internal functions the typedef zif_handler has been introduced. It is
recommended to use this from now on, instead of defining own handler types.
u. The GC globals (GC_G) are now private. Use the new zend_gc_get_status() to
retrieve status information of the GC.
v. The should_free argument of the php_add[c]slashes functions has been
removed. It is now always the caller's responsibility to free the passed
string.
w. zend_class_entry.iterator_funcs have been replaced by iterator_funcs_ptr.
You don't have to set its value, setting parent.funcs in the get_iterator
function is enough.
x. Class declaration opcode formats were changed
- DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS now encode parent
class name in second operand directly (as IS_CONST operand). Previously,
parent class was fetched by the prior FETCH_CLASS opcode.
- ADD_INTERFACE and ADD_TRAIT don't use run-time cache to keep interface or
trait. These instructions are executed once, and caching is useless.
y. zend_constant.flags and zend_constant.module_number are packed into
reserved space inside zend_constant.value. They should be accessed using
ZEND_CONTANT_FLAGS(), ZEND_CONSTANTS_MODULE_NUMBER() and
ZEND_CONTANT_SET_FLAGS() macros.
z. HAVE_ST_BLKSIZE must be replaced with HAVE_STRUCT_STAT_ST_BLKSIZE and
HAVE_ST_RDEV must be replaced with HAVE_STRUCT_STAT_ST_RDEV.
aa. RETSIGTYPE has been removed from the generated php_config.h and should be
replaced with void.
bb. php_setcookie() now expects an additional samesite argument, and the
url_encode parameter has been moved to the end. The signature is now:
int php_setcookie(zend_string *name, zend_string *value, time_t expires,
zend_string *path, zend_string *domain, int secure,
int httponly, zend_string *samesite, int url_encode);
========================
2. Build system changes
========================
a. Unix build system changes
- PHP_PROG_LEX, TSRM_CHECK_GCC_ARG, and LIBZEND_CPLUSPLUS_CHECKS Autoconf
macros have been removed.
b. Windows build system changes
- ZEND_WIN32_FORCE_INLINE doesn't affect C++ anymore. zend_always_inline is
-195
View File
@@ -1,195 +0,0 @@
Creating an object
------------------
Object can be created in the following ways:
1. As a result of a function call. E.g.:
$foo = create_new_foo("parameter");
$foo->run();
The function should create a new zval, create new object and get the
handle for it, set handle and handler table as needed. Note that the
handle is the only ID of the object, so it should be enough to
identify it.
2. Overriding create_object handler for class. E.g.:
$foo = new Java("some.Class.here", "parameter");
$foo->run();
The create_object handler function should create a new zval, create
new object and get the handle for it, set handle and handler table as
needed, and also provide constructor method that would handle
constructor call. The get_constructor handler table entry should be
used for that. Do not rely class entry's constructor, unless you refer
to it from get_constructor handler.
Object maintenance
------------------
The handlers add_ref and del_ref are called when a new zval referring
to the object is created. This does not create a new object - both
zvals still refer to the same object.
clone_obj handler should create a new object, identical to an old one,
but being a separate entity.
delete_obj should destroy an object, all references to it become
invalid.
Object access - read
--------------------
read_property is used to read object's property. This value is not
meant to be changed. The handler returns zval * with the value.
Object access - write
---------------------
write_property is used to directly write object's property by
name. This handler is used to assign property variables or to change them
in operations like += or ++ (unless get_property_zval_ptr is also set).
get_property_zval_ptr is used to obtain pointer to modifiable zval for
operations like += or ++. This should be used only if your object model
stores properties as real zval's that can be modified from outside.
Otherwise this handler should be NULL and the engine will use
read_property and write_property instead.
get_property_ptr is used to obtain zval ** for future writing to
it. If your object properties are stored as zval*, return real place
where the property is stored. If the aren't, the best way is to create
proxy object and handle it via get and set methods (see below).
This method is meant to be used for send-by-reference and assign-by-reference
use of object properties. If you don;t want to implement property
referencing for your objects, you can set this handler to NULL.
get and set handlers are used when engine needs to access the object
as a value. E.g., in the following situation:
$foo =& $obj->bar;
$foo = 1;
if $foo is an object (e.g., proxy object from get_property_ptr) it
would be accessed using write handler.
Object access - method call
---------------------------
get_method handler is used to find method description by name. It
should set right type, function name and parameter mask for the
method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be
called via call_method handler, otherwise it would be called with
standard Zend means.
get_constructor performs the same function as get_method, but for the
object constructor.
call_method handler is used to perform method call. Parameters are
passed like to any other Zend internal function.
Object - comparison
-------------------
Objects can be compared via compare_objects handler. This is used with
== operation, === compares objects by handles, i.e., return true if
and only if it's really the same object. Note that objects from
different object types (i.e., having different handlers) can not be
compared.
Objects - reflection
--------------------
get_class_name is used to retrieve class name of the object.
get_class_entry returns class entry (zend_class_entry) for the object,
in case there exists PHP class for it.
No other reflection functions are currently implemented.
Objects - data structures and handlers
---------------------------------------
The object is represented by the following structure:
struct _zend_object_value {
zend_object_handle handle;
zend_object_handlers *handlers;
};
handle is an ID of the object among the objects of the same type (not
class!). The type of the object and how it behaves is determined by
the handler table.
typedef struct _zend_object_handlers {
zend_object_add_ref_t add_ref;
zend_object_del_ref_t del_ref;
zend_object_delete_obj_t delete_obj;
zend_object_clone_obj_t clone_obj;
zend_object_read_property_t read_property;
zend_object_write_property_t write_property;
zend_object_get_property_ptr_t get_property_ptr;
zend_object_get_property_zval_ptr_t get_property_zval_ptr;
zend_object_get_t get;
zend_object_set_t set;
zend_object_has_property_t has_property;
zend_object_unset_property_t unset_property;
zend_object_get_properties_t get_properties;
zend_object_get_method_t get_method;
zend_object_call_method_t call_method;
zend_object_get_constructor_t get_constructor;
zend_object_get_class_entry_t get_class_entry;
zend_object_get_class_name_t get_class_name;
zend_object_compare_t compare_objects;
} zend_object_handlers;
See zend_object_handlers.h for prototypes. All objects are passed as zval's.
Handlers explained:
add_ref - called when a copy of the object handle is created.
del_ref - called when a copy of the object handle is destroyed.
delete_obj - called when an object needs to be destroyed.
clone_obj - called when a new object identical to an old one should be
created (unlike Zend Engine 1, this never happens unless explicitly
asked for).
read_property - returns zval *, containing the value of the
property. Is used when value of the property should be retrieved for
reading.
write_property - assigns value to certain property of the object.
get_property_zval_ptr - retrieves zval** for being directly modified by
the engine. If your properties are not zval's, don't define it.
get_property_ptr - retrieves zval** for the property of the value, to
be used for read and write. If object properties are not zval's
natively, this method should create and return proxy object for use
with get and set methods.
get - retrieves zval* for object contents. To be used mainly with
proxy objects from get_property_ptr, but also may be used for
convert_to_* functions.
set - sets value for object contents. To be used mainly with
proxy objects from get_property_ptr.
has_property - checks if the object has certain property set.
unset_property - removes value for the property of the object
get_method - retrieves description of the method
call_method - calls the method (parameters should be put on stack like
for any other PHP internal function).
get_constructor - get description for the object constructor method
get_class_entry - should return the class entry for the object
get_class_name - get the name of the class the object belongs to
compare_objects - compares if two objects are equal
+47 -55
View File
@@ -1,29 +1,27 @@
dnl
dnl $Id$
dnl
dnl This file contains Zend specific autoconf functions.
dnl
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
AC_MSG_CHECKING(for $1)
AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_INTTYPES_H
#if HAVE_INTTYPES_H
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
#endif],
[if (($1 *) 0)
#endif]],
[[if (($1 *) 0)
return 0;
if (sizeof ($1))
return 0;
],[
]])],[
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
AC_MSG_RESULT(yes)
], AC_MSG_RESULT(no)
)dnl
], [AC_MSG_RESULT(no)
])dnl
])
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
@@ -63,7 +61,6 @@ stdlib.h \
dlfcn.h)
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_DEFUN([LIBZEND_LIBDL_CHECKS],[
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
@@ -109,7 +106,7 @@ ZEND_CHECK_FLOAT_PRECISION
dnl test whether double cast to long preserves least significant bits
AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <limits.h>
int main()
@@ -129,7 +126,7 @@ int main()
}
exit(1);
}
], [
]])], [
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_MSG_RESULT(yes)
], [
@@ -137,7 +134,7 @@ int main()
], [
AC_MSG_RESULT(no)
])
])
AC_DEFUN([LIBZEND_ENABLE_DEBUG],[
@@ -147,7 +144,7 @@ AC_ARG_ENABLE(debug,
ZEND_DEBUG=$enableval
],[
ZEND_DEBUG=no
])
])
])
@@ -158,10 +155,10 @@ AC_ARG_ENABLE(maintainer-zts,
ZEND_MAINTAINER_ZTS=$enableval
],[
ZEND_MAINTAINER_ZTS=no
])
])
AC_ARG_ENABLE(inline-optimization,
[ --disable-inline-optimization
[ --disable-inline-optimization
If building zend_execute.lo fails, try this switch],[
ZEND_INLINE_OPTIMIZATION=$enableval
],[
@@ -195,8 +192,7 @@ test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
AC_DEFINE(ZTS,1,[ ])
CFLAGS="$CFLAGS -DZTS"
LIBZEND_CPLUSPLUS_CHECKS
fi
fi
changequote({,})
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
@@ -222,7 +218,7 @@ dnl test and set the alignment define for ZEND_MM
dnl this also does the logarithmic test for ZEND_MM.
AC_MSG_CHECKING(for MM alignment and log values)
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
typedef union _mm_align_test {
@@ -249,16 +245,16 @@ int main()
}
fp = fopen("conftest.zend", "w");
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
fclose(fp);
exit(0);
}
], [
]])], [
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
LIBZEND_MM_ALIGN_LOG2=`cat conftest.zend | cut -d ' ' -f 2`
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
], [], [
dnl cross-compile needs something here
LIBZEND_MM_ALIGN=8
@@ -269,7 +265,7 @@ AC_MSG_RESULT(done)
dnl test for memory allocation using mmap(MAP_ANON)
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -301,7 +297,7 @@ int main()
}
return 0;
}
], [
]])], [
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
AC_MSG_RESULT(yes)
], [
@@ -314,7 +310,7 @@ int main()
dnl test for memory allocation using mmap("/dev/zero")
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -356,7 +352,7 @@ int main()
}
return 0;
}
], [
]])], [
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
AC_MSG_RESULT(yes)
], [
@@ -374,7 +370,7 @@ AC_ARG_ENABLE(zend-signals,
ZEND_SIGNALS=$enableval
],[
ZEND_SIGNALS=yes
])
])
AC_CHECK_FUNC(sigaction, [
AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
@@ -391,28 +387,24 @@ AC_MSG_RESULT($ZEND_SIGNALS)
])
AC_DEFUN([LIBZEND_CPLUSPLUS_CHECKS],[
])
AC_MSG_CHECKING(whether /dev/urandom exists)
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
AC_MSG_CHECKING(whether /dev/urandom exists)
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define if the target system has /dev/urandom device])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether /dev/arandom exists)
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
AC_MSG_CHECKING(whether /dev/arandom exists)
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
AC_DEFINE([HAVE_DEV_ARANDOM], 1, [Define if the target system has /dev/arandom device])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_ARG_ENABLE(gcc-global-regs,
[ --disable-gcc-global-regs
[ --disable-gcc-global-regs
whether to enable GCC global register variables],[
ZEND_GCC_GLOBAL_REGS=$enableval
],[
@@ -420,7 +412,7 @@ AC_ARG_ENABLE(gcc-global-regs,
])
AC_MSG_CHECKING(for global register variables support)
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if defined(__GNUC__)
# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#else
@@ -453,8 +445,8 @@ int emu(const opcode_handler_t *ip, void *fp) {
FP = orig_fp;
IP = orig_ip;
}
], [
], [
]], [[
]])], [
ZEND_GCC_GLOBAL_REGS=yes
], [
ZEND_GCC_GLOBAL_REGS=no
@@ -471,7 +463,7 @@ dnl
dnl Check if atof() accepts NAN
dnl
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
@@ -487,7 +479,7 @@ int main(int argc, char** argv)
{
return zend_isnan(atof("NAN")) ? 0 : 1;
}
],[
]])],[
ac_cv_atof_accept_nan=yes
],[
ac_cv_atof_accept_nan=no
@@ -502,7 +494,7 @@ dnl
dnl Check if atof() accepts INF
dnl
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
@@ -521,7 +513,7 @@ int main(int argc, char** argv)
{
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
}
],[
]])],[
ac_cv_atof_accept_inf=yes
],[
ac_cv_atof_accept_inf=no
@@ -536,7 +528,7 @@ dnl
dnl Check if HUGE_VAL == INF
dnl
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
@@ -555,7 +547,7 @@ int main(int argc, char** argv)
{
return zend_isinf(HUGE_VAL) ? 0 : 1;
}
],[
]])],[
ac_cv_huge_val_inf=yes
],[
ac_cv_huge_val_inf=no
@@ -571,7 +563,7 @@ dnl
dnl Check if HUGE_VAL + -HUGEVAL == NAN
dnl
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
#include <stdlib.h>
@@ -592,7 +584,7 @@ int main(int argc, char** argv)
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
#endif
}
],[
]])],[
ac_cv_huge_val_nan=yes
],[
ac_cv_huge_val_nan=no
-258
View File
@@ -1,258 +0,0 @@
# Microsoft Developer Studio Generated Dependency File, included by ZendCore.mak
.\zend_alloc.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
.\alloca.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_config.w32.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_compile.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_API.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
".\zend_ini.h"\
.\zend_constants.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend_constants.h"\
".\zend_operators.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_execute.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_API.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
".\zend_ini.h"\
.\zend_highlight.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_highlight.h"\
".\zend_llist.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_language_parser.tab.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
.\zend_llist.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend_llist.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_opcode.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_API.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
".\zend_ini.h"\
.\zend_operators.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
.\zend_ptr_stack.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend_ptr_stack.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_stack.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend_stack.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_variables.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_API.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
".\zend_ini.h"\
".\zend_list.h"\
.\zend.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend_operators.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_API.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_compile.h"\
".\zend_config.w32.h"\
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
".\zend.h"\
".\zend_API.h"\
".\zend_errors.h"\
".\zend_globals.h"\
".\zend_hash.h"\
".\zend_ini.h"\
".\zend_list.h"\
.\zend_hash.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_config.w32.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
.\zend_ini.c : \
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
".\zend_alloc.h"\
".\zend_config.w32.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_hash.h"\
".\zend_ini.h"\
!IF "$(CFG)" == "ZendCore - Win32 Release"
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
!ENDIF
!IF "$(CFG)" == "ZendCore - Win32 Release"
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
!ENDIF
!IF "$(CFG)" == "ZendCore - Win32 Release"
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
!ENDIF
!IF "$(CFG)" == "ZendCore - Win32 Release"
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
!ENDIF
+23 -28
View File
@@ -1,5 +1,3 @@
dnl $Id$
dnl
dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
@@ -7,7 +5,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
# min: 2.4 (i.e. 204, major * 100 + minor for easier comparison)
bison_version_min="204"
# non-working versions, e.g. "3.0 3.2";
# remove "none" when introducing the first incompatible bison version an
# remove "none" when introducing the first incompatible bison version an
# separate any following additions by spaces
bison_version_exclude=""
@@ -46,16 +44,14 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
AC_DEFUN([ZEND_FP_EXCEPT],[
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <floatingpoint.h>
],[
]],[[
fp_except x = (fp_except) 0;
],[
]])],[
ac_cv_type_fp_except=yes
],[
ac_cv_type_fp_except=no
],[
ac_cv_type_fp_except=no
])])
if test "$ac_cv_type_fp_except" = "yes"; then
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
@@ -67,7 +63,7 @@ dnl Check for broken sprintf()
dnl
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
ac_cv_broken_sprintf=no
],[
ac_cv_broken_sprintf=yes
@@ -91,8 +87,7 @@ AC_DEFUN([AC_ZEND_C_BIGENDIAN],
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
AC_TRY_RUN(
[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
short one = 1;
@@ -104,7 +99,7 @@ int main(void)
return(1);
}
}
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
@@ -119,9 +114,9 @@ dnl x87 floating point internal precision control checks
dnl See: http://wiki.php.net/rfc/rounding
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
AC_MSG_CHECKING([for usable _FPU_SETCW])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <fpu_control.h>
],[
]],[[
fpu_control_t fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
@@ -132,18 +127,18 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
], [ac_cfp_have__fpu_setcw=yes], [ac_cfp_have__fpu_setcw=no])
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable fpsetprec])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <machine/ieeefp.h>
],[
]],[[
fp_prec_t fpu_oldprec;
volatile double result;
double a = 2877.0;
@@ -153,7 +148,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
AC_MSG_RESULT(yes)
@@ -162,9 +157,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
fi
AC_MSG_CHECKING([for usable _controlfp])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
],[
]],[[
unsigned int fpu_oldcw;
volatile double result;
double a = 2877.0;
@@ -174,7 +169,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
AC_MSG_RESULT(yes)
@@ -183,9 +178,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
fi
AC_MSG_CHECKING([for usable _controlfp_s])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
],[
]],[[
unsigned int fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
@@ -196,7 +191,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
AC_MSG_RESULT(yes)
@@ -205,9 +200,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
fi
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
/* nothing */
],[
]],[[
unsigned int oldcw, cw;
volatile double result;
double a = 2877.0;
@@ -220,7 +215,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
AC_MSG_RESULT(yes)
-2
View File
@@ -4,8 +4,6 @@
# make -f build.mk
#
# Written by Sascha Schumann
#
# $Id$
LT_TARGETS = ltmain.sh ltconfig
+5 -5
View File
@@ -1,4 +1,3 @@
dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(zend.c)
@@ -60,7 +59,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -69,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -80,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -126,7 +125,8 @@ LIBZEND_OTHER_CHECKS
ZEND_EXTRA_LIBS="$LIBS"
LIBS=""
AC_SUBST(ZEND_EXTRA_LIBS)
AC_OUTPUT(Makefile)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# Local Variables:
# tab-width: 4
-2
View File
@@ -15,5 +15,3 @@
| Authors: |
+----------------------------------------------------------------------+
*/
/* $Id$ */
@@ -0,0 +1,21 @@
--TEST--
Argument unpacking does not work with non-integer keys
--FILE--
<?php
function foo(...$args) {
var_dump($args);
}
function gen() {
yield 1.23 => 123;
yield "2.34" => 234;
}
try {
foo(...gen());
} catch (Error $ex) {
echo "Exception: " . $ex->getMessage() . "\n";
}
?>
--EXPECT--
Exception: Cannot unpack Traversable with non-integer keys
+2 -2
View File
@@ -20,7 +20,7 @@ assert(0 && ($a = function () {
yield from $x;
}));
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
abstract class A extends B implements C, D {
const X = 12;
const Y = self::X, Z = "aaa";
@@ -161,7 +161,7 @@ Warning: assert(): assert(0 && ($a = function () {
yield from $x;
})) failed in %sexpect_015.php on line %d
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
abstract class A extends B implements C, D {
const X = 12;
const Y = self::X, Z = 'aaa';
+1 -1
View File
@@ -3,7 +3,7 @@ Empty statement in assert() shouldn't segfault
--FILE--
<?php
assert((function () { return true;; })());
assert((function () { return true; })());
echo "ok";
?>
+2 -2
View File
@@ -1,5 +1,5 @@
--TEST--
'break' error (non positive numbers)
'break' error (non positive integers)
--FILE--
<?php
function foo () {
@@ -7,4 +7,4 @@ function foo () {
}
?>
--EXPECTF--
Fatal error: 'break' operator accepts only positive numbers in %sbreak_error_001.php on line 3
Fatal error: 'break' operator accepts only positive integers in %sbreak_error_001.php on line 3
+2 -2
View File
@@ -1,5 +1,5 @@
--TEST--
'break' error (operator with non-constant operand)
'break' error (operator with non-integer operand)
--FILE--
<?php
function foo () {
@@ -7,4 +7,4 @@ function foo () {
}
?>
--EXPECTF--
Fatal error: 'break' operator with non-constant operand is no longer supported in %sbreak_error_002.php on line 3
Fatal error: 'break' operator with non-integer operand is no longer supported in %sbreak_error_002.php on line 3
-4
View File
@@ -1,9 +1,5 @@
--TEST--
Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
--SKIPIF--
<?php
if (!function_exists('stream_filter_register')) die('skip stream_filter_register() not available');
?>
--FILE--
<?php
class debugfilter extends php_user_filter {
+11 -3
View File
@@ -4,10 +4,18 @@ Bug #29883 (isset gives invalid values on strings)
<?php
$x = "bug";
var_dump(isset($x[-10]));
var_dump(isset($x[1]));
var_dump(isset($x["1"]));
echo $x["1"]."\n";
var_dump($x[-10])."\n";
var_dump($x[1])."\n";
var_dump($x["1"])."\n";
?>
--EXPECT--
--EXPECTF--
bool(false)
bool(true)
u
bool(true)
Notice: Uninitialized string offset: -10 in %s on line 6
string(0) ""
string(1) "u"
string(1) "u"
-4
View File
@@ -1,9 +1,5 @@
--TEST--
Bug #36568 (memory_limit has no effect)
--SKIPIF--
<?php
if (!function_exists('memory_get_usage')) die('skip PHP is configured without memory_limit');
?>
--INI--
memory_limit=16M
--FILE--
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #43450 (Memory leak on some functions with implicit object __toString() call)
--SKIPIF--
<?php if (!function_exists('memory_get_usage')) die('skip memory_get_usage() not installed'); ?>
--INI--
opcache.enable_cli=0
--FILE--
+15
View File
@@ -40,6 +40,11 @@ print ns1\ns2\coNSt6 . "\n";
print NS1\ns2\coNSt1 . "\n";
?>
--EXPECTF--
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 6
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 7
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 8
value1
value1
value1
@@ -52,13 +57,23 @@ value3
value4
value4
value4
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS1\ns2\const4" in %s on line 25
value4
value5
value5
value5
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\ns2\const5" in %s on line 30
value5
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 32
value6
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 33
value6
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "ns1\NS2\coNSt6" in %s on line 34
value6
value6
+1 -1
View File
@@ -19,7 +19,7 @@ unset($array[1]);
print_r($array);
$array = array(1 => 2);
$a = 1;
unset($array["1"]);
print_r($array);
?>
+123
View File
@@ -0,0 +1,123 @@
--TEST--
Bug #63217 (Constant numeric strings become integers when used as ArrayAccess offset)
--INI--
opcache.enable_cli=1
opcache.enable=1
opcache.optimization_level=-1
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($offset) {
echo "offsetExists given ";
var_dump($offset);
}
public function offsetUnset($offset) {
echo "offsetUnset given ";
var_dump($offset);
}
public function offsetSet($offset, $value) {
echo "offsetSet given ";
var_dump($offset);
}
public function offsetGet($offset) {
echo "offsetGet given ";
var_dump($offset);
}
}
$test = new Test;
/* These should all produce string(...) "..." output and not int(...) */
isset($test['0']);
isset($test['123']);
unset($test['0']);
unset($test['123']);
$test['0'] = true;
$test['123'] = true;
$foo = $test['0'];
$foo = $test['123'];
/* These caused the same bug, but in opcache rather than the compiler */
isset($test[(string)'0']);
isset($test[(string)'123']);
unset($test[(string)'0']);
unset($test[(string)'123']);
$test[(string)'0'] = true;
$test[(string)'123'] = true;
$foo = $test[(string)'0'];
$foo = $test[(string)'123'];
/**
* @see https://github.com/php/php-src/pull/2607#issuecomment-313781748
*/
function test(): string {
$array["10"] = 42;
foreach ($array as $key => $value) {
return $key;
}
}
var_dump(test());
/**
* Make sure we don't break arrays.
*/
$array = [];
$key = '123';
$array[$key] = 1;
$array['321'] = 2;
$array['abc'] = 3;
var_dump($array);
/**
* Make sure that we haven't broken ArrayObject
*/
$ao = new ArrayObject();
$key = '123';
$ao = [];
$ao[$key] = 1;
$ao['321'] = 2;
$ao['abc'] = 3;
var_dump($ao);
?>
--EXPECT--
offsetExists given string(1) "0"
offsetExists given string(3) "123"
offsetUnset given string(1) "0"
offsetUnset given string(3) "123"
offsetSet given string(1) "0"
offsetSet given string(3) "123"
offsetGet given string(1) "0"
offsetGet given string(3) "123"
offsetExists given string(1) "0"
offsetExists given string(3) "123"
offsetUnset given string(1) "0"
offsetUnset given string(3) "123"
offsetSet given string(1) "0"
offsetSet given string(3) "123"
offsetGet given string(1) "0"
offsetGet given string(3) "123"
string(2) "10"
array(3) {
[123]=>
int(1)
[321]=>
int(2)
["abc"]=>
int(3)
}
array(3) {
[123]=>
int(1)
[321]=>
int(2)
["abc"]=>
int(3)
}
+8 -1
View File
@@ -5,6 +5,13 @@ Bug #72543.5 (different references behavior comparing to PHP 5)
$arr = [1];
$ref =& $arr[0];
var_dump($arr[0] + ($arr[0] = 2));
$obj = new stdClass;
$obj->prop = 1;
$ref =& $obj->prop;
var_dump($obj->prop + ($obj->prop = 2));
?>
--EXPECT--
int(4)
int(3)
int(3)
-4
View File
@@ -1,9 +1,5 @@
--TEST--
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
--SKIPIF--
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for 32-bit only');
--FILE--
<?php
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
+68
View File
@@ -0,0 +1,68 @@
--TEST--
Bug #76439: Don't always strip leading whitespace from heredoc T_ENCAPSED_AND_WHITESPACE tokens
--FILE--
<?php
[$one, $two, $three, $four, $five, $six, $seven, $eight, $nine] = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var_dump(<<<BAR
$one-
BAR);
var_dump(<<<BAR
$two -
BAR);
var_dump(<<<BAR
$three -
BAR);
var_dump(<<<BAR
$four-$four
BAR);
var_dump(<<<BAR
$five-$five-
BAR);
var_dump(<<<BAR
$six-$six-$six
BAR);
var_dump(<<<BAR
$seven
-
BAR);
var_dump(<<<BAR
$eight
-
BAR);
var_dump(<<<BAR
$nine
BAR);
var_dump(<<<BAR
-
BAR);
var_dump(<<<BAR
-
BAR);
?>
--EXPECT--
string(2) "1-"
string(3) "2 -"
string(3) "3 -"
string(3) "4-4"
string(4) "5-5-"
string(5) "6-6-6"
string(3) "7
-"
string(4) "8
-"
string(1) "9"
string(1) "-"
string(2) " -"
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #76439: Don't always strip leading whitespace from heredoc T_ENCAPSED_AND_WHITESPACE tokens (error case)
--FILE--
<?php
$foo = 1;
var_dump(<<<BAR
$foo
$foo
BAR);
?>
--EXPECTF--
Parse error: Invalid body indentation level (expecting an indentation level of at least 1) in %s on line 7
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #76502: Chain of mixed exceptions and errors does not serialize properly
--FILE--
<?php
$examples = [
"Exception(Exception())" => new Exception("outer", 0, new Exception("inner")),
"Error(Error())" => new Error("outer", 0, new Error("inner")),
"Error(Exception())" => new Error("outer", 0, new Exception("inner")),
"Exception(Error())" => new Exception("outer", 0, new Error("inner"))
];
foreach ($examples as $name => $example) {
$processed = unserialize(serialize($example));
$processedPrev = $processed->getPrevious();
echo "---- $name ----\n";
echo "before: ", get_class($example), ".previous == ",
get_class($example->getPrevious()), "\n";
echo "after : ", get_class($processed), ".previous == ",
$processedPrev ? get_class($processedPrev) : "null", "\n";
}
?>
--EXPECT--
---- Exception(Exception()) ----
before: Exception.previous == Exception
after : Exception.previous == Exception
---- Error(Error()) ----
before: Error.previous == Error
after : Error.previous == Error
---- Error(Exception()) ----
before: Error.previous == Exception
after : Error.previous == Exception
---- Exception(Error()) ----
before: Exception.previous == Error
after : Exception.previous == Error
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)
--FILE--
<?php
set_error_handler(function ($severity, $message, $file, $line) {
throw new \Exception($message);
});
$x = "foo";
$y = &$x["bar"];
?>
--EXPECTF--
Fatal error: Uncaught Exception: Illegal string offset 'bar' in %sbug76534.php:%d
Stack trace:
#0 %sbug76534.php(%d): {closure}(2, 'Illegal string ...', '%s', %d, Array)
#1 {main}
thrown in %sbug76534.php on line %d
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #76667 (Segfault with divide-assign op and __get + __set)
--FILE--
<?php
class T {
public function __get($k)
{
return $undefined->$k;
}
public function __set($k, $v)
{
return $this->$v /= 0;
}
};
$x = new T;
$x->x = 1;
?>
--EXPECTF--
Notice: Undefined variable: undefined in %sbug76667.php on line %d
Notice: Trying to get property '1' of non-object in %sbug76667.php on line %d
Warning: Division by zero in %sbug76667.php on line %d
Notice: Undefined variable: undefined in %sbug76667.php on line %d
Notice: Trying to get property 'NAN' of non-object in %sbug76667.php on line %d
Warning: Division by zero in %sbug76667.php on line %d
Notice: Undefined variable: undefined in %sbug76667.php on line %d
Notice: Trying to get property 'NAN' of non-object in %sbug76667.php on line %d
Warning: Division by zero in %sbug76667.php on line %d
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in _get_zval_ptr_tmp failed)
--FILE--
<?php
$obj = new stdClass;
$val = 'foo';
$obj->prop = &$val;
var_dump($obj->prop ?? []);
?>
--EXPECT--
string(3) "foo"
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #76754 (parent private constant in extends class memory leak)
--INI--
opcache.enable=0
opcache.enable_cli=0
--FILE--
<?php
class FOO
{
private const FOO = 'BAR';
}
class BAR extends FOO { }
?>
okey
--EXPECT--
okey
@@ -0,0 +1,127 @@
--TEST--
Case-insensitive constants are deprecated
--FILE--
<?php
namespace {
define('FOO', 42, true); // Deprecated
define('NS\FOO', 24, true); // Deprecated
var_dump(FOO); // Ok
var_dump(foo); // Deprecated
var_dump(NS\FOO); // Ok
var_dump(ns\FOO); // Ok
var_dump(ns\foo); // Deprecated
var_dump(defined('FOO')); // Ok
var_dump(defined('foo')); // Ok
var_dump(defined('NS\FOO')); // Ok
var_dump(defined('ns\FOO')); // Ok
var_dump(defined('ns\foo')); // Ok
var_dump(constant('FOO')); // Ok
var_dump(constant('foo')); // Deprecated
var_dump(constant('NS\FOO')); // Ok
var_dump(constant('ns\FOO')); // Ok
var_dump(constant('ns\foo')); // Deprecated
}
namespace NS {
var_dump(FOO); // Ok
var_dump(foo); // Deprecated
}
namespace ns {
var_dump(FOO); // Ok
var_dump(foo); // Deprecated
}
namespace Other {
var_dump(FOO); // Ok
var_dump(foo); // Deprecated
var_dump(defined('FOO')); // Ok
var_dump(defined('foo')); // Ok
var_dump(defined('NS\FOO')); // Ok
var_dump(defined('ns\FOO')); // Ok
var_dump(defined('ns\foo')); // Ok
var_dump(constant('FOO')); // Ok
var_dump(constant('foo')); // Deprecated
var_dump(constant('NS\FOO')); // Ok
var_dump(constant('ns\FOO')); // Ok
var_dump(constant('ns\foo')); // Deprecated
const C1 = FOO; // Ok
var_dump(C1);
const C2 = foo; // Deprecated
var_dump(C2);
const C3 = 1 + FOO; // Ok
var_dump(C3);
const C4 = 1 + foo; // Deprecated
var_dump(C4);
}
?>
--EXPECTF--
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 4
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line 5
int(42)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 8
int(42)
int(24)
int(24)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 12
int(24)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
int(42)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 21
int(42)
int(24)
int(24)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 24
int(24)
int(24)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 29
int(24)
int(24)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 34
int(24)
int(42)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 39
int(42)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
int(42)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 48
int(42)
int(24)
int(24)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 51
int(24)
int(42)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 55
int(42)
int(43)
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 59
int(43)
@@ -0,0 +1,49 @@
--TEST--
Warning on continue targeting switch
--FILE--
<?php
function test() {
switch ($foo) {
case 0:
continue; // INVALID
case 1:
break;
}
while ($foo) {
switch ($bar) {
case 0:
continue; // INVALID
case 1:
continue 2;
case 2:
break;
}
}
while ($foo) {
switch ($bar) {
case 0:
while ($xyz) {
continue 2; // INVALID
}
case 1:
while ($xyz) {
continue 3;
}
case 2:
while ($xyz) {
break 2;
}
}
}
}
?>
--EXPECTF--
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 6
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 14
Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 26
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Defining a free-standing assert() function is deprecated
--FILE--
<?php
namespace FooBar;
function assert() {}
?>
--EXPECTF--
Deprecated: Defining a custom assert() function is deprecated, as the function has special semantics in %s on line %d
+21 -5
View File
@@ -17,16 +17,24 @@ var_dump(empty($str[5])); // 1
var_dump(empty($str[8]));
var_dump(empty($str[10000]));
// non-numeric offsets
print "- string ---\n";
var_dump(empty($str['-1']));
print "- string literal ---\n";
var_dump(empty($str['-1'])); // 3
var_dump(empty($str['-10']));
var_dump(empty($str['-4'])); // 0
var_dump(empty($str['0']));
var_dump(empty($str['1']));
var_dump(empty($str['4'])); // 0
var_dump(empty($str['1.5']));
var_dump(empty($str['good']));
var_dump(empty($str['3 and a half']));
print "- string variable ---\n";
var_dump(empty($str[$key = '-1'])); // 3
var_dump(empty($str[$key = '-10']));
var_dump(empty($str[$key = '0']));
var_dump(empty($str[$key = '1']));
var_dump(empty($str[$key = '4'])); // 0
var_dump(empty($str[$key = '1.5']));
var_dump(empty($str[$key = 'good']));
var_dump(empty($str[$key = '3 and a half']));
print "- bool ---\n";
var_dump(empty($str[true]));
var_dump(empty($str[false]));
@@ -54,7 +62,7 @@ var_dump(empty($str[$f]));
print "done\n";
?>
--EXPECT--
--EXPECTF--
- empty ---
bool(false)
bool(true)
@@ -65,9 +73,17 @@ bool(true)
bool(false)
bool(true)
bool(true)
- string ---
- string literal ---
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
- string variable ---
bool(false)
bool(true)
bool(false)
bool(false)
+133
View File
@@ -0,0 +1,133 @@
--TEST--
GC 038: Garbage created by compound assignment operators (e.g. +=)
--INI--
zend.enable_gc = 1
--FILE--
<?php
function test_add() {
$x = new stdClass;
$x->x= $x;
@$x += 5;
$n = gc_collect_cycles();
echo "+=\t$n\n";
}
test_add();
function test_sub() {
$x = new stdClass;
$x->x= $x;
@$x -= 5;
$n = gc_collect_cycles();
echo "-=\t$n\n";
}
test_sub();
function test_mul() {
$x = new stdClass;
$x->x= $x;
@$x *= 5;
$n = gc_collect_cycles();
echo "*=\t$n\n";
}
test_mul();
function test_div() {
$x = new stdClass;
$x->x= $x;
@$x /= 5;
$n = gc_collect_cycles();
echo "/=\t$n\n";
}
test_div();
function test_mod() {
$x = new stdClass;
$x->x= $x;
@$x %= 5;
$n = gc_collect_cycles();
echo "%=\t$n\n";
}
test_mod();
function test_sl() {
$x = new stdClass;
$x->x= $x;
@$x <<= 5;
$n = gc_collect_cycles();
echo "<<=\t$n\n";
}
test_sl();
function test_sr() {
$x = new stdClass;
$x->x= $x;
@$x >>= 5;
$n = gc_collect_cycles();
echo ">>=\t$n\n";
}
test_sr();
function test_or() {
$x = new stdClass;
$x->x= $x;
@$x |= 1;
$n = gc_collect_cycles();
echo "|=\t$n\n";
}
test_or();
function test_and() {
$x = new stdClass;
$x->x= $x;
@$x &= 1;
$n = gc_collect_cycles();
echo "&=\t$n\n";
}
test_and();
function test_xor() {
$x = new stdClass;
$x->x= $x;
@$x ^= 1;
$n = gc_collect_cycles();
echo "^=\t$n\n";
}
test_xor();
function test_pow() {
$x = new stdClass;
$x->x= $x;
@$x **= 1;
$n = gc_collect_cycles();
echo "**=\t$n\n";
}
test_pow();
class Y {
function __toString() {
return "y";
}
}
function test_concat() {
$x = new Y;
$x->x= $x;
@$x .= "x";
$n = gc_collect_cycles();
echo ".=\t$n\n";
}
test_concat();
?>
--EXPECT--
+= 1
-= 1
*= 1
/= 1
%= 1
<<= 1
>>= 1
|= 1
&= 1
^= 1
**= 1
.= 1
+15
View File
@@ -0,0 +1,15 @@
--TEST--
GC 039: Garbage created by replacing argument send by reference
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
zend.enable_gc = 1
--FILE--
<?php
$out = new stdClass;
$out->x = $out;
mb_parse_str("a=b", $out);
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(1)
+22 -4
View File
@@ -16,8 +16,8 @@ var_dump(isset($str[5])); // 1
var_dump(isset($str[8]));
var_dump(isset($str[10000]));
// non-numeric offsets
print "- string ---\n";
var_dump(isset($str['-1']));
print "- string literal ---\n";
var_dump(isset($str['-1'])); // 3
var_dump(isset($str['-10']));
var_dump(isset($str['0']));
var_dump(isset($str['1']));
@@ -25,6 +25,15 @@ var_dump(isset($str['4'])); // 0
var_dump(isset($str['1.5']));
var_dump(isset($str['good']));
var_dump(isset($str['3 and a half']));
print "- string variable ---\n";
var_dump(isset($str[$key = '-1'])); // 3
var_dump(isset($str[$key = '-10']));
var_dump(isset($str[$key = '0']));
var_dump(isset($str[$key = '1']));
var_dump(isset($str[$key = '4'])); // 0
var_dump(isset($str[$key = '1.5']));
var_dump(isset($str[$key = 'good']));
var_dump(isset($str[$key = '3 and a half']));
print "- bool ---\n";
var_dump(isset($str[true]));
var_dump(isset($str[false]));
@@ -51,7 +60,7 @@ var_dump(isset($str[$f]));
print "done\n";
?>
--EXPECT--
--EXPECTF--
- isset ---
bool(true)
bool(false)
@@ -61,7 +70,16 @@ bool(true)
bool(true)
bool(false)
bool(false)
- string ---
- string literal ---
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
- string variable ---
bool(true)
bool(false)
bool(true)
@@ -2,8 +2,6 @@
testing integer overflow (32bit)
--INI--
precision=14
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
--FILE--
<?php
+1 -1
View File
@@ -2,7 +2,7 @@
Overloaded function 001
--SKIPIF--
<?php
if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function");
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
+1 -1
View File
@@ -2,7 +2,7 @@
Overloaded function 002
--SKIPIF--
<?php
if (!class_exists('_ZendTestClass')) die("skip needs class with overloaded function");
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
@@ -2,7 +2,7 @@
Return type for internal functions
--SKIPIF--
<?php
if (!function_exists('zend_test_array_return')) die('skip');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
// Internal function return types are only checked in debug builds
if (!PHP_DEBUG) die('skip requires debug build');
?>
@@ -2,7 +2,7 @@
Return type for internal functions 2
--SKIPIF--
<?php
if (!function_exists('zend_test_nullable_array_return')) die('skip');
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
zend_test_nullable_array_return();
@@ -0,0 +1,11 @@
--TEST--
Return type for internal functions 3: Void return type
--SKIPIF--
<?php
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
--FILE--
<?php
var_dump(zend_test_void_return());
?>
--EXPECT--
NULL
+10 -8
View File
@@ -3,15 +3,17 @@ $this re-assign in extract()
--FILE--
<?php
function foo() {
extract(["this"=>42]);
var_dump($this);
try {
extract(["this"=>42, "a"=>24]);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($a);
}
foo();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_in_extract.php:3
Stack trace:
#0 %sthis_in_extract.php(3): extract(Array)
#1 %sthis_in_extract.php(6): foo()
#2 {main}
thrown in %sthis_in_extract.php on line 3
Cannot re-assign $this
Notice: Undefined variable: a in %s on line %d
NULL
+1 -1
View File
@@ -2,7 +2,7 @@
Bug #69579 (Internal trait double-free)
--SKIPIF--
<?php
if (!trait_exists('_ZendTestTrait')) die("skip requires internal trait");
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
?>
--FILE--
<?php
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #76539 (Trait attribute is set incorrectly when using self::class with another string)
--FILE--
<?php
trait MyTrait {
protected $attr = self::class . 'Test';
public function test() {
echo $this->attr, PHP_EOL;
}
}
class A {
use MyTrait;
}
class B {
use MyTrait;
}
(new A())->test();
(new B())->test();
?>
--EXPECT--
ATest
BTest
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #76700 (false-positive "Error: Call to protected method" when using trait aliases)
--FILE--
<?php
trait T1
{
protected function aa() { echo 123; }
}
trait T2
{
use T1 {
aa as public;
}
}
class A
{
use T1;
}
class B extends A
{
use T2;
}
$b = new B();
$b->aa();
--EXPECT--
123
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Bug #76773 (Traits used on the parent are ignored for child classes)
--FILE--
<?php
trait MyTrait
{
public function hello()
{
echo __CLASS__, "\n";
if (\is_callable(array('parent', __FUNCTION__))) {
parent::hello();
}
}
}
class ParentClass
{
use MyTrait;
}
class ChildClass extends ParentClass
{
use MyTrait;
}
$c = new ChildClass();
$c->hello();
--EXPECT--
ChildClass
ParentClass
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Operator precedence
--FILE--
<?php /* $Id$ */
<?php
var_dump((object)1 instanceof stdClass);
var_dump(! (object)1 instanceof Exception);
+1 -3
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_extensions.h"
#include "zend_modules.h"
@@ -415,7 +413,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
zend_print_flat_zval_r(Z_REFVAL_P(expr));
break;
default:
zend_print_variable(expr);
zend_print_zval(expr, 0);
break;
}
}
+14 -12
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_H
#define ZEND_H
@@ -86,20 +84,17 @@ typedef struct _zend_unserialize_data zend_unserialize_data;
typedef struct _zend_trait_method_reference {
zend_string *method_name;
zend_class_entry *ce;
zend_string *class_name;
} zend_trait_method_reference;
typedef struct _zend_trait_precedence {
zend_trait_method_reference *trait_method;
union {
zend_class_entry *ce;
zend_string *class_name;
} *exclude_from_classes;
zend_trait_method_reference trait_method;
uint32_t num_excludes;
zend_string *exclude_class_names[1];
} zend_trait_precedence;
typedef struct _zend_trait_alias {
zend_trait_method_reference *trait_method;
zend_trait_method_reference trait_method;
/**
* name for method to be added
@@ -142,12 +137,15 @@ struct _zend_class_entry {
union _zend_function *serialize_func;
union _zend_function *unserialize_func;
zend_class_iterator_funcs iterator_funcs;
/* allocated only if class implements Iterator or IteratorAggregate interface */
zend_class_iterator_funcs *iterator_funcs_ptr;
/* handlers */
zend_object* (*create_object)(zend_class_entry *class_type);
union {
zend_object* (*create_object)(zend_class_entry *class_type);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
};
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method);
/* serializer callbacks */
@@ -243,6 +241,10 @@ ZEND_API size_t zend_print_zval(zval *expr, int indent);
ZEND_API void zend_print_zval_r(zval *expr, int indent);
ZEND_API zend_string *zend_print_zval_r_to_str(zval *expr, int indent);
ZEND_API void zend_print_flat_zval_r(zval *expr);
#define zend_print_variable(var) \
zend_print_zval((var), 0)
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API void zend_activate(void);
+96 -129
View File
@@ -19,8 +19,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_execute.h"
#include "zend_API.h"
@@ -531,12 +529,13 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest
zval rv;
zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);
Z_ADDREF_P(z);
if (Z_TYPE_P(z) != IS_OBJECT) {
zval_dtor(arg);
ZVAL_NULL(arg);
if (!zend_make_printable_zval(z, arg)) {
zval_ptr_dtor(arg);
if (Z_TYPE_P(z) == IS_STRING) {
ZVAL_COPY_VALUE(arg, z);
} else {
ZVAL_STR(arg, zval_get_string_func(z));
zval_ptr_dtor(z);
}
*dest = Z_STR_P(arg);
return 1;
@@ -1146,76 +1145,46 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
{
if (!(class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
zend_class_entry *ce;
zend_class_constant *c;
zval *val;
zend_property_info *prop_info;
if (class_type->parent) {
if (UNEXPECTED(zend_update_class_constants(class_type->parent) != SUCCESS)) {
return FAILURE;
}
}
if (!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count) {
/* initialize static members of internal class */
int i;
zval *p;
#if ZTS
CG(static_members_table)[(zend_intptr_t)(class_type->static_members_table)] = emalloc(sizeof(zval) * class_type->default_static_members_count);
#else
class_type->static_members_table = emalloc(sizeof(zval) * class_type->default_static_members_count);
#endif
for (i = 0; i < class_type->default_static_members_count; i++) {
p = &class_type->default_static_members_table[i];
if (Z_ISREF_P(p)) {
if (class_type->parent &&
i < class_type->parent->default_static_members_count &&
p == &class_type->parent->default_static_members_table[i] &&
Z_TYPE(CE_STATIC_MEMBERS(class_type->parent)[i]) != IS_UNDEF
) {
zval *q = &CE_STATIC_MEMBERS(class_type->parent)[i];
ZVAL_NEW_REF(q, q);
ZVAL_COPY(&CE_STATIC_MEMBERS(class_type)[i], q);
} else {
ZVAL_COPY_OR_DUP(&CE_STATIC_MEMBERS(class_type)[i], Z_REFVAL_P(p));
}
} else {
ZVAL_COPY_OR_DUP(&CE_STATIC_MEMBERS(class_type)[i], p);
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
val = &c->value;
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
return FAILURE;
}
}
} else {
zend_class_entry *ce;
zend_class_constant *c;
zval *val;
zend_property_info *prop_info;
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
val = &c->value;
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
return FAILURE;
ce = class_type;
while (ce) {
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
if (prop_info->ce == ce) {
if (prop_info->flags & ZEND_ACC_STATIC) {
val = CE_STATIC_MEMBERS(class_type) + prop_info->offset;
} else {
val = (zval*)((char*)class_type->default_properties_table + prop_info->offset - OBJ_PROP_TO_OFFSET(0));
}
ZVAL_DEREF(val);
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, ce) != SUCCESS)) {
return FAILURE;
}
}
}
} ZEND_HASH_FOREACH_END();
ce = class_type;
while (ce) {
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
if (prop_info->ce == ce) {
if (prop_info->flags & ZEND_ACC_STATIC) {
val = CE_STATIC_MEMBERS(class_type) + prop_info->offset;
} else {
val = (zval*)((char*)class_type->default_properties_table + prop_info->offset - OBJ_PROP_TO_OFFSET(0));
}
ZVAL_DEREF(val);
if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, ce) != SUCCESS)) {
return FAILURE;
}
}
}
} ZEND_HASH_FOREACH_END();
ce = ce->parent;
}
ce = ce->parent;
}
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
}
@@ -1332,7 +1301,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */
{
if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
if (class_type->ce_flags & ZEND_ACC_INTERFACE) {
@@ -1369,15 +1338,16 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
}
/* }}} */
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API int object_init_ex(zval *arg, zend_class_entry *class_type) /* {{{ */
{
return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_RELAY_CC);
return object_and_properties_init(arg, class_type, 0);
}
/* }}} */
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC) /* {{{ */
ZEND_API int object_init(zval *arg) /* {{{ */
{
return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_RELAY_CC);
ZVAL_OBJ(arg, zend_objects_new(zend_standard_class_def));
return SUCCESS;
}
/* }}} */
@@ -2120,6 +2090,11 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
char lcname[16];
size_t name_len;
if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
|| ZSTR_VAL(fptr->common.function_name)[1] != '_') {
return;
}
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
name_len = ZSTR_LEN(fptr->common.function_name);
@@ -2363,6 +2338,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
*/
if ((fname_len == class_name_len) && !ctor && !memcmp(ZSTR_VAL(lowercase_name), lc_class_name, class_name_len+1)) {
ctor = reg_function;
} else if (ZSTR_VAL(lowercase_name)[0] != '_' || ZSTR_VAL(lowercase_name)[1] != '_') {
reg_function = NULL;
} else if (zend_string_equals_literal(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME)) {
ctor = reg_function;
} else if (zend_string_equals_literal(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME)) {
@@ -2908,7 +2885,7 @@ ZEND_API int zend_disable_class(char *class_name, size_t class_name_length) /* {
if (!disabled_class) {
return FAILURE;
}
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new);
disabled_class->create_object = display_disabled_class;
zend_hash_clean(&disabled_class->function_table);
return SUCCESS;
@@ -3016,39 +2993,30 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
fcc->calling_scope = NULL;
if (!ce_org) {
zend_function *func;
zend_string *lmname;
/* Skip leading \ */
if (UNEXPECTED(Z_STRVAL_P(callable)[0] == '\\')) {
ZSTR_ALLOCA_INIT(lmname, Z_STRVAL_P(callable) + 1, Z_STRLEN_P(callable) - 1, use_heap);
} else {
lmname = Z_STR_P(callable);
}
/* Check if function with given name exists.
* This may be a compound name that includes namespace name */
zv = zend_hash_find(EG(function_table), lmname);
if (EXPECTED(zv != NULL)) {
fcc->function_handler = Z_PTR_P(zv);
if (lmname != Z_STR_P(callable)) {
ZSTR_ALLOCA_FREE(lmname, use_heap);
}
return 1;
if (UNEXPECTED(Z_STRVAL_P(callable)[0] == '\\')) {
/* Skip leading \ */
ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable) - 1, use_heap);
zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable) + 1, Z_STRLEN_P(callable) - 1);
func = zend_fetch_function(lmname);
ZSTR_ALLOCA_FREE(lmname, use_heap);
} else {
if (lmname == Z_STR_P(callable)) {
ZSTR_ALLOCA_INIT(lmname, Z_STRVAL_P(callable), Z_STRLEN_P(callable), use_heap);
} else {
zend_string_forget_hash_val(lmname);
}
zend_str_tolower(ZSTR_VAL(lmname), ZSTR_LEN(lmname));
zv = zend_hash_find(EG(function_table), lmname);
if (zv != NULL) {
fcc->function_handler = Z_PTR_P(zv);
lmname = Z_STR_P(callable);
func = zend_fetch_function(lmname);
if (!func) {
ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable), use_heap);
zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable), Z_STRLEN_P(callable));
func = zend_fetch_function(lmname);
ZSTR_ALLOCA_FREE(lmname, use_heap);
return 1;
}
}
if (lmname != Z_STR_P(callable)) {
ZSTR_ALLOCA_FREE(lmname, use_heap);
if (EXPECTED(func != NULL)) {
fcc->function_handler = func;
return 1;
}
}
@@ -3497,7 +3465,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_nam
if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_STRICT, callable_name, &fcc, NULL)) {
if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) {
zval_dtor(callable);
zval_ptr_dtor_str(callable);
array_init(callable);
add_next_index_str(callable, zend_string_copy(fcc.calling_scope->name));
add_next_index_str(callable, zend_string_copy(fcc.function_handler->common.function_name));
@@ -3723,9 +3691,6 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
if (ce->type == ZEND_INTERNAL_CLASS) {
property_info = pemalloc(sizeof(zend_property_info), 1);
if ((access_type & ZEND_ACC_STATIC) || Z_TYPE_P(property) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
} else {
property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
if (Z_TYPE_P(property) == IS_CONSTANT_AST) {
@@ -4091,42 +4056,37 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object
}
/* }}} */
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(fake_scope);
zend_string *key = zend_string_init(name, name_length, 0);
EG(fake_scope) = scope;
property = zend_std_get_static_property(scope, key, 0);
property = zend_std_get_static_property(scope, name, 0);
EG(fake_scope) = old_scope;
zend_string_efree(key);
if (!property) {
return FAILURE;
} else {
if (property != value) {
if (Z_ISREF_P(property)) {
zval_dtor(property);
ZVAL_COPY_VALUE(property, value);
if (Z_REFCOUNTED_P(value) && Z_REFCOUNT_P(value) > 0) {
zval_opt_copy_ctor(property);
}
} else {
zval garbage;
ZVAL_COPY_VALUE(&garbage, property);
if (Z_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
if (Z_ISREF_P(value)) {
SEPARATE_ZVAL(value);
}
}
ZVAL_COPY_VALUE(property, value);
zval_ptr_dtor(&garbage);
}
}
return SUCCESS;
}
if (property != value) {
zval garbage;
ZVAL_DEREF(property);
ZVAL_DEREF(value);
ZVAL_COPY_VALUE(&garbage, property);
ZVAL_COPY(property, value);
zval_ptr_dtor(&garbage);
}
return SUCCESS;
}
/* }}} */
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, 0);
int retval = zend_update_static_property_ex(scope, key, value);
zend_string_efree(key);
return retval;
}
/* }}} */
@@ -4217,21 +4177,28 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c
}
/* }}} */
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
{
zval *property;
zend_class_entry *old_scope = EG(fake_scope);
zend_string *key = zend_string_init(name, name_length, 0);
EG(fake_scope) = scope;
property = zend_std_get_static_property(scope, key, silent);
property = zend_std_get_static_property(scope, name, silent);
EG(fake_scope) = old_scope;
zend_string_efree(key);
return property;
}
/* }}} */
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, 0);
zval *property = zend_read_static_property_ex(scope, key, silent);
zend_string_efree(key);
return property;
}
/* }}} */
ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */
{
current->handling = EG(error_handling);
+16 -28
View File
@@ -19,8 +19,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_API_H
#define ZEND_API_H
@@ -185,18 +183,16 @@ typedef struct _zend_fcall_info_cache {
#endif
#define INIT_CLASS_ENTRY(class_container, class_name, functions) \
INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
INIT_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions)
#define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, NULL, NULL, NULL, NULL, NULL)
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
{ \
memset(&class_container, 0, sizeof(zend_class_entry)); \
class_container.name = zend_string_init_interned(class_name, class_name_len, 1); \
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
class_container.info.internal.builtin_functions = functions; \
}
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions) \
{ \
class_container.constructor = NULL; \
class_container.destructor = NULL; \
@@ -204,16 +200,15 @@ typedef struct _zend_fcall_info_cache {
class_container.serialize = NULL; \
class_container.unserialize = NULL; \
class_container.create_object = NULL; \
class_container.interface_gets_implemented = NULL; \
class_container.get_static_method = NULL; \
class_container.__call = handle_fcall; \
class_container.__call = NULL; \
class_container.__callstatic = NULL; \
class_container.__tostring = NULL; \
class_container.__get = handle_propget; \
class_container.__set = handle_propset; \
class_container.__unset = handle_propunset; \
class_container.__isset = handle_propisset; \
class_container.__debugInfo = NULL; \
class_container.__get = NULL; \
class_container.__set = NULL; \
class_container.__unset = NULL; \
class_container.__isset = NULL; \
class_container.__debugInfo = NULL; \
class_container.serialize_func = NULL; \
class_container.unserialize_func = NULL; \
class_container.parent = NULL; \
@@ -224,20 +219,14 @@ typedef struct _zend_fcall_info_cache {
class_container.trait_precedences = NULL; \
class_container.interfaces = NULL; \
class_container.get_iterator = NULL; \
class_container.iterator_funcs.funcs = NULL; \
class_container.iterator_funcs_ptr = NULL; \
class_container.info.internal.module = NULL; \
class_container.info.internal.builtin_functions = functions; \
}
#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL)
#define INIT_NS_CLASS_ENTRY(class_container, ns, class_name, functions) \
INIT_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions)
#define INIT_OVERLOADED_NS_CLASS_ENTRY_EX(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, ZEND_NS_NAME(ns, class_name), sizeof(ZEND_NS_NAME(ns, class_name))-1, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset)
#define INIT_OVERLOADED_NS_CLASS_ENTRY(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset) \
INIT_OVERLOADED_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions, handle_fcall, handle_propget, handle_propset)
#ifdef ZTS
# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members_table:CG(static_members_table)[(zend_intptr_t)(ce)->static_members_table])
@@ -354,6 +343,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, const char *name, size_t name_length, zend_long value);
@@ -365,6 +355,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zend_bool silent, zval *rv);
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent);
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent);
ZEND_API char *zend_get_type_by_const(int type);
@@ -385,12 +376,9 @@ ZEND_API char *zend_get_type_by_const(int type);
#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
#define array_init_size(arg, size) ZVAL_ARR((arg), zend_new_array(size))
#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC)
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC);
ZEND_API int object_init(zval *arg);
ZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties);
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type);
ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties);
ZEND_API void object_properties_load(zend_object *object, HashTable *properties);
+8 -5
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
/*
* zend_alloc is designed to be a modern CPU cache friendly memory manager
* for PHP. Most ideas are taken from jemalloc and tcmalloc implementations.
@@ -425,11 +423,16 @@ static void *zend_mm_mmap_fixed(void *addr, size_t size)
#ifdef _WIN32
return VirtualAlloc(addr, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
#else
/* MAP_FIXED leads to discarding of the old mapping, so it can't be used. */
void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON /*| MAP_POPULATE | MAP_HUGETLB*/, -1, 0);
int flags = MAP_PRIVATE | MAP_ANON;
#ifdef MAP_FIXED_NOREPLACE
flags |= MAP_FIXED_NOREPLACE;
#elif defined MAP_EXCL
flags |= MAP_FIXED | MAP_EXCL;
#endif
void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, flags /*| MAP_POPULATE | MAP_HUGETLB*/, -1, 0);
if (ptr == MAP_FAILED) {
#if ZEND_MM_ERROR
#if ZEND_MM_ERROR && !defined(MAP_FIXED_NOREPLACE) && !defined(MAP_EXCL)
fprintf(stderr, "\nmmap() failed: [%d] %s\n", errno, strerror(errno));
#endif
return NULL;
+8 -3
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H
@@ -195,7 +193,14 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
#define pemalloc(size, persistent) ((persistent)?__zend_malloc(size):emalloc(size))
#define safe_pemalloc(nmemb, size, offset, persistent) ((persistent)?_safe_malloc(nmemb, size, offset):safe_emalloc(nmemb, size, offset))
#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr))
#define pefree_size(ptr, size, persistent) ((persistent)?free(ptr):efree_size(ptr, size))
#define pefree_size(ptr, size, persistent) do { \
if (persistent) { \
free(ptr); \
} else { \
efree_size(ptr, size);\
} \
} while (0)
#define pecalloc(nmemb, size, persistent) ((persistent)?__zend_calloc((nmemb), (size)):ecalloc((nmemb), (size)))
#define perealloc(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc((ptr), (size)))
#define perealloc2(ptr, size, copy_size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc2((ptr), (size), (copy_size)))
+38 -34
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend_ast.h"
#include "zend_API.h"
#include "zend_operators.h"
@@ -405,12 +403,12 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
zend_error(E_WARNING,
"Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr);
zval_ptr_dtor_nogc(expr);
}
break;
case IS_STRING:
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
zval_dtor(offset);
zval_ptr_dtor_str(offset);
break;
case IS_NULL:
zend_symtable_update(Z_ARRVAL_P(result), ZSTR_EMPTY_ALLOC(), expr);
@@ -448,13 +446,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
} else {
binary_op_type op = get_binary_op(ast->attr);
ret = op(result, &op1, &op2);
zval_dtor(&op1);
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op1);
zval_ptr_dtor_nogc(&op2);
}
break;
case ZEND_AST_GREATER:
@@ -462,15 +460,15 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
} else {
/* op1 > op2 is the same as op2 < op1 */
binary_op_type op = ast->kind == ZEND_AST_GREATER
? is_smaller_function : is_smaller_or_equal_function;
ret = op(result, &op2, &op1);
zval_dtor(&op1);
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op1);
zval_ptr_dtor_nogc(&op2);
}
break;
case ZEND_AST_UNARY_OP:
@@ -479,7 +477,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
} else {
unary_op_type op = get_unary_op(ast->attr);
ret = op(result, &op1);
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
}
break;
case ZEND_AST_ZVAL:
@@ -517,16 +515,16 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
}
if (zend_is_true(&op1)) {
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
break;
}
ZVAL_BOOL(result, zend_is_true(&op2));
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op2);
} else {
ZVAL_FALSE(result);
}
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
break;
case ZEND_AST_OR:
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
@@ -537,14 +535,14 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
ZVAL_TRUE(result);
} else {
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
break;
}
ZVAL_BOOL(result, zend_is_true(&op2));
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op2);
}
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
break;
case ZEND_AST_CONDITIONAL:
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
@@ -556,19 +554,19 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
*result = op1;
} else {
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
break;
}
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
}
} else {
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[2], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
break;
}
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
}
break;
case ZEND_AST_COALESCE:
@@ -580,11 +578,11 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
*result = op1;
} else {
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
break;
}
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
}
break;
case ZEND_AST_UNARY_PLUS:
@@ -593,7 +591,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
} else {
ZVAL_LONG(&op1, 0);
ret = add_function(result, &op1, &op2);
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op2);
}
break;
case ZEND_AST_UNARY_MINUS:
@@ -602,7 +600,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
} else {
ZVAL_LONG(&op1, 0);
ret = sub_function(result, &op1, &op2);
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op2);
}
break;
case ZEND_AST_ARRAY:
@@ -619,21 +617,21 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
zend_ast *elem = list->child[i];
if (elem->child[1]) {
if (UNEXPECTED(zend_ast_evaluate(&op1, elem->child[1], scope) != SUCCESS)) {
zval_dtor(result);
zval_ptr_dtor_nogc(result);
return FAILURE;
}
} else {
ZVAL_UNDEF(&op1);
}
if (UNEXPECTED(zend_ast_evaluate(&op2, elem->child[0], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_dtor(result);
zval_ptr_dtor_nogc(&op1);
zval_ptr_dtor_nogc(result);
return FAILURE;
}
if (UNEXPECTED(zend_ast_add_array_element(result, &op1, &op2) != SUCCESS)) {
zval_dtor(&op1);
zval_dtor(&op2);
zval_dtor(result);
zval_ptr_dtor_nogc(&op1);
zval_ptr_dtor_nogc(&op2);
zval_ptr_dtor_nogc(result);
return FAILURE;
}
}
@@ -647,13 +645,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
zval_ptr_dtor_nogc(&op1);
ret = FAILURE;
} else {
zend_fetch_dimension_const(result, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R);
zval_dtor(&op1);
zval_dtor(&op2);
zval_ptr_dtor_nogc(&op1);
zval_ptr_dtor_nogc(&op2);
}
break;
default:
@@ -1347,6 +1345,9 @@ tail_call:
zend_ast_export_ex(str, decl->child[1], 0, indent);
if (decl->child[3]) {
smart_str_appends(str, ": ");
if (decl->child[3]->attr & ZEND_TYPE_NULLABLE) {
smart_str_appendc(str, '?');
}
zend_ast_export_ns_name(str, decl->child[3], 0, indent);
}
if (decl->child[2]) {
@@ -1881,6 +1882,9 @@ simple_list:
break;
case ZEND_AST_PARAM:
if (ast->child[0]) {
if (ast->child[0]->attr & ZEND_TYPE_NULLABLE) {
smart_str_appendc(str, '?');
}
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
smart_str_appendc(str, ' ');
}
+4 -21
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_AST_H
#define ZEND_AST_H
@@ -204,27 +202,12 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_zval_from_long(zend_long lval)
ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_constant(zend_string *name, zend_ast_attr attr);
#if ZEND_AST_SPEC
# ifdef ZEND_WIN32
# define ZEND_AST_EXPAND_VA(a) a
# endif
# ifdef ZEND_WIN32
# define ZEND_AST_SPEC_CALL(name, ...) \
ZEND_AST_EXPAND_VA(ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
# else
# define ZEND_AST_SPEC_CALL(name, ...) \
ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__)
# endif
# define ZEND_AST_SPEC_CALL(name, ...) \
ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
# define ZEND_AST_SPEC_CALL_(name, _, _4, _3, _2, _1, suffix, ...) \
name ## suffix
# ifdef ZEND_WIN32
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
ZEND_AST_EXPAND_VA(ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
# else
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__)
# endif
# define ZEND_AST_SPEC_CALL_EX(name, ...) \
ZEND_EXPAND_VA(ZEND_AST_SPEC_CALL_EX_(name, __VA_ARGS__, _4, _3, _2, _1, _0)(__VA_ARGS__))
# define ZEND_AST_SPEC_CALL_EX_(name, _, _5, _4, _3, _2, _1, suffix, ...) \
name ## suffix
+52 -13
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_API.h"
#include "zend_gc.h"
@@ -338,6 +336,10 @@ int zend_startup_builtin_functions(void) /* {{{ */
Get the version of the Zend Engine */
ZEND_FUNCTION(zend_version)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1);
}
/* }}} */
@@ -347,6 +349,10 @@ ZEND_FUNCTION(zend_version)
Returns number of freed bytes */
ZEND_FUNCTION(gc_mem_caches)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(zend_mm_gc(zend_mm_get_heap()));
}
/* }}} */
@@ -356,6 +362,10 @@ ZEND_FUNCTION(gc_mem_caches)
Returns number of freed zvals */
ZEND_FUNCTION(gc_collect_cycles)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(gc_collect_cycles());
}
/* }}} */
@@ -364,6 +374,10 @@ ZEND_FUNCTION(gc_collect_cycles)
Returns status of the circular reference collector */
ZEND_FUNCTION(gc_enabled)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_BOOL(gc_enabled());
}
/* }}} */
@@ -372,7 +386,13 @@ ZEND_FUNCTION(gc_enabled)
Activates the circular reference collector */
ZEND_FUNCTION(gc_enable)
{
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_string *key;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_alter_ini_entry_chars(key, "1", sizeof("1")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release_ex(key, 0);
}
@@ -382,7 +402,13 @@ ZEND_FUNCTION(gc_enable)
Deactivates the circular reference collector */
ZEND_FUNCTION(gc_disable)
{
zend_string *key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_string *key;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
key = zend_string_init("zend.enable_gc", sizeof("zend.enable_gc")-1, 0);
zend_alter_ini_entry_chars(key, "0", sizeof("0")-1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
zend_string_release_ex(key, 0);
}
@@ -394,6 +420,10 @@ ZEND_FUNCTION(gc_status)
{
zend_gc_status status;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
zend_gc_get_status(&status);
array_init_size(return_value, 3);
@@ -411,6 +441,10 @@ ZEND_FUNCTION(func_num_args)
{
zend_execute_data *ex = EX(prev_execute_data);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
RETURN_LONG(-1);
@@ -466,8 +500,7 @@ ZEND_FUNCTION(func_get_arg)
arg = ZEND_CALL_ARG(ex, requested_offset + 1);
}
if (EXPECTED(!Z_ISUNDEF_P(arg))) {
ZVAL_DEREF(arg);
ZVAL_COPY(return_value, arg);
ZVAL_COPY_DEREF(return_value, arg);
}
}
/* }}} */
@@ -819,7 +852,6 @@ ZEND_FUNCTION(define)
case_sensitive = 0;
}
/* class constant, check if there is name and make sure class is valid & exists */
if (zend_memnstr(ZSTR_VAL(name), "::", sizeof("::") - 1, ZSTR_VAL(name) + ZSTR_LEN(name))) {
zend_error(E_WARNING, "Class constants cannot be defined or redefined");
RETURN_FALSE;
@@ -870,10 +902,16 @@ repeat:
ZVAL_COPY(&c.value, val);
zval_ptr_dtor(&val_free);
register_constant:
c.flags = case_sensitive; /* non persistent */
if (non_cs) {
zend_error(E_DEPRECATED,
"define(): Declaration of case-insensitive constants is deprecated");
}
/* non persistent */
ZEND_CONSTANT_SET_FLAGS(&c, case_sensitive, PHP_USER_CONSTANT);
c.name = zend_string_copy(name);
c.module_number = PHP_USER_CONSTANT;
if (zend_register_constant(&c) == SUCCESS) {
RETURN_TRUE;
} else {
@@ -893,7 +931,7 @@ ZEND_FUNCTION(defined)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT)) {
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT | ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1071,6 +1109,7 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, int st
prop = NULL;
if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
prop = &ce->default_static_members_table[prop_info->offset];
ZVAL_DEINDIRECT(prop);
} else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)];
}
@@ -2106,13 +2145,13 @@ ZEND_FUNCTION(get_defined_constants)
continue;
}
if (val->module_number == PHP_USER_CONSTANT) {
if (ZEND_CONSTANT_MODULE_NUMBER(val) == PHP_USER_CONSTANT) {
module_number = i;
} else if (val->module_number > i || val->module_number < 0) {
} else if (ZEND_CONSTANT_MODULE_NUMBER(val) > i) {
/* should not happen */
continue;
} else {
module_number = val->module_number;
module_number = ZEND_CONSTANT_MODULE_NUMBER(val);
}
if (Z_TYPE(modules[module_number]) == IS_UNDEF) {
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_BUILTIN_FUNCTIONS_H
#define ZEND_BUILTIN_FUNCTIONS_H
+14 -5
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_API.h"
#include "zend_closures.h"
@@ -236,7 +234,8 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
fci.size = sizeof(zend_fcall_info);
fci.retval = return_value;
fcc.function_handler = (zend_function *) EX(func)->common.arg_info;
fcc.function_handler = (EX(func)->internal_function.fn_flags & ZEND_ACC_STATIC) ?
EX(func)->internal_function.scope->__callstatic : EX(func)->internal_function.scope->__call;
fci.params = params;
fci.param_count = 2;
ZVAL_STR(&fci.params[0], EX(func)->common.function_name);
@@ -272,9 +271,9 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
memset(&call, 0, sizeof(zend_internal_function));
call.type = ZEND_INTERNAL_FUNCTION;
call.fn_flags = mptr->common.fn_flags & ZEND_ACC_STATIC;
call.handler = zend_closure_call_magic;
call.function_name = mptr->common.function_name;
call.arg_info = (zend_internal_arg_info *) mptr->common.prototype;
call.scope = mptr->common.scope;
zend_free_trampoline(mptr);
@@ -412,7 +411,7 @@ static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int t
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
if (has_set_exists != 2) {
if (has_set_exists != ZEND_PROPERTY_EXISTS) {
ZEND_CLOSURE_PROPERTY_ERROR();
}
return 0;
@@ -731,6 +730,16 @@ void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var) /
}
/* }}} */
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val) /* {{{ */
{
zend_closure *closure = (zend_closure *) Z_OBJ_P(closure_zv);
HashTable *static_variables = closure->func.op_array.static_variables;
zval *var = (zval*)((char*)static_variables->arData + offset);
zval_ptr_dtor(var);
ZVAL_COPY_VALUE(var, val);
}
/* }}} */
/*
* Local variables:
* tab-width: 4
+1 -2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_CLOSURES_H
#define ZEND_CLOSURES_H
@@ -30,6 +28,7 @@ BEGIN_EXTERN_C()
void zend_register_closure_ce(void);
void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var);
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val);
extern ZEND_API zend_class_entry *zend_ce_closure;
+171 -136
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <zend_language_parser.h>
#include "zend.h"
#include "zend_compile.h"
@@ -460,7 +458,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string *name) /* {{{ */{
void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
{
zval_dtor(CT_CONSTANT_EX(op_array, n));
zval_ptr_dtor_nogc(CT_CONSTANT_EX(op_array, n));
if (n + 1 == op_array->last_literal) {
op_array->last_literal--;
} else {
@@ -649,7 +647,8 @@ static void zend_end_live_range(zend_op_array *op_array, uint32_t offset, uint32
}
/* }}} */
static inline void zend_begin_loop(zend_uchar free_opcode, const znode *loop_var) /* {{{ */
static inline void zend_begin_loop(
zend_uchar free_opcode, const znode *loop_var, zend_bool is_switch) /* {{{ */
{
zend_brk_cont_element *brk_cont_element;
int parent = CG(context).current_brk_cont;
@@ -658,6 +657,7 @@ static inline void zend_begin_loop(zend_uchar free_opcode, const znode *loop_var
CG(context).current_brk_cont = CG(context).last_brk_cont;
brk_cont_element = get_next_brk_cont_element();
brk_cont_element->parent = parent;
brk_cont_element->is_switch = is_switch;
if (loop_var && (loop_var->op_type & (IS_VAR|IS_TMP_VAR))) {
uint32_t start = get_next_op_number(CG(active_op_array));
@@ -723,15 +723,7 @@ void zend_do_free(znode *op1) /* {{{ */
}
if (opline->result_type == IS_VAR
&& opline->result.var == op1->u.op.var) {
if (opline->opcode == ZEND_FETCH_R ||
opline->opcode == ZEND_FETCH_DIM_R ||
opline->opcode == ZEND_FETCH_OBJ_R ||
opline->opcode == ZEND_FETCH_STATIC_PROP_R) {
/* It's very rare and useless case. It's better to use
additional FREE opcode and simplify the FETCH handlers
their selves */
zend_emit_op(NULL, ZEND_FREE, op1, NULL);
} else if (opline->opcode == ZEND_FETCH_THIS) {
if (opline->opcode == ZEND_FETCH_THIS) {
opline->opcode = ZEND_NOP;
opline->result_type = IS_UNUSED;
} else {
@@ -1077,7 +1069,9 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opli
if (function->op_array.refcount) {
(*function->op_array.refcount)++;
}
function->op_array.static_variables = NULL; /* NULL out the unbound function */
if (!(function->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
function->op_array.static_variables = NULL; /* NULL out the unbound function */
}
return SUCCESS;
}
}
@@ -1188,11 +1182,10 @@ void zend_do_early_binding(void) /* {{{ */
break;
case ZEND_DECLARE_INHERITED_CLASS:
{
zend_op *fetch_class_opline = opline-1;
zval *parent_name;
zend_class_entry *ce;
parent_name = CT_CONSTANT(fetch_class_opline->op2);
parent_name = CT_CONSTANT(opline->op2);
if (((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) == NULL) ||
((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&
(ce->type == ZEND_INTERNAL_CLASS))) {
@@ -1207,9 +1200,8 @@ void zend_do_early_binding(void) /* {{{ */
if (do_bind_inherited_class(CG(active_op_array), opline, CG(class_table), ce, 1) == NULL) {
return;
}
/* clear unnecessary ZEND_FETCH_CLASS opcode */
zend_del_literal(CG(active_op_array), fetch_class_opline->op2.constant);
MAKE_NOP(fetch_class_opline);
zend_del_literal(CG(active_op_array), opline->op2.constant+1);
zend_del_literal(CG(active_op_array), opline->op2.constant);
table = CG(class_table);
break;
@@ -1293,7 +1285,7 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array, uint3
CG(in_compilation) = 1;
while (opline_num != (uint32_t)-1) {
const zend_op *opline = &op_array->opcodes[opline_num-1];
const zend_op *opline = &op_array->opcodes[opline_num];
zval *parent_name = RT_CONSTANT(opline, opline->op2);
if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) {
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
@@ -1374,7 +1366,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
static zend_constant *zend_lookup_reserved_const(const char *name, size_t len) /* {{{ */
{
zend_constant *c = zend_hash_find_ptr_lc(EG(zend_constants), name, len);
if (c && !(c->flags & CONST_CS) && (c->flags & CONST_CT_SUBST)) {
if (c && !(ZEND_CONSTANT_FLAGS(c) & CONST_CS) && (ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST)) {
return c;
}
return NULL;
@@ -1388,9 +1380,9 @@ static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool i
/* Substitute case-sensitive (or lowercase) constants */
c = zend_hash_find_ptr(EG(zend_constants), name);
if (c && (
((c->flags & CONST_PERSISTENT)
((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)
&& !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION)
&& (!(c->flags & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
&& (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
|| (Z_TYPE(c->value) < IS_OBJECT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION))
)) {
ZVAL_COPY_OR_DUP(zv, &c->value);
@@ -1754,8 +1746,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->__tostring = NULL;
ce->create_object = NULL;
ce->get_iterator = NULL;
ce->iterator_funcs.funcs = NULL;
ce->interface_gets_implemented = NULL;
ce->iterator_funcs_ptr = NULL;
ce->get_static_method = NULL;
ce->parent = NULL;
ce->num_interfaces = 0;
@@ -1901,12 +1892,14 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
}
/* }}} */
static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t type) /* {{{ */
{
zend_uchar factor = (opline->opcode == ZEND_FETCH_STATIC_PROP_R) ? 1 : 3;
switch (type) {
case BP_VAR_R:
opline->result_type = IS_TMP_VAR;
result->op_type = IS_TMP_VAR;
return;
case BP_VAR_W:
opline->opcode += 1 * factor;
@@ -1915,6 +1908,8 @@ static void zend_adjust_for_fetch_type(zend_op *opline, uint32_t type) /* {{{ */
opline->opcode += 2 * factor;
return;
case BP_VAR_IS:
opline->result_type = IS_TMP_VAR;
result->op_type = IS_TMP_VAR;
opline->opcode += 3 * factor;
return;
case BP_VAR_FUNC_ARG:
@@ -2433,6 +2428,26 @@ static inline void zend_handle_numeric_op(znode *node) /* {{{ */
}
/* }}} */
static inline void zend_handle_numeric_dim(zend_op *opline, znode *dim_node) /* {{{ */
{
if (Z_TYPE(dim_node->u.constant) == IS_STRING) {
zend_ulong index;
if (ZEND_HANDLE_NUMERIC(Z_STR(dim_node->u.constant), index)) {
/* For numeric indexs we also keep the original value to use by ArrayAccess
* See bug #63217
*/
int c = zend_add_literal(CG(active_op_array), &dim_node->u.constant);
ZEND_ASSERT(opline->op2.constant + 1 == c);
ZVAL_LONG(CT_CONSTANT(opline->op2), index);
Z_EXTRA_P(CT_CONSTANT(opline->op2)) = ZEND_EXTRA_VALUE;
return;
}
}
Z_EXTRA_P(CT_CONSTANT(opline->op2)) = 0;
}
/* }}} */
static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /* {{{ */
{
if (class_node->op_type == IS_CONST) {
@@ -2445,46 +2460,6 @@ static inline void zend_set_class_name_op1(zend_op *opline, znode *class_node) /
}
/* }}} */
static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int throw_exception) /* {{{ */
{
zend_op *opline;
znode name_node;
zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
zend_string *name;
uint32_t fetch_type;
if (Z_TYPE(name_node.u.constant) != IS_STRING) {
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
}
name = Z_STR(name_node.u.constant);
fetch_type = zend_get_class_fetch_type(name);
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
opline->op1.num = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
if (fetch_type == ZEND_FETCH_CLASS_DEFAULT) {
uint32_t type = name_ast->kind == ZEND_AST_ZVAL ? name_ast->attr : ZEND_NAME_FQ;
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
zend_resolve_class_name(name, type));
opline->extended_value = zend_alloc_cache_slot();
} else {
zend_ensure_valid_class_fetch_type(fetch_type);
}
zend_string_release_ex(name, 0);
} else {
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, &name_node);
opline->op1.num = ZEND_FETCH_CLASS_DEFAULT | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
}
return opline;
}
/* }}} */
static void zend_compile_class_ref_ex(znode *result, zend_ast *name_ast, uint32_t fetch_flags) /* {{{ */
{
uint32_t fetch_type;
@@ -2596,7 +2571,7 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, zend_ast *ast, uint
opline->extended_value = ZEND_FETCH_LOCAL;
}
zend_adjust_for_fetch_type(opline, type);
zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
@@ -2615,7 +2590,11 @@ static zend_bool is_this_fetch(zend_ast *ast) /* {{{ */
static void zend_compile_simple_var(znode *result, zend_ast *ast, uint32_t type, int delayed) /* {{{ */
{
if (is_this_fetch(ast)) {
zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
zend_op *opline = zend_emit_op(result, ZEND_FETCH_THIS, NULL, NULL);
if ((type == BP_VAR_R) || (type == BP_VAR_IS)) {
opline->result_type = IS_TMP_VAR;
result->op_type = IS_TMP_VAR;
}
} else if (zend_try_compile_cv(result, ast) == FAILURE) {
zend_compile_simple_var_no_cv(result, ast, type, delayed);
}
@@ -2670,11 +2649,14 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t
dim_node.op_type = IS_UNUSED;
} else {
zend_compile_expr(&dim_node, dim_ast);
zend_handle_numeric_op(&dim_node);
}
opline = zend_delayed_emit_op(result, ZEND_FETCH_DIM_R, &var_node, &dim_node);
zend_adjust_for_fetch_type(opline, type);
zend_adjust_for_fetch_type(opline, result, type);
if (dim_node.op_type == IS_CONST) {
zend_handle_numeric_dim(opline, &dim_node);
}
return opline;
}
/* }}} */
@@ -2709,7 +2691,7 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
opline->extended_value = zend_alloc_polymorphic_cache_slot();
}
zend_adjust_for_fetch_type(opline, type);
zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
@@ -2754,7 +2736,7 @@ zend_op *zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, i
SET_NODE(opline->op2, &class_node);
}
zend_adjust_for_fetch_type(opline, type);
zend_adjust_for_fetch_type(opline, result, type);
return opline;
}
/* }}} */
@@ -2814,6 +2796,7 @@ static void zend_compile_list_assign(
zend_ast *elem_ast = list->child[i];
zend_ast *var_ast, *key_ast;
znode fetch_result, dim_node;
zend_op *opline;
if (elem_ast == NULL) {
if (is_keyed) {
@@ -2851,8 +2834,12 @@ static void zend_compile_list_assign(
zend_verify_list_assign_target(var_ast, old_style);
zend_emit_op(&fetch_result,
elem_ast->attr ? ZEND_FETCH_LIST_W : ZEND_FETCH_LIST_R, expr_node, &dim_node);
opline = zend_emit_op(&fetch_result,
elem_ast->attr ? (expr_node->op_type == IS_CV ? ZEND_FETCH_DIM_W : ZEND_FETCH_LIST_W) : ZEND_FETCH_LIST_R, expr_node, &dim_node);
if (dim_node.op_type == IS_CONST) {
zend_handle_numeric_dim(opline, &dim_node);
}
if (var_ast->kind == ZEND_AST_ARRAY) {
if (elem_ast->attr) {
@@ -3214,7 +3201,7 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */
opcode = ZEND_SEND_REF;
} else {
zend_compile_var(&arg_node, arg, BP_VAR_R);
opcode = ZEND_SEND_VAR;
opcode = (arg_node.op_type == IS_TMP_VAR) ? ZEND_SEND_VAL : ZEND_SEND_VAR;
}
} else {
do {
@@ -3419,7 +3406,7 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */
if (arg_node.op_type == IS_CONST && Z_TYPE(arg_node.u.constant) == IS_STRING) {
result->op_type = IS_CONST;
ZVAL_LONG(&result->u.constant, Z_STRLEN(arg_node.u.constant));
zval_dtor(&arg_node.u.constant);
zval_ptr_dtor_str(&arg_node.u.constant);
} else {
zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL);
}
@@ -4260,7 +4247,7 @@ void zend_compile_global_var(zend_ast *ast) /* {{{ */
}
/* }}} */
static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_bool by_ref) /* {{{ */
static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, uint32_t by_ref) /* {{{ */
{
znode var_node;
zend_op *opline;
@@ -4287,7 +4274,7 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
}
CG(active_op_array)->static_variables = zend_array_dup(CG(active_op_array)->static_variables);
}
zend_hash_update(CG(active_op_array)->static_variables, var_name, value);
value = zend_hash_update(CG(active_op_array)->static_variables, var_name, value);
if (zend_string_equals_literal(var_name, "this")) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as static variable");
@@ -4296,7 +4283,7 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
opline = zend_emit_op(NULL, ZEND_BIND_STATIC, NULL, &var_node);
opline->op1_type = IS_CV;
opline->op1.var = lookup_cv(CG(active_op_array), var_name);
opline->extended_value = by_ref;
opline->extended_value = (uint32_t)((char*)value - (char*)CG(active_op_array)->static_variables->arData) | by_ref;
}
/* }}} */
@@ -4312,7 +4299,7 @@ void zend_compile_static_var(zend_ast *ast) /* {{{ */
ZVAL_NULL(&value_zv);
}
zend_compile_static_var_common(var_ast, &value_zv, 1);
zend_compile_static_var_common(var_ast, &value_zv, ZEND_BIND_REF);
}
/* }}} */
@@ -4530,13 +4517,13 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
if (depth_ast) {
zval *depth_zv;
if (depth_ast->kind != ZEND_AST_ZVAL) {
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand "
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-integer operand "
"is no longer supported", ast->kind == ZEND_AST_BREAK ? "break" : "continue");
}
depth_zv = zend_ast_get_zval(depth_ast);
if (Z_TYPE_P(depth_zv) != IS_LONG || Z_LVAL_P(depth_zv) < 1) {
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers",
zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive integers",
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
}
@@ -4555,6 +4542,29 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
depth, depth == 1 ? "" : "s");
}
}
if (ast->kind == ZEND_AST_CONTINUE) {
int d, cur = CG(context).current_brk_cont;
for (d = depth - 1; d > 0; d--) {
cur = CG(context).brk_cont_array[cur].parent;
ZEND_ASSERT(cur != -1);
}
if (CG(context).brk_cont_array[cur].is_switch) {
if (depth == 1) {
zend_error(E_WARNING,
"\"continue\" targeting switch is equivalent to \"break\". " \
"Did you mean to use \"continue %d\"?",
depth + 1);
} else {
zend_error(E_WARNING,
"\"continue %d\" targeting switch is equivalent to \"break %d\". " \
"Did you mean to use \"continue %d\"?",
depth, depth, depth + 1);
}
}
}
opline = zend_emit_op(NULL, ast->kind == ZEND_AST_BREAK ? ZEND_BRK : ZEND_CONT, NULL, NULL);
opline->op1.num = CG(context).current_brk_cont;
opline->op2.num = depth;
@@ -4578,7 +4588,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
}
zval_dtor(label);
zval_ptr_dtor_str(label);
ZVAL_NULL(label);
current = opline->extended_value;
@@ -4667,7 +4677,7 @@ void zend_compile_while(zend_ast *ast) /* {{{ */
opnum_jmp = zend_emit_jump(0);
zend_begin_loop(ZEND_NOP, NULL);
zend_begin_loop(ZEND_NOP, NULL, 0);
opnum_start = get_next_op_number(CG(active_op_array));
zend_compile_stmt(stmt_ast);
@@ -4690,7 +4700,7 @@ void zend_compile_do_while(zend_ast *ast) /* {{{ */
znode cond_node;
uint32_t opnum_start, opnum_cond;
zend_begin_loop(ZEND_NOP, NULL);
zend_begin_loop(ZEND_NOP, NULL, 0);
opnum_start = get_next_op_number(CG(active_op_array));
zend_compile_stmt(stmt_ast);
@@ -4741,7 +4751,7 @@ void zend_compile_for(zend_ast *ast) /* {{{ */
opnum_jmp = zend_emit_jump(0);
zend_begin_loop(ZEND_NOP, NULL);
zend_begin_loop(ZEND_NOP, NULL, 0);
opnum_start = get_next_op_number(CG(active_op_array));
zend_compile_stmt(stmt_ast);
@@ -4804,7 +4814,7 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
opnum_reset = get_next_op_number(CG(active_op_array));
opline = zend_emit_op(&reset_node, by_ref ? ZEND_FE_RESET_RW : ZEND_FE_RESET_R, &expr_node, NULL);
zend_begin_loop(ZEND_FE_FREE, &reset_node);
zend_begin_loop(ZEND_FE_FREE, &reset_node, 0);
opnum_fetch = get_next_op_number(CG(active_op_array));
opline = zend_emit_op(NULL, by_ref ? ZEND_FE_FETCH_RW : ZEND_FE_FETCH_R, &reset_node, NULL);
@@ -4959,7 +4969,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
zend_compile_expr(&expr_node, expr_ast);
zend_begin_loop(ZEND_FREE, &expr_node);
zend_begin_loop(ZEND_FREE, &expr_node, 1);
case_node.op_type = IS_TMP_VAR;
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
@@ -5071,7 +5081,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, &expr_node);
} else if (expr_node.op_type == IS_CONST) {
zval_dtor(&expr_node.u.constant);
zval_ptr_dtor_nogc(&expr_node.u.constant);
}
efree(jmpnz_opnums);
@@ -5347,7 +5357,7 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
zval value_zv;
zend_const_expr_to_zval(&value_zv, value_ast);
FC(declarables).ticks = zval_get_long(&value_zv);
zval_dtor(&value_zv);
zval_ptr_dtor_nogc(&value_zv);
} else if (zend_string_equals_literal_ci(name, "encoding")) {
if (FAILURE == zend_declare_is_first_statement(ast)) {
@@ -5662,16 +5672,32 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
}
/* }}} */
static void zend_compile_closure_binding(znode *closure, zend_ast *uses_ast) /* {{{ */
static void zend_compile_closure_binding(znode *closure, zend_op_array *op_array, zend_ast *uses_ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(uses_ast);
uint32_t i;
if (!list->children) {
return;
}
if (!op_array->static_variables) {
op_array->static_variables = zend_new_array(8);
}
if (GC_REFCOUNT(op_array->static_variables) > 1) {
if (!(GC_FLAGS(op_array->static_variables) & IS_ARRAY_IMMUTABLE)) {
GC_DELREF(op_array->static_variables);
}
op_array->static_variables = zend_array_dup(op_array->static_variables);
}
for (i = 0; i < list->children; ++i) {
zend_ast *var_name_ast = list->child[i];
zend_string *var_name = zval_make_interned_string(zend_ast_get_zval(var_name_ast));
zend_bool by_ref = var_name_ast->attr;
uint32_t by_ref = var_name_ast->attr;
zend_op *opline;
zval *value;
if (zend_string_equals_literal(var_name, "this")) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable");
@@ -5681,10 +5707,16 @@ static void zend_compile_closure_binding(znode *closure, zend_ast *uses_ast) /*
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use auto-global as lexical variable");
}
value = zend_hash_add(op_array->static_variables, var_name, &EG(uninitialized_zval));
if (!value) {
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot use variable $%s twice", ZSTR_VAL(var_name));
}
opline = zend_emit_op(NULL, ZEND_BIND_LEXICAL, closure, NULL);
opline->op2_type = IS_CV;
opline->op2.var = lookup_cv(CG(active_op_array), var_name);
opline->extended_value = by_ref;
opline->extended_value = (uint32_t)((char*)value - (char*)op_array->static_variables->arData) | by_ref;
}
}
/* }}} */
@@ -5698,16 +5730,10 @@ void zend_compile_closure_uses(zend_ast *ast) /* {{{ */
for (i = 0; i < list->children; ++i) {
zend_ast *var_ast = list->child[i];
zend_string *var_name = zend_ast_get_str(var_ast);
zend_bool by_ref = var_ast->attr;
uint32_t by_ref = var_ast->attr;
zval zv;
ZVAL_NULL(&zv);
if (op_array->static_variables
&& zend_hash_exists(op_array->static_variables, var_name)) {
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot use variable $%s twice", ZSTR_VAL(var_name));
}
{
int i;
for (i = 0; i < op_array->last_var; i++) {
@@ -5770,7 +5796,9 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
}
if (in_interface) {
if (zend_string_equals_literal(lcname, ZEND_CALL_FUNC_NAME)) {
if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') {
/* pass */
} else if (zend_string_equals_literal(lcname, ZEND_CALL_FUNC_NAME)) {
if (!is_public || is_static) {
zend_error(E_WARNING, "The magic method __call() must have "
"public visibility and cannot be static");
@@ -5821,6 +5849,10 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
if (!ce->constructor) {
ce->constructor = (zend_function *) op_array;
}
} else if (ZSTR_VAL(lcname)[0] != '_' || ZSTR_VAL(lcname)[1] != '_') {
if (!is_static) {
op_array->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
} else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
ce->constructor = (zend_function *) op_array;
} else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) {
@@ -5921,6 +5953,12 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
zend_error(E_DEPRECATED, "__autoload() is deprecated, use spl_autoload_register() instead");
}
if (zend_string_equals_literal_ci(unqualified_name, "assert")) {
zend_error(E_DEPRECATED,
"Defining a custom assert() function is deprecated, "
"as the function has special semantics");
}
key = zend_build_runtime_definition_key(lcname, decl->lex_pos);
zend_hash_update_ptr(CG(function_table), key, op_array);
zend_register_seen_symbol(lcname, ZEND_SYMBOL_FUNCTION);
@@ -5974,7 +6012,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast) /* {{{ */
} else {
zend_begin_func_decl(result, op_array, decl);
if (uses_ast) {
zend_compile_closure_binding(result, uses_ast);
zend_compile_closure_binding(result, op_array, uses_ast);
}
}
@@ -6113,13 +6151,11 @@ void zend_compile_class_const_decl(zend_ast *ast) /* {{{ */
}
/* }}} */
static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast) /* {{{ */
static void zend_compile_method_ref(zend_ast *ast, zend_trait_method_reference *method_ref) /* {{{ */
{
zend_ast *class_ast = ast->child[0];
zend_ast *method_ast = ast->child[1];
zend_trait_method_reference *method_ref = emalloc(sizeof(zend_trait_method_reference));
method_ref->ce = NULL;
method_ref->method_name = zend_string_copy(zend_ast_get_str(method_ast));
if (class_ast) {
@@ -6127,25 +6163,6 @@ static zend_trait_method_reference *zend_compile_method_ref(zend_ast *ast) /* {{
} else {
method_ref->class_name = NULL;
}
return method_ref;
}
/* }}} */
static zend_string **zend_compile_name_list(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_string **names = safe_emalloc(sizeof(zend_string *), list->children + 1, 0);
uint32_t i;
for (i = 0; i < list->children; ++i) {
zend_ast *name_ast = list->child[i];
names[i] = zend_resolve_class_name_ast(name_ast);
}
names[list->children] = NULL;
return names;
}
/* }}} */
@@ -6153,11 +6170,17 @@ static void zend_compile_trait_precedence(zend_ast *ast) /* {{{ */
{
zend_ast *method_ref_ast = ast->child[0];
zend_ast *insteadof_ast = ast->child[1];
zend_ast_list *insteadof_list = zend_ast_get_list(insteadof_ast);
uint32_t i;
zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence));
precedence->trait_method = zend_compile_method_ref(method_ref_ast);
precedence->exclude_from_classes
= (void *) zend_compile_name_list(insteadof_ast);
zend_trait_precedence *precedence = emalloc(sizeof(zend_trait_precedence) + (insteadof_list->children - 1) * sizeof(zend_string*));
zend_compile_method_ref(method_ref_ast, &precedence->trait_method);
precedence->num_excludes = insteadof_list->children;
for (i = 0; i < insteadof_list->children; ++i) {
zend_ast *name_ast = insteadof_list->child[i];
precedence->exclude_class_names[i] = zend_resolve_class_name_ast(name_ast);
}
zend_add_to_list(&CG(active_class_entry)->trait_precedences, precedence);
}
@@ -6180,7 +6203,7 @@ static void zend_compile_trait_alias(zend_ast *ast) /* {{{ */
}
alias = emalloc(sizeof(zend_trait_alias));
alias->trait_method = zend_compile_method_ref(method_ref_ast);
zend_compile_method_ref(method_ref_ast, &alias->trait_method);
alias->modifiers = modifiers;
if (alias_ast) {
@@ -6225,7 +6248,6 @@ void zend_compile_use_trait(zend_ast *ast) /* {{{ */
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
zend_resolve_class_name_ast(trait_ast));
opline->extended_value = zend_alloc_cache_slot();
ce->num_traits++;
}
@@ -6268,7 +6290,6 @@ void zend_compile_implements(znode *class_node, zend_ast *ast) /* {{{ */
opline->op2_type = IS_CONST;
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
zend_resolve_class_name_ast(class_ast));
opline->extended_value = zend_alloc_cache_slot();
CG(active_class_entry)->num_interfaces++;
}
@@ -6298,7 +6319,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
zend_string *name, *lcname;
zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
zend_op *opline;
znode declare_node, extends_node;
znode declare_node;
int extends_const;
zend_class_entry *original_ce = CG(active_class_entry);
znode original_implementing_class = FC(implementing_class);
@@ -6351,13 +6373,24 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
}
if (extends_ast) {
znode extends_node;
zend_string *extends_name;
if (!zend_is_const_default_class_ref(extends_ast)) {
zend_string *extends_name = zend_ast_get_str(extends_ast);
extends_name = zend_ast_get_str(extends_ast);
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot use '%s' as class name as it is reserved", ZSTR_VAL(extends_name));
}
zend_compile_class_ref(&extends_node, extends_ast, 1);
zend_compile_expr(&extends_node, extends_ast);
if (extends_node.op_type != IS_CONST || Z_TYPE(extends_node.u.constant) != IS_STRING) {
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
}
extends_name = Z_STR(extends_node.u.constant);
extends_const = zend_add_class_name_literal(CG(active_op_array),
zend_resolve_class_name(extends_name,
extends_ast->kind == ZEND_AST_ZVAL ? extends_ast->attr : ZEND_NAME_FQ));
zend_string_release_ex(extends_name, 0);
ce->ce_flags |= ZEND_ACC_INHERITED;
}
@@ -6372,7 +6405,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
if (decl->flags & ZEND_ACC_ANON_CLASS) {
if (extends_ast) {
opline->opcode = ZEND_DECLARE_ANON_INHERITED_CLASS;
SET_NODE(opline->op2, &extends_node);
opline->op2_type = IS_CONST;
opline->op2.constant = extends_const;
} else {
opline->opcode = ZEND_DECLARE_ANON_CLASS;
}
@@ -6391,7 +6425,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
if (extends_ast) {
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
SET_NODE(opline->op2, &extends_node);
opline->op2_type = IS_CONST;
opline->op2.constant = extends_const;
} else {
opline->opcode = ZEND_DECLARE_CLASS;
}
+138 -107
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_COMPILE_H
#define ZEND_COMPILE_H
@@ -158,6 +156,7 @@ typedef struct _zend_brk_cont_element {
int cont;
int brk;
int parent;
zend_bool is_switch;
} zend_brk_cont_element;
typedef struct _zend_label {
@@ -198,115 +197,143 @@ typedef struct _zend_oparray_context {
HashTable *labels;
} zend_oparray_context;
/*
* Function and method flags
*
* Free flags:
* 0x10
* 0x20
* 0x2000000
*/
/* Class, property and method flags class|meth.|prop.|const*/
/* | | | */
/* Common flags | | | */
/* ============ | | | */
/* | | | */
/* Staic method or property | | | */
#define ZEND_ACC_STATIC (1 << 0) /* | X | X | */
/* | | | */
/* Final class or method | | | */
#define ZEND_ACC_FINAL (1 << 2) /* X | X | | */
/* | | | */
/* Visibility flags (public < protected < private) | | | */
#define ZEND_ACC_PUBLIC (1 << 8) /* | X | X | X */
#define ZEND_ACC_PROTECTED (1 << 9) /* | X | X | X */
#define ZEND_ACC_PRIVATE (1 << 10) /* | X | X | X */
/* | | | */
/* TODO: explain the name ??? | | | */
#define ZEND_ACC_CHANGED (1 << 11) /* | X | X | */
/* | | | */
/* TODO: used only by ext/reflection ??? | | | */
#define ZEND_ACC_IMPLICIT_PUBLIC (1 << 12) /* | ? | ? | ? */
/* | | | */
/* Shadow of parent's private method/property | | | */
#define ZEND_ACC_SHADOW (1 << 17) /* | ? | X | */
/* | | | */
/* Class Flags (unused: 0, 1, 3, 11-18, 21, 25...) | | | */
/* =========== | | | */
/* | | | */
/* class is abstarct, since it is set by any | | | */
/* abstract method | | | */
#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS (1 << 4) /* X | | | */
/* | | | */
/* Class is explicitly defined as abstract by using | | | */
/* the keyword. | | | */
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS (1 << 5) /* X | | | */
/* | | | */
/* Special class types | | | */
#define ZEND_ACC_INTERFACE (1 << 6) /* X | | | */
#define ZEND_ACC_TRAIT (1 << 7) /* X | | | */
#define ZEND_ACC_ANON_CLASS (1 << 8) /* X | | | */
/* | | | */
/* Bound anonymous class | | | */
#define ZEND_ACC_ANON_BOUND (1 << 9) /* X | | | */
/* | | | */
/* Class extends another class | | | */
#define ZEND_ACC_INHERITED (1 << 10) /* X | | | */
/* | | | */
/* Class implements interface(s) | | | */
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 19) /* X | | | */
/* | | | */
/* Class constants updated | | | */
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 20) /* X | | | */
/* | | | */
/* Class uses trait(s) | | | */
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 22) /* X | | | */
/* | | | */
/* User class has methods with static variables | | | */
#define ZEND_HAS_STATIC_IN_METHODS (1 << 23) /* X | | | */
/* | | | */
/* Class has magic methods __get/__set/__unset/ | | | */
/* __isset that use guards | | | */
#define ZEND_ACC_USE_GUARDS (1 << 24) /* X | | | */
/* | | | */
/* Function Flags (unused: 4, 5, 17?) | | | */
/* ============== | | | */
/* | | | */
/* Abstarct method | | | */
#define ZEND_ACC_ABSTRACT (1 << 1) /* | X | | */
/* | | | */
/* TODO: used only during inheritance ??? | | | */
#define ZEND_ACC_IMPLEMENTED_ABSTRACT (1 << 3) /* | X | | */
/* | | | */
#define ZEND_ACC_FAKE_CLOSURE (1 << 6) /* | X | | */
/* | | | */
/* method flag used by Closure::__invoke() | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 7) /* | X | | */
/* | | | */
/* method flags (special method detection) | | | */
#define ZEND_ACC_CTOR (1 << 13) /* | X | | */
#define ZEND_ACC_DTOR (1 << 14) /* | X | | */
/* | | | */
/* "main" op_array with | | | */
/* ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes | | | */
#define ZEND_ACC_EARLY_BINDING (1 << 15) /* | X | | */
/* | | | */
/* method flag (bc only), any method that has this | | | */
/* flag can be used statically and non statically. | | | */
#define ZEND_ACC_ALLOW_STATIC (1 << 16) /* | X | | */
/* | | | */
/* deprecation flag | | | */
#define ZEND_ACC_DEPRECATED (1 << 18) /* | X | | */
/* | | | */
#define ZEND_ACC_NO_RT_ARENA (1 << 19) /* | X | | */
/* | | | */
#define ZEND_ACC_CLOSURE (1 << 20) /* | X | | */
/* | | | */
/* call through user function trampoline. e.g. | | | */
/* __call, __callstatic | | | */
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 21) /* | X | | */
/* | | | */
/* disable inline caching | | | */
#define ZEND_ACC_NEVER_CACHE (1 << 22) /* | X | | */
/* | | | */
#define ZEND_ACC_GENERATOR (1 << 23) /* | X | | */
/* | | | */
/* Function with varable number of arguments | | | */
#define ZEND_ACC_VARIADIC (1 << 24) /* | X | | */
/* | | | */
/* Immutable op_array (lazy loading) | | | */
#define ZEND_ACC_IMMUTABLE (1 << 25) /* | X | | */
/* | | | */
/* Function returning by reference | | | */
#define ZEND_ACC_RETURN_REFERENCE (1 << 26) /* | X | | */
/* | | | */
#define ZEND_ACC_DONE_PASS_TWO (1 << 27) /* | X | | */
/* | | | */
/* Function has typed arguments | | | */
#define ZEND_ACC_HAS_TYPE_HINTS (1 << 28) /* | X | | */
/* | | | */
/* op_array has finally blocks (user only) | | | */
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 29) /* | X | | */
/* | | | */
/* internal function is allocated at arena (int only) | | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 29) /* | X | | */
/* | | | */
/* Function has a return type | | | */
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 30) /* | X | | */
/* | | | */
/* op_array uses strict mode types | | | */
#define ZEND_ACC_STRICT_TYPES (1 << 31) /* | X | | */
/* method flags (types) */
#define ZEND_ACC_STATIC 0x01
#define ZEND_ACC_ABSTRACT 0x02
#define ZEND_ACC_FINAL 0x04
#define ZEND_ACC_IMPLEMENTED_ABSTRACT 0x08
/* method flags (visibility) */
/* The order of those must be kept - public < protected < private */
#define ZEND_ACC_PUBLIC 0x100
#define ZEND_ACC_PROTECTED 0x200
#define ZEND_ACC_PRIVATE 0x400
#define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE)
#define ZEND_ACC_CHANGED 0x800
#define ZEND_ACC_IMPLICIT_PUBLIC 0x1000
/* method flags (special method detection) */
#define ZEND_ACC_CTOR 0x2000
#define ZEND_ACC_DTOR 0x4000
/* "main" op_array with ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes */
#define ZEND_ACC_EARLY_BINDING 0x8000
/* method flag used by Closure::__invoke() */
#define ZEND_ACC_USER_ARG_INFO 0x80
/* method flag (bc only), any method that has this flag can be used statically and non statically. */
#define ZEND_ACC_ALLOW_STATIC 0x10000
/* shadow of parent's private method/property */
#define ZEND_ACC_SHADOW 0x20000
/* deprecation flag */
#define ZEND_ACC_DEPRECATED 0x40000
#define ZEND_ACC_CLOSURE 0x100000
#define ZEND_ACC_FAKE_CLOSURE 0x40
#define ZEND_ACC_GENERATOR 0x800000
#define ZEND_ACC_NO_RT_ARENA 0x80000
/* call through user function trampoline. e.g. __call, __callstatic */
#define ZEND_ACC_CALL_VIA_TRAMPOLINE 0x200000
/* call through internal function handler. e.g. Closure::invoke() */
#define ZEND_ACC_CALL_VIA_HANDLER ZEND_ACC_CALL_VIA_TRAMPOLINE
/* disable inline caching */
#define ZEND_ACC_NEVER_CACHE 0x400000
#define ZEND_ACC_VARIADIC 0x1000000
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
/* class has magic methods __get/__set/__unset/__isset that use guards */
#define ZEND_ACC_USE_GUARDS 0x1000000
/* function has typed arguments */
#define ZEND_ACC_HAS_TYPE_HINTS 0x10000000
/* op_array has finally blocks */
#define ZEND_ACC_HAS_FINALLY_BLOCK 0x20000000
/* internal function is allocated at arena */
#define ZEND_ACC_ARENA_ALLOCATED 0x20000000
/* Function has a return type (or class has such non-private function) */
#define ZEND_ACC_HAS_RETURN_TYPE 0x40000000
/* op_array uses strict mode types */
#define ZEND_ACC_STRICT_TYPES 0x80000000
/*
* Class flags
*
* Classes also use the ZEND_ACC_FINAL (0x04) flag, otherwise there is no overlap.
*/
/* class flags (types) */
/* ZEND_ACC_IMPLICIT_ABSTRACT_CLASS is used for abstract classes (since it is set by any abstract method even interfaces MAY have it set, too). */
/* ZEND_ACC_EXPLICIT_ABSTRACT_CLASS denotes that a class was explicitly defined as abstract by using the keyword. */
#define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS 0x10
#define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS 0x20
#define ZEND_ACC_INTERFACE 0x40
#define ZEND_ACC_TRAIT 0x80
#define ZEND_ACC_ANON_CLASS 0x100
#define ZEND_ACC_ANON_BOUND 0x200
#define ZEND_ACC_INHERITED 0x400
/* class implement interface(s) flag */
#define ZEND_ACC_IMPLEMENT_INTERFACES 0x80000
#define ZEND_ACC_IMPLEMENT_TRAITS 0x400000
/* class constants updated */
#define ZEND_ACC_CONSTANTS_UPDATED 0x100000
/* user class has methods with static variables */
#define ZEND_HAS_STATIC_IN_METHODS 0x800000
char *zend_visibility_string(uint32_t fn_flags);
typedef struct _zend_property_info {
@@ -376,7 +403,7 @@ struct _zend_op_array {
int cache_size; /* number of run_time_cache_slots * sizeof(void*) */
int last_var; /* number of CV variables */
uint32_t T; /* numner of temporary variables */
uint32_t T; /* number of temporary variables */
uint32_t last; /* number of opcodes */
zend_op *opcodes;
@@ -676,6 +703,8 @@ struct _zend_execute_data {
#define IS_VAR (1<<2)
#define IS_CV (1<<3) /* Compiled variable */
#define ZEND_EXTRA_VALUE 1
#include "zend_globals.h"
BEGIN_EXTERN_C()
@@ -941,9 +970,11 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
#define ZEND_RETURN_VAL 0
#define ZEND_RETURN_REF 1
#define ZEND_BIND_VAL 0
#define ZEND_BIND_REF 1
#define ZEND_RETURNS_FUNCTION 1<<0
#define ZEND_RETURNS_VALUE 1<<1
#define ZEND_RETURNS_FUNCTION (1<<0)
#define ZEND_RETURNS_VALUE (1<<1)
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
#define ZEND_ARRAY_NOT_PACKED (1<<1)
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_CONFIG_NW_H
#define ZEND_CONFIG_NW_H
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_CONFIG_W32_H
#define ZEND_CONFIG_W32_H
+78 -71
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_constants.h"
#include "zend_exceptions.h"
@@ -39,14 +37,14 @@ void free_zend_constant(zval *zv)
{
zend_constant *c = Z_PTR_P(zv);
if (!(c->flags & CONST_PERSISTENT)) {
zval_ptr_dtor(&c->value);
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
zval_ptr_dtor_nogc(&c->value);
if (c->name) {
zend_string_release_ex(c->name, 0);
}
efree(c);
} else {
zval_internal_dtor(&c->value);
zval_internal_ptr_dtor(&c->value);
if (c->name) {
zend_string_release_ex(c->name, 1);
}
@@ -60,7 +58,7 @@ static void copy_zend_constant(zval *zv)
{
zend_constant *c = Z_PTR_P(zv);
ZEND_ASSERT(c->flags & CONST_PERSISTENT);
ZEND_ASSERT(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
Z_PTR_P(zv) = pemalloc(sizeof(zend_constant), 1);
memcpy(Z_PTR_P(zv), c, sizeof(zend_constant));
@@ -84,7 +82,7 @@ static int clean_module_constant(zval *el, void *arg)
zend_constant *c = (zend_constant *)Z_PTR_P(el);
int module_number = *(int *)arg;
if (c->module_number == module_number) {
if (ZEND_CONSTANT_MODULE_NUMBER(c) == module_number) {
return 1;
} else {
return 0;
@@ -153,9 +151,8 @@ ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int
zend_constant c;
ZVAL_NULL(&c.value);
c.flags = flags;
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c);
}
@@ -164,9 +161,8 @@ ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zen
zend_constant c;
ZVAL_BOOL(&c.value, bval);
c.flags = flags;
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c);
}
@@ -175,9 +171,8 @@ ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zen
zend_constant c;
ZVAL_LONG(&c.value, lval);
c.flags = flags;
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c);
}
@@ -187,9 +182,8 @@ ZEND_API void zend_register_double_constant(const char *name, size_t name_len, d
zend_constant c;
ZVAL_DOUBLE(&c.value, dval);
c.flags = flags;
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c);
}
@@ -199,9 +193,8 @@ ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len,
zend_constant c;
ZVAL_STR(&c.value, zend_string_init_interned(strval, strlen, flags & CONST_PERSISTENT));
c.flags = flags;
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c);
}
@@ -250,7 +243,7 @@ ZEND_API int zend_verify_const_access(zend_class_constant *c, zend_class_entry *
}
/* }}} */
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
static inline zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len)
{
zend_constant *c;
ALLOCA_FLAG(use_heap)
@@ -259,7 +252,7 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
char *lcname = do_alloca(name_len + 1, use_heap);
zend_str_tolower_copy(lcname, name, name_len);
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, name_len)) != NULL) {
if (c->flags & CONST_CS) {
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
c = NULL;
}
} else {
@@ -268,10 +261,16 @@ ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
free_alloca(lcname, use_heap);
}
return c;
}
ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len)
{
zend_constant *c = zend_get_constant_str_impl(name, name_len);
return c ? &c->value : NULL;
}
ZEND_API zval *zend_get_constant(zend_string *name)
static inline zend_constant *zend_get_constant_impl(zend_string *name)
{
zval *zv;
zend_constant *c;
@@ -284,16 +283,39 @@ ZEND_API zval *zend_get_constant(zend_string *name)
zv = zend_hash_str_find(EG(zend_constants), lcname, ZSTR_LEN(name));
if (zv != NULL) {
c = Z_PTR_P(zv);
if (c->flags & CONST_CS) {
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
c = NULL;
}
} else {
c = zend_get_special_constant(ZSTR_VAL(name), ZSTR_LEN(name));
}
free_alloca(lcname, use_heap);
return c ? &c->value : NULL;
return c;
} else {
return &((zend_constant*)Z_PTR_P(zv))->value;
return (zend_constant *) Z_PTR_P(zv);
}
}
ZEND_API zval *zend_get_constant(zend_string *name)
{
zend_constant *c = zend_get_constant_impl(name);
return c ? &c->value : NULL;
}
static zend_bool is_access_deprecated(const zend_constant *c, const char *access_name) {
const char *ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name));
if (ns_sep) {
/* Namespaces are always case-insensitive. Only compare shortname. */
size_t shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
size_t shortname_len = ZSTR_LEN(c->name) - shortname_offset;
return memcmp(
access_name + shortname_offset,
ZSTR_VAL(c->name) + shortname_offset,
shortname_len
) != 0;
} else {
/* No namespace, compare whole name */
return memcmp(access_name, ZSTR_VAL(c->name), ZSTR_LEN(c->name)) != 0;
}
}
@@ -409,70 +431,55 @@ failure:
/* try lowercase */
zend_str_tolower(lcname + prefix_len + 1, const_name_len);
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, lcname_len)) != NULL) {
if ((c->flags & CONST_CS) != 0) {
if ((ZEND_CONSTANT_FLAGS(c) & CONST_CS) != 0) {
c = NULL;
}
}
}
free_alloca(lcname, use_heap);
if (c) {
return &c->value;
if (!c) {
if (!(flags & IS_CONSTANT_UNQUALIFIED)) {
return NULL;
}
/* name requires runtime resolution, need to check non-namespaced name */
c = zend_get_constant_str_impl(constant_name, const_name_len);
name = constant_name;
}
/* name requires runtime resolution, need to check non-namespaced name */
if ((flags & IS_CONSTANT_UNQUALIFIED) != 0) {
return zend_get_constant_str(constant_name, const_name_len);
} else {
if (cname) {
c = zend_get_constant_impl(cname);
} else {
c = zend_get_constant_str_impl(name, name_len);
}
}
if (!c) {
return NULL;
}
if (cname) {
return zend_get_constant(cname);
} else {
return zend_get_constant_str(name, name_len);
}
}
ZEND_API zend_constant* ZEND_FASTCALL zend_quick_get_constant(const zval *key, uint32_t flags)
{
zval *zv;
zend_constant *c = NULL;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
c = (zend_constant*)Z_PTR_P(zv);
}
}
}
if (!(flags & ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK)) {
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST)) && is_access_deprecated(c, name)) {
zend_error(E_DEPRECATED,
"Case-insensitive constants are deprecated. "
"The correct casing for this constant is \"%s\"",
ZSTR_VAL(c->name));
}
}
return c;
return &c->value;
}
static void* zend_hash_add_constant(HashTable *ht, zend_string *key, zend_constant *c)
{
void *ret;
zend_constant *copy = pemalloc(sizeof(zend_constant), c->flags & CONST_PERSISTENT);
zend_constant *copy = pemalloc(sizeof(zend_constant), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
memcpy(copy, c, sizeof(zend_constant));
ret = zend_hash_add_ptr(ht, key, copy);
if (!ret) {
pefree(copy, c->flags & CONST_PERSISTENT);
pefree(copy, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
}
return ret;
}
@@ -487,14 +494,14 @@ ZEND_API int zend_register_constant(zend_constant *c)
printf("Registering constant for module %d\n", c->module_number);
#endif
if (!(c->flags & CONST_CS)) {
lowercase_name = zend_string_tolower_ex(c->name, c->flags & CONST_PERSISTENT);
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CS)) {
lowercase_name = zend_string_tolower_ex(c->name, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
lowercase_name = zend_new_interned_string(lowercase_name);
name = lowercase_name;
} else {
char *slash = strrchr(ZSTR_VAL(c->name), '\\');
if (slash) {
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT);
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name));
lowercase_name = zend_new_interned_string(lowercase_name);
name = lowercase_name;
@@ -513,8 +520,8 @@ ZEND_API int zend_register_constant(zend_constant *c)
}
zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name));
zend_string_release(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
zval_ptr_dtor_nogc(&c->value);
}
ret = FAILURE;
}
+15 -6
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_CONSTANTS_H
#define ZEND_CONSTANTS_H
@@ -29,15 +27,27 @@
#define CONST_CT_SUBST (1<<2) /* Allow compile-time substitution */
#define CONST_NO_FILE_CACHE (1<<3) /* Can't be saved in file cache */
#define PHP_USER_CONSTANT INT_MAX /* a constant defined in user space */
#define PHP_USER_CONSTANT 0x7fffff /* a constant defined in user space */
/* Flag for zend_get_constant_ex(). Must not class with ZEND_FETCH_CLASS_* flags. */
#define ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK 0x1000
typedef struct _zend_constant {
zval value;
zend_string *name;
int flags;
int module_number;
} zend_constant;
#define ZEND_CONSTANT_FLAGS(c) \
(Z_CONSTANT_FLAGS((c)->value) & 0xff)
#define ZEND_CONSTANT_MODULE_NUMBER(c) \
(Z_CONSTANT_FLAGS((c)->value) >> 8)
#define ZEND_CONSTANT_SET_FLAGS(c, _flags, _module_number) do { \
Z_CONSTANT_FLAGS((c)->value) = \
((_flags) & 0xff) | ((_module_number) << 8); \
} while (0)
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number)
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number)
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
@@ -79,7 +89,6 @@ ZEND_API int zend_register_constant(zend_constant *c);
#ifdef ZTS
void zend_copy_constants(HashTable *target, HashTable *sourc);
#endif
ZEND_API zend_constant* ZEND_FASTCALL zend_quick_get_constant(const zval *key, uint32_t flags);
END_EXTERN_C()
#define ZEND_CONSTANT_DTOR free_zend_constant
+3 -6
View File
@@ -29,14 +29,11 @@ typedef struct _zend_cpu_info {
static zend_cpu_info cpuinfo = {0};
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#include <cpuid.h>
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
__asm__ __volatile__ (
"cpuid"
: "=a"(cpuinfo->eax), "=b"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
: "a"(func), "c"(subfunc)
);
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);
}
#elif defined(ZEND_WIN32)
#elif defined(ZEND_WIN32) && !defined(__clang__)
# include <intrin.h>
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
int regs[4];
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_API.h"
#include "zend_builtin_functions.h"
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_ERRORS_H
#define ZEND_ERRORS_H
+2 -4
View File
@@ -19,8 +19,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_API.h"
#include "zend_builtin_functions.h"
@@ -325,7 +323,7 @@ ZEND_METHOD(exception, __wakeup)
CHECK_EXC_TYPE(ZEND_STR_TRACE, IS_ARRAY);
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
!instanceof_function(Z_OBJCE_P(pvalue), zend_ce_throwable) ||
pvalue == object)) {
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
}
@@ -984,7 +982,7 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
zend_string *str, *file = NULL;
zend_long line = 0;
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &tmp);
zend_call_method_with_0_params(&exception, ce_exception, &ex->ce->__tostring, "__tostring", &tmp);
if (!EG(exception)) {
if (Z_TYPE(tmp) != IS_STRING) {
zend_error(E_WARNING, "%s::__toString() must return a string", ZSTR_VAL(ce_exception->name));
-2
View File
@@ -19,8 +19,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_EXCEPTIONS_H
#define ZEND_EXCEPTIONS_H
+236 -86
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#define ZEND_INTENSIVE_DEBUGGING 0
#include <stdio.h>
@@ -146,7 +144,7 @@ ZEND_API const zend_internal_function zend_pass_function = {
if (EXPECTED(Z_TYPE_P(__zv) == IS_INDIRECT)) { \
ZVAL_COPY(__zv, Z_INDIRECT_P(__zv)); \
} \
zval_dtor_func(__ref); \
rc_dtor_func(__ref); \
} \
} \
} while (0)
@@ -262,7 +260,7 @@ static zend_never_inline ZEND_COLD void zval_undefined_cv(uint32_t var EXECUTE_D
}
}
static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type EXECUTE_DATA_DC)
{
switch (type) {
case BP_VAR_R:
@@ -282,52 +280,50 @@ static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int
return ptr;
}
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var EXECUTE_DATA_DC)
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var EXECUTE_DATA_DC)
{
zval_undefined_cv(var EXECUTE_DATA_CC);
return &EG(uninitialized_zval);
}
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var EXECUTE_DATA_DC)
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var EXECUTE_DATA_DC)
{
zval_undefined_cv(var EXECUTE_DATA_CC);
return &EG(uninitialized_zval);
}
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var EXECUTE_DATA_DC)
static zend_never_inline ZEND_COLD zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var EXECUTE_DATA_DC)
{
ZVAL_NULL(ptr);
zval_undefined_cv(var EXECUTE_DATA_CC);
return ptr;
}
static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var EXECUTE_DATA_DC)
{
ZVAL_NULL(ptr);
return ptr;
}
static zend_always_inline zval *_get_zval_ptr_cv(uint32_t var, int type EXECUTE_DATA_DC)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
if (type == BP_VAR_W) {
ZVAL_NULL(ret);
} else {
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
}
}
return ret;
}
static zend_always_inline zval *_get_zval_ptr_cv_undef(uint32_t var EXECUTE_DATA_DC)
{
return EX_VAR(var);
}
static zend_always_inline zval *_get_zval_ptr_cv_deref(uint32_t var, int type EXECUTE_DATA_DC)
{
zval *ret = EX_VAR(var);
if (UNEXPECTED(Z_TYPE_P(ret) == IS_UNDEF)) {
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
if (type == BP_VAR_W) {
ZVAL_NULL(ret);
return ret;
} else {
return _get_zval_cv_lookup(ret, var, type EXECUTE_DATA_CC);
}
}
ZVAL_DEREF(ret);
return ret;
@@ -416,32 +412,18 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(uint32_t var EXECUTE_D
zval *ret = EX_VAR(var);
if (Z_TYPE_P(ret) == IS_UNDEF) {
return _get_zval_cv_lookup_BP_VAR_W(ret, var EXECUTE_DATA_CC);
ZVAL_NULL(ret);
}
return ret;
}
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(uint32_t var EXECUTE_DATA_DC)
{
return EX_VAR(var);
}
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_RW(uint32_t var EXECUTE_DATA_DC)
{
return EX_VAR(var);
}
static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_UNSET(uint32_t var EXECUTE_DATA_DC)
{
return EX_VAR(var);
}
static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(uint32_t var EXECUTE_DATA_DC)
{
zval *ret = EX_VAR(var);
if (Z_TYPE_P(ret) == IS_UNDEF) {
return _get_zval_cv_lookup_BP_VAR_W(ret, var EXECUTE_DATA_CC);
ZVAL_NULL(ret);
return ret;
}
ZVAL_DEREF(ret);
return ret;
@@ -545,7 +527,7 @@ static zend_always_inline zval *_get_zval_ptr_undef(int op_type, znode_op node,
if (op_type == IS_CONST) {
return RT_CONSTANT(opline, node);
} else if (op_type == IS_CV) {
return _get_zval_ptr_cv_undef(node.var EXECUTE_DATA_CC);
return EX_VAR(node.var);
} else {
return NULL;
}
@@ -576,11 +558,6 @@ static inline zval *_get_zval_ptr_ptr(int op_type, znode_op node, zend_free_op *
}
}
static zend_always_inline zval *_get_obj_zval_ptr_unused(EXECUTE_DATA_D)
{
return &EX(This);
}
static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type == IS_UNUSED) {
@@ -625,7 +602,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
if (GC_DELREF(garbage) == 0) {
ZVAL_REF(variable_ptr, ref);
zval_dtor_func(garbage);
rc_dtor_func(garbage);
return;
} else {
gc_check_possible_root(garbage);
@@ -654,7 +631,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_assign
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
@@ -682,7 +659,7 @@ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object(zval *obje
} else {
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
}
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
}
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
@@ -716,7 +693,7 @@ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object_rw(zval *o
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
zend_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
}
return 0;
}
@@ -1075,9 +1052,12 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
zend_class_entry *ce = NULL;
void *dummy_cache_slot = NULL;
if (UNEXPECTED(ZEND_TYPE_CODE(ret_info->type) == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
return 0;
if (ZEND_TYPE_CODE(ret_info->type) == IS_VOID) {
if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
return 0;
}
return 1;
}
if (UNEXPECTED(!zend_check_type(ret_info->type, ret, &ce, &dummy_cache_slot, NULL, NULL, 1))) {
@@ -1175,7 +1155,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval *
}
zval_ptr_dtor(&res);
} else {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zend_use_object_as_array();
if (retval) {
ZVAL_NULL(retval);
}
@@ -1228,6 +1208,10 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(EXECUTE_DATA_D)
const zend_op *end;
uint32_t var;
if (UNEXPECTED(EG(exception) != NULL)) {
return;
}
switch (opline->opcode) {
case ZEND_ASSIGN_ADD:
case ZEND_ASSIGN_SUB:
@@ -1348,7 +1332,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(z
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
zend_error(E_NOTICE, "Trying to get property '%s' of non-object", ZSTR_VAL(property_name));
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(zval *property)
@@ -1356,7 +1340,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
zend_error(E_NOTICE, "Trying to unset property '%s' of non-object", ZSTR_VAL(property_name));
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(zval *property)
@@ -1364,7 +1348,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(
zend_string *tmp_property_name;
zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
zend_error(E_NOTICE, "Trying to check property '%s' of non-object", ZSTR_VAL(property_name));
zend_tmp_string_release(property_name);
zend_tmp_string_release(tmp_property_name);
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc)
@@ -1464,12 +1448,8 @@ static zend_never_inline void zend_post_incdec_overloaded_property(zval *object,
ZVAL_COPY_VALUE(z, value);
}
if (UNEXPECTED(Z_TYPE_P(z) == IS_REFERENCE)) {
ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(z));
} else {
ZVAL_COPY(EX_VAR(opline->result.var), z);
}
ZVAL_COPY(&z_copy, EX_VAR(opline->result.var));
ZVAL_COPY_DEREF(&z_copy, z);
ZVAL_COPY(EX_VAR(opline->result.var), &z_copy);
if (inc) {
increment_function(&z_copy);
} else {
@@ -1513,11 +1493,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
}
ZVAL_COPY_VALUE(z, value);
}
if (UNEXPECTED(Z_TYPE_P(z) == IS_REFERENCE)) {
ZVAL_COPY(&z_copy, Z_REFVAL_P(z));
} else {
ZVAL_COPY(&z_copy, z);
}
ZVAL_COPY_DEREF(&z_copy, z);
if (inc) {
increment_function(&z_copy);
} else {
@@ -1871,6 +1847,9 @@ fetch_from_array:
zend_use_object_as_array();
ZVAL_ERROR(result);
} else {
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
dim++;
}
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
if (UNEXPECTED(retval == &EG(uninitialized_zval))) {
@@ -1953,7 +1932,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
try_array:
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type EXECUTE_DATA_CC);
ZVAL_COPY(result, retval);
ZVAL_COPY_DEREF(result, retval);
return;
} else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
container = Z_REFVAL_P(container);
@@ -2028,12 +2007,17 @@ try_string_offset:
zend_use_object_as_array();
ZVAL_NULL(result);
} else {
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
dim++;
}
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result);
ZEND_ASSERT(result != NULL);
if (retval) {
if (result != retval) {
ZVAL_COPY(result, retval);
ZVAL_COPY_DEREF(result, retval);
} else if (UNEXPECTED(Z_ISREF_P(retval))) {
zend_unwrap_reference(result);
}
} else {
ZVAL_NULL(result);
@@ -2068,16 +2052,10 @@ static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_IS
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS, 1, 0 EXECUTE_DATA_CC);
}
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_w(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC)
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC)
{
zval *result = EX_VAR(opline->result.var);
zend_fetch_dimension_address(result, container, dim, IS_TMP_VAR, BP_VAR_W EXECUTE_DATA_CC);
}
static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC)
{
zval *result = EX_VAR(opline->result.var);
zend_fetch_dimension_address_read(result, container, dim, IS_TMP_VAR, BP_VAR_R, 0, 0 EXECUTE_DATA_CC);
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R, 0, 0 EXECUTE_DATA_CC);
}
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type)
@@ -2125,7 +2103,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isset_dim_slow(zval *container,
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
zend_use_object_as_array();
return 0;
}
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */
@@ -2170,7 +2148,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isempty_dim_slow(zval *container
if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1);
} else {
zend_error(E_NOTICE, "Trying to check element of non-array");
zend_use_object_as_array();
return 1;
}
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */
@@ -2372,7 +2350,7 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
zend_refcounted *r = Z_COUNTED_P(cv);
if (!GC_DELREF(r)) {
ZVAL_NULL(cv);
zval_dtor_func(r);
rc_dtor_func(r);
} else {
gc_check_possible_root(r);
}
@@ -2529,6 +2507,64 @@ static zend_never_inline void ZEND_FASTCALL init_func_run_time_cache(zend_op_arr
}
/* }}} */
static zend_always_inline zend_function* ZEND_FASTCALL init_func_run_time_cache_i(zval *zv) /* {{{ */
{
zend_op_array *op_array = Z_PTR_P(zv);
ZEND_ASSERT(op_array->run_time_cache == NULL);
if (op_array->fn_flags & ZEND_ACC_IMMUTABLE) {
zend_op_array *new_op_array = zend_arena_alloc(&CG(arena), sizeof(zend_op_array) + op_array->cache_size);
Z_PTR_P(zv) = new_op_array;
memcpy(new_op_array, op_array, sizeof(zend_op_array));
new_op_array->fn_flags &= ~ZEND_ACC_IMMUTABLE;
new_op_array->run_time_cache = (void**)(new_op_array + 1);
memset(new_op_array->run_time_cache, 0, new_op_array->cache_size);
return (zend_function*)new_op_array;
} else {
op_array->run_time_cache = zend_arena_alloc(&CG(arena), op_array->cache_size);
memset(op_array->run_time_cache, 0, op_array->cache_size);
return (zend_function*)op_array;
}
}
/* }}} */
static zend_never_inline zend_function* init_func_run_time_cache_ex(zval *zv) /* {{{ */
{
return init_func_run_time_cache_i(zv);
}
/* }}} */
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name) /* {{{ */
{
zval *zv = zend_hash_find(EG(function_table), name);
if (EXPECTED(zv != NULL)) {
zend_function *fbc = Z_FUNC_P(zv);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
fbc = (zend_function*)init_func_run_time_cache_i(zv);
}
return fbc;
}
return NULL;
} /* }}} */
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len) /* {{{ */
{
zval *zv = zend_hash_str_find(EG(function_table), name, len);
if (EXPECTED(zv != NULL)) {
zend_function *fbc = Z_FUNC_P(zv);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
fbc = (zend_function*)init_func_run_time_cache_i(zv);
}
return fbc;
}
return NULL;
} /* }}} */
static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value) /* {{{ */
{
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
@@ -2561,8 +2597,7 @@ ZEND_API void zend_init_func_execute_data(zend_execute_data *ex, zend_op_array *
EX(prev_execute_data) = EG(current_execute_data);
if (!op_array->run_time_cache) {
op_array->run_time_cache = zend_arena_alloc(&CG(arena), op_array->cache_size);
memset(op_array->run_time_cache, 0, op_array->cache_size);
init_func_run_time_cache(op_array);
}
i_init_func_execute_data(op_array, return_value, 1 EXECUTE_DATA_CC);
@@ -2922,6 +2957,9 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_s
return NULL;
}
}
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
init_func_run_time_cache(&fbc->op_array);
}
} else {
if (ZSTR_VAL(function)[0] == '\\') {
lcname = zend_string_alloc(ZSTR_LEN(function) - 1, 0);
@@ -2937,13 +2975,12 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_s
zend_string_release_ex(lcname, 0);
fbc = Z_FUNC_P(func);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
fbc = init_func_run_time_cache_ex(func);
}
called_scope = NULL;
}
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
init_func_run_time_cache(&fbc->op_array);
}
return zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC,
fbc, num_args, called_scope, NULL);
}
@@ -3116,7 +3153,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
zend_destroy_file_handle(&file_handle);
zend_string_release_ex(resolved_path, 0);
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
zend_string_release_ex(Z_STR(tmp_inc_filename), 0);
zval_ptr_dtor_str(&tmp_inc_filename);
}
return op_array;
} else {
@@ -3154,7 +3191,7 @@ already_compiled:
}
if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
zend_string_release_ex(Z_STR(tmp_inc_filename), 0);
zval_ptr_dtor_str(&tmp_inc_filename);
}
return new_op_array;
}
@@ -3240,6 +3277,119 @@ static zend_never_inline zend_bool ZEND_FASTCALL zend_fe_reset_iterator(zval *ar
}
/* }}} */
static zend_always_inline int _zend_quick_get_constant(
const zval *key, uint32_t flags, int check_defined_only OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
{
zval *zv;
const zval *orig_key = key;
zend_constant *c = NULL;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv) {
c = (zend_constant*)Z_PTR_P(zv);
} else {
key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
c = (zend_constant*)Z_PTR_P(zv);
}
}
}
}
}
if (!c) {
if (!check_defined_only) {
if ((opline->op1.num & IS_CONSTANT_UNQUALIFIED) != 0) {
char *actual = (char *)zend_memrchr(Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)), '\\', Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)));
if (!actual) {
ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
} else {
actual++;
ZVAL_STRINGL(EX_VAR(opline->result.var),
actual, Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)) - (actual - Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))));
}
/* non-qualified constant - allow text substitution */
zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
} else {
zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
}
}
return FAILURE;
}
if (!check_defined_only) {
ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value);
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST))) {
const char *ns_sep;
size_t shortname_offset;
size_t shortname_len;
zend_bool is_deprecated;
if (flags & IS_CONSTANT_UNQUALIFIED) {
const zval *access_key;
if (!(flags & IS_CONSTANT_IN_NAMESPACE)) {
access_key = orig_key - 1;
} else {
if (key < orig_key + 2) {
goto check_short_name;
} else {
access_key = orig_key + 2;
}
}
is_deprecated = !zend_string_equals(c->name, Z_STR_P(access_key));
} else {
check_short_name:
ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name));
ZEND_ASSERT(ns_sep);
/* Namespaces are always case-insensitive. Only compare shortname. */
shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1;
shortname_len = ZSTR_LEN(c->name) - shortname_offset;
is_deprecated = memcmp(ZSTR_VAL(c->name) + shortname_offset, Z_STRVAL_P(orig_key - 1) + shortname_offset, shortname_len) != 0;
}
if (is_deprecated) {
zend_error(E_DEPRECATED,
"Case-insensitive constants are deprecated. "
"The correct casing for this constant is \"%s\"",
ZSTR_VAL(c->name));
return SUCCESS;
}
}
}
CACHE_PTR(opline->extended_value, c);
return SUCCESS;
}
/* }}} */
static zend_never_inline void ZEND_FASTCALL zend_quick_get_constant(
const zval *key, uint32_t flags OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
{
_zend_quick_get_constant(key, flags, 0 OPLINE_CC EXECUTE_DATA_CC);
} /* }}} */
static zend_never_inline int ZEND_FASTCALL zend_quick_check_constant(
const zval *key OPLINE_DC EXECUTE_DATA_DC) /* {{{ */
{
return _zend_quick_get_constant(key, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
} /* }}} */
#ifdef ZEND_VM_TRACE_HANDLERS
# include "zend_vm_trace_handlers.h"
#elif defined(ZEND_VM_TRACE_MAP)
+6 -5
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_EXECUTE_H
#define ZEND_EXECUTE_H
@@ -107,7 +105,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
Z_ADDREF_P(variable_ptr);
}
}
zval_dtor_func(garbage);
rc_dtor_func(garbage);
return variable_ptr;
} else { /* we need to split */
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
@@ -232,7 +230,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_in
zend_refcounted *r = Z_COUNTED_P(p);
if (!GC_DELREF(r)) {
ZVAL_NULL(p);
zval_dtor_func(r);
rc_dtor_func(r);
} else {
gc_check_possible_root(r);
}
@@ -259,7 +257,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
zend_refcounted *r = Z_COUNTED_P(p);
if (!GC_DELREF(r)) {
ZVAL_NULL(p);
zval_dtor_func(r);
rc_dtor_func(r);
}
}
p++;
@@ -308,6 +306,9 @@ ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_t
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type);
void zend_verify_abstract_class(zend_class_entry *ce);
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name);
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len);
ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type);
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
+16 -45
View File
@@ -18,8 +18,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdio.h>
#include <signal.h>
@@ -103,7 +101,7 @@ static void zend_extension_deactivator(zend_extension *extension) /* {{{ */
static int clean_non_persistent_constant_full(zval *zv) /* {{{ */
{
zend_constant *c = Z_PTR_P(zv);
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
return (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
@@ -142,6 +140,7 @@ void init_executor(void) /* {{{ */
EG(in_autoload) = NULL;
EG(autoload_func) = NULL;
EG(error_handling) = EH_NORMAL;
EG(flags) = EG_FLAGS_INITIAL;
zend_vm_stack_init();
@@ -180,6 +179,10 @@ void init_executor(void) /* {{{ */
EG(each_deprecation_thrown) = 0;
EG(persistent_constants_count) = EG(zend_constants)->nNumUsed;
EG(persistent_functions_count) = EG(function_table)->nNumUsed;
EG(persistent_classes_count) = EG(class_table)->nNumUsed;
EG(active) = 1;
}
/* }}} */
@@ -278,25 +281,9 @@ void shutdown_executor(void) /* {{{ */
* Zend Memory Manager frees memory by its own. We don't have to free
* each allocated block separately.
*/
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
zend_constant *c = Z_PTR_P(zv);
if (c->flags & CONST_PERSISTENT) {
break;
}
} ZEND_HASH_FOREACH_END_DEL();
ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) {
zend_function *func = Z_PTR_P(zv);
if (func->type == ZEND_INTERNAL_FUNCTION) {
break;
}
} ZEND_HASH_FOREACH_END_DEL();
ZEND_HASH_REVERSE_FOREACH_VAL(EG(class_table), zv) {
zend_class_entry *ce = Z_PTR_P(zv);
if (ce->type == ZEND_INTERNAL_CLASS) {
break;
}
} ZEND_HASH_FOREACH_END_DEL();
zend_hash_discard(EG(zend_constants), EG(persistent_constants_count));
zend_hash_discard(EG(function_table), EG(persistent_functions_count));
zend_hash_discard(EG(class_table), EG(persistent_classes_count));
zend_cleanup_internal_classes();
} else {
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
@@ -332,7 +319,7 @@ void shutdown_executor(void) /* {{{ */
} else {
ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(EG(zend_constants), key, zv) {
zend_constant *c = Z_PTR_P(zv);
if (c->flags & CONST_PERSISTENT) {
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
break;
}
zval_ptr_dtor_nogc(&c->value);
@@ -527,23 +514,6 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */
}
/* }}} */
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC);
}
/* }}} */
ZEND_API void _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
if (Z_REFCOUNTED_P(zval_ptr)) {
Z_DELREF_P(zval_ptr);
if (Z_REFCOUNT_P(zval_ptr) == 0) {
_zval_internal_dtor_for_ptr(zval_ptr ZEND_FILE_LINE_CC);
}
}
}
/* }}} */
ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
{
char *colon;
@@ -901,9 +871,10 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
}
if (!EG(autoload_func)) {
zval *zv = zend_hash_find_ex(EG(function_table), ZSTR_KNOWN(ZEND_STR_MAGIC_AUTOLOAD), 1);
if (zv) {
EG(autoload_func) = (zend_function*)Z_PTR_P(zv);
zend_function *func = zend_fetch_function(ZSTR_KNOWN(ZEND_STR_MAGIC_AUTOLOAD));
if (func) {
EG(autoload_func) = func;
} else {
if (!key) {
zend_string_release_ex(lc_name, 0);
@@ -958,7 +929,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
zend_exception_restore();
zval_ptr_dtor(&args[0]);
zval_dtor(&fcall_info.function_name);
zval_ptr_dtor_str(&fcall_info.function_name);
zend_hash_del(EG(in_autoload), lc_name);
@@ -1070,7 +1041,7 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
} else {
retval = FAILURE;
}
zval_dtor(&pv);
zval_ptr_dtor_str(&pv);
return retval;
}
/* }}} */
-2
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend_extensions.h"
ZEND_API zend_llist zend_extensions;
+1 -3
View File
@@ -17,8 +17,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_EXTENSIONS_H
#define ZEND_EXTENSIONS_H
@@ -46,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no.. */
#define ZEND_EXTENSION_API_NO 320180606
#define ZEND_EXTENSION_API_NO 320180731
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
-2
View File
@@ -16,8 +16,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "zend.h"
#include "zend_compile.h"
#include "zend_float.h"
-2
View File
@@ -16,8 +16,6 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H
Loaded 100 of 1705 files, more files were not shown because too many files have changed in this diff. Show more