Compare commits

..
Author SHA1 Message Date
Bob Weinand 4f4400d7e5 PHP_MD5_CTX is now always used due to fix for #71204 2015-12-08 15:32:55 +01:00
Anatol Belski 2629ad65a4 prepare 7.0.1RC1 2015-12-08 15:24:12 +01:00
Scott c0ce2281bc Update random.c
Supersedes #1589
2015-12-08 13:16:48 +01:00
Anthony Ferrara 908f67b1d4 Expose php_random_bytes as a first-class API within internals
This also defines two macros: php_random_bytes_throw and php_random_bytes_silent depending on use case which will throw exceptions or not respectively
2015-12-08 13:12:45 +01:00
Xinchen Hui 0495bf5650 Revert "fix typos "paramer" -> "parameters""
ABI BC break

This reverts commit 6ac12f1337.
2015-12-08 10:52:50 +08:00
Anatol Belski 920c088082 update NEWS 2015-12-07 22:54:44 +01:00
Anatol Belski 7c981192eb Fixed bug #71024 Unable to use PHP 7.0 x64 side-by-side with PHP 5.6 x32 on the same server 2015-12-07 22:53:35 +01:00
Xinchen Hui 250430acdc Fixed Bug #71049 (SQLite3Stmt::execute() releases bound parameter instead of internal buffer) 2015-12-07 07:43:09 -08:00
Márcio Almada 6ac12f1337 fix typos "paramer" -> "parameters" 2015-12-07 14:48:26 +08:00
Xinchen Hui e48988311d Fixed bug #71020 (Use after free in Collator::sortWithSortKeys) 2015-12-07 10:58:26 +08:00
Joe Watkins 03a43d50e1 standard tsrm usage for seven 2015-12-06 14:06:07 +01:00
Anatol Belski 713ad54fec update NEWS with fixed bug #70831 2015-12-06 12:41:51 +01:00
Daniel Axtens 2ea924fffc Fix #70831: Compile fails on system with 160 CPUs
This fixes the following build issue on 160-CPU POWER8 machines

ext/tokenizer/tokenizer_data.c:28:34: fatal error: zend_language_parser.h: No such file or directory
 #include <zend_language_parser.h>

It is fixed by introducing an explicit dependency on the header file.

Signed-off-by: Daniel Axtens <dja@axtens.net>
2015-12-06 12:37:08 +01:00
Bob Weinand aa8cac578e Fix double free in formatted_print.c 2015-12-06 02:54:28 +01:00
Bob Weinand 559ede17e1 Fixed bug #71013 (Incorrect exception handler with yield from) 2015-12-06 02:45:19 +01:00
Nikita Popov 1d5744027e Disable PEAR in Travis build 2015-12-05 22:48:29 +01:00
Xinchen Hui 311eb2b11e Missed one place 2015-12-04 06:51:16 -08:00
Xinchen Hui 7ac24aa661 Fixed bug #71028 (Undefined index with ArrayIterator) 2015-12-04 06:45:26 -08:00
Xinchen Hui 3ae3341533 Fixed bug #71018 (ReflectionProperty::setValue() behavior changed) 2015-12-04 11:52:08 +08:00
Lior Kaplan 5b9267c4c0 Align NEWS entries format 2015-12-03 17:53:48 +02:00
Popa Adrian Marius a154410597 Add PDO_Firebird fix in NEWS 2015-12-03 17:28:51 +02:00
Popa Adrian Marius 9ddfd49063 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use LL_MASK for SQL_INT64 data formatting
2015-12-03 17:13:45 +02:00
Popa Adrian Marius 8da5752311 Use LL_MASK for SQL_INT64 data formatting 2015-12-03 17:12:02 +02:00
Popa Adrian Marius 337fd3ad64 Merge branch 'PHP-7.0' of https://git.php.net/push/php-src into PHP-7.0
* 'PHP-7.0' of https://git.php.net/push/php-src:
  NEWS for 8907da99b8
  Fixed bug #71006 (symbol referencing errors on Sparc/Solaris)
  remove PHP 5 NEWS entries
2015-12-03 16:24:24 +02:00
Popa Adrian Marius 1745ead668 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix Bug #60052	Integer returned as a 64bit integer on X64_86 for pdo_firebird
2015-12-03 16:15:18 +02:00
Popa Adrian Marius 4173a667fa Fix Bug #60052 Integer returned as a 64bit integer on X64_86 for pdo_firebird 2015-12-03 16:14:17 +02:00
Andrea Faulds 3d6dd2a27b NEWS for 8907da99b8 2015-12-03 12:16:15 +00:00
Dmitry Stogov 59424bb7bd Fixed bug #71006 (symbol referencing errors on Sparc/Solaris) 2015-12-03 13:28:41 +03:00
Anatol Belski 2fabcbfedb remove PHP 5 NEWS entries 2015-12-03 10:55:58 +01:00
Lior Kaplan e322fb0015 SIZEOF_SIZE_T doesn't exist on AIX, keep using SIZEOF_LONG
Follow up for 3689b444
2015-12-02 19:30:05 +02:00
Anatol Belski 2f62ad16a4 remove older UPGRADING entry, bug #38409 is already fixed in 5.6 2015-12-01 11:32:52 +01:00
Adam Harvey 91bad929aa Fix bug #71005 (Segfault in php_cli_server_dispatch_router()).
We didn't initialise the retval variable in
php_cli_server_dispatch_router(); let's now initialise it to be
IS_UNDEF, as the following if condition expects.
2015-12-01 03:09:36 +00:00
Xinchen Hui ed4b887cf6 Fixed bug #70991 (zend_file_cache.c:710: error: array type has incomplete element type) 2015-12-01 10:35:32 +08:00
Scott 00e3b7614e Update random.c
Ref: https://github.com/jedisct1/libsodium/commit/beb826f6fd173cff4473c8b7614033dbd4803500
2015-12-01 10:33:33 +08:00
Anatol Belski 1b27754888 arrange NEWS for final and fix one NEWS mistake 2015-12-01 02:03:49 +01:00
Dmitry Stogov 25c5d185fc Fixed bug #70997 (When using parentClass:: instead of parent::, static context changed) 2015-11-30 16:52:57 +03:00
Xinchen Hui 5df6f9f20e Fixed bug #70993 (Array key references break argument processing) 2015-11-30 10:50:23 +08:00
Jakub Zelenka e6e77d9e27 Fix typo in php_stream_from_res_no_verify
This macro is not used but it's wrong as zend_fetch_resource
accepts only 3 args and just one res index. So obviously
we need to use zend_fetch_resource2 here.
2015-11-29 19:28:25 +00:00
Xinchen Hui 4424cbf757 Order the NEWS 2015-11-28 23:48:12 -08:00
Xinchen Hui 1f65006fce Fixed bug #70931 (Two errors messages are in conflict) 2015-11-28 23:43:41 -08:00
Xinchen Hui 9397f52724 Fixed Bug #70967 (Weird error handling for __toString when Error is thrown) 2015-11-28 23:38:19 -08:00
Xinchen Hui 5af61aa1cc Space 2015-11-27 19:12:26 -08:00
Xinchen Hui 58fbe7a838 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-27 07:32:21 -08:00
Xinchen Hui e9a8d7ff1d Fixed bug #70977, #70973 (Segmentation fault with opcache.huge_code_pages=1) 2015-11-27 07:30:37 -08:00
Andrea Faulds 8907da99b8 Set called_scope in Closure::call (fixes bug #70987) 2015-11-27 15:06:13 +00:00
Xinchen Hui a347b0be48 Fixed bug #70949 (SQL Result Sets With NULL Can Cause Fatal Memory Errors) 2015-11-27 15:52:55 +08:00
Xinchen Hui b0f472b3b2 Fixed test 2015-11-27 11:42:30 +08:00
Xinchen Hui 6cb6c04499 Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6) 2015-11-27 11:32:38 +08:00
Nikita Popov 99dd7ee80b Forbid namespace\int type hint as well 2015-11-26 16:56:08 +01:00
Xinchen Hui 0e91e5fb90 Fixed test 2015-11-26 12:00:25 +08:00
Bob Weinand 2de8915dea Fixed bug causing exception not being thrown immediately into a generator yielding from an array 2015-11-25 23:09:44 +01:00
Christopher Jones 071247713f Change line endings: Windows to Unix 2015-11-26 06:51:46 +11:00
Xinchen Hui f96175750a Fixed NEWs again (not sure why this is messd up twice today) 2015-11-25 08:04:36 -08:00
Xinchen Hui 4a7e83f54a Fixed bug #70970 (Segfault when combining error handler with output buffering)
of course we can try to refactor the current flow to make this error can
be catched safly.

but as 7.0.0 is releasing,  I don't think a refactor is safe now. and
actually I don't see any gain to make this catchable.

so let's keep this be consistent with 5.6 and safe for now
2015-11-25 08:00:20 -08:00
Xinchen Hui 0394c04144 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 06:34:40 -08:00
Xinchen Hui 9376e8213c ZEND_SPACESHIP supports 2015-11-25 20:20:05 +08:00
Xinchen Hui 1b6873b4e6 Fixed NEWS 2015-11-25 19:15:33 +08:00
Xinchen Hui d6f39a1011 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 19:12:40 +08:00
Xinchen Hui 3cdbe347ae Always lower name 2015-11-25 19:11:22 +08:00
Xinchen Hui 05738eb71a Revert "Improved fix for Fully qualified (leading backslash) type names must fail"
This reverts commit 00865ae22f.
2015-11-25 19:06:42 +08:00
Bob Weinand 73a92964ff Fixed bug #70965 (yield from with a common iterator primes too much) 2015-11-25 09:54:24 +01:00
Anatol Belski 2bae178b35 fix NEWS 2015-11-25 05:03:15 +01:00
Xinchen Hui 0134de7cff Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-25 11:46:14 +08:00
Xinchen Hui 00865ae22f Improved fix for Fully qualified (leading backslash) type names must fail
it now all fails with COMPILE_ERROR instead of syntax error for T_ARRAY
but COMPILE_ERROR for int
2015-11-25 11:27:32 +08:00
Anatol Belski 541631253a rearrange NEWS for RC8 2015-11-25 03:39:28 +01:00
Christopher Jones 7be30eb78c Improve test portability 2015-11-25 12:43:05 +11:00
Christopher Jones d10ee1eef1 Fix remaining gcov valgrind issues 2015-11-25 12:42:27 +11:00
Bob Weinand 80d9dcafe0 Fixed bug #70904 (yield from incorrectly marks valid generator as finished) 2015-11-24 23:43:34 +01:00
Bob Weinand 569763cb1a Fix scalar type names with leading backslash 2015-11-24 21:39:06 +01:00
Xinchen Hui d978e92d3d Update NEWS 2015-11-24 13:45:56 +08:00
Xinchen Hui e637ead6ed Merge branch 'PHP-5.6' into PHP-7.0 2015-11-24 13:45:32 +08:00
Xinchen Hui e6b46dc2ff Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number of parameters) 2015-11-24 13:45:16 +08:00
Xinchen Hui fd545f4f44 Also fixed 'r' 2015-11-24 11:48:03 +08:00
Xinchen Hui 3e0b2ba5d8 Indent (not sure why it was messed) 2015-11-24 11:08:30 +08:00
Xinchen Hui 31b4581c45 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-11-24 11:05:56 +08:00
Xinchen Hui 91fb1edbbf Fixed bug #70963 (Unserialize shows UNKNOW in result)
Thanks to ryat for reportinig
2015-11-24 11:04:42 +08:00
Côme Bernigaud e6759644ec Revert "Added back support for undocummented host:port syntax"
This reverts commit 15876e85e5.
2015-11-24 03:45:21 +01:00
Côme Bernigaud 5a8bcf73ba Revert "Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)"
This reverts commit 391087ed28.
2015-11-24 03:45:17 +01:00
Lior Kaplan a8bd182ccd Align NEWS entries format 2015-11-23 19:00:42 +02:00
Lior Kaplan 818bffc534 Add NEWS entry for #61751 2015-11-23 18:58:03 +02:00
Lior Kaplan 9642710a09 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #61751 (SAPI build problem on AIX: Undefined symbol: php_register_internal_extensions)

 Conflicts:
	sapi/cgi/config9.m4
	sapi/fpm/config.m4
2015-11-23 18:56:13 +02:00
Lior Kaplan 1c72e5b299 Align NEWS entries format 2015-11-23 18:46:19 +02:00
Bob Weinand c1189eccae Output stderr on real stderr in phpdbg 2015-11-23 17:46:07 +01:00
Lior Kaplan 532912d8ab Add NEWS entry for #61751 2015-11-23 18:42:21 +02:00
Lior Kaplan d6b78a3511 Fixed bug #61751 (SAPI build problem on AIX: Undefined symbol: php_register_internal_extensions) 2015-11-23 18:40:47 +02:00
Xinchen Hui 7e9f416218 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 23:15:33 +08:00
Xinchen Hui f8bf1f33a5 Fixed bug #70959 (ArrayObject unserialize does not restore protected fields) 2015-11-23 07:08:47 -08:00
Xinchen Hui 801e46d8c0 Add test for bug (count on symbol table)
I should have do this ....
2015-11-23 06:21:30 -08:00
Xinchen Hui 6313e16a04 Improved fix for bug (count on symbol table) 2015-11-23 06:12:03 -08:00
Xinchen Hui 8c51578c81 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-23 18:48:51 +08:00
Xinchen Hui b9845e5006 Add bug #70957 and #70958 releated test in refection 2015-11-23 18:48:21 +08:00
Xinchen Hui 45c5e27183 Fixed test 2015-11-23 18:33:14 +08:00
Xinchen Hui 51ccc88b87 Port fix to 7.0 2015-11-23 18:31:56 +08:00
Xinchen Hui 397be4ff54 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2015-11-23 18:30:41 +08:00
Xinchen Hui a2b85ddecf Fixed bug #70958 (Invalid opcode while using ::class as trait method paramater default value) 2015-11-23 18:29:59 +08:00
Xinchen Hui 1b16c2f41c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2015-11-23 12:22:17 +08:00
Xinchen Hui ab17840d33 Fixed bug #70957 (self::class can not be resolved with reflection for abstract class) 2015-11-23 12:20:44 +08:00
Xinchen Hui eada2aa91a Fixed bug (count on symbol tables) 2015-11-21 20:58:29 -08:00
Xinchen Hui 31d93fcf4b Port the fix of 5.6 to 7.0 2015-11-21 05:41:53 -08:00
Xinchen Hui c6961cb41b Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/tests/bug70944.phpt
	Zend/zend_exceptions.c
2015-11-21 05:03:20 -08:00
Xinchen Hui 205e0ba81d Update test script 2015-11-21 05:01:51 -08:00
Xinchen Hui cbc71995a8 Unused var 2015-11-21 04:54:48 -08:00
Xinchen Hui 7b195c9875 Improved fix for bug #70944 2015-11-21 00:27:56 -08:00
Xinchen Hui 4674f18a4b Improved previously fix a little 2015-11-20 06:54:57 -08:00
Xinchen Hui 519f9bc675 Fixed bug #70947 (INI parser segfault with INI_SCANNER_TYPED) 2015-11-20 06:37:38 -08:00
Xinchen Hui 2a9fc35e51 Update NEWS 2015-11-20 16:38:24 +08:00
Xinchen Hui a2e4e64682 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_exceptions.c
2015-11-20 16:38:00 +08:00
Xinchen Hui a1c887964e Fixed bug #70944 (try{ } finally{} can create infinite chains of exceptions) 2015-11-20 16:24:53 +08:00
Xinchen Hui 64a90a6b98 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-20 15:36:26 +08:00
Xinchen Hui b42eb16cf4 This seems better 2015-11-20 15:36:13 +08:00
Xinchen Hui 7e68d6e735 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-20 15:22:45 +08:00
Xinchen Hui c8d6673b59 Fixed build error "undefined symbol gdJpegGetVersionString" 2015-11-20 15:22:05 +08:00
Christopher Jones f66e25a82b Fixed LOB implementation size_t/zend_long mismatch reported by gcov 2015-11-20 09:14:05 +11:00
Christopher Jones 8b32fe80ae Stablize test on Windows 2015-11-20 09:13:47 +11:00
Remi Collet 77e9f2d6b1 typo 2015-11-19 09:20:13 +01:00
Remi Collet 1bd22e8e65 NEWS 2015-11-19 08:19:04 +01:00
Remi Collet 6680c2b22e Fixed bug #70940 Segfault in soep / type_to_string 2015-11-19 08:18:13 +01:00
Bob Weinand 4dee0c4a14 Fixed bug #70899 (buildconf failure in extensions) 2015-11-17 21:07:29 +01:00
Xinchen Hui 4f0a05ab3e Merge branch 'PHP-5.6' into PHP-7.0 2015-11-17 20:14:11 +08:00
Xinchen Hui 66c1f966f0 Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-17 20:13:22 +08:00
Xinchen Hui fba3985f23 Improve the test 2015-11-17 20:12:50 +08:00
Andrey Hristov 96406f0842 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-16 12:39:04 +01:00
Andrey Hristov 822400ef3b News for fixed bug #68344 2015-11-16 12:38:25 +01:00
Xinchen Hui 9134f9e98f Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/mysql/php_mysql.c
2015-11-16 17:59:46 +08:00
Xinchen Hui 25439e939e Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-16 17:00:16 +08:00
Xinchen Hui be6fd4ba89 Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction)
Actually, this only be fixed if php uses mysqlnd
2015-11-16 16:59:55 +08:00
Côme Bernigaud 15876e85e5 Added back support for undocummented host:port syntax 2015-11-16 04:50:12 +01:00
Christopher Jones 0dce4bef79 Fixed LOB mem leak reported on gcov. Also fixed unsigend comparison compile warning; and remove direct field access 2015-11-16 08:15:22 +11:00
Jakub Zelenka 3c32019989 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-15 19:13:49 +00:00
Jakub Zelenka e5abc53701 Use the same CS for all json tests 2015-11-15 19:06:09 +00:00
Anatol Belski 7819fef345 Fixed bug #70917 install-pear-nozlib.phar missing
The actual bug is caused by some network error while packaged. An
error check added to interrupt the packaging process if phar package
download failed.
2015-11-15 19:01:22 +01:00
Reeze Xia c856b6e0ff Update mime type generator script to keep track of additional mime-types 2015-11-15 20:25:47 +08:00
Thorsten Rinne 04c3fbac37 Added support for CSS/JavaScript source maps
Source maps (http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/) are basically a way to map a combined/minified file back to an unbuilt state. To avoid error messages in Browser DevTools, source map files should be served with the MIME type "application/json"
2015-11-15 20:25:39 +08:00
Anatol Belski 1934d6d9ab fix test title
c/p mistake :)
2015-11-15 00:03:40 +01:00
Anatol Belski e3d19e81a2 update NEWS 2015-11-14 23:48:40 +01:00
Taoguang Chen 617698dfe0 Fixed bug #70914 zend_throw_or_error() format string vulnerability 2015-11-14 23:44:59 +01:00
Xinchen Hui c2773ea02f Update NEWs 2015-11-14 01:14:36 -08:00
Xinchen Hui fce44a5a13 Fixed bug #70910 (extract() breaks variable references) 2015-11-13 19:39:59 -08:00
Xinchen Hui 25de928df7 Fixed bug #70912 (Null ptr dereference instantiating class with invalid array property) 2015-11-13 21:24:42 +08:00
Yasuo Ohgaki a03786f773 Use distinguishable error messages. 2015-11-13 21:25:10 +09:00
Xinchen Hui 310fc87c2d SKIP on slow debug version PHP 2015-11-13 14:00:01 +08:00
Dmitry Stogov 04526093e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #70900 (SoapClient systematic out of memory error)
2015-11-12 20:36:39 +03:00
Dmitry Stogov f8bf9bd86b Fixed bug #70900 (SoapClient systematic out of memory error) 2015-11-12 20:31:52 +03:00
Anatol Belski cc10da474d fixed typo 2015-11-12 13:37:45 +01:00
Anatol Belski 9c4fd36783 add test for bug #70898 2015-11-12 09:28:10 +01:00
Xinchen Hui c2de445f79 Also protects this one 2015-11-12 14:51:19 +08:00
Xinchen Hui 2b494ecc9c Update NEWS 2015-11-12 14:38:44 +08:00
Xinchen Hui 53c03115cf Re-fixed #70895 2015-11-12 14:35:34 +08:00
Xinchen Hui 2bed2152e6 Revert "Fixed bug Bug #70895 null ptr deref and segfault"
This reverts commit 8eef11d317.
2015-11-12 14:34:00 +08:00
Xinchen Hui c245fd7d91 Revert "refix bug #70895"
This reverts commit 93240102e0.
2015-11-12 14:33:14 +08:00
Xinchen Hui 75f85288f4 Revert "Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))"
This reverts commit e4e54f33ce.
2015-11-12 14:32:35 +08:00
Xinchen Hui fc611a134b Merge branch 'PHP-5.6' into PHP-7.0 2015-11-12 14:20:03 +08:00
Xinchen Hui e4e54f33ce Fixed bug #70898 (SIGBUS/GPF zend_mm_alloc_small (zend_alloc.c:1291))
Include tail \0
2015-11-12 14:18:02 +08:00
Côme Bernigaud 391087ed28 Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)
Note that passing 0 will also result in default port.
2015-11-12 07:06:05 +01:00
Anatol Belski a1e8b74827 update NEWS 2015-11-12 01:41:59 +01:00
Anatol Belski 93240102e0 refix bug #70895
move this code to where it belongs, no behavior change to actual
throwing function, thus retaining compat with old ZPP
2015-11-12 01:39:02 +01:00
Anatol Belski 8eef11d317 Fixed bug Bug #70895 null ptr deref and segfault 2015-11-12 00:52:36 +01:00
Anatol Belski a2e59e72bc fix format macro names in UPGRADING.INTERNALS 2015-11-11 16:33:34 +01:00
Ferenc Kovacs 2777d0a1d9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Ensure the test fails
2015-11-11 14:59:31 +01:00
Xinchen Hui f72c7edfa4 Ensure the test fails 2015-11-11 14:55:33 +01:00
Xinchen Hui 88fb6d90c4 Ensure the test fails 2015-11-11 19:51:33 +08:00
Anatol Belski 3517f85e47 update NEWS, patch for #70249 pulled into RC7 2015-11-11 12:20:18 +01:00
Anatol Belski b89f451694 adjust test expectation 2015-11-11 09:47:29 +01:00
Anatol Belski 3cdc438e53 fix test filename and title 2015-11-11 09:47:24 +01:00
Ferenc Kovacs 1f39665083 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  propare for 5.6.16RC1
2015-11-11 09:21:32 +01:00
Ferenc Kovacs b22636c838 propare for 5.6.16RC1 2015-11-11 09:20:16 +01:00
Xinchen Hui 82f503f587 Re-Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Let's fixed this in the root instead
2015-11-11 12:32:46 +08:00
Xinchen Hui c3260b66c9 Revert "Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)"
This reverts commit d6c527830e.
2015-11-11 12:06:38 +08:00
Xinchen Hui d6c527830e Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Maybe we should introduce a new zend_hash_safe_apply which always reload
the ht->arData to make sure won't segfault the ht is grew?
2015-11-11 11:34:11 +08:00
Bob Weinand ccf8b54b89 Use --vex-iropt-precise-memory-exns=yes for valgrind < 3.8.0 2015-11-10 09:27:49 +01:00
Matteo Beccati 3cb3979de3 Split shmop/tests/002.phpt in two (all + non-root)
One of the conditions tested was expected to fail with "Permission denied",
but it doesn't when running as root. The memory segment was also leaked, hence
the split.
2015-11-10 09:10:10 +01:00
Matteo Beccati 6fa9b76342 Fix bug #70886 in shmop/tests/002.phpt 2015-11-10 09:10:10 +01:00
Xinchen Hui 4803914ae6 Unused var 2015-11-10 15:54:32 +08:00
Dmitry Stogov d66d1b97aa Fixed incorrect order of free/finally on exception 2015-11-10 10:10:39 +03:00
Anatol Belski 795af791b0 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2015-11-10 00:41:40 +01:00
Andrea Faulds 37b64de20f Merge branch 'use_ZEND_STRL_for_builtin_types' into PHP-7.0 2015-11-09 23:40:49 +00:00
Anatol Belski a3f1154b3d additional catch to bug #70863 2015-11-10 00:38:11 +01:00
Anatol Belski 2e38918ba4 add test for eb32da13 2015-11-09 22:45:22 +01:00
Dmitry Stogov c9eacb181c Added tests 2015-11-09 23:54:09 +03:00
Anatol Belski e029a86aad prepare news for next 2015-11-09 19:39:02 +01:00
Jakub Zelenka 570cdc05d7 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-09 18:23:29 +00:00
Jakub Zelenka 1a12403002 Remove SNI test that trigger request to sni.velox.ch
This has been requested by Kaspar Brand who provides
sni.velox.ch. That site is only for interactive
testing and not for unit/integration/regression testing.
Although this test is run only in special cases (when
SNI_TESTS is defined) it should still be removed.

Also this test is not reliable as it depends on external
resources.
2015-11-09 18:11:18 +00:00
Andrea Faulds dae37661d9 Use ZEND_STRL macro for builtin_types 2015-11-09 11:15:58 +00:00
Xinchen Hui d70aa14f2c Fixed bug #70323 (Regression in zend_fetch_debug_backtrace() can cause segfaults) 2015-11-09 17:14:15 +08:00
Xinchen Hui 0a1e199682 Fixed bug #70624 opcache.huge_code_pages 2015-11-09 12:21:45 +08:00
Xinchen Hui 12f1cfa86a Update NEWS 2015-11-09 12:02:27 +08:00
Caleb Champlin 6ff014b31c Make sure context is set to null to prevent use after free 2015-11-09 11:58:34 +08:00
Xinchen Hui fe12492480 Merge branch 'patch-1' of https://github.com/colinodell/php-src into PHP-7.0 2015-11-07 23:06:41 -08:00
Xinchen Hui 83de5364b7 manually apply the typo fix in master 2015-11-07 23:03:25 -08:00
Lynn 269674f79d rm duplicate include 2015-11-07 23:01:23 -08:00
James Titcumb bb55ac6279 Fixed typo in reflection phpt 2015-11-07 22:58:56 -08:00
Colin O'Dell 55abf6dfb2 Fix description of a BC break 2015-11-07 17:48:02 -05:00
Nikita Popov bc3512c1d6 Fix various update_opN_const issues 2015-11-07 17:45:26 +01:00
Nikita Popov 9da456655c Refactor update_op2_const
Combines both switches into one, to avoid having to maintain the same
opcode list twice. This also makes most of the bugs fixed by the next
commit pretty obvious.

No functional change here.
2015-11-07 17:31:09 +01:00
Xinchen Hui de8bfb32bd Use defined macro 2015-11-07 07:43:18 -08:00
Xinchen Hui e9fd8ad446 Fixed bug #70876 (Segmentation fault when regenerating session id with strict mode) 2015-11-07 07:30:31 -08:00
Xinchen Hui 148bb622fa Revert "Fixed bug #70876 Segmentation fault when regenerating session id with strict mode"
This reverts commit 0bf3ebb4ba.
2015-11-07 07:17:43 -08:00
Xinchen Hui 2d8d97cee2 Fixed bug #70873 (Regression on private static properties access) 2015-11-07 06:50:36 -08:00
Reeze Xia c524f43e4f C99 complain fix 2015-11-07 22:15:19 +08:00
Reeze Xia e4c1e90536 Update NEWS 2015-11-07 22:10:56 +08:00
Reeze Xia 0bf3ebb4ba Fixed bug #70876 Segmentation fault when regenerating session id with strict mode
The comment *mod_data always be non-NULL is not true.
The same as this FIXME: https://github.com/php/php-src/blob/master/ext/session/mod_files.c#L676
2015-11-07 21:46:21 +08:00
Nikita Popov 99d818f1e9 Don't propagate into ops that error on non-string
To properly support this make update_opN_const fallible -- they
are not always called through replace_with_const.
2015-11-07 12:04:51 +01:00
Nikita Popov 00b37e718d Strip leading backslash in update_opN_const 2015-11-07 12:04:51 +01:00
Nikita Popov 632bee4abb Fix update_opX_const lowercasing
It was lowering in-place.
2015-11-07 12:04:51 +01:00
Matteo Beccati c263dcee2f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #70875 Segmentation fault if wsdl has no targetNamespace attribute
2015-11-07 11:05:36 +01:00
Matteo Beccati fd61666d96 Fix bug #70875 Segmentation fault if wsdl has no targetNamespace attribute 2015-11-07 11:00:33 +01:00
Matteo Beccati f2853386b1 Merge remote-tracking branch 'origin/PHP-5.6' into PHP-7.0
* origin/PHP-5.6:
  Always remember NEWS....
  Fix compile warnings about comparison of unsigned expression always being true
  Bump OCI8 version
  Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil)
2015-11-07 10:46:17 +01:00
Anatol Belski 0cbf3afe17 update NEWS 2015-11-06 23:08:18 +01:00
Anatol Belski d59eb9fcc3 fix decrement_function regarding bug #70863 2015-11-06 23:07:21 +01:00
Anatol Belski 8155ecba61 Fixed bug #70863 Incorect logic to increment_function for proxy objects 2015-11-06 23:07:16 +01:00
Anatol Belski 6897c1116a no more dev ZEND_VERSION 2015-11-06 23:07:10 +01:00
Bob Weinand 855bb36fd0 Add support for IPV6_V6ONLY on sockets 2015-11-06 21:45:31 +01:00
Christopher Jones 049325ca96 Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil) 2015-11-07 02:24:17 +11:00
Christopher Jones 089ca134fb Always remember NEWS.... 2015-11-07 02:15:24 +11:00
Christopher Jones a57b205383 Fix compile warnings about comparison of unsigned expression always being true 2015-11-07 02:14:18 +11:00
Christopher Jones f88a9a9643 Bump OCI8 version 2015-11-07 02:10:57 +11:00
Christopher Jones 3060dfd92e Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil) 2015-11-07 01:56:50 +11:00
Xinchen Hui 27aef97f65 Fixed bug #70868 (PCRE JIT and pattern reuse segfault) 2015-11-06 11:37:17 +08:00
Márcio Almada 283b6275df add failing test for bug #70868 2015-11-06 11:34:45 +08:00
Anatol Belski aa0d441ede update NEWS 2015-11-05 22:51:25 +01:00
Anatol Belski 01c844a01d use Z* macro name 2015-11-05 22:39:10 +01:00
Anatol Belski 2283551cfa fix NULL deref in mbstring post handler 2015-11-05 22:24:47 +01:00
Anatol Belski c1f893d894 fix NULL deref in pdo_firebird
ref #70862
2015-11-05 22:11:00 +01:00
Anatol Belski cff9e16a12 fix pdo_sqlite crash with empty bound stream 2015-11-05 21:50:34 +01:00
Anatol Belski 1406f80135 fix leak 2015-11-05 21:49:21 +01:00
Anatol Belski 7b32b8f4e1 fix pdo_mysql crash with empty bound stream param
rel #70862
2015-11-05 21:32:31 +01:00
Anatol Belski 1184f0aca5 add test for bug #70861 2015-11-05 19:48:08 +01:00
Fabian Franz 1fcadf67e6 Fix setting of empty string resource. 2015-11-05 19:47:12 +01:00
Anatol Belski f189353178 fix possible NULL deref in image functions 2015-11-05 18:16:32 +01:00
Anatol Belski 5ac288bcc6 fix crash in sqlite when executing with bound stream param
rel #70862
2015-11-05 18:08:08 +01:00
Anatol Belski 9385eb6ff8 re-update NEWS 2015-11-05 14:48:30 +01:00
Anatol Belski a80545992b update the actual sql parser file for #70861 2015-11-05 14:46:40 +01:00
Anatol Belski 5c96a91d77 Fix bug #70861 Segmentation fault in pdo_parse_params() during Drupal 8 test suite 2015-11-05 14:46:28 +01:00
Anatol Belski 9968129831 don't get invalid chmod mode through 2015-11-05 14:46:23 +01:00
Anatol Belski dea14fc707 zero cwd buffer before passing to chmod 2015-11-05 14:46:18 +01:00
Reeze Xia 435565a54f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Make test for bug #70852 to cover all cases
  Fixed bug #70852 Segfault getting NULL offset of an ArrayObject.
2015-11-05 14:28:49 +08:00
Reeze Xia 1c0622a472 Make test for bug #70852 to cover all cases 2015-11-05 14:09:24 +08:00
Reeze Xia 51218b3b9d Fixed bug #70852 Segfault getting NULL offset of an ArrayObject. 2015-11-05 13:46:03 +08:00
Xinchen Hui e4ac4e75b5 Fixed bug #70853 (SplFixedArray throws exception when using ref variable as index) 2015-11-04 06:44:29 -08:00
Xinchen Hui fe0af271c6 Fixed bug #70843 (Segmentation fault on MacOSX with opcache.file_cache_only=1) 2015-11-04 18:59:30 +08:00
Xinchen Hui 2f2653aa77 Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite) 2015-11-03 17:53:56 -08:00
Xinchen Hui d7ff107654 Fixed bug #70540 (sapi/fpm/tests/008.phpt and 016.phpt should be skipped on some platforms) 2015-11-02 16:43:28 +08:00
Xinchen Hui 8dd5e1c2b5 Add test_fpm_conf to skip some tests ranth than mark --xfail-- 2015-11-02 16:42:11 +08:00
Xinchen Hui 8d443d4626 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-02 10:59:07 +08:00
Xinchen Hui 227c898cd9 Fixed test 2015-11-02 10:58:55 +08:00
Xinchen Hui 63c601b631 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-02 10:55:05 +08:00
Xinchen Hui a23a88b3e7 Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6 2015-11-02 10:47:32 +08:00
Xinchen Hui 37ed0dafe4 Fixed bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant) 2015-11-02 10:47:02 +08:00
Jakub Zelenka e62db72111 Use standard title for new openssl tests 2015-10-29 19:11:57 +00:00
root 06c6b51e7d new tests to openssl module, don't covered yet. 2015-10-29 19:06:40 +00:00
Andrey Hristov 6d51b7b2e3 Another Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation
Added the possibility to explicitly state that the peer certificate should not be checked.
Back to the default - checking the certificate.
Exported MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT
Usage : mysqli_real_connect( , , , , , MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT)

If mysqli_ssl_set() is not called, but only MYSQLI_CLIENT_SSL is passed, without the (don't) very flag,
then no verification takes place.
2015-10-27 12:59:09 +01:00
Xinchen Hui 008d8b6789 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:28:19 -07:00
Xinchen Hui 31553f07f2 Revert "Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use)"
This reverts commit 3ef96c2cc6.
2015-10-26 17:26:30 -07:00
Xinchen Hui 3ef96c2cc6 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:09:42 -07:00
Leigh faf835be2b Use arc4random on OpenBSD 5.5+ and NetBSD 7+
As discussed with @weltling, keeping arc4random on the condition that the OS has a solid implementation of it
2015-10-30 19:08:20 +00:00
Reeze Xia c4297a5a29 This couldn't be false as it has been checked before 2015-10-30 19:50:54 +08:00
Reeze Xia 68b431e37d Use h parameter to avoid duplicate ht access of array_combine() 2015-10-30 19:49:04 +08:00
Dmitry Stogov 3c5a3e77d4 Fixed incomplete initialization. 2015-10-30 07:15:56 +03:00
Jakub Zelenka 41de89f61b Merge branch 'PHP-5.6' into PHP-7.0 2015-10-29 19:14:25 +00:00
Dmitry Stogov c67fc6bb09 Fixed memory leak in php_stream_context_set_option() 2015-10-29 20:06:55 +03:00
Xinchen Hui 241e340f78 Make these tests fail faster, Thanks to GFW 2015-10-29 15:01:43 +08:00
Xinchen Hui 661798ad34 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-10-29 14:35:31 +08:00
Xinchen Hui 179fba3f38 Fixed bug #70808 (array_merge_recursive corrupts memory of unset items)
I knew, this fix seems ugly
2015-10-29 14:33:58 +08:00
Julien Pauli eb59dd7d81 Don't remap .text segment if huge pages are not available. 2015-10-29 08:44:19 +03:00
Andrey Hristov 2b23ba97f3 Fix mysqli tests 2015-10-28 12:56:12 +01:00
Anatol Belski 5dd59cc90d sync NEWS 2015-10-27 20:10:06 +01:00
Anatol Belski ac4601eadd 7.0.1 is next 2015-10-27 20:08:54 +01:00
Dmitry Stogov eb32da13cd Fix frequent reallocations with many small strings 2015-10-27 17:07:58 +01:00
Anatol Belski 0e50a4c008 correct snprintf usage 2015-10-27 17:07:51 +01:00
Andrey Hristov c133515811 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-27 13:32:45 +01:00
Leigh a53510239f Remove arc4random
There has been a lot of discussion around whether arc4random should be included. Given how many different impementations of it are in the wild, we can't guarantee a secure implementation on all platforms.
2015-10-26 20:40:28 +00:00
Anatol Belski fff11a1e07 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #70718 stream_select() when OpenSSL extension is loaded on PHP Win64
  unbreak coverage data: fix #line directives in phpdbg parser
  exclude datelib from coverage report as asked by Derick
2015-10-26 15:57:26 +01:00
Anatol Belski 2f7a8515ca update NEWS 2015-10-26 15:56:34 +01:00
Anatol Belski 83bfefeccb Fixed bug #70718 stream_select() when OpenSSL extension is loaded on PHP Win64 2015-10-26 15:54:29 +01:00
Dmitry Stogov 0172f198e3 Fixed inconsistent exception handling (uopz/tests/006.phpt was failed when PHP build with --disable-gcc-global-regs). 2015-10-26 16:01:20 +03:00
Xinchen Hui 5767f2b648 Fixed bug #70785 (Infinite loop due to exception during identical comparison) 2015-10-26 11:15:17 +08:00
Jakub Zelenka 2ee99f8954 Check EVP_SealFinal return code
This can be done since we no longer support OpenSSL 0.9.6
2015-10-25 17:53:39 +00:00
Bob Weinand ac58d21aa3 Fix refcount reaching 2^32 - 1 for resources
Happens e.g. in proc_close() when nothing is referencing the file handles, e.g. they have refcount 0 when passed to zend_list_close() and then zend_list_delete() which decrements it to (uint32_t) -1
2015-10-25 18:47:50 +01:00
Nuno Lopes 36311ee4fd unbreak coverage data: fix #line directives in phpdbg parser 2015-10-24 18:12:24 -04:00
Nuno Lopes a0665f3a18 unbreak coverage data: fix #line directives in phpdbg parser 2015-10-24 17:45:53 -04:00
Nuno Lopes 0e069fa57d exclude datelib from coverage report as asked by Derick 2015-10-24 17:38:20 -04:00
Nuno Lopes 87498c5c39 exclude datelib from coverage report as asked by Derick 2015-10-24 17:37:00 -04:00
Nikita Popov b9cc3176eb Fix bug #70782 2015-10-24 23:19:02 +02:00
Anatol Belski aae108c1ce Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix globals initialization in sapi/cgi
2015-10-23 13:59:27 +02:00
Anatol Belski 22af88274b Fix globals initialization in sapi/cgi
Basically backport 8430ec17
2015-10-23 13:56:40 +02:00
Anatol Belski 448d1ce428 rather use the supplied inttypes.h with vc14 2015-10-23 09:47:00 +02:00
Anatol Belski 5ba763413b fix test redirection when run not from source root 2015-10-23 09:42:19 +02:00
Xinchen Hui 95446b4416 Indents 2015-10-23 11:19:30 +08:00
c9s bbaf6daa9d Fix boolean conversion warnings
Summary:

The compiler complains and raised some warnings about boolean
conversion:

    warning: address of 'ce->constants_table' will always evaluate to
    'true' [-Wpointer-bool-conversion]

Since the address of 'HashTable' will always evaluate to true. the
condition should be removed. The scope is kept for local variables.

Platform:

    OS X 10.11

Compiler:

    Apple LLVM version 7.0.0 (clang-700.0.72)
    Target: x86_64-apple-darwin15.0.0
    Thread model: posix
2015-10-23 11:19:19 +08:00
Andrey Hristov 3dc0bf7428 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-22 11:50:12 +02:00
Andrey Hristov afd31489d0 Improve fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-22 11:48:53 +02:00
Andrey Hristov 8f9b2b68ee Merge branch 'PHP-5.6' into PHP-7.0 2015-10-21 15:52:38 +02:00
Andrey Hristov 8292260515 Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-21 15:10:24 +02:00
Andrey Hristov efd2b3f5f2 Update the certificates needed for the mysqli tests 2015-10-21 10:42:51 +02:00
Bob Weinand 2ef327caed Exempt paging from -qrr mode 2015-10-20 21:56:00 +02:00
Anatol Belski 1149833a58 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport 262160e and 2d55e8c into 5.6
2015-10-20 20:07:14 +02:00
Anatol Belski ccc95bf9df backport 262160e and 2d55e8c into 5.6 2015-10-20 20:05:44 +02:00
Xinchen Hui 6ad2c3eb33 Revert "Ensure proper exception handling and EX(opline) state in USER_OPCODE handler"
read: http://news.php.net/php.internals/88887

This reverts commit 808f62bb4d.
2015-10-20 08:12:04 -07:00
Xinchen Hui 673ad62eed Regenerate zend_ini_scanner.c 2015-10-20 16:58:30 +08:00
Xinchen Hui a5a5c3e09a Update NEWS 2015-10-20 13:26:40 +08:00
Xinchen Hui c7cb40353c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_ini_scanner.c
2015-10-20 13:26:02 +08:00
Xinchen Hui d5f76caf6c Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l) 2015-10-20 13:20:56 +08:00
Ferenc Kovacs 131a348d37 remove imap tests for now until I finish the sudoless dovecot config 2015-10-19 23:57:43 +02:00
Ferenc Kovacs fa0ffa4777 remove imap tests for now until I finish the sudoless dovecot config 2015-10-19 23:43:26 +02:00
Ferenc Kovacs 03e1e88db1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 23:02:52 +02:00
Ferenc Kovacs 395ef4efb7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 22:47:23 +02:00
Ferenc Kovacs f3838a9c35 Merge branch 'pr-1483' into PHP-5.5
* pr-1483:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 22:44:19 +02:00
Stanislav Malyshev 26e5429f72 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #64172
  Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException

Conflicts:
	ext/pdo/pdo_dbh.c
2015-10-18 17:20:00 -07:00
Stanislav Malyshev 0b35e0c5a1 Merge branch 'pull-request/1535' into PHP-5.6
* pull-request/1535:
  Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
2015-10-18 17:17:55 -07:00
Daniel Persson 73384728ca Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:06:54 -07:00
Daniel Persson 307c1f6bf0 Fix bug #64172
Check if the SQLSTATE error code is equal to PDO_ERR_NONE before we ask the driver.
And if no error is reported skip the extra call to the driver.
2015-10-18 17:03:39 -07:00
Stanislav Malyshev c7c6df6cec Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip some tests for platforms different than x86
2015-10-18 15:45:40 -07:00
Fábio Perez c76fd640e6 Skip some tests for platforms different than x86
These tests are verifying undefined behaviour such as shifting by more than 63
bits and by negative numbers.
2015-10-18 15:45:25 -07:00
Stanislav Malyshev 5f759b04b8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip serialize test if ext/session is not loaded

Conflicts:
	ext/standard/tests/serialize/bug70219_1.phpt
2015-10-18 15:44:59 -07:00
Stanislav Malyshev b94f67885c Skip serialize test if ext/session is not loaded 2015-10-18 15:43:03 -07:00
Stanislav Malyshev 6a4803026d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Remove wrong argument $session from SNMP::setSecurity()
  Fix SNMP::setSecurity() arginfo (Fixes bug #70476)
2015-10-18 14:51:13 -07:00
jubianchi 718445b096 Remove wrong argument $session from SNMP::setSecurity() 2015-10-18 14:48:39 -07:00
jubianchi 39a2514643 Fix SNMP::setSecurity() arginfo (Fixes bug #70476) 2015-10-18 14:48:25 -07:00
Felipe Pena f231ddddaf - Implemented output paging 2015-10-18 12:08:04 -02:00
Anatol Belski daddb7a832 updated NEWS 2015-10-18 11:36:04 +02:00
Anatol Belski dc241566aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2015-10-18 11:35:25 +02:00
Anatol Belski 9501293de7 update NEWS 2015-10-18 11:34:42 +02:00
Anatol Belski af8937c056 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  C89 compat
  use spprintf instead (no need to estrdup afterwards).
  dblib's dbcolname can return null in some cases
  testcase fot bug #69757
  Segmentation fault on pdo_dblib::nextRowset (bug #69757)

Conflicts:
	ext/pdo_dblib/dblib_stmt.c
2015-10-18 11:28:57 +02:00
Anatol Belski 7f33ab834d C89 compat 2015-10-18 11:14:30 +02:00
MiRacLe.RPZ 2b5af600e3 use spprintf instead (no need to estrdup afterwards). 2015-10-18 11:10:50 +02:00
MiRacLe.RPZ 5c19355095 dblib's dbcolname can return null in some cases 2015-10-18 11:10:45 +02:00
MiRacLe.RPZ 4c8f064d7d testcase fot bug #69757 2015-10-18 11:10:39 +02:00
MiRacLe.RPZ acb2368976 Segmentation fault on pdo_dblib::nextRowset (bug #69757) 2015-10-18 11:10:34 +02:00
Aaron Piotrowski c100a742dc Fix missed assertion tests 2015-10-18 02:23:43 -05:00
Aaron Piotrowski 49d6336fae Always return boolean from assert
Matches docs prototype
2015-10-18 01:42:15 -05:00
Aaron Piotrowski 51953423ee Fix assert() implementation to match docs 2015-10-17 14:30:41 -05:00
Xinchen Hui e2d6090043 Fixed bug #70730 (Incorrect ArrayObject serialization if unset is called in serialize())
It's possible to fixed this in SPL side, but it will be ugly, and we
should make serialize more robust, so I prefer fix it in serialize side.
2015-10-17 05:28:49 -07:00
Xinchen Hui d4df6641c8 Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) 2015-10-17 01:52:32 -07:00
Felipe Pena 20a384dfa9 Fixed bug #70678 (PHP7 returns true when false is expected)
Cherry-pick from master.
2015-10-16 17:44:17 +02:00
Nikita Popov e3e92e96c1 Fixed bug #70430 2015-10-15 22:14:23 +02:00
Nikita Popov 06f38d36a8 Reindent zend_yytnamerr
Separating this whitespace change from the next diff.
2015-10-15 22:13:14 +02:00
Xinchen Hui 88a69ffa58 Fixed bug #70715 (Segmentation fault inside soap client) 2015-10-15 18:46:57 +08:00
Sara Golemon a2005cec5c Scan through a range of ports in case 31338 is busy
ext/standard/tests/network/ud4loop.phpt hardcodes port 31338.
If that fails to bind, try a few more (up to 31499) before giving up.
2015-10-14 22:44:27 -07:00
Xinchen Hui a2cfcdfbe9 Fixed bug #70709 (SOAP Client generates Segfault) 2015-10-15 10:19:43 +08:00
Ferenc Kovacs b610d740fd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.15RC1
2015-10-15 00:54:59 +02:00
Ferenc Kovacs 22cbf68344 prepare for 5.6.15RC1 2015-10-15 00:22:12 +02:00
Bob Weinand 60b4355168 Do not create a fake Closure for real Closures
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
2015-10-14 12:07:33 +02:00
Xinchen Hui 5649b0ccba Merge branch 'patch-1' of https://github.com/glensc/php-src into PHP-7.0 2015-10-14 10:31:07 +08:00
Xinchen Hui 534856c98a Move the tests to proper place 2015-10-14 10:26:02 +08:00
Xinchen Hui 010509355d Fixed Conditional jump or move depends on uninitialised value 2015-10-14 10:19:57 +08:00
Bob Weinand d398cc9d10 Prevent memcmp() result truncation
This fixes reported issues with sapi/phpdbg/tests/watch_001.phpt
2015-10-13 15:51:23 +02:00
Bob Weinand 6efbfc4caf phpdbg test info_001.phpt was dependent on auto_globals_jit 2015-10-13 14:40:42 +02:00
Dmitry Stogov d949c3b6e5 Fixed incorrect "peak" memory consumption calculation. 2015-10-13 15:20:17 +03:00
Anatol Belski d1b67af3ab update UPGRADING 2015-10-13 11:47:30 +02:00
Xinchen Hui a8ae88162f Fixed bug #70689 (Exception handler does not work as expected) 2015-10-13 17:40:58 +08:00
Bob Weinand e85a0aba9b Fix on/off values in phpdbg lexer 2015-10-13 11:29:51 +02:00
Anatol Belski 4d8e284cce prepare NEWS for next 2015-10-13 10:34:30 +02:00
Anatol Belski afdbd8f95b update libs_versions.txt 2015-10-13 09:41:34 +02:00
Nikita Popov 7597a06562 Add more tests for closure binding 2015-10-12 20:37:14 +02:00
Dmitry Stogov 23b372d358 Forbid "fake" closure rebinding 2015-10-12 20:34:08 +02:00
Anatol Belski dcbbf7c38d increase API versions 2015-10-12 20:17:22 +02:00
Anatol Belski 5492fe9f25 fork test for ICU 56.1 2015-10-12 11:20:51 +02:00
Anatol Belski aea420c7cf fork test for ICU-56.1 2015-10-12 11:16:27 +02:00
Anatol Belski 3fb6f0014a fix test for ICU-56.1 2015-10-12 11:10:04 +02:00
Matteo Beccati 474a2e01eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2015-10-12 09:47:02 +02:00
Anatol Belski d160e98feb fix test 2015-10-12 09:46:52 +02:00
Xinchen Hui 8732ead953 Double declaration 2015-10-12 10:42:04 +08:00
Anatol Belski 4224907864 fix stack overflow 2015-10-10 18:37:16 +02:00
Bob Weinand fe67696867 Generally run all tests in sapi folder by default
Turned out that sapi/phpdbg actually wasn't explicitly included as sapi folders were individually selected
2015-10-10 17:24:14 +02:00
Nikita Popov c85ad5d0be Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_closures.c
2015-10-10 15:00:41 +02:00
Nikita Popov d7d01fc9a3 Fixed bug #70685
Doing a less intrusive variant of the PHP 7.0 fix for 5.6.
2015-10-10 14:59:21 +02:00
Nikita Popov 4b821f0fc6 Normalize rebinding failures
Move all rebinding checks into one function to make sure they stay
in sync. Normalize return value to be NULL for all rebinding
failures, instead of returning an improperly bound closure in some
cases.
2015-10-10 13:56:36 +02:00
Anatol Belski ffb5d0aca3 Implemented file_cache_fallback mechanism
which is essential as an attempt to fix the "failed to reattach"
error on Windows. If file_cache is enabled, Opcache will
automaticaly switch to file_cache_only mode in the case a process
failed to map the shared segment at the required address. The
important small part of the SHM will still be mapped, which
allows information exchange between normal processes using SHM
and those using the fallback mechanism.

This is based on Dmitry's, Matt's and mine ideas. So many thanks for
support!
2015-10-09 23:47:59 +02:00
Nikita Popov d677b25b1c Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:28:58 +02:00
Nikita Popov e19423f3cb Improve previous fix
Don't forbid null binding on plain functions.
2015-10-09 23:28:24 +02:00
Nikita Popov f6ae19f158 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:06:32 +02:00
Nikita Popov bbae7ddf29 Fixed bug #70681 2015-10-09 23:01:23 +02:00
Anatol Belski be09d1c262 update NEWS 2015-10-09 12:36:40 +02:00
Anatol Belski d468390353 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  fix coverage report for datelib
2015-10-09 12:35:48 +02:00
Anatol Belski 505c9c3742 update NEWS 2015-10-09 12:35:06 +02:00
Dmitry Stogov 0847681b1a Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure()) 2015-10-09 11:48:13 +03:00
Dmitry Stogov c6af0aa33f Fixed reference cuntmting for closures (previously we didn't increment reference counter for "internal" closures) 2015-10-09 02:39:07 +03:00
Dmitry Stogov 93748bf9dd Fixed infinity recurion if we create closure on top of other closure. 2015-10-09 02:37:51 +03:00
Dmitry Stogov 05bd331c6a Fixed use after free 2015-10-09 01:09:22 +03:00
Dmitry Stogov 91fb3a7b27 Fixed bug #70674 (ReflectionFunction::getClosure() leaks memory when used for internal functions) 2015-10-09 00:45:02 +03:00
Andrea Faulds fa23bebe94 Correct intdiv() argument names and description 2015-10-08 15:45:22 +01:00
Dmitry Stogov 3815e97136 Fixed bug #70668 (array_keys() doesn't respect references when $strict is true) 2015-10-08 14:59:02 +03:00
Dmitry Stogov 9af07e7119 Fixed bug #70667 (strtr() causes invalid writes and a crashes) 2015-10-08 14:30:43 +03:00
Nikita Popov cc3c425af8 Fix bug #70662
This replaces add_new with update for the RW case. This should not
be problematic for performance, as this branch throws a notice.

Alternatively add_new could also be replaced with add. I went with
update, because it makes $a[0] += 1 behavior the same as
$a[0] = $a[0] + 1.
2015-10-08 11:03:39 +02:00
Márcio Almada ddb6d7801e Fix bug #70650 2015-10-07 16:25:59 +02:00
Ferenc Kovacs f9e3461c02 pear 1.10 was released and the go-pear and install pear phars are now php7 compatible 2015-10-07 13:56:47 +02:00
Dmitry Stogov 5d2813edce Fixed test.
MySQL and MariaDB of different versions have different assumptions about TIMESTAMP attributes.
Probably we need to add yet another condition to also check MariaDB version.
2015-10-07 14:09:37 +03:00
Christopher Jones 19e461b07d Merge branch 'PHP-7.0' of https://git.php.net/repository/php-src into PHP-7.0
* 'PHP-7.0' of https://git.php.net/repository/php-src:
  Fixed test running on MarinaDB.
2015-10-07 20:27:38 +11:00
Christopher Jones 4a57f1821b Fix mem leak and improve test portability (Senthil) 2015-10-07 20:24:49 +11:00
Dmitry Stogov ccb677ece8 Fixed test running on MarinaDB. 2015-10-07 12:21:43 +03:00
Anatol Belski c0ca731d7a add comment to test 2015-10-07 09:43:28 +02:00
Dmitry Stogov b8b335c492 Restored the original (php-5) behavior of convert_to_cstring(). It was broken in php7 by mistake and caused problems in ext/pgsql/tests/bug46408.phpt. 2015-10-07 04:26:26 +03:00
Dmitry Stogov 91588a98be Fixed test (system error messages may be different). 2015-10-07 03:25:12 +03:00
Dmitry Stogov abf3c2f796 Fixed test (it failed on 32-bit Linux and worked on 64-bit Linux just because of luck). 2015-10-07 03:08:11 +03:00
Dmitry Stogov 424a26d5d4 Split test into different versions for 32-bit and 64-bit systems 2015-10-07 01:51:37 +03:00
Dmitry Stogov 2c92f33b1d Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:php-src:
  Drop HAVE_PACKED_OBJECT_VALUE
  More zpp cleanup in ext/intl
2015-10-07 01:48:11 +03:00
Nikita Popov cd2b0a7bb8 Drop HAVE_PACKED_OBJECT_VALUE
This check doesn't make sense anymore, we have no object_value
anymore.
2015-10-06 23:12:34 +02:00
Dmitry Stogov e0b3b3c752 Revert "Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())"
This reverts commit 517b553625.
2015-10-06 23:59:36 +03:00
Nikita Popov 0a3c1fb4c2 More zpp cleanup in ext/intl 2015-10-06 22:58:02 +02:00
Dmitry Stogov e193d35c1e Revert "Improve 517b55362 (scope rebinding on method Closures)"
This reverts commit 881c502520.
2015-10-06 23:48:15 +03:00
Dmitry Stogov 24e88348f3 Revert "Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src"
This reverts commit a6be0f3fd6.
2015-10-06 23:48:12 +03:00
Dmitry Stogov 524d00e005 Revert "Allow random $this on non-internal Closures again"
This reverts commit 35d0405c47.
2015-10-06 23:48:10 +03:00
Dmitry Stogov 3c0348056a Revert "Speed up self::method() calls (no ZEND_FETCH_CLASS)"
This reverts commit 8c33bdb976.
2015-10-06 23:48:08 +03:00
Dmitry Stogov 5a49ac77aa Revert "Speed up self::$property access by 20%"
This reverts commit 0fbd3e5fe7.
2015-10-06 23:48:04 +03:00
Dmitry Stogov 1198c5d8bb Revert "Update NEWS"
This reverts commit 60bb51c0d3.
2015-10-06 23:47:49 +03:00
Sara Golemon a2082b7c97 Add some tests for unserialize() class filtering 2015-10-06 12:04:11 -07:00
Rasmus Lerdorf fb2c890c2c zend.assertions is not a boolean 2015-10-06 17:13:38 +09:00
Bob Weinand 60bb51c0d3 Update NEWS 2015-10-06 01:03:04 +02:00
Scott 63617a678f Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
See:
* https://bugs.php.net/bug.php?id=70641
* https://github.com/php/php-src/pull/1513#issuecomment-145571829
2015-10-06 01:03:04 +02:00
Anatol Belski d5bd999a8f don't leak handles 2015-10-05 21:59:26 +02:00
Anatol Belski 3331d870aa use correct function to close handles 2015-10-05 21:59:22 +02:00
Bob Weinand 0fbd3e5fe7 Speed up self::$property access by 20% 2015-10-05 21:52:09 +02:00
Bob Weinand 8c33bdb976 Speed up self::method() calls (no ZEND_FETCH_CLASS) 2015-10-05 21:16:52 +02:00
Bob Weinand 35d0405c47 Allow random $this on non-internal Closures again
As it turns out, there is actually no reason to prevent this, it even was a bigger BC break than expected...

Also fixes a memory leak (the Closure leaks) when calling internal functions via Closure by moving it out of leave helper onto caller side for TOP_CODE:

$z = new SplStack; $z->push(20);
$x = (new ReflectionMethod("SplStack", "pop"))->getClosure($z);
var_dump($x());
2015-10-05 17:49:32 +02:00
Bob Weinand a6be0f3fd6 Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src 2015-10-05 14:50:04 +02:00
Bob Weinand 881c502520 Improve 517b55362 (scope rebinding on method Closures)
Now it is completely impossible to rebind a scoped method Closure (only the kind you get from ReflectionMethod::getClosure()) to a foreign scope
Adding a lot of tests to ensure this...
Also, properly return NULL in case the Closure could not be created instead of some crippled unbound Closure
2015-10-05 00:56:55 +02:00
Anatol Belski a549a3ac17 improve error message 2015-10-04 16:36:53 +02:00
Anatol Belski c97198e181 fix incrementing on 32-bit 2015-10-04 12:19:16 +02:00
Nuno Lopes 052dd3005b fix coverage report for datelib 2015-10-04 05:45:05 -04:00
Nuno Lopes ba4a85b012 fix coverage report for datelib 2015-10-04 05:39:01 -04:00
Xinchen Hui 2a54b02257 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-03 23:16:38 -07:00
Xinchen Hui 2fb8bb1157 Fixed bug #70632 (Third one of segfault in gc_remove_from_buffer) 2015-10-03 20:33:24 -07:00
Xinchen Hui 6876112c89 Fixed the third one of (segfault in gc_remove_from_buffer())
This one maybe only used in debug mode, so no bug report and no test
script provided
2015-10-03 20:15:35 -07:00
Xinchen Hui 4744eec753 Fixed bug #70631 (Another Segfault in gc_remove_from_buffer()) 2015-10-03 20:08:21 -07:00
Xinchen Hui 925412ee1c Do not edit the zval cause it might be in shared memory 2015-10-03 19:50:38 -07:00
Xinchen Hui c147d90dbf Fixed bug #70601 (Segfault in gc_remove_from_buffer()) 2015-10-03 19:38:56 -07:00
Bob Weinand 517b553625 Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())
This additionally removes support for binding to an unknown (not in parent hierarchy) scope.
Removing support for cross-scope is necessary for certain compile-time assumptions (like class constants) to prevent unexpected results
2015-10-04 01:38:59 +02:00
Elan Ruusamäe 62c74ac634 Update UPGRADING.INTERNALS
typo fix
2015-10-03 22:10:47 +03:00
Anatol Belski 4cb6342426 remove useless checks
Other platforms than listed in the checks are not supported since
PHP 5.5. We also won't need these checks for a while, so can simplify.
2015-10-03 10:57:32 +02:00
Anatol Belski 96fe3be7f2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix win10 support
2015-10-03 10:46:10 +02:00
Anatol Belski 83bef0ef83 fix win10 support
dwMajorVersion == 10 there, and generally this check is obsolete
as we don't support dwMajorVersion < 6 since 5.5
2015-10-03 10:44:43 +02:00
Nikita Popov e892e2e253 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-03 10:13:44 +02:00
Nikita Popov fe1933aae2 Fixed bug #70625 2015-10-03 10:12:11 +02:00
Ferenc Kovacs b2988714aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS file with LDAP fixes
2015-10-02 21:51:13 +02:00
Ferenc Kovacs 6f895a29c9 Merge branch 'pr-1544' into PHP-5.6
* pr-1544:
  Update NEWS file with LDAP fixes
2015-10-02 21:48:33 +02:00
Derick Rethans a2f5619303 Updated to version 2015.7 (2015g) 2015-10-02 18:12:18 +01:00
Derick Rethans 60b5487897 Empty merge 2015-10-02 18:12:18 +01:00
Derick Rethans c08824fd72 Updated to version 2015.7 (2015g) 2015-10-02 18:12:16 +01:00
Xinchen Hui d6c9dc719e PHP7 is not affected 2015-10-02 07:26:04 -07:00
Xinchen Hui 83fea9461e Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/date/php_date.c
2015-10-02 07:21:07 -07:00
Xinchen Hui c98ea8465b Fixed bug #70619 (DateTimeImmutable segfault) 2015-10-02 07:19:21 -07:00
Bob Weinand 8285731362 Fix parse errors in -rr mode 2015-10-02 12:51:32 +02:00
Bob Weinand 4f90e2ec9d Ensure proper set_exception_handler() handling with exit() inside it 2015-10-02 12:37:40 +02:00
Bob Weinand 0c03ba0ad0 Fixed bug #70614 (incorrect exit code in -rr mode with Exceptions) 2015-10-02 12:37:40 +02:00
Bob Weinand 32337d35cc Do not display memory leaks on fatal 2015-10-02 12:37:40 +02:00
Bob Weinand 6c61286da4 Do not include zend_verify_return_type in executable ops (phpdbg) 2015-10-02 12:37:39 +02:00
Nikita Popov 1287c48082 Fix/improve zpp usage
The ext/interbase changes are done blindly, fingers crossed.

Some of these are bug fixes, some make zpp usage more idiomatic.
2015-10-02 09:35:00 +02:00
Nikita Popov 1a39b6e3c0 More check_parameters improvements
* Switch default REPORT_LEVEL to 1 to cut down on the noise
* Make initialization of 'C' variable always required
* Don't require init of lLdb variable if ! is used
* Don't throw error about missing init of not detected parameters
  (This was a regression in the last changeset)
* Support method_parameters and throw variations
2015-10-02 09:05:39 +02:00
Nikita Popov 5c1b627458 More check_parameters improvements
* Allow / on everything but lLdb (on which it will work, but makes
  no sense).
* For ! on lLdb add additional zend_bool* parameter.
* For optional s and p only require one of the variables to be
  initialized. The length is usually not initialized.
2015-10-01 20:42:57 +02:00
Sean DuBois 06dde16a6a Update scripts/dev/check_parameters.php for PHP 7
Also fix deprecation errors and move from preg_replace
-> preg_replace_callback.
2015-10-01 20:08:05 +02:00
Nikita Popov 8557e8323a Remove checks for read_property retval being NULL
read_property uses &EG(uninitialized_zval) instead.
2015-10-01 16:33:30 +02:00
Nikita Popov c25e81ab7b Remove dead assignment in get_property_guard 2015-10-01 16:28:28 +02:00
Matteo Beccati 8039063d95 ReflectionGenerator and ReflectionType are new classes
I've added them to the new classes paragraph for the sake of completeness, even
though they are mentioned before as new features.
2015-09-30 15:50:01 +02:00
Antony Dovgal 99d5634079 fix dl() function
..which was using old macro
2015-09-30 14:40:29 +01:00
Dmitry Stogov 64a79817ce Reordered field to improve data lacality and reduce L1D CPU cache misses in ZEND_INIT_FCALL opcode family 2015-09-30 16:22:56 +03:00
Julien Pauli a60105d7a4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test
  5.5.31 now
2015-09-30 13:19:37 +02:00
Julien Pauli 0fd71d1184 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test
  5.5.31 now

Conflicts:
	configure.in
	main/php_version.h
2015-09-30 13:19:18 +02:00
Julien Pauli d7fb43e30d Fixed test 2015-09-30 13:18:16 +02:00
Julien Pauli 3f08fc0466 5.5.31 now 2015-09-30 13:01:11 +02:00
Bob Weinand ba6d193b4c Add NTS/ZTS information to php -v 2015-09-30 12:39:09 +02:00
Anatol Belski 3e74df74f9 fix test 2015-09-30 12:18:32 +02:00
Anatol Belski 59541795e2 fork test 2015-09-30 11:13:29 +02:00
Anatol Belski e80306cbe8 fix tests on Windows 2015-09-30 11:13:28 +02:00
Anatol Belski 353d996c9f tweak cgi binary search 2015-09-30 11:13:27 +02:00
Andrey Hristov 07a8e5ce37 Add JSON as exported type, if available. mysqlnd has it, libmysql doesn't export it (for now). 2015-09-30 09:03:35 +02:00
Xinchen Hui df1a99d9a4 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-09-30 12:59:45 +08:00
Andrey Hristov 7b787ebbb6 Merge branch 'PHP-5.6' into PHP-7.0 2015-09-30 09:04:00 +02:00
Richard Quadling 64990642cf Spelling
bugger => buffer
2015-09-30 12:59:16 +08:00
Xinchen Hui 11baa1b672 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2015-09-30 10:41:54 +08:00
Xinchen Hui 45cb42f49f Simply use 0/1 instead as dmitry suggested 2015-09-30 10:41:27 +08:00
Ferenc Kovacs 70e6bf03bf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS, these missed 5.6.14RC1 as I was not asked to include them so delaying for the next release
2015-09-30 01:35:35 +02:00
Ferenc Kovacs 0c10e10ee8 update NEWS, these missed 5.6.14RC1 as I was not asked to include them so delaying for the next release 2015-09-30 01:28:39 +02:00
Ferenc Kovacs 6d9f12d0b3 add NEWS entries 2015-09-30 01:17:40 +02:00
Ferenc Kovacs f8ec1d922e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add NEWS entries
  add NEWS entries
2015-09-30 01:17:10 +02:00
Ferenc Kovacs 264f33a23f add NEWS entries 2015-09-30 01:16:43 +02:00
Ferenc Kovacs 62ff2d0bfe Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add NEWS entries
2015-09-30 01:15:54 +02:00
Ferenc Kovacs 932f707177 add NEWS entries 2015-09-30 01:15:24 +02:00
Xinchen Hui df2ff75116 Make ZEND_ECHO and removed ZEND_PRINT distinguishable 2015-09-29 21:50:15 +08:00
Misha Nasledov 84452dba8e Update NEWS file with LDAP fixes 2015-09-28 12:59:16 -07:00
Bishop Bettini 368d3ff0d9 Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
-------------------------------------------------------------------------------
DirectoryIterator implements SeekableIterator, which "should throw an
OutOfBoundsException if the position is not seekable". As is, seek just returns
and one must call valid(). This approach is different than most (all?) other
SeekableIterator implementations and leads to developer confusion. See the
bug report for a specific example.
2015-09-23 11:14:52 -04:00
Ferenc Kovacs 95a0b11d0a fixup, both catched by nikic 2015-08-24 17:02:25 +02:00
Ferenc Kovacs e93d7953df use another character device in this test as /dev/console seems that it is different for lxc containers 2015-08-24 14:40:21 +02:00
Ferenc Kovacs 941bbf2067 the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one 2015-08-24 14:40:06 +02:00
Ferenc Kovacs 85d34c3264 let's try running our testsuite without sudo 2015-08-23 22:47:51 +02:00
368 changed files with 8853 additions and 4697 deletions

No files matched your search

+18 -8
View File
@@ -1,4 +1,22 @@
language: c
sudo: false
addons:
apt:
packages:
- locales
- language-pack-de
- re2c
- libgmp-dev
- libicu-dev
- libmcrypt-dev
- libtidy-dev
- libenchant-dev
- libaspell-dev
- libpspell-dev
- librecode-dev
- libsasl2-dev
- libxpm-dev
- libt1-dev
notifications:
email:
@@ -27,13 +45,6 @@ env:
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev
- sudo cp ./travis/de /var/lib/locales/supported.d/de
- sudo dpkg-reconfigure locales
- ./travis/install.sh
before_script:
# Compile PHP
- ./travis/compile.sh
@@ -43,7 +54,6 @@ before_script:
- . ./travis/ext/pdo_mysql/setup.sh
- . ./travis/ext/pgsql/setup.sh
- . ./travis/ext/pdo_pgsql/setup.sh
- . ./travis/ext/imap/setup.sh
# Run PHPs run-tests.php
script:
+1 -1
View File
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
cp $$x.bbg lcov_data/$$y.bbg ; \
fi; \
done; \
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
if test -d lcov_data/$$dir; then \
rm -rf lcov_data/$$dir ; \
fi; \
+417 -411
View File
File diff suppressed because it is too large. Load diff
+10 -4
View File
@@ -599,8 +599,8 @@ TSRM_API int shmget(int key, int size, int flags)
return -1;
}
sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key);
sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key);
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
@@ -612,6 +612,12 @@ TSRM_API int shmget(int key, int size, int flags)
created = TRUE;
}
if (!shm_handle || !info_handle) {
if (shm_handle) {
CloseHandle(shm_handle);
}
if (info_handle) {
CloseHandle(info_handle);
}
return -1;
}
} else {
@@ -622,8 +628,8 @@ TSRM_API int shmget(int key, int size, int flags)
shm = shm_get(key, NULL);
if (!shm) {
UnmapViewOfFile(shm_handle);
UnmapViewOfFile(info_handle);
CloseHandle(shm_handle);
CloseHandle(info_handle);
return -1;
}
shm->segment = shm_handle;
+8 -4
View File
@@ -352,7 +352,7 @@ Relevant RFCs:
Other language changes
----------------------
* Removed support for static calls to non-static calls form an incompatible
* Removed support for static calls to non-static methods from an incompatible
$this context. In this case $this will not be defined, but the call will be
allowed with a deprecation notice. An example:
@@ -556,6 +556,10 @@ Other
. Added ability to move PHP code pages (PHP TEXT segment) into HUGE pages.
It's possible to enable/disable this feature in php.ini through
opcache.huge_code_pages=0/1. OS should be configured to provide huge pages.
. Added Windows only opcache.file_cache_fallback=1 ini option, which implies
the implemented fallback mechanism. When OPcache was not able to reattach
the shared memory segment to the desired address and opcache.file_cache
is on, opcache.file_cache_only=1 will be automatically enforced.
- OpenSSL
. Added "alpn_protocols" SSL context option allowing encrypted client/server
@@ -604,9 +608,6 @@ Other
5. Changed Functions
========================================
- parse_ini_file():
- parse_ini_string():
. Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
- unserialize():
. Added second parameter for unserialize function
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
@@ -643,6 +644,7 @@ Other
========================================
6. New Functions
========================================
- GMP
. Added gmp_random_seed().
@@ -666,6 +668,8 @@ Other
7. New Classes and Interfaces
========================================
- ReflectionGenerator
- ReflectionType
========================================
8. Removed Extensions and SAPIs
+2 -2
View File
@@ -90,7 +90,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
they can use the implemenations available on the system, not the PHP one. With snprintf the
macros ZEND_INT_FMT and ZEND_UINT_FMT should be used.
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
h. HashTable API
@@ -248,7 +248,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
w. Tick functions internal API change
Tick functions have different declaration now. They expect a single
single parameter while before they were parameterless. When registering the
parameter while before they were parameterless. When registering the
tick function a value for this parameter must be passed. This value will be
provided to the tick function on every execution.
+1 -1
View File
@@ -18,7 +18,7 @@ bool(true)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_016.php on line 6
NULL
bool(false)
bool(true)
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %sexpect_016.php on line 8
+2 -2
View File
@@ -25,9 +25,9 @@ bool(true)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_018.php on line 10
NULL
bool(false)
bool(true)
Warning: assert(): assert(false) failed in %sexpect_018.php on line 12
NULL
bool(false)
bool(true)
+2 -2
View File
@@ -68,7 +68,7 @@ catch (Exception $e) {
--EXPECTF--
Hello World!
===NONE===
string(56) "Method NoneTest::__toString() must return a string value"
string(%d) "Method NoneTest::__toString() must return a string value"
===THROW===
Fatal error: Method ErrorTest::__toString() must not throw an exception in %sbug26166.php on line %d
Fatal error: Method ErrorTest::__toString() must not throw an exception, caught Exception: This is an error! in %sbug26166.php on line %d
+1 -1
View File
@@ -14,7 +14,7 @@ class Bad {
$bad = new Bad();
echo "$bad";
--EXPECTF--
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
Fatal error: Method Bad::__toString() must not throw an exception, caught Exception: Oops, I cannot do this in %sbug60909_2.php on line %d
!!!shutdown!!!
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70430: Stack buffer overflow in zend_language_parser()
--FILE--
<?php
$"*** Testing function() : ***\n";
?>
--EXPECTF--
Parse error: syntax error, unexpected '"*** Testing function() : ***' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '{' or '$' in %s on line %d
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())
--FILE--
<?php
class a {}
$x = (new ReflectionFunction("substr"))->getClosure();
$x->call(new a);
?>
--EXPECTF--
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #70662: Duplicate array key via undefined index error handler
--FILE--
<?php
$a = [];
set_error_handler(function() use(&$a) {
$a['b'] = 2;
});
$a['b'] += 1;
var_dump($a);
?>
--EXPECT--
array(1) {
["b"]=>
int(1)
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #70681: Segfault when binding $this of internal instance method to null
--FILE--
<?php
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(null);
$c = (new ReflectionFunction('strlen'))->getClosure();
$c = $c->bindTo(null);
var_dump($c("foo"));
?>
--EXPECTF--
Warning: Cannot unbind $this of internal method in %s on line %d
int(3)
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70685: Segfault for getClosure() internal method rebind with invalid $this
--FILE--
<?php
class cls {}
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(new cls);
var_dump($c);
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(new SplStack, 'cls');
var_dump($c);
?>
--EXPECTF--
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
NULL
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70689 (Exception handler does not work as expected)
--FILE--
<?php
function foo($foo) {
echo "Executing foo\n";
}
set_error_handler(function($errno, $errstr) {
throw new Exception($errstr);
});
try {
foo();
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
--FILE--
<?php
$ini = '[${ ';
$ini_file = __DIR__ . "/bug70748.ini";
file_put_contents($ini_file, $ini);
var_dump(parse_ini_file($ini_file));
?>
--CLEAN--
<?php
unlink(__DIR__ . "bug70748.ini");
?>
--EXPECTF--
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
in %sbug70748.php on line %d
bool(false)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70782: null ptr deref and segfault (zend_get_class_fetch_type)
--FILE--
<?php
(-0)::$prop;
?>
--EXPECTF--
Fatal error: Illegal class name in %s on line %d
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #70785 (Infinite loop due to exception during identical comparison)
--FILE--
<?php
set_error_handler(function($no, $msg) {
throw new Exception($msg);
});
try {
if ($a === null) { // ZEND_VM_SMART_BRANCH
undefined_function('Null');
}
} catch (Exception $e) {
}
try {
$c === 3; // ZEND_VM_NEXT_OPCODE
undefined_function();
} catch (Exception $e) {
}
?>
okey
--EXPECT--
okey
+46
View File
@@ -0,0 +1,46 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["array"]);
unset($GLOBALS["a"]); // this will be called in gc_colloct_roots and put $a into gc roots buf
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
$c = new A;
$array = array($c); //This is used to leave a room for $GLOBALS["a"]
unset($c);
while ($i++ < 9997) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t); // This is used to trigger C::__destruct while doing gc_colloct_roots
$e = $a;
unset($a); // This one can not be putted into roots buf because it's full, thus gc_colloct_roots will be called,
// but C::__destructor which is called in gc_colloct_roots will put $a into buf
// which will make $a be putted into gc roots buf twice
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(0)
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["array"]);
unset($GLOBALS["a"]);
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
$c = new A;
$array = array($c);
unset($c);
while ($i++ < 9997) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t);
unset($a);
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(2)
+37
View File
@@ -0,0 +1,37 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
--FILE--
<?php
class A {
}
class B {
}
class C {
public function __destruct() {
if (isset($GLOBALS["a"])) {
unset($GLOBALS["a"]);
}
}
}
$a = new A;
$a->b = new B;
$a->b->a = $a;
$i = 0;
while ($i++ < 9998) {
$t = [];
$t[] = &$t;
unset($t);
}
$t = [new C];
$t[] = &$t;
unset($t);
unset($a);
var_dump(gc_collect_cycles());
--EXPECT--
int(2)
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Bug #70873 (Regression on private static properties access)
--FILE--
<?php
class A {
private static $x = 1;
}
class B extends A {
function bar() {
var_dump(self::$x);
}
};
class C extends A {
function bar() {
var_dump(A::$x);
}
};
$a = new B;
$a->bar();
$b = new C;
$b->bar();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access property B::$x in %sbug70873.php:%d
Stack trace:
#0 %sbug70873.php(%d): B->bar()
#1 {main}
thrown in %sbug70873.php on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #70895 null ptr deref and segfault with crafted callable
--FILE--
<?php
array_map("%n", 0);
array_map("%n %i", 0);
array_map("%n %i aoeu %f aoeu %p", 0);
?>
--EXPECTREGEX--
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70895 null ptr deref and segfault with crafted callable
--FILE--
<?php
function m($f,$a){
return array_map($f,0);
}
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
?>
--EXPECTF--
Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
Warning: implode(): Argument must be an array in %sbug70898.php on line %d
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #70912 (Null ptr dereference when class property is initialised to a dereferenced value)
--FILE--
<?php
class A {
public $a=[][];
}
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %sbug70912.php on line %d
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #70914 zend_throw_or_error() format string vulnerability
--SKIPIF--
<?php
if (!extension_loaded("pdo_sqlite")) {
die("skip pdo_sqlite required");
}
?>
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$st = $db->query('SELECT 1');
$re = $st->fetchObject('%Z');
?>
--EXPECTREGEX--
Fatal error: Class '%Z' not found in .+bug70914.php on line \d+
+37
View File
@@ -0,0 +1,37 @@
--TEST--
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
--FILE--
<?php
try {
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw $e;
}
} catch (Exception $e) {
var_dump((string)$e);
}
try {
$e = new Exception("Foo");
try {
throw new Exception("Bar", 0, $e);
} finally {
throw new Exception("Dummy", 0, $e);
}
} catch (Exception $e) {
var_dump((string)$e);
}
?>
--EXPECTF--
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}"
string(%d) "Exception: Foo in %sbug70944.php:%d
Stack trace:
#0 {main}
Next Exception: Dummy in %sbug70944.php:%d
Stack trace:
#0 {main}"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #70957 (self::class can not be resolved with reflection for abstract class)
--FILE--
<?php
abstract class Foo
{
function bar($a = self::class) {}
}
trait T {
public function bar() {
}
}
class B extends Foo
{
use T;
}
?>
--EXPECTF--
Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
--FILE--
<?php
trait Foo
{
function bar($a = self::class) {
var_dump($a);
}
}
class B {
use Foo;
}
$b = new B;
$b->bar();
?>
--EXPECT--
string(1) "B"
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #70967 (Weird error handling for __toString when Error is thrown)
--FILE--
<?php
class A {
public function __toString() {
undefined_function();
}
}
echo (new A);
?>
--EXPECTF--
Fatal error: Method A::__toString() must not throw an exception, caught Error: Call to undefined function undefined_function() in %sbug70967.php on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #70987 (static::class within Closure::call() causes segfault)
--FILE--
<?php
class foo {}
$bar = function () {
return static::class;
};
var_dump($bar->call(new foo));
?>
--EXPECTF--
string(3) "foo"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #70997 (When using parentClass:: instead of parent::, static context changed)
--FILE--
<?php
class A {
const TEST = false;
public function test()
{
var_dump(static::TEST);
}
}
class B extends A {
const TEST = true;
public function test()
{
A::test();
}
}
$b = new B;
$b->test();
--EXPECT--
bool(true)
+2 -6
View File
@@ -53,9 +53,9 @@ $d = $nonstaticScoped->bindTo(null); $d(); echo "\n";
$d->bindTo($d);
echo "After binding, with same-class instance for the bound ones", "\n";
$d = $staticUnscoped->bindTo(new A); $d(); echo "\n";
$d = $staticUnscoped->bindTo(new A);
$d = $nonstaticUnscoped->bindTo(new A); $d(); echo " (should be scoped to dummy class)\n";
$d = $staticScoped->bindTo(new A); $d(); echo "\n";
$d = $staticScoped->bindTo(new A);
$d = $nonstaticScoped->bindTo(new A); $d(); echo "\n";
echo "After binding, with different instance for the bound ones", "\n";
@@ -87,14 +87,10 @@ After binding, with same-class instance for the bound ones
Warning: Cannot bind an instance to a static closure in %s on line %d
scoped to A: bool(false)
bound: no
scoped to A: bool(false)
bound: A (should be scoped to dummy class)
Warning: Cannot bind an instance to a static closure in %s on line %d
scoped to A: bool(true)
bound: no
scoped to A: bool(true)
bound: A
After binding, with different instance for the bound ones
scoped to A: bool(false)
+4 -16
View File
@@ -26,16 +26,16 @@ $d = $staticUnscoped->bindTo(null, null); $d(); echo "\n";
$d = $staticScoped->bindTo(null, null); $d(); echo "\n";
echo "After binding, null scope, with instance", "\n";
$d = $staticUnscoped->bindTo(new A, null); $d(); echo "\n";
$d = $staticScoped->bindTo(new A, null); $d(); echo "\n";
$d = $staticUnscoped->bindTo(new A, null);
$d = $staticScoped->bindTo(new A, null);
echo "After binding, with scope, no instance", "\n";
$d = $staticUnscoped->bindTo(null, 'A'); $d(); echo "\n";
$d = $staticScoped->bindTo(null, 'A'); $d(); echo "\n";
echo "After binding, with scope, with instance", "\n";
$d = $staticUnscoped->bindTo(new A, 'A'); $d(); echo "\n";
$d = $staticScoped->bindTo(new A, 'A'); $d(); echo "\n";
$d = $staticUnscoped->bindTo(new A, 'A');
$d = $staticScoped->bindTo(new A, 'A');
echo "Done.\n";
@@ -57,14 +57,8 @@ bool(false)
After binding, null scope, with instance
Warning: Cannot bind an instance to a static closure in %s on line %d
bool(false)
bool(false)
Warning: Cannot bind an instance to a static closure in %s on line %d
bool(false)
bool(false)
After binding, with scope, no instance
bool(true)
bool(false)
@@ -75,12 +69,6 @@ bool(false)
After binding, with scope, with instance
Warning: Cannot bind an instance to a static closure in %s on line %d
bool(true)
bool(false)
Warning: Cannot bind an instance to a static closure in %s on line %d
bool(true)
bool(false)
Done.
+241
View File
@@ -0,0 +1,241 @@
--TEST--
Rebinding of ::getClosure()s
--FILE--
<?php
use SplDoublyLinkedList as DLL;
function func($arg) { }
class Cls {
public function method() {}
public static function staticMethod($arg) {}
}
class ClsChild extends Cls {}
class ClsUnrelated {}
/* Format: [Function, [Obj, Scope]] */
$tests = [
['func', [
[null, null],
[new Cls, null],
[new Cls, 'Cls'],
[null, 'Cls'],
[null, 'stdClass'],
[new stdClass, null],
]],
['strlen', [
[null, null],
[new Cls, null],
[new Cls, 'Cls'],
[null, 'Cls'],
[null, 'stdClass'],
[new stdClass, null],
]],
[['Cls', 'staticMethod'], [
[null, 'Cls'],
[new Cls, null],
[new Cls, 'Cls'],
[null, null],
[null, 'ClsChild'],
[null, 'ClsUnrelated'],
]],
[[new Cls, 'method'], [
[null, 'Cls'],
[new Cls, 'Cls'],
[new ClsChild, 'Cls'],
[new ClsUnrelated, 'Cls'],
[new Cls, null],
[new Cls, 'ClsUnrelated'],
[new Cls, 'ClsChild'],
]],
[[new DLL, 'count'], [
[new DLL, DLL::class],
[new SplStack, DLL::class],
[new ClsUnrelated, DLL::class],
[null, null],
[null, DLL::class],
[new DLL, null],
[new DLL, ClsUnrelated::class],
]],
[function() {}, [
[null, null],
[new Cls, null],
[new Cls, 'Cls'],
[null, 'Cls'],
[null, 'stdClass'],
[new stdClass, null],
]],
];
set_error_handler(function($errno, $errstr) {
echo "$errstr\n\n";
});
foreach ($tests as list($fn, $bindings)) {
if (is_array($fn)) {
$r = new ReflectionMethod($fn[0], $fn[1]);
$c = $r->getClosure(is_object($fn[0]) ? $fn[0] : null);
$fnStr = is_object($fn[0]) ? "(new " . get_class($fn[0]) . ")->$fn[1]" : "$fn[0]::$fn[1]";
} else {
$c = (new ReflectionFunction($fn))->getClosure();
$fnStr = $fn;
}
if ($fn instanceof Closure) {
$fnStr = "(function() {})";
}
echo "$fnStr()\n" . str_repeat('-', strlen($fnStr) + 2), "\n\n";
foreach ($bindings as list($obj, $scope)) {
$objStr = $obj ? "new " . get_class($obj) : "null";
$scopeStr = $scope ? "$scope::class" : "null";
echo "bindTo($objStr, $scopeStr):\n";
$ret = $c->bindTo($obj, $scope);
if ($ret !== null) {
echo "Success!\n\n";
}
}
}
?>
--EXPECT--
func()
------
bindTo(null, null):
Success!
bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
bindTo(new stdClass, null):
Success!
strlen()
--------
bindTo(null, null):
Success!
bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, Cls::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
bindTo(new stdClass, null):
Success!
Cls::staticMethod()
-------------------
bindTo(null, Cls::class):
Success!
bindTo(new Cls, null):
Cannot bind an instance to a static closure
bindTo(new Cls, Cls::class):
Cannot bind an instance to a static closure
bindTo(null, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, ClsChild::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(null, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
(new Cls)->method()
-------------------
bindTo(null, Cls::class):
Success!
bindTo(new Cls, Cls::class):
Success!
bindTo(new ClsChild, Cls::class):
Success!
bindTo(new ClsUnrelated, Cls::class):
Success!
bindTo(new Cls, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(new Cls, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(new Cls, ClsChild::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
(new SplDoublyLinkedList)->count()
----------------------------------
bindTo(new SplDoublyLinkedList, SplDoublyLinkedList::class):
Success!
bindTo(new SplStack, SplDoublyLinkedList::class):
Success!
bindTo(new ClsUnrelated, SplDoublyLinkedList::class):
Cannot bind internal method SplDoublyLinkedList::count() to object of class ClsUnrelated
bindTo(null, null):
Cannot unbind $this of internal method
bindTo(null, SplDoublyLinkedList::class):
Cannot unbind $this of internal method
bindTo(new SplDoublyLinkedList, null):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
(function() {})()
-----------------
bindTo(null, null):
Success!
bindTo(new Cls, null):
Success!
bindTo(new Cls, Cls::class):
Success!
bindTo(null, Cls::class):
Success!
bindTo(null, stdClass::class):
Cannot bind closure to scope of internal class stdClass
bindTo(new stdClass, null):
Success!
+1 -1
View File
@@ -61,7 +61,7 @@ int(0)
int(0)
int(3)
Warning: Cannot bind closure to object of internal class stdClass in %s line %d
Warning: Cannot bind closure to scope of internal class stdClass in %s line %d
NULL
int(21)
int(3)
+52
View File
@@ -0,0 +1,52 @@
--TEST--
Concatenating many small strings should not slowdown allocations
--SKIPIF--
<?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
--INI--
memory_limit=256m
--FILE--
<?php
/* To note is that memory usage can vary depending on whether opcache is on. The actual
measuring that matters is timing here. */
$time = microtime(TRUE);
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
$t0_max = 0.1;
$t1_max = 0.4;
$datas = [];
for ($i = 0; $i < 220000; $i++)
{
$datas[] = [
'000.000.000.000',
'000.255.255.255',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
'保留地址',
];
}
$t0 = microtime(TRUE) - $time;
var_dump($t0 < $t0_max);
$texts = '';
foreach ($datas AS $data)
{
$texts .= implode("\t", $data) . "\r\n";
}
$t1 = microtime(TRUE) - $time;
var_dump($t1 < $t1_max);
?>
+++DONE+++
--EXPECT--
bool(true)
bool(true)
+++DONE+++
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #70904 (yield from incorrectly marks valid generator as finished)
--FILE--
<?php
function g1() {
yield 1;
}
function g2($g1) {
yield from $g1;
echo "reached!\n";
yield 2;
}
$g1 = g1();
$g2 = g2($g1);
var_dump($g2->valid());
var_dump($g2->current());
$g1->next();
var_dump($g1->valid());
var_dump($g2->valid());
var_dump($g2->current());
$g2->next();
var_dump($g2->valid());
var_dump($g2->current());
$g2->next();
var_dump($g2->valid());
var_dump($g2->current());
?>
--EXPECT--
bool(true)
int(1)
bool(false)
bool(true)
int(1)
reached!
bool(true)
int(2)
bool(false)
NULL
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #70965 (yield from with a common iterator primes too much)
--FILE--
<?php
function it() {
yield from [1, 2, 3, 4, 5];
}
function bar($g) {
yield from $g;
}
$gen = it();
$gens[] = bar($gen);
$gens[] = bar($gen);
do {
foreach($gens as $g) {
var_dump($g->current());
$gen->next();
}
} while ($gen->valid());
?>
--EXPECT--
int(1)
int(2)
int(3)
int(4)
int(5)
int(5)
+49
View File
@@ -0,0 +1,49 @@
--TEST--
Bug #71013 (Incorrect exception handler with yield from)
--FILE--
<?php
class FooBar implements Iterator {
function __construct() { echo "Constructing new FooBar\n"; }
function __destruct() { echo "Destructing FooBar\n"; }
function current () { throw new Exception; }
function key () { return 0; }
function next () {}
function rewind () {}
function valid () { return true; }
}
function foo() {
try {
$f = new FooBar;
yield from $f;
} catch (Exception $e) {
echo "[foo()] Caught Exception\n";
}
}
function bar() {
echo "Starting bar()\n";
$x = foo();
try {
var_dump($x->current());
} catch (Exception $e) {
echo "[bar()] Caught Exception\n";
}
echo "Unsetting \$x\n";
unset($x);
echo "Finishing bar()\n";
}
bar();
?>
--EXPECT--
Starting bar()
Constructing new FooBar
[foo()] Caught Exception
Destructing FooBar
NULL
Unsetting $x
Finishing bar()
@@ -37,5 +37,8 @@ int(4)
int(6)
int(3)
int(5)
int(3)
int(5)
NULL
bool(false)
@@ -0,0 +1,43 @@
--TEST--
Throwing into a generator yielding from an array/iterator
--FILE--
<?php
$data = [1, 2, 3];
function yielditer($arr) {
foreach($arr as $val) {
yield $val;
}
}
function yf($in) {
yield from $in;
}
function test($g) {
var_dump($g->current());
try {
$g->throw(new Exception("Exception!"));
} catch (Exception $e) {
echo "{$e->getMessage()}\n";
}
var_dump($g->current());
}
$yfiter = yf($data);
$yfgen = yf(yielditer($data));
test(yf($data));
echo "\n";
test(yf(yielditer($data)));
?>
--EXPECT--
int(1)
Exception!
NULL
int(1)
Exception!
NULL
+1 -1
View File
@@ -11,4 +11,4 @@ echo __NAMESPACE__ . "\n";
===DONE===
--EXPECTF--
Fatal error: Namespace declaration statement has to be the very first statement in the script in %sns_068.php on line %d
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_068.php on line %d
+1 -1
View File
@@ -11,4 +11,4 @@ echo "ok\n";
}
?>
--EXPECTF--
Fatal error: Namespace declaration statement has to be the very first statement in the script in %s on line %d
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_083.php on line %d
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Combination of foreach, finally and goto (call order)
--FILE--
<?php
class A {
public $n = 0;
function __construct($n) {
$this->n = $n;
}
function __destruct() {
echo "destruct" . $this->n . "\n";
}
}
foreach ([new A(1)] as $a) {
$a = null;
try {
foreach ([new A(2)] as $a) {
$a = null;
try {
foreach ([new A(3)] as $a) {
$a = null;
goto out;
}
} finally {
echo "finally1\n";
}
out: ;
}
} finally {
echo "finally2\n";
}
}
?>
--EXPECT--
destruct3
finally1
destruct2
finally2
destruct1
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Combination of foreach, finally and exception (call order)
--FILE--
<?php
class A {
public $n = 0;
function __construct($n) {
$this->n = $n;
}
function __destruct() {
echo "destruct" . $this->n . "\n";
}
}
foreach ([new A(1)] as $a) {
$a = null;
try {
foreach ([new A(2)] as $a) {
$a = null;
try {
foreach ([new A(3)] as $a) {
$a = null;
throw new Exception();
}
} finally {
echo "finally1\n";
}
}
} catch (Exception $e) {
echo "catch\n";
} finally {
echo "finally2\n";
}
}
?>
--EXPECT--
destruct3
finally1
destruct2
catch
finally2
destruct1
@@ -0,0 +1,13 @@
--TEST--
Fully qualified (leading backslash) type names must fail
--FILE--
<?php
function foo(\int $foo) {
var_dump($foo);
}
foo(1);
?>
--EXPECTF--
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
@@ -0,0 +1,11 @@
--TEST--
namespace\int is not a valid type hint
--FILE--
<?php
function test(namespace\int $i) {}
test(0);
?>
--EXPECTF--
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
@@ -0,0 +1,13 @@
--TEST--
Accessing a static property on a statically evaluable class expression
--FILE--
<?php
class A {
public static $b = 42;
}
var_dump(('A' . (string) '')::$b);
?>
--EXPECT--
int(42)
@@ -0,0 +1,13 @@
--TEST--
Static property on constexpr class with leading backslash
--FILE--
<?php
class A {
public static $b = 42;
}
var_dump(('\A' . (string) '')::$b);
?>
--EXPECT--
int(42)
@@ -0,0 +1,11 @@
--TEST--
Static property access on constexpr class evaluating to integer
--FILE--
<?php
((int)1)::$b;
?>
--EXPECTF--
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+3 -3
View File
@@ -129,7 +129,7 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
STD_ZEND_INI_BOOLEAN("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
STD_ZEND_INI_BOOLEAN("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, gc_enabled, zend_gc_globals, gc_globals)
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
@@ -1316,7 +1316,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c
if (EG(current_execute_data) && !CG(in_compilation)) {
zend_throw_exception(exception_ce, message, 0);
} else {
zend_error(E_ERROR, message);
zend_error(E_ERROR, "%s", message);
}
efree(message);
@@ -1346,7 +1346,7 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
if (throw_exception) {
zend_throw_exception(zend_ce_type_error, message, 0);
} else {
zend_error(E_WARNING, message);
zend_error(E_WARNING, "%s", message);
}
efree(message);
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.0.0-dev"
#define ZEND_VERSION "3.0.0"
#define ZEND_ENGINE_3
+14 -2
View File
@@ -1219,8 +1219,20 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
zend_property_info *property_info;
ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) {
if(key) {
property_info = zend_get_property_info(object->ce, key, 1);
if (key) {
if (ZSTR_VAL(key)[0] == '\0') {
const char *class_name, *prop_name;
size_t prop_name_len;
if (zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len) == SUCCESS) {
zend_string *pname = zend_string_init(prop_name, prop_name_len, 0);
property_info = zend_get_property_info(object->ce, pname, 1);
zend_string_release(pname);
} else {
property_info = ZEND_WRONG_PROPERTY_INFO;
}
} else {
property_info = zend_get_property_info(object->ce, key, 1);
}
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0) {
+33 -5
View File
@@ -506,9 +506,9 @@ static void zend_mm_munmap(void *addr, size_t size)
/* number of trailing set (1) bits */
static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
{
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
return __builtin_ctzl(~bitset);
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
return __builtin_ctzll(~bitset);
#elif defined(_WIN32)
unsigned long index;
@@ -545,9 +545,9 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
/* number of trailing zero bits (0x01 -> 1; 0x40 -> 6; 0x00 -> LEN) */
static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset)
{
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
return __builtin_ctzl(bitset);
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
return __builtin_ctzll(bitset);
#elif defined(_WIN32)
unsigned long index;
@@ -1161,7 +1161,7 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch
/* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
static zend_always_inline int zend_mm_small_size_to_bit(int size)
{
#if defined(__GNUC__) || __has_builtin(__builtin_clz)
#if (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
return (__builtin_clz(size) ^ 0x1f) + 1;
#elif defined(_WIN32)
unsigned long index;
@@ -1462,7 +1462,15 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
#if ZEND_DEBUG
size = real_size;
#endif
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
#else
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
#endif
if (new_size == old_size) {
#if ZEND_DEBUG
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -1507,7 +1515,9 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
heap->real_size += new_size - old_size;
#endif
#if ZEND_MM_STAT
heap->real_peak = MAX(heap->real_peak, heap->real_size);
heap->size += new_size - old_size;
heap->peak = MAX(heap->peak, heap->size);
#endif
#if ZEND_DEBUG
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -1618,9 +1628,19 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
}
/* Naive reallocation */
#if ZEND_MM_STAT
do {
size_t orig_peak = heap->peak;
size_t orig_real_peak = heap->real_peak;
#endif
ret = zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
memcpy(ret, ptr, MIN(old_size, copy_size));
zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
#if ZEND_MM_STAT
heap->peak = MAX(orig_peak, heap->size);
heap->real_peak = MAX(orig_real_peak, heap->real_size);
} while (0);
#endif
return ret;
}
@@ -1710,7 +1730,15 @@ static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t
static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
#else
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
#endif
void *ptr;
#if ZEND_MM_LIMIT
+1 -1
View File
@@ -124,7 +124,6 @@ enum _zend_ast_kind {
ZEND_AST_SWITCH,
ZEND_AST_SWITCH_CASE,
ZEND_AST_DECLARE,
ZEND_AST_PROP_ELEM,
ZEND_AST_CONST_ELEM,
ZEND_AST_USE_TRAIT,
ZEND_AST_TRAIT_PRECEDENCE,
@@ -142,6 +141,7 @@ enum _zend_ast_kind {
ZEND_AST_TRY,
ZEND_AST_CATCH,
ZEND_AST_PARAM,
ZEND_AST_PROP_ELEM,
/* 4 child nodes */
ZEND_AST_FOR = 4 << ZEND_AST_NUM_CHILDREN_SHIFT,
+11 -9
View File
@@ -2481,7 +2481,7 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit) /* {{{ */
{
zend_execute_data *call, *ptr, *skip;
zend_execute_data *ptr, *skip, *call = NULL;
zend_object *object;
int lineno, frameno = 0;
zend_function *func;
@@ -2490,8 +2490,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
zend_string *include_filename = NULL;
zval stack_frame;
call = NULL;
ptr = EG(current_execute_data);
array_init(return_value);
if (!(ptr = EG(current_execute_data))) {
return;
}
if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type)) {
call = ptr;
ptr = ptr->prev_execute_data;
@@ -2509,13 +2513,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
ptr = ptr->prev_execute_data;
}
}
if (!call) {
call = ptr;
ptr = ptr->prev_execute_data;
}
}
if (!call) {
call = ptr;
ptr = ptr->prev_execute_data;
}
array_init(return_value);
while (ptr && (limit == 0 || frameno < limit)) {
frameno++;
+89 -44
View File
@@ -34,11 +34,15 @@
#define ZEND_CLOSURE_PROPERTY_ERROR() \
zend_throw_error(NULL, "Closure object cannot have properties")
/* reuse bit to mark "fake" closures (it wasn't used for functions before) */
#define ZEND_ACC_FAKE_CLOSURE ZEND_ACC_INTERFACE
typedef struct _zend_closure {
zend_object std;
zend_function func;
zval this_ptr;
zend_class_entry *called_scope;
void (*orig_internal_handler)(INTERNAL_FUNCTION_PARAMETERS);
} zend_closure;
/* non-static since it needs to be referenced */
@@ -69,6 +73,47 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
}
/* }}} */
static zend_bool zend_valid_closure_binding(
zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */
{
zend_function *func = &closure->func;
if (newthis) {
if (func->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
return 0;
}
if (func->type == ZEND_INTERNAL_FUNCTION && func->common.scope &&
!instanceof_function(Z_OBJCE_P(newthis), func->common.scope)) {
/* Binding incompatible $this to an internal method is not supported. */
zend_error(E_WARNING, "Cannot bind internal method %s::%s() to object of class %s",
ZSTR_VAL(func->common.scope->name),
ZSTR_VAL(func->common.function_name),
ZSTR_VAL(Z_OBJCE_P(newthis)->name));
return 0;
}
} else if (!(func->common.fn_flags & ZEND_ACC_STATIC) && func->common.scope
&& func->type == ZEND_INTERNAL_FUNCTION) {
zend_error(E_WARNING, "Cannot unbind $this of internal method");
return 0;
}
if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) {
/* rebinding to internal class is not allowed */
zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s",
ZSTR_VAL(scope->name));
return 0;
}
if ((func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) && scope != func->common.scope) {
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
return 0;
}
return 1;
}
/* }}} */
/* {{{ proto mixed Closure::call(object to [, mixed parameter] [, mixed ...] )
Call closure, binding to a given object with its class as the scope */
ZEND_METHOD(Closure, call)
@@ -89,25 +134,9 @@ ZEND_METHOD(Closure, call)
zclosure = getThis();
closure = (zend_closure *) Z_OBJ_P(zclosure);
if (closure->func.common.fn_flags & ZEND_ACC_STATIC) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
return;
}
if (closure->func.type == ZEND_INTERNAL_FUNCTION) {
/* verify that we aren't binding internal function to a wrong object */
if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
!instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", ZSTR_VAL(closure->func.common.scope->name), ZSTR_VAL(closure->func.common.function_name), ZSTR_VAL(Z_OBJCE_P(newthis)->name));
return;
}
}
newobj = Z_OBJ_P(newthis);
if (newobj->ce != closure->func.common.scope && newobj->ce->type == ZEND_INTERNAL_CLASS) {
/* rebinding to internal class is not allowed */
zend_error(E_WARNING, "Cannot bind closure to object of internal class %s", ZSTR_VAL(newobj->ce->name));
if (!zend_valid_closure_binding(closure, newthis, Z_OBJCE_P(newthis))) {
return;
}
@@ -121,6 +150,7 @@ ZEND_METHOD(Closure, call)
fci.param_count = my_param_count;
fci.object = fci_cache.object = newobj;
fci_cache.initialized = 1;
fci_cache.called_scope = Z_OBJCE_P(newthis);
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
zval new_closure;
@@ -162,15 +192,11 @@ ZEND_METHOD(Closure, bind)
zend_class_entry *ce, *called_scope;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) {
RETURN_NULL();
return;
}
closure = (zend_closure *)Z_OBJ_P(zclosure);
if ((newthis != NULL) && (closure->func.common.fn_flags & ZEND_ACC_STATIC)) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
}
if (scope_arg != NULL) { /* scope argument was given */
if (Z_TYPE_P(scope_arg) == IS_OBJECT) {
ce = Z_OBJCE_P(scope_arg);
@@ -187,15 +213,14 @@ ZEND_METHOD(Closure, bind)
}
zend_string_release(class_name);
}
if(ce && ce != closure->func.common.scope && ce->type == ZEND_INTERNAL_CLASS) {
/* rebinding to internal class is not allowed */
zend_error(E_WARNING, "Cannot bind closure to scope of internal class %s", ZSTR_VAL(ce->name));
return;
}
} else { /* scope argument not given; do not change the scope by default */
ce = closure->func.common.scope;
}
if (!zend_valid_closure_binding(closure, newthis, ce)) {
return;
}
if (newthis) {
called_scope = Z_OBJCE_P(newthis);
} else {
@@ -517,6 +542,15 @@ void zend_register_closure_ce(void) /* {{{ */
}
/* }}} */
static void zend_closure_internal_handler(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
{
zend_closure *closure = (zend_closure*)EX(func)->common.prototype;
closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
OBJ_RELEASE((zend_object*)closure);
EX(func) = NULL;
}
/* }}} */
ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */
{
zend_closure *closure;
@@ -525,17 +559,16 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
closure = (zend_closure *)Z_OBJ_P(res);
memcpy(&closure->func, func, func->type == ZEND_USER_FUNCTION ? sizeof(zend_op_array) : sizeof(zend_internal_function));
closure->func.common.prototype = (zend_function*)closure;
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
if ((scope == NULL) && this_ptr && (Z_TYPE_P(this_ptr) != IS_UNDEF)) {
/* use dummy scope if we're binding an object without specifying a scope */
/* maybe it would be better to create one for this purpose */
scope = zend_ce_closure;
}
if (closure->func.type == ZEND_USER_FUNCTION) {
if (func->type == ZEND_USER_FUNCTION) {
memcpy(&closure->func, func, sizeof(zend_op_array));
closure->func.common.prototype = (zend_function*)closure;
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
if (closure->func.op_array.static_variables) {
HashTable *static_variables = closure->func.op_array.static_variables;
@@ -551,19 +584,20 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
(*closure->func.op_array.refcount)++;
}
} else {
/* verify that we aren't binding internal function to a wrong scope */
if(func->common.scope != NULL) {
if(scope && !instanceof_function(scope, func->common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name), ZSTR_VAL(scope->name));
scope = NULL;
}
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
!instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name), ZSTR_VAL(Z_OBJCE_P(this_ptr)->name));
scope = NULL;
this_ptr = NULL;
}
memcpy(&closure->func, func, sizeof(zend_internal_function));
closure->func.common.prototype = (zend_function*)closure;
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
/* wrap internal function handler to avoid memory leak */
if (UNEXPECTED(closure->func.internal_function.handler == zend_closure_internal_handler)) {
/* avoid infinity recursion, by taking handler from nested closure */
zend_closure *nested = (zend_closure*)((char*)func - XtOffsetOf(zend_closure, func));
ZEND_ASSERT(nested->std.ce == zend_ce_closure);
closure->orig_internal_handler = nested->orig_internal_handler;
} else {
closure->orig_internal_handler = closure->func.internal_function.handler;
}
closure->func.internal_function.handler = zend_closure_internal_handler;
if (!func->common.scope) {
/* if it's a free function, we won't set scope & this since they're meaningless */
this_ptr = NULL;
scope = NULL;
@@ -584,6 +618,17 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
}
/* }}} */
ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */
{
zend_closure *closure;
zend_create_closure(res, func, scope, called_scope, this_ptr);
closure = (zend_closure *)Z_OBJ_P(res);
closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE;
}
/* }}} */
/*
* Local variables:
* tab-width: 4
+1
View File
@@ -29,6 +29,7 @@ void zend_register_closure_ce(void);
extern ZEND_API zend_class_entry *zend_ce_closure;
ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr);
ZEND_API void zend_create_fake_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr);
ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj);
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj);
ZEND_API zval* zend_get_closure_this_ptr(zval *obj);
+45 -36
View File
@@ -190,10 +190,10 @@ typedef struct _builtin_type_info {
} builtin_type_info;
static const builtin_type_info builtin_types[] = {
{"int", sizeof("int") - 1, IS_LONG},
{"float", sizeof("float") - 1, IS_DOUBLE},
{"string", sizeof("string") - 1, IS_STRING},
{"bool", sizeof("bool") - 1, _IS_BOOL},
{ZEND_STRL("int"), IS_LONG},
{ZEND_STRL("float"), IS_DOUBLE},
{ZEND_STRL("string"), IS_STRING},
{ZEND_STRL("bool"), _IS_BOOL},
{NULL, 0, IS_UNDEF}
};
@@ -1703,18 +1703,6 @@ zend_ast *zend_ast_append_str(zend_ast *left_ast, zend_ast *right_ast) /* {{{ */
}
/* }}} */
/* A hacky way that is used to store the doc comment for properties */
zend_ast *zend_ast_append_doc_comment(zend_ast *list) /* {{{ */
{
if (CG(doc_comment)) {
list = zend_ast_list_add(list, zend_ast_create_zval_from_str(CG(doc_comment)));
CG(doc_comment) = NULL;
}
return list;
}
/* }}} */
void zend_verify_namespace(void) /* {{{ */
{
if (FC(has_bracketed_namespaces) && !FC(in_namespace)) {
@@ -2042,6 +2030,7 @@ static void zend_emit_return_type_check(znode *expr, zend_arg_info *return_info)
void zend_emit_final_return(zval *zv) /* {{{ */
{
znode zn;
zend_op *ret;
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
@@ -2055,7 +2044,8 @@ void zend_emit_final_return(zval *zv) /* {{{ */
ZVAL_NULL(&zn.u.constant);
}
zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
ret = zend_emit_op(NULL, returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN, &zn, NULL);
ret->extended_value = -1;
}
/* }}} */
@@ -2136,8 +2126,15 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int th
zend_compile_expr(&name_node, name_ast);
if (name_node.op_type == IS_CONST) {
zend_string *name = Z_STR(name_node.u.constant);
uint32_t fetch_type = zend_get_class_fetch_type(name);
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->extended_value = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
@@ -3612,12 +3609,14 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
void zend_compile_echo(zend_ast *ast) /* {{{ */
{
zend_op *opline;
zend_ast *expr_ast = ast->child[0];
znode expr_node;
zend_compile_expr(&expr_node, expr_ast);
zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
opline->extended_value = 0;
}
/* }}} */
@@ -4384,6 +4383,11 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
if (type != 0) {
if (ast->attr != ZEND_NAME_NOT_FQ) {
zend_error_noreturn(E_COMPILE_ERROR,
"Scalar type declaration '%s' must be unqualified",
ZSTR_VAL(zend_string_tolower(class_name)));
}
arg_info->type_hint = type;
} else {
uint32_t fetch_type = zend_get_class_fetch_type_ast(ast);
@@ -4910,7 +4914,6 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
uint32_t flags = list->attr;
zend_class_entry *ce = CG(active_class_entry);
uint32_t i, children = list->children;
zend_string *doc_comment = NULL;
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables");
@@ -4920,19 +4923,20 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract");
}
/* Doc comment has been appended as last element in property list */
if (list->child[children - 1]->kind == ZEND_AST_ZVAL) {
doc_comment = zend_string_copy(zend_ast_get_str(list->child[children - 1]));
children -= 1;
}
for (i = 0; i < children; ++i) {
zend_ast *prop_ast = list->child[i];
zend_ast *name_ast = prop_ast->child[0];
zend_ast *value_ast = prop_ast->child[1];
zend_ast *doc_comment_ast = prop_ast->child[2];
zend_string *name = zend_ast_get_str(name_ast);
zend_string *doc_comment = NULL;
zval value_zv;
/* Doc comment has been appended as last element in ZEND_AST_PROP_ELEM ast */
if (doc_comment_ast) {
doc_comment = zend_string_copy(zend_ast_get_str(doc_comment_ast));
}
if (flags & ZEND_ACC_FINAL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, "
"the final modifier is allowed only for methods and classes",
@@ -4952,9 +4956,6 @@ void zend_compile_prop_decl(zend_ast *ast) /* {{{ */
name = zend_new_interned_string_safe(name);
zend_declare_property_ex(ce, name, &value_zv, flags, doc_comment);
/* Doc comment is only assigned to first property */
doc_comment = NULL;
}
}
/* }}} */
@@ -5634,7 +5635,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */
}
if (num > 0) {
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
"the very first statement in the script");
"the very first statement or after any declare call in the script");
}
}
@@ -6214,12 +6215,14 @@ void zend_compile_coalesce(znode *result, zend_ast *ast) /* {{{ */
void zend_compile_print(znode *result, zend_ast *ast) /* {{{ */
{
zend_op *opline;
zend_ast *expr_ast = ast->child[0];
znode expr_node;
zend_compile_expr(&expr_node, expr_ast);
zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
opline = zend_emit_op(NULL, ZEND_ECHO, &expr_node, NULL);
opline->extended_value = 1;
result->op_type = IS_CONST;
ZVAL_LONG(&result->u.constant, 1);
@@ -7383,12 +7386,15 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
case ZEND_AST_DIM:
{
/* constant expression should be always read context ... */
zval *container, *dim;
if (ast->child[1] == NULL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (!ast->child[0] || !ast->child[1] || ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
@@ -7471,10 +7477,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
if (Z_TYPE(result) == IS_NULL) {
if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
zend_ast_destroy(ast);
*ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
}
return;
} else {
break;
}
break;
}
zend_eval_const_expr(&class_ast);
+11 -12
View File
@@ -431,17 +431,17 @@ struct _zend_execute_data {
const zend_op *opline; /* executed opline */
zend_execute_data *call; /* current call */
zval *return_value;
zend_function *func; /* executed op_array */
zval This;
#if ZEND_EX_USE_RUN_TIME_CACHE
void **run_time_cache;
#endif
#if ZEND_EX_USE_LITERALS
zval *literals;
#endif
zend_function *func; /* executed funcrion */
zval This; /* this + call_info + num_args */
zend_class_entry *called_scope;
zend_execute_data *prev_execute_data;
zend_array *symbol_table;
#if ZEND_EX_USE_RUN_TIME_CACHE
void **run_time_cache; /* cache op_array->run_time_cache */
#endif
#if ZEND_EX_USE_LITERALS
zval *literals; /* cache op_array->literals */
#endif
};
#define ZEND_CALL_FUNCTION (0 << 0)
@@ -698,7 +698,6 @@ void zend_emit_final_return(zval *zv);
zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right);
uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag);
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag);
zend_ast *zend_ast_append_doc_comment(zend_ast *list);
void zend_handle_encoding_declaration(zend_ast *ast);
/* parser-driven code generators */
@@ -954,9 +953,9 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
#define ZEND_ARRAY_SIZE_SHIFT 2
/* Pseudo-opcodes that are used only temporarily during compilation */
#define ZEND_GOTO 253
#define ZEND_BRK 254
#define ZEND_CONT 255
#define ZEND_GOTO 253
#define ZEND_BRK 254
#define ZEND_CONT 255
END_EXTERN_C()
+18 -9
View File
@@ -70,29 +70,38 @@ ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)
{
zval tmp, *previous, zv, *pzv, rv;
zval *previous, *ancestor, *ex;
zval pv, zv, rv;
zend_class_entry *base_ce;
if (exception == add_previous || !add_previous || !exception) {
return;
}
ZVAL_OBJ(&tmp, add_previous);
if (!instanceof_function(Z_OBJCE(tmp), zend_ce_throwable)) {
ZVAL_OBJ(&pv, add_previous);
if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
return;
}
ZVAL_OBJ(&zv, exception);
pzv = &zv;
ex = &zv;
do {
base_ce = i_get_exception_base(pzv);
previous = zend_read_property(base_ce, pzv, "previous", sizeof("previous")-1, 1, &rv);
ancestor = zend_read_property(i_get_exception_base(&pv), &pv, "previous", sizeof("previous")-1, 1, &rv);
while (Z_TYPE_P(ancestor) == IS_OBJECT) {
if (Z_OBJ_P(ancestor) == Z_OBJ_P(ex)) {
OBJ_RELEASE(add_previous);
return;
}
ancestor = zend_read_property(i_get_exception_base(ancestor), ancestor, "previous", sizeof("previous")-1, 1, &rv);
}
base_ce = i_get_exception_base(ex);
previous = zend_read_property(base_ce, ex, "previous", sizeof("previous")-1, 1, &rv);
if (Z_TYPE_P(previous) == IS_NULL) {
zend_update_property(base_ce, pzv, "previous", sizeof("previous")-1, &tmp);
zend_update_property(base_ce, ex, "previous", sizeof("previous")-1, &pv);
GC_REFCOUNT(add_previous)--;
return;
}
pzv = previous;
} while (pzv && Z_OBJ_P(pzv) != add_previous);
ex = previous;
} while (Z_OBJ_P(ex) != add_previous);
}
void zend_exception_save(void) /* {{{ */
+20 -14
View File
@@ -893,7 +893,7 @@ static zend_always_inline int zend_verify_missing_arg_type(zend_function *zf, ui
return 1;
}
static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
static ZEND_COLD void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
{
if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
UNEXPECTED(zend_verify_missing_arg_type(EX(func), arg_num, cache_slot))) {
@@ -907,9 +907,7 @@ static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, ui
} else {
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
}
return 1;
}
return 0;
}
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
@@ -1451,8 +1449,8 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object, z
ZVAL_OBJ(&obj, Z_OBJ_P(object));
Z_ADDREF(obj);
if (Z_OBJ_HT(obj)->read_property &&
(z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv)) != NULL) {
if (EXPECTED(Z_OBJ_HT(obj)->read_property)) {
z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
if (UNEXPECTED(EG(exception))) {
OBJ_RELEASE(Z_OBJ(obj));
return;
@@ -1557,7 +1555,8 @@ num_index:
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined offset: " ZEND_LONG_FMT, hval);
/* break missing intentionally */
retval = zend_hash_index_update(ht, hval, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
break;
@@ -1605,7 +1604,8 @@ str_index:
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined index: %s", ZSTR_VAL(offset_key));
/* break missing intentionally */
retval = zend_hash_update(ht, offset_key, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(ht, offset_key, &EG(uninitialized_zval));
break;
@@ -1964,8 +1964,8 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) {
zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot);
if (NULL == ptr) {
if (Z_OBJ_HT_P(container)->read_property &&
(ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result)) != NULL) {
if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result);
if (ptr != result) {
ZVAL_INDIRECT(result, ptr);
} else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) {
@@ -2418,9 +2418,8 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
}
/* }}} */
static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t op_num) /* {{{ */
{
int i;
if (UNEXPECTED(EX(call))) {
zend_execute_data *call = EX(call);
zend_op *opline = EX(func)->op_array.opcodes + op_num;
@@ -2543,6 +2542,12 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
call = EX(call);
} while (call);
}
}
/* }}} */
static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
{
int i;
for (i = 0; i < EX(func)->op_array.last_brk_cont; i++) {
const zend_brk_cont_element *brk_cont = &EX(func)->op_array.brk_cont_array[i];
@@ -2592,7 +2597,8 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
/* }}} */
void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) {
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
cleanup_live_vars(execute_data, op_num, catch_op_num);
}
#ifdef HAVE_GCC_GLOBAL_REGS
@@ -2734,9 +2740,9 @@ ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_n
return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot);
}
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
{
return zend_verify_missing_arg(execute_data, arg_num, cache_slot);
zend_verify_missing_arg(execute_data, arg_num, cache_slot);
}
/*
+1 -1
View File
@@ -52,7 +52,7 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg);
ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot);
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
+7 -6
View File
@@ -220,7 +220,7 @@ static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce,
if (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) {
zend_throw_error(exception_ce, message);
} else {
zend_error(E_ERROR, message);
zend_error(E_ERROR, "%s", message);
}
efree(message);
@@ -839,15 +839,16 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
Z_OBJ(call->This) = fci->object;
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
ZEND_ASSERT(GC_TYPE((zend_object*)func->op_array.prototype) == IS_OBJECT);
GC_REFCOUNT((zend_object*)func->op_array.prototype)++;
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE);
}
if (func->type == ZEND_USER_FUNCTION) {
int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0;
EG(scope) = func->common.scope;
call->symbol_table = fci->symbol_table;
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
ZEND_ASSERT(GC_TYPE((zend_object*)func->op_array.prototype) == IS_OBJECT);
GC_REFCOUNT((zend_object*)func->op_array.prototype)++;
ZEND_ADD_CALL_FLAG(call, ZEND_CALL_CLOSURE);
}
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
zend_init_execute_data(call, &func->op_array, fci->retval);
zend_execute_ex(call);
+1 -1
View File
@@ -28,7 +28,7 @@
/* 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 320140815
#define ZEND_EXTENSION_API_NO 320151012
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
+7
View File
@@ -242,6 +242,13 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
GC_REFCOUNT(ref)++;
gc_collect_cycles();
GC_REFCOUNT(ref)--;
if (UNEXPECTED(GC_REFCOUNT(ref)) == 0) {
zval_dtor_func_for_ptr(ref);
return;
}
if (UNEXPECTED(GC_INFO(ref))) {
return;
}
newRoot = GC_G(unused);
if (!newRoot) {
#if ZEND_GC_DEBUG
+35 -25
View File
@@ -65,12 +65,6 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
{
zval_ptr_dtor(&generator->value);
ZVAL_UNDEF(&generator->value);
zval_ptr_dtor(&generator->key);
ZVAL_UNDEF(&generator->key);
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
@@ -170,6 +164,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
zend_generator_close(generator, 0);
/* we can't immediately free them in zend_generator_close() else yield from won't be able to fetch it */
zval_ptr_dtor(&generator->value);
zval_ptr_dtor(&generator->key);
if (EXPECTED(!Z_ISUNDEF(generator->retval))) {
zval_ptr_dtor(&generator->retval);
}
@@ -289,6 +287,12 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
{
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
}
/* Throw the exception in the context of the generator. Decrementing the opline
* to pretend the exception happened during the YIELD opcode. */
zend_execute_data *original_execute_data = EG(current_execute_data);
@@ -508,6 +512,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
EG(current_execute_data) = original_execute_data;
} else {
ZVAL_COPY(&root->value, &root->node.parent->value);
ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
}
}
@@ -568,7 +573,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
if (iter->index++ > 0) {
iter->funcs->move_forward(iter);
if (UNEXPECTED(EG(exception) != NULL)) {
goto failure;
goto exception;
}
}
@@ -578,7 +583,9 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
}
value = iter->funcs->get_current_data(iter);
if (UNEXPECTED(EG(exception) != NULL || !value)) {
if (UNEXPECTED(EG(exception) != NULL)) {
goto exception;
} else if (UNEXPECTED(!value)) {
goto failure;
}
@@ -590,7 +597,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
iter->funcs->get_current_key(iter, &generator->key);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(&generator->key);
goto failure;
goto exception;
}
} else {
ZVAL_LONG(&generator->key, iter->index);
@@ -598,6 +605,13 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
}
return SUCCESS;
exception: {
zend_execute_data *ex = EG(current_execute_data);
EG(current_execute_data) = generator->execute_data;
zend_throw_exception_internal(NULL);
EG(current_execute_data) = ex;
}
failure:
zval_ptr_dtor(&generator->values);
ZVAL_UNDEF(&generator->values);
@@ -622,6 +636,11 @@ try_again:
return;
}
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0 && !Z_ISUNDEF(generator->value))) {
/* We must not advance Generator if we yield from a Generator being currently run */
return;
}
if (UNEXPECTED(!Z_ISUNDEF(generator->values))) {
if (EXPECTED(zend_generator_get_next_delegated_value(generator) == SUCCESS)) {
return;
@@ -630,11 +649,6 @@ try_again:
* after the "yield from" expression. */
}
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0) && !Z_ISUNDEF(generator->value)) {
/* We must not advance Generator if we yield from a Generator being currently run */
return;
}
/* Drop the AT_FIRST_YIELD flag */
orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
@@ -708,7 +722,7 @@ try_again:
static void inline zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
{
if (EXPECTED(generator->execute_data) && UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->node.parent == NULL)) {
if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) {
generator->flags |= ZEND_GENERATOR_DO_INIT;
zend_generator_resume(generator);
generator->flags &= ~ZEND_GENERATOR_DO_INIT;
@@ -759,7 +773,7 @@ ZEND_METHOD(Generator, valid)
zend_generator_get_current(generator);
RETURN_BOOL(EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL));
RETURN_BOOL(EXPECTED(generator->execute_data != NULL));
}
/* }}} */
@@ -778,7 +792,7 @@ ZEND_METHOD(Generator, current)
zend_generator_ensure_initialized(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->value) != IS_UNDEF)) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -802,7 +816,7 @@ ZEND_METHOD(Generator, key)
zend_generator_ensure_initialized(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->key) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->key) != IS_UNDEF)) {
zval *key = &root->key;
ZVAL_DEREF(key);
@@ -865,7 +879,7 @@ ZEND_METHOD(Generator, send)
zend_generator_resume(generator);
root = zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
if (EXPECTED(generator->execute_data)) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -905,7 +919,7 @@ ZEND_METHOD(Generator, throw)
zend_generator_resume(generator);
root = zend_generator_get_current(generator);
if (Z_TYPE(root->value) != IS_UNDEF) {
if (generator->execute_data) {
zval *value = &root->value;
ZVAL_DEREF(value);
@@ -982,11 +996,7 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{
zend_generator_get_current(generator);
if (EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL)) {
return SUCCESS;
} else {
return FAILURE;
}
return generator->execute_data ? SUCCESS : FAILURE;
}
/* }}} */
+50 -11
View File
@@ -112,7 +112,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize)
rather than using an undefined bis scan result. */
return nSize;
}
#elif defined(__GNUC__) || __has_builtin(__builtin_clz)
#elif (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f);
#else
nSize -= 1;
@@ -283,6 +283,40 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
}
}
static uint32_t zend_array_recalc_elements(HashTable *ht)
{
zval *val;
uint32_t num = ht->nNumOfElements;
ZEND_HASH_FOREACH_VAL(ht, val) {
if (Z_TYPE_P(val) == IS_UNDEF) continue;
if (Z_TYPE_P(val) == IS_INDIRECT) {
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
num--;
}
}
} ZEND_HASH_FOREACH_END();
return num;
}
/* }}} */
ZEND_API uint32_t zend_array_count(HashTable *ht)
{
uint32_t num;
if (UNEXPECTED(ht->u.v.flags & HASH_FLAG_HAS_EMPTY_IND)) {
num = zend_array_recalc_elements(ht);
if (UNEXPECTED(ht->nNumOfElements == num)) {
ht->u.v.flags &= ~HASH_FLAG_HAS_EMPTY_IND;
}
} else if (UNEXPECTED(ht == &EG(symbol_table))) {
num = zend_array_recalc_elements(ht);
} else {
num = zend_hash_num_elements(ht);
}
return num;
}
/* }}} */
ZEND_API void ZEND_FASTCALL zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
{
if (bApplyProtection) {
@@ -1049,9 +1083,14 @@ ZEND_API int ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key)
return FAILURE;
} else {
if (ht->pDestructor) {
ht->pDestructor(data);
zval tmp;
ZVAL_COPY_VALUE(&tmp, data);
ZVAL_UNDEF(data);
ht->pDestructor(&tmp);
} else {
ZVAL_UNDEF(data);
}
ZVAL_UNDEF(data);
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
}
} else {
_zend_hash_del_el_ex(ht, idx, p, prev);
@@ -1095,6 +1134,7 @@ ZEND_API int ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *str,
ht->pDestructor(data);
}
ZVAL_UNDEF(data);
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
}
} else {
_zend_hash_del_el_ex(ht, idx, p, prev);
@@ -1454,8 +1494,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
@@ -1480,8 +1520,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val, argument);
@@ -1509,8 +1549,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
HASH_PROTECT_RECURSION(ht);
p = ht->arData;
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
va_start(args, num_args);
hash_key.h = p->h;
@@ -1543,10 +1583,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
HASH_PROTECT_RECURSION(ht);
idx = ht->nNumUsed;
p = ht->arData + idx;
while (idx > 0) {
idx--;
p--;
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
+1
View File
@@ -216,6 +216,7 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_
ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
ZEND_API uint32_t zend_array_count(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
+7 -4
View File
@@ -106,16 +106,19 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
if (Z_TYPE_P(op1) != IS_STRING) {
zend_string *str = zval_get_string(op1);
ZVAL_PSTRINGL(op1, str->val, str->len);
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release(str);
}
op1_len = (int)Z_STRLEN_P(op1);
if (Z_TYPE_P(op2) != IS_STRING) {
convert_to_string(op2);
}
length = op1_len + (int)Z_STRLEN_P(op2);
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
memcpy(Z_STRVAL_P(result)+op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2));
Z_STRVAL_P(result)[length] = 0;
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
}
/* }}} */
+2 -2
View File
@@ -114,7 +114,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yytext[0]) { \
while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
@@ -125,7 +125,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
while (yyleng > 0 && ( \
while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \
+2 -2
View File
@@ -112,7 +112,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yytext[0]) { \
while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
@@ -123,7 +123,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
while (yyleng > 0 && ( \
while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \
+49 -32
View File
@@ -700,7 +700,7 @@ class_statement_list:
class_statement:
variable_modifiers property_list ';'
{ $$ = zend_ast_append_doc_comment($2); $$->attr = $1; }
{ $$ = $2; $$->attr = $1; }
| T_CONST class_const_list ';'
{ $$ = $2; RESET_DOC_COMMENT(); }
| T_USE name_list trait_adaptations
@@ -798,9 +798,10 @@ property_list:
;
property:
T_VARIABLE { $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL); }
| T_VARIABLE '=' expr
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3); }
T_VARIABLE backup_doc_comment
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, NULL, ($2 ? zend_ast_create_zval_from_str($2) : NULL)); }
| T_VARIABLE '=' expr backup_doc_comment
{ $$ = zend_ast_create(ZEND_AST_PROP_ELEM, $1, $3, ($4 ? zend_ast_create_zval_from_str($4) : NULL)); }
;
class_const_list:
@@ -1277,50 +1278,66 @@ isset_variable:
would have been. */
static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
{
if (!yyres) {
return yystrlen(yystr);
/* CG(parse_error) states:
* 0 => yyres = NULL, yystr is the unexpected token
* 1 => yyres = NULL, yystr is one of the expected tokens
* 2 => yyres != NULL, yystr is the unexpected token
* 3 => yyres != NULL, yystr is one of the expected tokens
*/
if (yyres && CG(parse_error) < 2) {
CG(parse_error) = 2;
}
{
if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
CG(parse_error) = 1;
if (CG(parse_error) % 2 == 0) {
/* The unexpected token */
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
unsigned int len = 0, toklen = 0, yystr_len;
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
CG(parse_error)++;
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
if (yyres) {
yystpcpy(yyres, "end of file");
return sizeof("end of file")-1;
}
return sizeof("end of file")-1;
}
str = LANG_SCNG(yy_text);
end = memchr(str, '\n', LANG_SCNG(yy_leng));
yystr_len = (unsigned int)yystrlen(yystr);
str = LANG_SCNG(yy_text);
end = memchr(str, '\n', LANG_SCNG(yy_leng));
yystr_len = (unsigned int)yystrlen(yystr);
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
toklen = (tok2 - tok1) + 1;
} else {
tok1 = tok2 = NULL;
toklen = 0;
}
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
toklen = (tok2 - tok1) + 1;
} else {
tok1 = tok2 = NULL;
toklen = 0;
}
if (end == NULL) {
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
} else {
len = (end - str) > 30 ? 30 : (end - str);
}
if (end == NULL) {
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
} else {
len = (end - str) > 30 ? 30 : (end - str);
}
if (yyres) {
if (toklen) {
snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
} else {
snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
}
yystpcpy(yyres, buffer);
return len + (toklen ? toklen + 1 : 0) + 2;
}
return len + (toklen ? toklen + 1 : 0) + 2;
}
/* One of the expected tokens */
if (!yyres) {
return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
}
if (*yystr == '"') {
YYSIZE_T yyn = 0;
const char *yyp = yystr;
+1 -1
View File
@@ -84,7 +84,7 @@ static void zend_resource_dtor(zend_resource *res)
ZEND_API int zend_list_close(zend_resource *res)
{
if (GC_REFCOUNT(res) <= 0) {
return zend_list_delete(res);
return zend_list_free(res);
} else if (res->type >= 0) {
zend_resource_dtor(res);
}
+1 -1
View File
@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
#define ZEND_MODULE_API_NO 20141001
#define ZEND_MODULE_API_NO 20151012
#ifdef ZTS
#define USING_ZTS 1
#else
+12 -5
View File
@@ -275,10 +275,10 @@ static zend_always_inline int zend_verify_property_access(zend_property_info *pr
return 1;
} else if (property_info->flags & ZEND_ACC_PRIVATE) {
return (ce == EG(scope) || property_info->ce == EG(scope));
} else {
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
} else if (property_info->flags & ZEND_ACC_PROTECTED) {
return zend_check_protected(property_info->ce, EG(scope));
}
return 0;
}
/* }}} */
@@ -494,7 +494,6 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
{
HashTable *guards;
zend_long stub, *guard;
zval tmp;
ZEND_ASSERT(GC_FLAGS(zobj) & IS_OBJ_USE_GUARDS);
if (GC_FLAGS(zobj) & IS_OBJ_HAS_GUARDS) {
@@ -506,7 +505,6 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
} else {
ALLOC_HASHTABLE(guards);
zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0);
ZVAL_PTR(&tmp, guards);
Z_PTR(zobj->properties_table[zobj->ce->default_properties_count]) = guards;
GC_FLAGS(zobj) |= IS_OBJ_HAS_GUARDS;
}
@@ -1528,9 +1526,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
if (ce->__tostring &&
(zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
if (UNEXPECTED(EG(exception) != NULL)) {
zval *msg, ex, rv;
zval_ptr_dtor(&retval);
ZVAL_OBJ(&ex, EG(exception));
EG(exception) = NULL;
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ZSTR_VAL(ce->name));
msg = zend_read_property(Z_OBJCE(ex), &ex, "message", sizeof("message") - 1, 1, &rv);
if (UNEXPECTED(Z_TYPE_P(msg) != IS_STRING)) {
ZVAL_EMPTY_STRING(&rv);
msg = &rv;
}
zend_error_noreturn(E_ERROR,
"Method %s::__toString() must not throw an exception, caught %s: %s",
ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg));
return FAILURE;
}
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
+11 -3
View File
@@ -492,7 +492,15 @@ try_again:
ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
_convert_to_string(op ZEND_FILE_LINE_CC);
if (Z_TYPE_P(op) == IS_DOUBLE) {
zend_string *str;
double dval = Z_DVAL_P(op);
str = zend_strpprintf(0, "%.*H", (int) EG(precision), dval);
ZVAL_NEW_STR(op, str);
} else {
_convert_to_string(op ZEND_FILE_LINE_CC);
}
}
/* }}} */
@@ -2269,7 +2277,7 @@ try_again:
zval *val;
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
Z_TRY_ADDREF_P(val);
increment_function(val);
Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
@@ -2337,7 +2345,7 @@ try_again:
zval *val;
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
Z_ADDREF_P(val);
Z_TRY_ADDREF_P(val);
decrement_function(val);
Z_OBJ_HANDLER_P(op1, set)(op1, val);
zval_ptr_dtor(val);
+1 -1
View File
@@ -757,7 +757,7 @@ static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op
int ret; \
zval rv; \
zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv); \
Z_ADDREF_P(objval); \
Z_TRY_ADDREF_P(objval); \
ret = binary_op(objval, objval, op2); \
Z_OBJ_HANDLER_P(op1, set)(op1, objval); \
zval_ptr_dtor(objval); \
+17
View File
@@ -459,6 +459,9 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
}
}
#else
#ifdef ZEND_WIN32
ZeroMemory(&cwd, sizeof(cwd));
#endif
result = getcwd(cwd, sizeof(cwd));
#endif
if (!result) {
@@ -1563,6 +1566,20 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
return -1;
}
#ifdef ZEND_WIN32
{
mode_t _tmp = mode;
mode = 0;
if (_tmp & _S_IREAD) {
mode |= _S_IREAD;
}
if (_tmp & _S_IWRITE) {
mode |= _S_IWRITE;
}
}
#endif
ret = chmod(new_state.cwd, mode);
CWD_STATE_FREE_ERR(&new_state);
+32 -32
View File
@@ -328,12 +328,9 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
result = fast_is_identical_function(op1, op2);
FREE_OP1();
FREE_OP2();
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
@@ -349,12 +346,9 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
result = fast_is_not_identical_function(op1, op2);
FREE_OP1();
FREE_OP2();
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
@@ -1565,7 +1559,8 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -3107,8 +3102,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -4713,9 +4708,8 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
HANDLE_EXCEPTION();
}
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
@@ -5519,8 +5513,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -7124,11 +7124,12 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
}
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
cleanup_live_vars(execute_data, op_num, finally_op_num);
if (in_finally && Z_OBJ_P(fast_call)) {
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
@@ -7138,6 +7139,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else {
cleanup_live_vars(execute_data, op_num, catch_op_num);
if (in_finally) {
/* we are going out of current finally scope */
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
@@ -7176,14 +7178,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
SAVE_OPLINE();
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
if (EG(exception)) {
HANDLE_EXCEPTION();
}
opline = EX(opline);
switch (ret) {
case ZEND_USER_OPCODE_CONTINUE:
LOAD_OPLINE();
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
@@ -7196,13 +7194,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
case ZEND_USER_OPCODE_ENTER:
ZEND_VM_ENTER();
case ZEND_USER_OPCODE_LEAVE:
LOAD_OPLINE();
ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH(opline->opcode, opline);
default:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
}
}
@@ -7564,20 +7559,25 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
USE_OPLINE
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
EG(exception) = Z_OBJ_P(fast_call);
Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
}
}
}
}
+186 -220
View File
@@ -1204,9 +1204,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
HANDLE_EXCEPTION();
}
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
@@ -1515,11 +1514,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
}
}
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
cleanup_unfinished_calls(execute_data, op_num);
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
cleanup_live_vars(execute_data, op_num, finally_op_num);
if (in_finally && Z_OBJ_P(fast_call)) {
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
}
@@ -1529,6 +1529,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
ZEND_VM_CONTINUE();
} else {
cleanup_live_vars(execute_data, op_num, catch_op_num);
if (in_finally) {
/* we are going out of current finally scope */
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
@@ -1567,14 +1568,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
SAVE_OPLINE();
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
if (EG(exception)) {
HANDLE_EXCEPTION();
}
opline = EX(opline);
switch (ret) {
case ZEND_USER_OPCODE_CONTINUE:
LOAD_OPLINE();
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
@@ -1587,13 +1584,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
case ZEND_USER_OPCODE_ENTER:
ZEND_VM_ENTER();
case ZEND_USER_OPCODE_LEAVE:
LOAD_OPLINE();
ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH(opline->opcode, opline);
default:
ZEND_ASSERT(EX(opline) == opline);
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
}
}
@@ -1647,20 +1641,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
USE_OPLINE
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else {
EG(exception) = Z_OBJ_P(fast_call);
Z_OBJ_P(fast_call) = NULL;
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
ZEND_VM_CONTINUE();
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
zend_generator *generator = zend_get_running_generator(execute_data);
zend_generator_close(generator, 1);
ZEND_VM_RETURN();
} else {
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
}
}
}
@@ -4596,12 +4595,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -4617,12 +4613,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CO
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5024,7 +5017,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -5698,8 +5692,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -6118,8 +6112,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HAN
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -6645,12 +6645,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6666,12 +6663,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TM
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6828,12 +6822,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6849,12 +6840,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VA
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -6945,7 +6933,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -7058,8 +7047,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDL
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -7441,7 +7436,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -7671,8 +7667,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -7917,8 +7913,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -8537,12 +8539,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HAN
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -8558,12 +8557,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9414,8 +9410,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -11222,8 +11218,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -12570,12 +12566,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -12591,12 +12584,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13125,12 +13115,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13146,12 +13133,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13308,12 +13292,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13329,12 +13310,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13861,12 +13839,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13882,12 +13857,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16411,12 +16383,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -16432,12 +16401,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -17581,8 +17547,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -18153,12 +18119,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18174,12 +18137,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18365,12 +18325,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HAND
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -18386,12 +18343,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19221,8 +19175,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -19619,12 +19573,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19640,12 +19591,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -20848,8 +20796,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -22418,8 +22366,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
object = Z_OBJ(EX(This));
}
if (!object) {
ce = object->ce;
} else {
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
/* Allowed for PHP 4 compatibility. */
zend_error(
@@ -30097,12 +30045,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -30118,12 +30063,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -31092,7 +31034,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -32210,8 +32153,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLE
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -32977,12 +32926,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -32998,12 +32944,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -33188,12 +33131,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDL
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -33209,12 +33149,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_H
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
@@ -33305,7 +33242,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -33505,8 +33443,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -34242,7 +34186,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -34734,8 +34679,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDL
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -35332,12 +35283,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLE
result = fast_is_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -35353,12 +35301,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HA
result = fast_is_not_identical_function(op1, op2);
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
ZEND_VM_SMART_BRANCH(result, 1);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -41434,7 +41379,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -41944,8 +41890,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HA
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -42415,7 +42367,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -42528,8 +42481,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HAND
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
@@ -42816,7 +42775,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
break;
case BP_VAR_RW:
zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
/* break missing intentionally */
retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
break;
case BP_VAR_W:
retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
break;
@@ -42929,8 +42889,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_H
ZVAL_UNDEF(var);
zval_dtor_func_for_ptr(garbage);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
ZVAL_UNDEF(var);
zval *z = var;
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
ZVAL_UNDEF(var);
gc_possible_root(Z_COUNTED_P(z));
} else {
ZVAL_UNDEF(var);
}
}
} else {
ZVAL_UNDEF(var);
+54
View File
@@ -3050,3 +3050,57 @@ AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
])
dnl PHP_CHECK_BUILTIN_CLZ
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
AC_MSG_CHECKING([for __builtin_clz])
AC_TRY_LINK(, [
return __builtin_clz(1) ? 1 : 0;
], [
have_builtin_clz=1
AC_MSG_RESULT([yes])
], [
have_builtin_clz=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz])
])
dnl PHP_CHECK_BUILTIN_CTZL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
AC_MSG_CHECKING([for __builtin_ctzl])
AC_TRY_LINK(, [
return __builtin_ctzl(2L) ? 1 : 0;
], [
have_builtin_ctzl=1
AC_MSG_RESULT([yes])
], [
have_builtin_ctzl=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl])
])
dnl PHP_CHECK_BUILTIN_CTZLL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
AC_MSG_CHECKING([for __builtin_ctzll])
AC_TRY_LINK(, [
return __builtin_ctzll(2LL) ? 1 : 0;
], [
have_builtin_ctzll=1
AC_MSG_RESULT([yes])
], [
have_builtin_ctzll=0
AC_MSG_RESULT([no])
])
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
])
+4 -2
View File
@@ -4,7 +4,9 @@
dir=$1; shift
for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do
echo "config_m4_src=$stubfile
config_m4_dir=`dirname $stubfile`
echo "dnl Define where extension directories are located in the configure context
AC_DEFUN([PHP_EXT_BUILDDIR], [`dirname $stubfile`])
AC_DEFUN([PHP_EXT_DIR], [`dirname $stubfile`])
AC_DEFUN([PHP_EXT_SRCDIR], [\$abs_srcdir/`dirname $stubfile`])
sinclude($stubfile)"
done
+8 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="RC4"
PHP_RELEASE_VERSION=1
PHP_EXTRA_VERSION="RC1"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
@@ -577,6 +577,12 @@ PHP_CHECK_STDINT_TYPES
dnl Check __builtin_expect
PHP_CHECK_BUILTIN_EXPECT
dnl Check __builtin_clz
PHP_CHECK_BUILTIN_CLZ
dnl Check __builtin_ctzl
PHP_CHECK_BUILTIN_CTZL
dnl Check __builtin_ctzll
PHP_CHECK_BUILTIN_CTZLL
dnl Check for members of the stat structure
AC_STRUCT_ST_BLKSIZE
+2
View File
@@ -9,6 +9,8 @@ if (!extension_loaded('curl')) exit("skip curl extension not loaded");
$curl = curl_init("http://www.google.com");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_PRIVATE, "123");
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
curl_exec($curl);
var_dump(curl_getinfo($curl, CURLINFO_PRIVATE));
+3 -1
View File
@@ -15,7 +15,9 @@ var_dump(curl_setopt_array($c, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_UPLOAD => true,
CURLOPT_INFILE => $f,
CURLOPT_INFILESIZE => filesize(__FILE__)
CURLOPT_INFILESIZE => filesize(__FILE__),
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 1,
]));
fclose($f);
var_dump(curl_setopt_array($c, [
+3 -1
View File
@@ -17,7 +17,9 @@ curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read'
CURLOPT_READFUNCTION => 'curl_read',
CURLOPT_CONNECTTIMEOUT=> 1,
CURLOPT_TIMEOUT=>1
));
function curl_read($ch, $fp, $len) {
+3 -1
View File
@@ -18,7 +18,9 @@ curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read'
CURLOPT_READFUNCTION => 'curl_read',
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 1
));
function curl_read($ch, $fp, $len) {
+98 -98
View File
@@ -1,5 +1,5 @@
/* Generated by re2c 0.13.5 on Thu Aug 13 10:30:11 2015 */
#line 1 "parse_date.re"
#line 1 "ext/date/lib/parse_date.re"
/*
* The MIT License (MIT)
*
@@ -820,11 +820,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 946 "parse_date.re"
#line 946 "ext/date/lib/parse_date.re"
#line 828 "<stdout>"
#line 828 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -964,7 +964,7 @@ yy2:
}
yy3:
YYDEBUG(3, *YYCURSOR);
#line 1626 "parse_date.re"
#line 1626 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -977,7 +977,7 @@ yy3:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 981 "<stdout>"
#line 981 "ext/date/lib/parse_date.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1288,12 +1288,12 @@ yy11:
if (yych <= '9') goto yy1385;
yy12:
YYDEBUG(12, *YYCURSOR);
#line 1721 "parse_date.re"
#line 1721 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1297 "<stdout>"
#line 1297 "ext/date/lib/parse_date.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2350,11 +2350,11 @@ yy48:
if (yych <= '9') goto yy54;
yy49:
YYDEBUG(49, *YYCURSOR);
#line 1710 "parse_date.re"
#line 1710 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2358 "<stdout>"
#line 2358 "ext/date/lib/parse_date.c"
yy50:
YYDEBUG(50, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2363,12 +2363,12 @@ yy51:
YYDEBUG(51, *YYCURSOR);
++YYCURSOR;
YYDEBUG(52, *YYCURSOR);
#line 1715 "parse_date.re"
#line 1715 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2372 "<stdout>"
#line 2372 "ext/date/lib/parse_date.c"
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2755,7 +2755,7 @@ yy71:
if (yych == 's') goto yy73;
yy72:
YYDEBUG(72, *YYCURSOR);
#line 1694 "parse_date.re"
#line 1694 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2770,7 +2770,7 @@ yy72:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2774 "<stdout>"
#line 2774 "ext/date/lib/parse_date.c"
yy73:
YYDEBUG(73, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3532,7 +3532,7 @@ yy165:
}
yy166:
YYDEBUG(166, *YYCURSOR);
#line 1557 "parse_date.re"
#line 1557 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3549,7 +3549,7 @@ yy166:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3553 "<stdout>"
#line 3553 "ext/date/lib/parse_date.c"
yy167:
YYDEBUG(167, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4069,7 +4069,7 @@ yy192:
}
yy193:
YYDEBUG(193, *YYCURSOR);
#line 1616 "parse_date.re"
#line 1616 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4078,7 +4078,7 @@ yy193:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4082 "<stdout>"
#line 4082 "ext/date/lib/parse_date.c"
yy194:
YYDEBUG(194, *YYCURSOR);
++YYCURSOR;
@@ -4129,7 +4129,7 @@ yy197:
}
yy198:
YYDEBUG(198, *YYCURSOR);
#line 1362 "parse_date.re"
#line 1362 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4142,7 +4142,7 @@ yy198:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4146 "<stdout>"
#line 4146 "ext/date/lib/parse_date.c"
yy199:
YYDEBUG(199, *YYCURSOR);
yyaccept = 6;
@@ -4411,7 +4411,7 @@ yy221:
}
yy222:
YYDEBUG(222, *YYCURSOR);
#line 1664 "parse_date.re"
#line 1664 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4440,7 +4440,7 @@ yy222:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4444 "<stdout>"
#line 4444 "ext/date/lib/parse_date.c"
yy223:
YYDEBUG(223, *YYCURSOR);
yyaccept = 7;
@@ -5138,7 +5138,7 @@ yy277:
YYDEBUG(277, *YYCURSOR);
++YYCURSOR;
YYDEBUG(278, *YYCURSOR);
#line 1640 "parse_date.re"
#line 1640 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5161,7 +5161,7 @@ yy277:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5165 "<stdout>"
#line 5165 "ext/date/lib/parse_date.c"
yy279:
YYDEBUG(279, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5339,7 +5339,7 @@ yy293:
++YYCURSOR;
yy294:
YYDEBUG(294, *YYCURSOR);
#line 1334 "parse_date.re"
#line 1334 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -5352,7 +5352,7 @@ yy294:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5356 "<stdout>"
#line 5356 "ext/date/lib/parse_date.c"
yy295:
YYDEBUG(295, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6572,7 +6572,7 @@ yy361:
if (yych <= '9') goto yy364;
yy363:
YYDEBUG(363, *YYCURSOR);
#line 1478 "parse_date.re"
#line 1478 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -6585,7 +6585,7 @@ yy363:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6589 "<stdout>"
#line 6589 "ext/date/lib/parse_date.c"
yy364:
YYDEBUG(364, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7223,7 +7223,7 @@ yy391:
}
yy392:
YYDEBUG(392, *YYCURSOR);
#line 1536 "parse_date.re"
#line 1536 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -7243,7 +7243,7 @@ yy392:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7247 "<stdout>"
#line 7247 "ext/date/lib/parse_date.c"
yy393:
YYDEBUG(393, *YYCURSOR);
yyaccept = 5;
@@ -8993,7 +8993,7 @@ yy453:
++YYCURSOR;
yy454:
YYDEBUG(454, *YYCURSOR);
#line 1239 "parse_date.re"
#line 1239 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9004,7 +9004,7 @@ yy454:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9008 "<stdout>"
#line 9008 "ext/date/lib/parse_date.c"
yy455:
YYDEBUG(455, *YYCURSOR);
yyaccept = 0;
@@ -9564,7 +9564,7 @@ yy474:
}
yy475:
YYDEBUG(475, *YYCURSOR);
#line 1376 "parse_date.re"
#line 1376 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9575,7 +9575,7 @@ yy475:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9579 "<stdout>"
#line 9579 "ext/date/lib/parse_date.c"
yy476:
YYDEBUG(476, *YYCURSOR);
yyaccept = 10;
@@ -9716,7 +9716,7 @@ yy487:
YYDEBUG(487, *YYCURSOR);
++YYCURSOR;
YYDEBUG(488, *YYCURSOR);
#line 1094 "parse_date.re"
#line 1094 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9732,7 +9732,7 @@ yy487:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9736 "<stdout>"
#line 9736 "ext/date/lib/parse_date.c"
yy489:
YYDEBUG(489, *YYCURSOR);
yyaccept = 11;
@@ -9745,7 +9745,7 @@ yy489:
}
yy490:
YYDEBUG(490, *YYCURSOR);
#line 1131 "parse_date.re"
#line 1131 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9770,7 +9770,7 @@ yy490:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9774 "<stdout>"
#line 9774 "ext/date/lib/parse_date.c"
yy491:
YYDEBUG(491, *YYCURSOR);
yyaccept = 11;
@@ -10080,7 +10080,7 @@ yy522:
YYDEBUG(522, *YYCURSOR);
++YYCURSOR;
YYDEBUG(523, *YYCURSOR);
#line 1111 "parse_date.re"
#line 1111 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10099,7 +10099,7 @@ yy522:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10103 "<stdout>"
#line 10103 "ext/date/lib/parse_date.c"
yy524:
YYDEBUG(524, *YYCURSOR);
yyaccept = 11;
@@ -10205,7 +10205,7 @@ yy533:
if (yych <= '9') goto yy540;
yy534:
YYDEBUG(534, *YYCURSOR);
#line 1293 "parse_date.re"
#line 1293 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -10219,7 +10219,7 @@ yy534:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10223 "<stdout>"
#line 10223 "ext/date/lib/parse_date.c"
yy535:
YYDEBUG(535, *YYCURSOR);
yych = *++YYCURSOR;
@@ -10956,7 +10956,7 @@ yy604:
YYDEBUG(605, *YYCURSOR);
++YYCURSOR;
YYDEBUG(606, *YYCURSOR);
#line 1308 "parse_date.re"
#line 1308 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -10967,7 +10967,7 @@ yy604:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10971 "<stdout>"
#line 10971 "ext/date/lib/parse_date.c"
yy607:
YYDEBUG(607, *YYCURSOR);
yyaccept = 11;
@@ -11003,7 +11003,7 @@ yy610:
if (yych <= '9') goto yy604;
yy611:
YYDEBUG(611, *YYCURSOR);
#line 1320 "parse_date.re"
#line 1320 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11016,7 +11016,7 @@ yy611:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11020 "<stdout>"
#line 11020 "ext/date/lib/parse_date.c"
yy612:
YYDEBUG(612, *YYCURSOR);
yyaccept = 11;
@@ -11657,7 +11657,7 @@ yy655:
}
yy656:
YYDEBUG(656, *YYCURSOR);
#line 1279 "parse_date.re"
#line 1279 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11670,7 +11670,7 @@ yy656:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11674 "<stdout>"
#line 11674 "ext/date/lib/parse_date.c"
yy657:
YYDEBUG(657, *YYCURSOR);
yyaccept = 13;
@@ -11776,7 +11776,7 @@ yy665:
}
yy666:
YYDEBUG(666, *YYCURSOR);
#line 1223 "parse_date.re"
#line 1223 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -11791,7 +11791,7 @@ yy666:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11795 "<stdout>"
#line 11795 "ext/date/lib/parse_date.c"
yy667:
YYDEBUG(667, *YYCURSOR);
yyaccept = 14;
@@ -12024,7 +12024,7 @@ yy699:
if (yych <= ':') goto yy703;
yy700:
YYDEBUG(700, *YYCURSOR);
#line 1506 "parse_date.re"
#line 1506 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12044,7 +12044,7 @@ yy700:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12048 "<stdout>"
#line 12048 "ext/date/lib/parse_date.c"
yy701:
YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12596,7 +12596,7 @@ yy762:
}
yy763:
YYDEBUG(763, *YYCURSOR);
#line 1251 "parse_date.re"
#line 1251 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12609,7 +12609,7 @@ yy763:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12613 "<stdout>"
#line 12613 "ext/date/lib/parse_date.c"
yy764:
YYDEBUG(764, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12648,7 +12648,7 @@ yy770:
YYDEBUG(770, *YYCURSOR);
++YYCURSOR;
YYDEBUG(771, *YYCURSOR);
#line 1492 "parse_date.re"
#line 1492 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12661,7 +12661,7 @@ yy770:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12665 "<stdout>"
#line 12665 "ext/date/lib/parse_date.c"
yy772:
YYDEBUG(772, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12799,7 +12799,7 @@ yy782:
}
yy783:
YYDEBUG(783, *YYCURSOR);
#line 1527 "parse_date.re"
#line 1527 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12807,7 +12807,7 @@ yy783:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12811 "<stdout>"
#line 12811 "ext/date/lib/parse_date.c"
yy784:
YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12958,7 +12958,7 @@ yy792:
}
yy793:
YYDEBUG(793, *YYCURSOR);
#line 1348 "parse_date.re"
#line 1348 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -12971,7 +12971,7 @@ yy793:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 12975 "<stdout>"
#line 12975 "ext/date/lib/parse_date.c"
yy794:
YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13186,7 +13186,7 @@ yy813:
if (yych <= '7') goto yy816;
yy814:
YYDEBUG(814, *YYCURSOR);
#line 1459 "parse_date.re"
#line 1459 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13204,7 +13204,7 @@ yy814:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13208 "<stdout>"
#line 13208 "ext/date/lib/parse_date.c"
yy815:
YYDEBUG(815, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13214,7 +13214,7 @@ yy816:
YYDEBUG(816, *YYCURSOR);
++YYCURSOR;
YYDEBUG(817, *YYCURSOR);
#line 1440 "parse_date.re"
#line 1440 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13232,7 +13232,7 @@ yy816:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13236 "<stdout>"
#line 13236 "ext/date/lib/parse_date.c"
yy818:
YYDEBUG(818, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13296,7 +13296,7 @@ yy820:
}
yy821:
YYDEBUG(821, *YYCURSOR);
#line 1426 "parse_date.re"
#line 1426 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13309,7 +13309,7 @@ yy821:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13313 "<stdout>"
#line 13313 "ext/date/lib/parse_date.c"
yy822:
YYDEBUG(822, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13412,7 +13412,7 @@ yy841:
++YYCURSOR;
yy842:
YYDEBUG(842, *YYCURSOR);
#line 1400 "parse_date.re"
#line 1400 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13437,7 +13437,7 @@ yy842:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13441 "<stdout>"
#line 13441 "ext/date/lib/parse_date.c"
yy843:
YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13699,7 +13699,7 @@ yy847:
}
yy848:
YYDEBUG(848, *YYCURSOR);
#line 1388 "parse_date.re"
#line 1388 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -13710,7 +13710,7 @@ yy848:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13714 "<stdout>"
#line 13714 "ext/date/lib/parse_date.c"
yy849:
YYDEBUG(849, *YYCURSOR);
yych = *++YYCURSOR;
@@ -14630,7 +14630,7 @@ yy972:
if (yych <= '9') goto yy995;
yy973:
YYDEBUG(973, *YYCURSOR);
#line 1265 "parse_date.re"
#line 1265 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -14643,7 +14643,7 @@ yy973:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14647 "<stdout>"
#line 14647 "ext/date/lib/parse_date.c"
yy974:
YYDEBUG(974, *YYCURSOR);
yyaccept = 22;
@@ -15652,7 +15652,7 @@ yy1065:
}
yy1067:
YYDEBUG(1067, *YYCURSOR);
#line 1157 "parse_date.re"
#line 1157 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15674,7 +15674,7 @@ yy1067:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15678 "<stdout>"
#line 15678 "ext/date/lib/parse_date.c"
yy1068:
YYDEBUG(1068, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15766,7 +15766,7 @@ yy1074:
}
yy1075:
YYDEBUG(1075, *YYCURSOR);
#line 1203 "parse_date.re"
#line 1203 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -15785,7 +15785,7 @@ yy1075:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15789 "<stdout>"
#line 15789 "ext/date/lib/parse_date.c"
yy1076:
YYDEBUG(1076, *YYCURSOR);
yyaccept = 25;
@@ -16683,7 +16683,7 @@ yy1116:
}
yy1117:
YYDEBUG(1117, *YYCURSOR);
#line 1599 "parse_date.re"
#line 1599 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16699,7 +16699,7 @@ yy1117:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16703 "<stdout>"
#line 16703 "ext/date/lib/parse_date.c"
yy1118:
YYDEBUG(1118, *YYCURSOR);
++YYCURSOR;
@@ -16750,7 +16750,7 @@ yy1125:
YYDEBUG(1125, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1126, *YYCURSOR);
#line 1072 "parse_date.re"
#line 1072 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16771,7 +16771,7 @@ yy1125:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16775 "<stdout>"
#line 16775 "ext/date/lib/parse_date.c"
yy1127:
YYDEBUG(1127, *YYCURSOR);
yyaccept = 26;
@@ -16879,7 +16879,7 @@ yy1140:
}
yy1141:
YYDEBUG(1141, *YYCURSOR);
#line 1575 "parse_date.re"
#line 1575 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16902,7 +16902,7 @@ yy1141:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16906 "<stdout>"
#line 16906 "ext/date/lib/parse_date.c"
yy1142:
YYDEBUG(1142, *YYCURSOR);
yych = *++YYCURSOR;
@@ -19579,7 +19579,7 @@ yy1293:
goto yy1297;
yy1294:
YYDEBUG(1294, *YYCURSOR);
#line 1049 "parse_date.re"
#line 1049 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -19601,7 +19601,7 @@ yy1294:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19605 "<stdout>"
#line 19605 "ext/date/lib/parse_date.c"
yy1295:
YYDEBUG(1295, *YYCURSOR);
yyaccept = 28;
@@ -19862,7 +19862,7 @@ yy1315:
YYDEBUG(1315, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1316, *YYCURSOR);
#line 1032 "parse_date.re"
#line 1032 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -19878,7 +19878,7 @@ yy1315:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19882 "<stdout>"
#line 19882 "ext/date/lib/parse_date.c"
yy1317:
YYDEBUG(1317, *YYCURSOR);
yyaccept = 0;
@@ -21309,7 +21309,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1006 "parse_date.re"
#line 1006 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -21334,7 +21334,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21338 "<stdout>"
#line 21338 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21770,7 +21770,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 994 "parse_date.re"
#line 994 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -21781,7 +21781,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21785 "<stdout>"
#line 21785 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21816,7 +21816,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 984 "parse_date.re"
#line 984 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -21825,7 +21825,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21829 "<stdout>"
#line 21829 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23837,7 +23837,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 963 "parse_date.re"
#line 963 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -23845,7 +23845,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23849 "<stdout>"
#line 23849 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23984,7 +23984,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 972 "parse_date.re"
#line 972 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -23995,7 +23995,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23999 "<stdout>"
#line 23999 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24528,7 +24528,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 951 "parse_date.re"
#line 951 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -24539,7 +24539,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24543 "<stdout>"
#line 24543 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24712,7 +24712,7 @@ yy1537:
goto yy1531;
}
}
#line 1725 "parse_date.re"
#line 1725 "ext/date/lib/parse_date.re"
}
+18 -18
View File
@@ -1,5 +1,5 @@
/* Generated by re2c 0.13.5 on Thu Aug 13 10:30:12 2015 */
#line 1 "parse_iso_intervals.re"
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
* The MIT License (MIT)
*
@@ -254,11 +254,11 @@ static int scan(Scanner *s)
std:
s->tok = cursor;
s->len = 0;
#line 282 "parse_iso_intervals.re"
#line 282 "ext/date/lib/parse_iso_intervals.re"
#line 262 "<stdout>"
#line 262 "ext/date/lib/parse_iso_intervals.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -325,12 +325,12 @@ std:
if ((yych = *YYCURSOR) <= '/') goto yy3;
if (yych <= '9') goto yy98;
yy3:
#line 395 "parse_iso_intervals.re"
#line 395 "ext/date/lib/parse_iso_intervals.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 334 "<stdout>"
#line 334 "ext/date/lib/parse_iso_intervals.c"
yy4:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -344,7 +344,7 @@ yy5:
if (yych <= '9') goto yy12;
if (yych == 'T') goto yy14;
yy6:
#line 322 "parse_iso_intervals.re"
#line 322 "ext/date/lib/parse_iso_intervals.re"
{
timelib_sll nr;
int in_time = 0;
@@ -385,22 +385,22 @@ yy6:
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
#line 389 "<stdout>"
#line 389 "ext/date/lib/parse_iso_intervals.c"
yy7:
++YYCURSOR;
#line 384 "parse_iso_intervals.re"
#line 384 "ext/date/lib/parse_iso_intervals.re"
{
goto std;
}
#line 396 "<stdout>"
#line 396 "ext/date/lib/parse_iso_intervals.c"
yy9:
++YYCURSOR;
#line 389 "parse_iso_intervals.re"
#line 389 "ext/date/lib/parse_iso_intervals.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 404 "<stdout>"
#line 404 "ext/date/lib/parse_iso_intervals.c"
yy11:
yych = *++YYCURSOR;
goto yy3;
@@ -682,7 +682,7 @@ yy51:
if (yych <= '/') goto yy13;
if (yych >= ':') goto yy13;
++YYCURSOR;
#line 364 "parse_iso_intervals.re"
#line 364 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("combinedrep");
TIMELIB_INIT;
@@ -701,7 +701,7 @@ yy51:
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
#line 705 "<stdout>"
#line 705 "ext/date/lib/parse_iso_intervals.c"
yy59:
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
@@ -804,7 +804,7 @@ yy76:
if (yych != 'Z') goto yy13;
yy83:
++YYCURSOR;
#line 298 "parse_iso_intervals.re"
#line 298 "ext/date/lib/parse_iso_intervals.re"
{
timelib_time *current;
@@ -827,7 +827,7 @@ yy83:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 831 "<stdout>"
#line 831 "ext/date/lib/parse_iso_intervals.c"
yy85:
yych = *++YYCURSOR;
if (yych <= '/') goto yy13;
@@ -889,7 +889,7 @@ yy98:
if (yych <= '/') goto yy100;
if (yych <= '9') goto yy98;
yy100:
#line 287 "parse_iso_intervals.re"
#line 287 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("recurrences");
TIMELIB_INIT;
@@ -899,9 +899,9 @@ yy100:
s->have_recurrences = 1;
return TIMELIB_PERIOD;
}
#line 903 "<stdout>"
#line 903 "ext/date/lib/parse_iso_intervals.c"
}
#line 399 "parse_iso_intervals.re"
#line 399 "ext/date/lib/parse_iso_intervals.re"
}
#ifdef PHP_WIN32
+666 -510
View File
File diff suppressed because it is too large. Load diff
+4
View File
@@ -1,4 +1,8 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#include "php_config.h"
#endif
#ifdef HAVE_GD_PNG
/* needs to be first */
+230
View File
@@ -0,0 +1,230 @@
--TEST--
gmp_random_seed() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
--FILE--
<?php
// zero int
var_dump(gmp_random_seed(0));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// zero gmp
var_dump(gmp_random_seed(gmp_init(0)));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// negative int
var_dump(gmp_random_seed(-100));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// negative gmp
var_dump(gmp_random_seed(gmp_init(-100)));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// positive int
var_dump(gmp_random_seed(100));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// positive gmp
var_dump(gmp_random_seed(100));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
$seed = gmp_init(1);
$seed <<= 512;
// large negative gmp
var_dump(gmp_random_seed($seed * -1));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// large positive gmp
var_dump(gmp_random_seed($seed));
var_dump(gmp_strval(gmp_random()));
var_dump(gmp_strval(gmp_random(1)));
var_dump(gmp_strval(gmp_random(10)));
var_dump(gmp_strval(gmp_random_bits(10)));
var_dump(gmp_strval(gmp_random_bits(100)));
var_dump(gmp_strval(gmp_random_bits(1000)));
var_dump(gmp_strval(gmp_random_range(0, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 10000)));
var_dump(gmp_strval(gmp_random_range(-10000, 0)));
// standard non conversion error
var_dump(gmp_random_seed('not a number'));
echo "Done\n";
?>
--EXPECTF--
NULL
string(193) "2000022451473107283132031190545479155678097978829612864726689673263990484954900429188146529905019042225609517482723730948135765344007937183893986134210303199345433818579954244943136664096571499"
string(10) "3792281639"
string(97) "1281406676617847191505318987040099388645126071814252743902229506206669580396236451813261179688680"
string(2) "86"
string(30) "539590049119295715487546581833"
string(301) "1421393257467327495225454368915273750356127352353055226245692071178379257048985726109650766437957017507708821700349355658110489309871463201057688894986035545794429493563972043777521547094922637182497036750765553664196591958728194711096442220858890056073974348364544481270013556644174056049511198143353"
string(4) "8971"
string(4) "7838"
string(5) "-7823"
NULL
string(193) "2000022451473107283132031190545479155678097978829612864726689673263990484954900429188146529905019042225609517482723730948135765344007937183893986134210303199345433818579954244943136664096571499"
string(10) "3792281639"
string(97) "1281406676617847191505318987040099388645126071814252743902229506206669580396236451813261179688680"
string(2) "86"
string(30) "539590049119295715487546581833"
string(301) "1421393257467327495225454368915273750356127352353055226245692071178379257048985726109650766437957017507708821700349355658110489309871463201057688894986035545794429493563972043777521547094922637182497036750765553664196591958728194711096442220858890056073974348364544481270013556644174056049511198143353"
string(4) "8971"
string(4) "7838"
string(5) "-7823"
NULL
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
string(9) "513032517"
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
string(3) "111"
string(31) "1007352579363975542750518386428"
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
string(4) "2362"
string(5) "-9377"
string(5) "-8435"
NULL
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
string(9) "513032517"
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
string(3) "111"
string(31) "1007352579363975542750518386428"
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
string(4) "2362"
string(5) "-9377"
string(5) "-8435"
NULL
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
string(9) "513032517"
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
string(3) "111"
string(31) "1007352579363975542750518386428"
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
string(4) "2362"
string(5) "-9377"
string(5) "-8435"
NULL
string(193) "2481908463276861025880840116973116041137167231715512003123396619946362384184452775649311777755189162364804428739438733886421190841599393284032499618736594054572838636962845446571583771860379424"
string(9) "513032517"
string(97) "1269389652350468424962405917839748437534426606829298977422985976022226588797299164880342257267822"
string(3) "111"
string(31) "1007352579363975542750518386428"
string(301) "5972672173406546932378461222050826195392618168845902231231085819967980051373112173617569638344495916340820360974139193579303652817960325137050189614326029375858951250371622253667077551034119958866481056760107123567590230789917209543206262943739654964107980961862387602012190907147667678648223791029527"
string(4) "2362"
string(5) "-9377"
string(5) "-8435"
NULL
string(193) "4314861641594785951065006537821497084129700255567731661104366342587560122488351847486220156468888511744226746306538524023190734733433083354034308520246964938498767672539252131810891590624763642"
string(10) "3301287097"
string(97) "1532710025135934106005683287301200805525218110207399702226596673360222079570223526337866801028045"
string(3) "317"
string(30) "949682013136255600092941702271"
string(302) "10419061168407861659407303769436775291881708415032871985692089124472434944956010985892897595466043265819000974537553172663152640727594826474137173310039809413311432062725623183603946900548710858191078057179743726366436832870919212340219523613153893742764101120396858424887711932475871305848021245801132"
string(4) "2417"
string(5) "-7975"
string(4) "-378"
NULL
string(193) "4314861641594785951065006537821497084129700255567731661104366342587560122488351847486220156468888511744226746306538524023190734733433083354034308520246964938498767672539252131810891590624763642"
string(10) "3301287097"
string(97) "1532710025135934106005683287301200805525218110207399702226596673360222079570223526337866801028045"
string(3) "317"
string(30) "949682013136255600092941702271"
string(302) "10419061168407861659407303769436775291881708415032871985692089124472434944956010985892897595466043265819000974537553172663152640727594826474137173310039809413311432062725623183603946900548710858191078057179743726366436832870919212340219523613153893742764101120396858424887711932475871305848021245801132"
string(4) "2417"
string(5) "-7975"
string(4) "-378"
Warning: gmp_random_seed(): Unable to convert variable to GMP - string is not an integer in %s on line %d
bool(false)
Done
+1
View File
@@ -2,6 +2,7 @@
gmp_random_seed() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
+1 -1
View File
@@ -318,7 +318,7 @@ PHP_FUNCTION(ibase_blob_add)
PHP_FUNCTION(ibase_blob_get)
{
zval *blob_arg;
unsigned long len_arg;
zend_ulong len_arg;
ibase_blob *ib_blob;
RESET_ERRMSG;
+8 -6
View File
@@ -1061,7 +1061,8 @@ PHP_FUNCTION(ibase_query)
{
zval *zlink, *ztrans, *bind_args = NULL;
char *query;
int bind_i, query_len, bind_num;
size_t query_len;
int bind_i, bind_num;
long trans_res_id = 0;
ibase_db_link *ib_link = NULL;
ibase_trans *trans = NULL;
@@ -1073,7 +1074,7 @@ PHP_FUNCTION(ibase_query)
RETVAL_FALSE;
switch (ZEND_NUM_ARGS()) {
long l;
zend_long l;
default:
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3, "rrs",
@@ -1472,7 +1473,8 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) /* {{{ */
{
zval *result_arg;
long i, array_cnt = 0, flag = 0;
zend_long flag = 0;
long i, array_cnt = 0;
ibase_result *ib_result;
RESET_ERRMSG;
@@ -1684,7 +1686,7 @@ PHP_FUNCTION(ibase_name_result)
{
zval *result_arg;
char *name_arg;
int name_arg_len;
size_t name_arg_len;
ibase_result *ib_result;
RESET_ERRMSG;
@@ -1998,7 +2000,7 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */
PHP_FUNCTION(ibase_field_info)
{
zval *result_arg;
long field_arg;
zend_long field_arg;
int type;
XSQLDA *sqlda;
@@ -2062,7 +2064,7 @@ PHP_FUNCTION(ibase_num_params)
PHP_FUNCTION(ibase_param_info)
{
zval *result_arg;
long field_arg;
zend_long field_arg;
ibase_query *ib_query;
RESET_ERRMSG;
+5 -4
View File
@@ -425,7 +425,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
zval *res;
char *db, *bk, buf[200];
size_t dblen, bklen, spb_len;
long opts = 0;
zend_long opts = 0;
zend_bool verbose = 0;
ibase_service *svm;
@@ -488,8 +488,9 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
{
zval *res;
char buf[128], *db;
int dblen, spb_len;
long action, argument = 0;
size_t dblen;
int spb_len;
zend_long action, argument = 0;
ibase_service *svm;
RESET_ERRMSG;
@@ -596,7 +597,7 @@ PHP_FUNCTION(ibase_db_info)
PHP_FUNCTION(ibase_server_info)
{
zval *res;
long action;
zend_long action;
ibase_service *svm;
RESET_ERRMSG;
+1 -1
View File
@@ -1421,7 +1421,7 @@ PHP_FUNCTION(ibase_gen_id)
zval *link = NULL;
char query[128], *generator;
size_t gen_len;
long inc = 1;
zend_long inc = 1;
ibase_db_link *ib_link;
ibase_trans *trans = NULL;
XSQLDA out_sqlda;
Loaded 100 of 368 files, more files were not shown because too many files have changed in this diff. Show more