Compare commits

..
Author SHA1 Message Date
Stanislav Malyshev 3b7a2e0af9 5.4.0 alpha1 2011-06-19 20:13:45 +00:00
Stanislav Malyshev ed87dbab91 5.4.0 alpha11 2011-06-19 20:11:54 +00:00
Stanislav Malyshev de5254743e Integrate NEWS 2011-06-19 19:03:13 +00:00
Stanislav Malyshev bbf1904f3d fix error reporting on missing data - don't produce double errors 2011-06-19 18:55:48 +00:00
Stanislav Malyshev 4b0e699051 fix test with floats - make it not produce different result
on 32 and 64 bit
2011-06-19 18:52:58 +00:00
Stanislav Malyshev 177612ca4d re-generate credits 2011-06-19 17:56:09 +00:00
Daniel Convissor 7f04d85d31 Provide test for DateTime::add() issue (for discussion on internals, bugs.php.net is down). 2011-06-19 16:59:58 +00:00
Daniel Convissor 90789cf0a7 Split DateTime diff/add/sub tests into separate files to make things easier to see, test and (one hopes) fix. 2011-06-19 16:55:11 +00:00
Felipe Pena f417c732a9 - Fix tests 2011-06-19 15:43:16 +00:00
Felipe Pena 868b808f4c - Opss, restore old behavior 2011-06-19 14:50:44 +00:00
Felipe Pena d8782ddaeb - Added missing void param check in sys_get_temp_dir
- Fixed param check of umask()
2011-06-19 14:27:33 +00:00
Felipe Pena b9746b0ba6 - Missing usage of 'p' parameter specifier 2011-06-19 13:20:12 +00:00
Felipe Pena 6765a19d23 - Fix test 2011-06-19 12:58:56 +00:00
Felipe Pena fbb5aae32c - New tests (code coverage++) 2011-06-19 12:33:49 +00:00
Felipe Pena 772768f41c - Fix test 2011-06-19 00:18:17 +00:00
Felipe Pena 8c3335b96b - Added missing void param checks, and fix arginfo 2011-06-18 22:48:31 +00:00
Felipe Pena 72c4e72570 - Fixed compiler warning (redefinition of offsetof) 2011-06-18 18:11:27 +00:00
Felipe Pena 63db6d1435 - Missing change 2011-06-18 17:46:16 +00:00
Felipe Pena 94cd08457b - Fixed ZTS build 2011-06-18 17:41:56 +00:00
Jérôme Loyet 886cf1a318 Added master rlimit_files and rlimit_core in the global configuration settings 2011-06-18 16:27:48 +00:00
Jérôme Loyet eefbc4398a Fixed exit at FPM startup on fpm_resources_prepare 2011-06-18 16:15:15 +00:00
Felipe Pena ebf9db550f - Added missing arginfos for void params and void param checks 2011-06-18 15:56:14 +00:00
Jérôme Loyet e63f59191d Remove timestamp in logs written by children process 2011-06-18 15:33:07 +00:00
Boris Lytochkin 2a852af8f7 take over mantainership on snmp extension 2011-06-18 07:12:35 +00:00
Pierre Joye a8068a676b - fix build 2011-06-18 02:24:01 +00:00
Jérôme Loyet dec96a12fa missing doc in the conf file 2011-06-17 23:35:47 +00:00
Jérôme Loyet 3a5d2b2129 - added xml format to the status page
- clean fpm_status.c code
2011-06-17 23:19:54 +00:00
Christopher Jones 444289e03e Fix skipif to resolve the common reason this test fails 2011-06-17 18:28:34 +00:00
Boris Lytochkin 68c8c34a77 expand SNMP section 2011-06-17 18:26:54 +00:00
Derick Rethans 9437d4cea4 - Fixed bug where the DateTime object got changed while using date_diff(). 2011-06-17 16:38:23 +00:00
Johannes Schlüter 740285307d - Minor NEWS cleanup
# entrys are sentences and end with a full stop.
# PCRE and SQLite updates will hopefully released w/ 5.3 first (and the listed
# version numbers are outdated already)
2011-06-17 16:33:54 +00:00
Felipe Pena 0a7292087c - Fixed two "jump or move depends on uninitialised value" 2011-06-17 02:00:20 +00:00
Pierre Joye 104cd28e95 - did I not kill that already? (do not use rand_screen, pointless on server and not TS) 2011-06-16 13:06:41 +00:00
Pierre Joye 25849ab967 - fix nts build 2011-06-16 10:20:25 +00:00
Pierre Joye 358316b2ed - init win32 rng context once per process 2011-06-16 01:31:10 +00:00
Pierre Joye 1717764476 - install extra headers 2011-06-16 01:21:01 +00:00
Stanislav Malyshev 240653bad7 update the branches list 2011-06-15 23:19:30 +00:00
Christopher Jones af482a4fc8 Improve cross version compat 2011-06-14 20:04:18 +00:00
Scott MacVicar 08e7b84b7b Upgrade SQLite to 3.7.6.3 2011-06-14 17:00:49 +00:00
Felipe Pena a5974fdba8 - New tests for new feature 2011-06-14 02:05:37 +00:00
Felipe Pena a96426874a - Fix build on Windows 2011-06-13 17:52:23 +00:00
Timm Friebe fcff17524a - MFH suppression of compiler warning noted in bug #55009 2011-06-13 08:45:56 +00:00
Felipe Pena 5670174b66 - Fixed bug #54624 (class_alias and type hint) 2011-06-12 21:10:31 +00:00
Rasmus Lerdorf c9e41e8901 These regexes don't fail under the new backtrack limit, so lower it
just for the test to check the failure.
2011-06-12 18:38:26 +00:00
Felipe Pena 0333b86f2d - Added Bison 2.5 to bison_version_list 2011-06-12 17:26:45 +00:00
Felipe Pena 907fd926e5 - Restore basename in filename on non Windows OS 2011-06-12 15:15:44 +00:00
Rasmus Lerdorf fb2ce0bb00 Don't expect a path for tidy_repair_string() and fix the tests 2011-06-12 14:49:10 +00:00
Boris Lytochkin 7a0bd8b967 remove PHP_VERSION_ID ifdef's, limiting to 5.4 branch 2011-06-12 12:26:51 +00:00
Boris Lytochkin 2b8026cfff merging from trunk (r312088...r312092):
move SNMP VERSION constants into SNMP class itself
fix typo in comment
no more method open
fix method names in header
2011-06-12 12:10:01 +00:00
Felipe Pena bc6cb0c70d - Fixed bug #54680 (missing TRACK_VARS_SERVER check) 2011-06-12 02:47:48 +00:00
Felipe Pena 80d432ca62 - Avoid zend_do_ticks() call for each statement in parsing 2011-06-12 01:43:10 +00:00
Gustavo André dos Santos Lopes 8d52500d41 - Reverted r301991, which is a (partial) fix to bug #52550, addressing an
overflow in a signed subtraction. This fixes the overflow without
  changing the algorithm.
2011-06-12 00:56:18 +00:00
Felipe Pena f277d8a22f - Fixed tests 2011-06-12 00:31:13 +00:00
Gustavo André dos Santos Lopes bc9c089f3a - Fixed ext/sockets build on Mac OS X (hopefully).
- Improvements in the multicast tests.
- Very light refactoring in sockets.c.
2011-06-11 20:20:50 +00:00
Timm Friebe e2a48862f7 - MFH Bugfix for bug #53540 2011-06-11 18:55:41 +00:00
Felipe Pena d2c47040f5 - Missing fix for bug #54347 2011-06-11 15:11:49 +00:00
Felipe Pena f641cf8b2c - Possible fix for bug #55022 (memory_limit exhausted when set charset in sybase_connect) 2011-06-11 01:15:14 +00:00
Christopher Jones ea2cad7e76 Fix TSRMLS for Windows build 2011-06-11 00:24:26 +00:00
Felipe Pena 191df85605 - Drop C++ style comments 2011-06-10 23:14:15 +00:00
Felipe Pena 15f5dd5cb3 - Fixed bug #55028 (// is abad comment) 2011-06-10 22:48:36 +00:00
Christopher Jones 7bc6fbc448 Bump OCI8 version to stable in preparation for 5.3.7 RC 2011-06-10 20:01:46 +00:00
Christopher Jones a643bda32d Add new OCI8 tests. Refactor skipifs. Sync 5.3/5.4/trunk branches 2011-06-10 19:16:35 +00:00
Christopher Jones 199510ef07 Add oci_client_version() returning the runtime Oracle client library version - predominantly useful for the test suite 2011-06-10 17:38:07 +00:00
Rasmus Lerdorf 02023fc8fe Fix Apache1 build 2011-06-10 11:46:35 +00:00
Felipe Pena cee9b6603c - Fixed bug #54347 (reflection_extension does not lowercase module function name)
patch by: laruence at yahoo dot com dot cn
2011-06-09 22:45:35 +00:00
Shein Alexey 4cd96965fb Removed tests checking old/removed functionality (session_register/session_unregister/session_is_registered/register_globals) 2011-06-09 08:54:47 +00:00
Shein Alexey b99e1ba2d8 Changed session.save_path to /tmp to make test run. 2011-06-09 08:24:12 +00:00
Shein Alexey 060ceea06e Skip reason is now printed if session.save_path is not writable. 2011-06-09 08:18:49 +00:00
Shein Alexey efb6757e16 Fixed session test breakage due to serialize precision issue. 2011-06-09 07:44:10 +00:00
Felipe Pena 0a0443f07c - Missing fixes for grammar fix 's/valid path/a valid path/' 2011-06-09 00:23:43 +00:00
Ilia Alshanetsky 6e668453ac Fixed test 2011-06-08 23:30:02 +00:00
Ilia Alshanetsky 80f46ca2c5 Fixed test to account for smaller default floating point # precision 2011-06-08 02:03:14 +00:00
Christopher Jones 9622d0050d Relax autoconf support from 2.60 to 2.59. This is the version available on Centos/RHEL/Oracle Linux 5.6 2011-06-08 01:25:35 +00:00
Felipe Pena ddaddf6c2a s/valid path/a valid path/ 2011-06-08 00:53:55 +00:00
Gustavo André dos Santos Lopes c27079d9e0 - Fixed bug #54992: Stream not closed and error not returned when SSL CN_match
fails.
2011-06-08 00:23:02 +00:00
Christopher Jones 707e6dac61 Sync OCI8 branches. Allow 'pecl install' to work on both PHP 5.3 & 5.4 2011-06-07 23:53:02 +00:00
Felipe Pena 08b3d76cbf - Fixed bug #55007 (compiler fail after previous fail) 2011-06-07 22:58:38 +00:00
Felipe Pena af43d306c0 - Added 'p' type specifier 2011-06-07 22:22:01 +00:00
Christopher Jones a3ddc02e8e Update tests to match Felipe's null byte arg parsing change 2011-06-07 20:58:08 +00:00
Felipe Pena a641ccb774 - Test fixes 2011-06-07 02:29:03 +00:00
Ilia Alshanetsky de2291689c Fixed test 008 2011-06-07 01:40:54 +00:00
Felipe Pena d86b3633cf - Test fixes 2011-06-06 22:36:54 +00:00
Felipe Pena 66ac89a00b - Added indirect method call through array variable (FR Bug #47160) 2011-06-06 21:42:05 +00:00
Felipe Pena 32b5f8a1a3 - Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
2011-06-06 21:28:16 +00:00
Ilia Alshanetsky a311dc2443 Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). 2011-06-05 21:57:01 +00:00
Hannes Magnusson 6f56bf1cfc Fixed bug#51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error) 2011-06-05 13:30:01 +00:00
Hannes Magnusson eed6bdb5c7 When you write to a symlink - you access the file itself, not the symlink, so we need to compare the atime to the orignal file 2011-06-05 12:08:14 +00:00
Hannes Magnusson 513faa54bb Make sure we are writing more data then the block size 2011-06-05 12:07:11 +00:00
Hannes Magnusson 8f3e6433b2 No need to fetch external files and endless amount of DTDs for this test 2011-06-05 11:31:18 +00:00
Hannes Magnusson 86209a3919 touch() no longer attempts to create files on empty strings 2011-06-05 09:42:10 +00:00
Hannes Magnusson 148120e1e9 Fix tests when running without mbstring 2011-06-05 09:35:49 +00:00
Stanislav Malyshev 2da7edbc8d This method doesn't seem to be very useful without scalar types, so reverting it too 2011-06-05 08:59:24 +00:00
Hannes Magnusson 5fac6a938f This isn't less then 5.4.. but these still fail though. 2011-06-05 08:56:52 +00:00
Philip Olson 45f4c5dd7e Updated the note maintainers credits 2011-06-05 06:57:13 +00:00
Felipe Pena f57cbfcaa1 - Possible fix for bug #54609 (Certain implementation(s) of SplFixedArray cause hard crash) 2011-06-05 01:38:12 +00:00
Felipe Pena e1a5443f97 - Fixed bug #54929 (Parse error with single quote in sql comment) 2011-06-04 22:54:40 +00:00
Ilia Alshanetsky 31b91d7cdb Show ICU Data version inside phpinfo() 2011-06-03 18:14:36 +00:00
Hannes Magnusson a1ae8af54c Fix tests
#Note to self; do not rename tests just before committing
2011-06-03 17:38:37 +00:00
Hannes Magnusson 3837f1205b Add tests for broken function arguments 2011-06-03 17:12:59 +00:00
Stanislav Malyshev aea69cb06a and clean the tokenizer too 2011-06-03 01:16:01 +00:00
Stanislav Malyshev e18618905c scalar types cleanup 2011-06-03 01:09:32 +00:00
Scott MacVicar 0c107d3bf3 Fix Bug #54918 - Crash when there is a failure to read the browscap file 2011-06-03 00:42:07 +00:00
Scott MacVicar 76cbcc7f66 Added fabled hex2bin() function 2011-06-03 00:12:22 +00:00
Gustavo André dos Santos Lopes ce966baaa4 - Fixed double registering of browscap ini directive. See bug #54896. 2011-06-02 08:46:40 +00:00
Felipe Pena 767f924665 - Fixed bug #54970 (SplFixedArray::setSize() isn't resizing) 2011-06-02 00:40:27 +00:00
Ilia Alshanetsky 329eae2a7a More tests 2011-06-01 16:59:23 +00:00
Ilia Alshanetsky b8ffccb3ab Implemented FR #54561 (Expose ICU Version & ICU Data Version info). 2011-06-01 16:26:21 +00:00
Ilia Alshanetsky a8b8fe1f7f Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE settings). 2011-06-01 13:23:25 +00:00
Ilia Alshanetsky a7dfb31557 Fixed bug #54484 (Empty string in json_decode doesn't reset json_last_error()). 2011-06-01 09:44:38 +00:00
Rafael Machado Dohms 6406521a44 Adding testcases to validate imageloadfont input parameter validation, tests were developed at #tek11 testfest 2011-05-31 21:38:23 +00:00
Andrey Hristov ce816cb883 reuse code 2011-05-31 20:42:44 +00:00
Shein Alexey 11f667e82d Fixed notice breaking the test. 2011-05-31 12:57:40 +00:00
Shein Alexey f848423608 Removed test since there's no more safe_mode in PHP >= 5.4. 2011-05-31 12:45:00 +00:00
Dmitry Stogov c270347c0b MFH: Arithmetic speedup. Inlined most probable code-paths for arithmetic operations directly into executor. 2011-05-31 12:05:25 +00:00
Dmitry Stogov 6fca028fc5 MFH: Fixed bug #54957 (Memleak in alloc_globals_ctor) 2011-05-31 11:38:31 +00:00
Dmitry Stogov eaeb4537ec MFH: Fixed bug #54910 (Crash when calling call_user_func with unknown function name) 2011-05-31 11:36:57 +00:00
Andrey Hristov 0de3cd84a5 fix macros 2011-05-31 10:35:07 +00:00
Ilia Alshanetsky 3300cc8e38 Removed unnecessary rinit/rshutdown 2011-05-31 08:59:32 +00:00
Philip Olson c76af7c041 Updated qa-release.php notes as per the new qa-release.php syntax 2011-05-30 23:26:33 +00:00
Ilia Alshanetsky f5779d5e16 Fixed bug #52496 (Zero exit code on option parsing failure). 2011-05-30 15:57:50 +00:00
Hannes Magnusson 9392b9cd73 Fixed bug #54946 (stream_get_contents infinite loop) 2011-05-29 12:29:19 +00:00
Hannes Magnusson 2c03acef35 Fixed bug #54601 (Removing the doctype node segfaults) 2011-05-29 11:39:49 +00:00
Ilia Alshanetsky 34de2c30c5 Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). 2011-05-29 10:23:06 +00:00
Ilia Alshanetsky d2b11712ff Fixed bug #54137 (file_get_contents POST request sends additional line break). 2011-05-29 09:23:08 +00:00
Felipe Pena 8199f8dcfc - Fixed bug #54934 (Unresolved symbol strtoull in HP-UX 11.11) 2011-05-27 23:31:30 +00:00
Stanislav Malyshev 845d0805a8 MFH: Fixes for broken tests. 2011-05-27 19:27:05 +00:00
Stanislav Malyshev c16bfe403f MFH: Fixed comilation on x86_64 2011-05-27 19:24:09 +00:00
Stanislav Malyshev c2f796c58b MFH: Fix for failing test. 2011-05-27 19:21:21 +00:00
Stanislav Malyshev a2390fca5d MFH: Fixed crash on recursive error handler invocation 2011-05-27 19:14:36 +00:00
Ilia Alshanetsky 28edcb949d Fixed bug #54924 (assert.* is not being reset upon request shutdown). 2011-05-26 18:17:43 +00:00
Pierre Joye d1ea827f27 -fix bug 54935, php_win_err can lead to crash 2011-05-26 14:37:13 +00:00
Felipe Pena 565d4bc695 - Fixed ZTS build and removed unused vars 2011-05-25 22:23:48 +00:00
Stanislav Malyshev 5c9080d3a6 implement streams metadata API per RFC 2011-05-25 21:03:55 +00:00
Rasmus Lerdorf 378cf70c81 This isn't in 2011-05-25 19:58:41 +00:00
Philip Olson f5b67e09b9 Fixed test, as per r311323 2011-05-25 00:02:05 +00:00
Felipe Pena ad0666eb94 - Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode filter)
Patch by: slusarz at curecanti dot org
2011-05-24 23:49:26 +00:00
Philip Olson 07e9cfe6a5 Fixed test 2011-05-24 23:49:04 +00:00
Philip Olson 76ec6924cb Updated test. touch() emits E_WARNING for bogus values. Updated 5.3 test to look the same. 2011-05-24 23:27:49 +00:00
Felipe Pena 708017dd3f - Fix logic, it must check for both flags (as says the comment in the code) (bug #54912) 2011-05-24 22:34:07 +00:00
Felipe Pena 04d0210c8e - Fixed bug #54912 (filter/logical_filters.c:685:32: warning: use of logical || with constant op)
Initial patch by: crrodriguez at opensuse dot org
2011-05-24 22:24:06 +00:00
Pierre Joye 59c102bf51 - Fix #54721, different Hashes on Windows, BSD and Linux on wrong Salt size 2011-05-24 13:48:04 +00:00
Pierre Joye 6f594fc5ea - fix tests, keep EOL as unix style as the str len is used in expect 2011-05-24 10:47:35 +00:00
Michael Wallner 1056c57fa9 MFH: Fix Bug #54727, a re-incarnation of #26862 2011-05-24 05:06:53 +00:00
Felipe Pena b60f6774dc - Fix the fix
# Arghh, copy and paste error :(
2011-05-24 00:10:00 +00:00
Felipe Pena 70f4069138 - Fixed stack buffer overflow in socket_connect().
Found by: Mateusz Kocielski, Marek Kroemeke and Filip Palian
2011-05-24 00:05:50 +00:00
Philip Olson 388fa176be Fixed test for decoupled <?= as of r311260 2011-05-23 23:51:28 +00:00
Stanislav Malyshev 9eb5cb6571 fix some failing tests 2011-05-23 07:06:04 +00:00
Felipe Pena a95a021509 - Fixed bug #54529 (SAPI crashes on apache_config.c:197)
patch by: hebergement at riastudio dot fr
2011-05-23 01:47:06 +00:00
Felipe Pena a6acb1f09e - Fixed bug #54269 (Short exception message buffer causes crash) 2011-05-22 19:06:21 +00:00
Rasmus Lerdorf f5a9e17f9c Increase the overly conservative pcre backtrack limit from 100000 to 1000000 2011-05-21 19:48:37 +00:00
Felipe Pena 964f44a280 - Fixed bug #54895 (Fix compiling with older gcc version without need for membar_producer macro)
patch by: mhei at heimpold dot de
2011-05-20 21:24:51 +00:00
Scott MacVicar 30f19bd524 Allow management of your own padding in openssl_encrypt/decrypt.
For using mcrypt / openssl interchangeabley managing your own padding is the only solution.
2011-05-20 18:56:13 +00:00
Felipe Pena 1101293b3f - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick) 2011-05-19 23:20:47 +00:00
Rasmus Lerdorf 4ad9f1970c Fix CS 2011-05-19 23:18:55 +00:00
Rasmus Lerdorf 01a6840bbd Fix bug 54866 2011-05-19 23:09:58 +00:00
Scott MacVicar 3012b74e96 Move LDAP to its own section 2011-05-19 22:49:47 +00:00
Scott MacVicar fe790643ca Add new functions to UPGRADING 2011-05-19 21:39:01 +00:00
Rasmus Lerdorf fceeb296e6 Should probably have a note on the autoconf 2.60+ requirement here 2011-05-19 20:07:02 +00:00
Scott MacVicar 3cb4de03dc Tidy up ldap paging code and rename the API as discussed in #42060 2011-05-19 17:41:21 +00:00
Rasmus Lerdorf c24ef71e63 Decouple <?= from the short_tags setting and make it always enabled 2011-05-19 16:26:29 +00:00
Pierre Joye 1e2aa4416c - initial import, will add all libs later 2011-05-19 13:36:29 +00:00
Scott MacVicar 6fad717299 Revert part of the fix for #53339
On OSX we need ssl AND crypto

The patch that was applied didn't even match what was in the bug
2011-05-19 05:43:48 +00:00
Johannes Schlüter 0a17fe52fb - handle out of memory 2011-05-18 11:49:49 +00:00
Johannes Schlüter 4b450a0f85 - Keep the old arginfo for now
# This change we would E_RECOVERABLE instead of E_WARNING
# and needs some more review, as well fixing ~80 tests
2011-05-18 10:21:28 +00:00
Andrew Curioso 1e3b32c777 Commiting r311138 into the 5.3 branch - fix to SimpleXML get properties hash 2011-05-18 04:43:21 +00:00
Scott MacVicar cfdd25d5c0 ZEND_THREAD_SAFE and ZEND_DEBUG_BUILD are not meant to be case insensitive 2011-05-17 22:24:44 +00:00
Pierre Joye e6368659a7 - WS 2011-05-17 10:39:18 +00:00
Andrey Hristov 778273291d exchange a "trap" with an error 2011-05-17 09:44:11 +00:00
Johannes Schlüter 85eb08885b - Move the field access behind the check
# Only called from one place where the connection is checked, but
# playing safe, again (parfait)
2011-05-17 00:16:57 +00:00
Ferenc Kovacs 469b6d2b9e adding an XFAIL, as we have an open bug for this test 2011-05-16 23:43:12 +00:00
Ferenc Kovacs 5d10bb6231 adding an XFAIL, as we have an open bug for this test 2011-05-16 23:39:16 +00:00
Ferenc Kovacs 52c1db4b7d set the timezone to UTC as suggested by Alexey Shein, and adding an SKIPIF as this test was originaly intended to be windows only 2011-05-16 23:35:23 +00:00
Ferenc Kovacs 41533cdee1 fix the test with the removal of the unnecessary newline 2011-05-16 23:33:05 +00:00
Ferenc Kovacs 6b593349cb adding the serialize_precision=100 for the tests, credits to Mats Lindh for reporting it 2011-05-16 23:31:14 +00:00
Ferenc Kovacs a93c3ddbb7 removing XFAIL as #39863 has already been fixed 2011-05-16 23:28:46 +00:00
Johannes Schlüter ac96bcdc90 - Handle error if tempfile can't be opened, found by parfait 2011-05-16 22:24:41 +00:00
Johannes Schlüter 0f7d022eea - Fix a few more memleaks found by parfait 2011-05-16 21:29:45 +00:00
Johannes Schlüter db6a29e533 - Fix possible memory leak
# Found by parfait - http://labs.oracle.com/projects/parfait/
2011-05-16 19:46:32 +00:00
Rasmus Lerdorf a546b3207f oops, can't use that macro here 2011-05-16 17:26:10 +00:00
Rasmus Lerdorf a5eeecb13f Suppress a dozen unused return value warnings in places where the return
value is really not useful to us.
2011-05-16 17:22:41 +00:00
Rasmus Lerdorf 75ec1fedc7 Add php_ignore_value() macro to suppress unused return value warnings
from gcc. There are times when we really don't care about the return
value and this will cleanly tell gcc.
2011-05-16 16:58:02 +00:00
Rasmus Lerdorf 27dd44db95 Fix a couple of warnings. Use %zu to printf a time_t and get_request_time
actually returns a double, not a time_t.
2011-05-16 15:52:31 +00:00
Johannes Schlüter a90b7da435 - Fix Bug #53782 (foreach throws irrelevant exception) 2011-05-16 15:37:39 +00:00
Johannes Schlüter 8ab4c89d0b - Move the access behind the check.
# I can't find an unsafe call, but let's play safe
2011-05-16 10:15:28 +00:00
Rasmus Lerdorf 353077d234 Get rid of autoconf warnings 2011-05-16 00:14:47 +00:00
Pierre Joye c0748c7856 - version 2011-05-15 20:07:33 +00:00
Rasmus Lerdorf 6f9d0a25fd Make the version match the branch 2011-05-15 06:16:37 +00:00
Rasmus Lerdorf 245d15fdc6 Drop support for autoconf < 2.60 in trunk and the
new PHP_5_4 branch. autoconf >= 2.60 should finally
be working now.
2011-05-15 06:09:21 +00:00
Rasmus Lerdorf 8e256774b0 Cache the PDO include path 2011-05-15 05:24:34 +00:00
Rasmus Lerdorf d19c366c4a Missed merging this into the new PHP_5_4 branch 2011-05-15 05:21:01 +00:00
Stanislav Malyshev 654aa838cd forgot tokenizer... 2011-05-15 00:48:05 +00:00
Stanislav Malyshev 0f29950d9c initiate 5.4 branch 2011-05-15 00:40:12 +00:00
Stanislav Malyshev 516c2f5920 removing scalar types in trunk 2011-05-15 00:36:13 +00:00
Andrey Hristov 1ca8acda40 merge 2010-03-16 12:54:58 +00:00
Moriyoshi Koizumi 6c513876d0 - Forgot to commit this patch. Sorry. 2010-03-12 16:19:25 +00:00
Jani Taskinen 8c3428eeb8 MF53: - Update the bundled libmbfl to the latest on upstream. (r296101) 2010-03-12 13:16:33 +00:00
Jani Taskinen a377c4c580 - Merged 2 of these, nuke one totally outdated and irrelevant.
# Quite likely most if not all of TODO is also replaced by some Wiki page. 
# If so, replace the file contents with URL to the correct place :)
2010-03-12 13:09:27 +00:00
Jani Taskinen 499006bbb8 - These are no longer relevant 2010-03-12 13:01:56 +00:00
Jani Taskinen bc4588b1d9 MF53: New and improved DBA tests 2010-03-12 11:51:40 +00:00
Jani Taskinen a99e0b69df Merged r296086 2010-03-12 11:50:14 +00:00
Jani Taskinen 84f1562f99 MF53:- Added backlog socket context option for stream_socket_server(). (Mike) 2010-03-12 11:43:01 +00:00
Jani Taskinen cfdfcac8aa - This is 5.4.0 (for now..:) 2010-03-11 16:52:44 +00:00
Jani Taskinen 8ad52ac7c1 Hello PHP 5.4, open for all new stuff. 2010-03-11 16:09:37 +00:00
677 changed files with 54878 additions and 29388 deletions

No files matched your search

+2 -2
View File
@@ -497,8 +497,8 @@ STATUS: Working
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: snmp
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
MAINTENANCE: Odd Fixes
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net>, Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sockets
+6101 -10
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -51,6 +51,7 @@ Type specifiers
L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
p - valid path (string without null bytes in the middle) and its length (char*, int)
r - resource (zval*)
s - string (with possible null bytes) and its length (char*, int)
z - the actual zval (zval*)
+10 -13
View File
@@ -104,16 +104,15 @@ Derick) run the following commands for you:
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
3. Update the MD5 sums in ``web/qa/trunk/include/rc-md5sums.txt`` (no empty lines, ordered by filename, odler version number first, .bz2 before .gz).
3. Update ``web/qa/trunk/include/release-qa.php`` with the appropriate information.
See the documentation within release-qa.php for more information, but all releases
and RCs are configured here. Only $QA_RELEASES needs to be edited.
4. Update in ``web/qa/trunk/include/release-qa.php`` constants with the new RC and
commit this.
Example: When rolling an RC, set the 'rc' with appropriate information for the
given version.
a. ``$BUILD_TEST_RELEASES`` = array("4.4.7RC1", "5.2.2RC1")
Note: Remember to update the MD5 checksum information.
b. ``$CURRENT_QA_RELEASE_4`` = "4.4.7RC1" (``$CURRENT_QA_RELEASE_5`` for PHP5)
c. ``$RELEASE_PROCESS`` = array(4 => true, 5 => true)
1. Update in ``web/php-bugs/trunk/include/php_versions.php`` to include the new RC and commit.
@@ -247,13 +246,11 @@ number, and remove the RC from there.
11. Update ``qaweb/include/release-qa.php``
a. Update the $BUILD_TEST_RELEASES array with the release name
- Update $QA_RELEASES with the appropriate information, which means bumping
the version number to an upcoming version.
b. Update $RELEASE_PROCESS array (set to false)
I. For PHP4: Set $CURRENT_QA_RELEASE_4 to false
II. For PHP5: Set $CURRENT_QA_RELEASE_5 to false
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
Re-releasing the same version (or -pl)
--------------------------------------
+8 -4
View File
@@ -43,13 +43,17 @@ Having said that, here are the organizational rules::
Currently we have the following branches in use::
trunk Will become PHP 6.0. This CVS branch is for active development.
trunk The active development branch.
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
branches/PHP_5_4 Is used to release the PHP 5.4.x series. It still allows for
larger enhancements.
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
branches/PHP_5_3 Is used to release the PHP 5.3.x series. This is current
stable version and is open for bugfixes and small
improvements (check with RMs if in doubt).
branches/PHP_5_2 Is used to release the PHP 5.2.x series. It is closed for
changes now.
branches/PHP_5_1 This branch is closed.
-1
View File
@@ -1 +0,0 @@
#undef PTHREADS
+1 -1
View File
@@ -33,7 +33,7 @@ $(makefile_in_files): $(makefile_am_files)
aclocal.m4: configure.in acinclude.m4
aclocal
$(config_h_in): configure.in acconfig.h
$(config_h_in): configure.in
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@rm -f $@
+4
View File
@@ -7,6 +7,10 @@ AC_INIT(TSRM.c)
AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine)
AM_CONFIG_HEADER(tsrm_config.h)
AH_TOP([
#undef PTHREADS
])
sinclude(tsrm.m4)
TSRM_BASIC_CHECKS
+17 -2
View File
@@ -617,7 +617,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
memcmp(path, (*bucket)->path, path_len) == 0) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
/* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
}
free(r);
return;
} else {
@@ -692,7 +699,14 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
/* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
}
free(r);
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
memcmp(path, (*bucket)->path, path_len) == 0) {
@@ -1067,6 +1081,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
if (is_dir && !directory) {
/* not a directory */
tsrm_free_alloca(tmp, use_heap);
return -1;
}
}
+14 -1
View File
@@ -170,6 +170,12 @@ UPGRADE NOTES - PHP X.Y
- fclose() closes streams with resource refcount > 1; it doesn't merely
decrement the resource refcount.
- socket_set_options() and socket_get_options() now support multicast options.
- Arrays cast from SimpleXMLElement now always contain all nodes instead of
just the first matching node.
- All SimpleXMLElement children are now always printed when using var_dump(),
var_export(), and print_r().
- The raw data parameter in openssl_encrypt()/openssl_decrypt() is now an options
integer rather than a boolean. A value of true produces the same behaviour.
===================================
5. Changes made to existing methods
@@ -352,10 +358,15 @@ UPGRADE NOTES - PHP X.Y
- Core:
- get_declared_traits()
- hex2bin()
- http_response_code()
- trait_exists()
- stream_set_chunk_size()
- socket_import_stream()
- trait_exists()
- LDAP:
- ldap_control_paged_results()
- ldap_control_paged_results_response()
f. New global constants
@@ -384,6 +395,8 @@ UPGRADE NOTES - PHP X.Y
- IPV6_MULTICAST_LOOP
- IPPROTO_IP
- IPPROTO_IPV6
- OPENSSL_RAW_DATA
- OPENSSL_ZERO_PADDING
g. New classes
-127
View File
@@ -1,127 +0,0 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if defined(__GNUC__) && __GNUC__ >= 4
# define ZEND_API __attribute__ ((visibility("default")))
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
#else
# define ZEND_API
# define ZEND_DLEXPORT
#endif
#define ZEND_DLIMPORT
@TOP@
#undef uint
#undef ulong
/* Define if you want to enable memory limit support */
#define MEMORY_LIMIT 0
@BOTTOM@
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...);
#else
# define zend_sprintf sprintf
#endif
#include <math.h>
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
#define HAVE_ISNAN 1
#define HAVE_ISINF 1
#define HAVE_ISFINITE 1
#endif
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif
#endif
#ifdef HAVE_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#ifdef HAVE_FINITE
#define zend_finite(a) finite(a)
#elif defined(HAVE_ISFINITE) || defined(isfinite)
#define zend_finite(a) isfinite(a)
#elif defined(fpclassify)
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
#else
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#ifdef NETWARE
#ifdef USE_WINSOCK
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
#endif
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+1 -1
View File
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
+1 -1
View File
@@ -33,7 +33,7 @@ $(makefile_in_files): $(makefile_am_files)
aclocal.m4: configure.in acinclude.m4
aclocal
$(config_h_in): configure.in acconfig.h
$(config_h_in): configure.in
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@rm -f $@
+99
View File
@@ -11,6 +11,105 @@ AM_PROG_CC_STDC
ZEND_VERSION=$VERSION
AC_ZEND_C_BIGENDIAN
AH_TOP([
#if defined(__GNUC__) && __GNUC__ >= 4
# define ZEND_API __attribute__ ((visibility("default")))
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
#else
# define ZEND_API
# define ZEND_DLEXPORT
#endif
#define ZEND_DLIMPORT
#undef uint
#undef ulong
/* Define if you want to enable memory limit support */
#define MEMORY_LIMIT 0
])
AH_BOTTOM([
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...);
#else
# define zend_sprintf sprintf
#endif
#include <math.h>
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
#define HAVE_ISNAN 1
#define HAVE_ISINF 1
#define HAVE_ISFINITE 1
#endif
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif
#endif
#ifdef HAVE_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#ifdef HAVE_FINITE
#define zend_finite(a) finite(a)
#elif defined(HAVE_ISFINITE) || defined(isfinite)
#define zend_finite(a) isfinite(a)
#elif defined(fpclassify)
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
#else
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#ifdef NETWARE
#ifdef USE_WINSOCK
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
#endif
#endif
])
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #54624 (class_alias and type hint)
--FILE--
<?php
class A
{
function foo(A $param) {
}
}
class_alias('A', 'AliasA');
eval('
class B extends A
{
function foo(AliasA $param) {
}
}
');
echo "DONE\n";
?>
--EXPECTF--
DONE
+3
View File
@@ -0,0 +1,3 @@
<?php
namespace b\c {}
namespace b\d {}
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #54804 (__halt_compiler and imported namespaces)
--FILE--
<?php
namespace a;
require __DIR__ . '/bug54804.inc';
echo 'DONE';
__halt_compiler();
?>
--EXPECT--
DONE
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #54910 (Crash when calling call_user_func with unknown function name)
--FILE--
<?php
class A {
public function __call($method, $args) {
if (stripos($method, 'get') === 0) {
return $this->get();
}
die("No such method - '$method'\n");
}
protected function get() {
$class = get_class($this);
$call = array($class, 'noSuchMethod');
if (is_callable($call)) {
call_user_func($call);
}
}
}
class B extends A {}
$input = new B();
echo $input->getEmail();
--EXPECT--
No such method - 'noSuchMethod'
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #55007 (compiler fail after previous fail)
--FILE--
<?php
function __autoload($classname) {
if ('CompileErrorClass'==$classname) eval('class CompileErrorClass { function foo() { $a[] } }');
if ('MyErrorHandler'==$classname) eval('class MyErrorHandler { function __construct() { print "My error handler runs.\n"; } }');
}
function shutdown() {
new MyErrorHandler();
}
register_shutdown_function('shutdown');
new CompileErrorClass();
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %s(%d) : eval()'d code on line %d
My error handler runs.
+3 -2
View File
@@ -1,5 +1,5 @@
--TEST--
Persistent case insensetive and user defined constants
Persistent case insensitive and user defined constants
--FILE--
<?php
var_dump(ZEND_THREAD_safe);
@@ -7,5 +7,6 @@ define("ZEND_THREAD_safe", 123);
var_dump(ZEND_THREAD_safe);
?>
--EXPECTF--
bool(%s)
Notice: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' in %s on line %d
string(16) "ZEND_THREAD_safe"
int(123)
+9 -3
View File
@@ -1,12 +1,18 @@
--TEST--
Testing declare statement with several type values
--SKIPIF--
<?php
if (!extension_loaded("mbstring")) {
die("skip Requires ext/mbstring");
}
?>
--INI--
zend.multibyte=1
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 1123131232131312321);
declare(encoding = 112313123213131232100);
declare(encoding = NULL);
declare(encoding = 'utf-8');
declare(encoding = M_PI);
@@ -17,8 +23,8 @@ print 'DONE';
--EXPECTF--
Warning: Unsupported encoding [1] in %sdeclare_001.php on line %d
Warning: Unsupported encoding [1.1231312321313E+18] in %sdeclare_001.php on line %d
Warning: Unsupported encoding [1.1231312321313E+20] in %sdeclare_001.php on line %d
Warning: Unsupported encoding [] in %sdeclare_001.php on line %d
Fatal error: Cannot use constants as encoding in %sdeclare_001.php on line %d
Fatal error: Cannot use constants as encoding in %sdeclare_001.php on line %d
+3
View File
@@ -5,6 +5,9 @@ Testing declare statement with several type values
if (!ini_get("zend.multibyte")) {
die("skip Requires zend.multibyte=1");
}
if (!extension_loaded("mbstring")) {
die("skip Requires ext/mbstring");
}
?>
--FILE--
<?php
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Testing declare statement with several type values
--INI--
precision=15
zend.multibyte=1
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 11111111111111);
declare(encoding = NULL);
declare(encoding = M_PI);
print 'DONE';
?>
--EXPECTF--
Warning: Unsupported encoding [1] in %sdeclare_003.php on line %d
Warning: Unsupported encoding [11111111111111] in %sdeclare_003.php on line %d
Warning: Unsupported encoding [] in %sdeclare_003.php on line %d
Fatal error: Cannot use constants as encoding in %sdeclare_003.php on line %d
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Testing declare statement with several type values
--SKIPIF--
<?php
if (!ini_get("zend.multibyte")) {
die("skip Requires zend.multibyte=1");
}
?>
--FILE--
<?php
declare(encoding = 1);
declare(encoding = 1123131232131312321);
declare(encoding = NULL);
declare(encoding = M_PI);
print 'DONE';
?>
--EXPECTF--
Warning: Unsupported encoding [%d] in %sdeclare_004.php on line 3
Warning: Unsupported encoding [%f] in %sdeclare_004.php on line 4
Warning: Unsupported encoding [] in %sdeclare_004.php on line 5
Fatal error: Cannot use constants as encoding in %sdeclare_004.php on line 6
+150
View File
@@ -0,0 +1,150 @@
--TEST--
Calling method from array
--FILE--
<?php
class Hello {
public function world($x) {
echo "Hello, $x\n"; return $this;
}
}
class Hello2 {
static public function world($x) {
echo "Hello, $x\n";
}
}
class Magic {
public function __call($f, $a) {
printf("%s called (%s)!\n", __METHOD__, $f);
}
}
class Magic2 {
public static function __callStatic($f, $a) {
printf("%s called (%s)!\n", __METHOD__, $f);
}
}
class Magic3 {
public static function __callStatic($f, $a) {
printf("%s called (%s)!\n", __METHOD__, $f);
}
public function __call($f, $a) {
printf("%s called (%s)!\n", __METHOD__, $f);
}
}
$f = array('Hello','world');
var_dump($f('you'));
var_dump(call_user_func($f, 'you'));
printf("-----\n");
$h= new Hello;
$f = array($h,'world');
var_dump($f('again'));
var_dump(call_user_func($f, 'again'));
printf("-----\n");
function bar() {
return array(new Hello,'world');
}
$f = bar();
var_dump($f('there'));
var_dump(call_user_func($f, 'there'));
printf("-----\n");
$x = function ($c,$v) { return array($c, $v); };
$c = new Hello;
$m = 'world';
$f = $x($c, $m);
var_dump($f('devs'));
var_dump(call_user_func($f, 'devs'));
printf("-----\n");
$f = array(new Magic, 'foo');
$f();
call_user_func($f);
printf("-----\n");
$f = array('Magic2', 'foo');
$f();
call_user_func($f);
printf("-----\n");
$f = array('Magic3', 'foo');
$f();
call_user_func($f);
printf("-----\n");
$f = array(new Magic3, 'foo');
$f();
call_user_func($f);
printf("-----\n");
$f = array(new Hello2, 'world');
var_dump($f('you'));
var_dump(call_user_func($f, 'you'));
?>
--EXPECTF--
Strict Standards: Non-static method Hello::world() should not be called statically in %s on line %d
Hello, you
Notice: Undefined variable: this in %s on line %d
NULL
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Hello::world() should not be called statically in %s on line %d
Hello, you
Notice: Undefined variable: this in %s on line %d
NULL
-----
Hello, again
object(Hello)#1 (0) {
}
Hello, again
object(Hello)#1 (0) {
}
-----
Hello, there
object(Hello)#2 (0) {
}
Hello, there
object(Hello)#2 (0) {
}
-----
Hello, devs
object(Hello)#4 (0) {
}
Hello, devs
object(Hello)#4 (0) {
}
-----
Magic::__call called (foo)!
Magic::__call called (foo)!
-----
Magic2::__callStatic called (foo)!
Magic2::__callStatic called (foo)!
-----
Magic3::__callStatic called (foo)!
Magic3::__callStatic called (foo)!
-----
Magic3::__call called (foo)!
Magic3::__call called (foo)!
-----
Hello, you
NULL
Hello, you
NULL
+9
View File
@@ -0,0 +1,9 @@
--TEST--
Argument parsing error #001
--FILE--
<?php
function foo($arg1 string) {}
?>
--EXPECTF--
Parse error: syntax error, unexpected T_STRING, expecting ')' in %sfunction_arguments_001.php on line %d
+9
View File
@@ -0,0 +1,9 @@
--TEST--
Argument parsing error #002
--FILE--
<?php
function foo($arg1/) {}
?>
--EXPECTF--
Parse error: syntax error, unexpected '/', expecting ')' in %sfunction_arguments_002.php on line %d
-97
View File
@@ -1,97 +0,0 @@
--TEST--
Parameter type hint - Reflection
--FILE--
<?php
function test(int $a, double $b, string $c, boolean $d = true, resource $e, array $f = array(), object $g) {
}
$func = new ReflectionFunction('test');
Reflection::Export($func);
foreach ($func->getParameters() as $i => $param) {
printf(
"-- Parameter #%d: %s {\n".
" Allows NULL: %s\n".
" Hint Type: %s\n".
" Passed to by reference: %s\n".
" Is optional?: %s\n",
$i,
$param->getName(),
var_export($param->getClass(), 1),
$param->getTypeHint(),
var_export($param->allowsNull(), 1),
var_export($param->isPassedByReference(), 1),
$param->isOptional() ? 'yes' : 'no'
);
printf(" Int: %d | Double: %d | Bool: %d | String: %d | Resource: %d | Array: %d | Object: %d\n",
$param->isInt(), $param->isDouble(), $param->isBool(), $param->isString(),
$param->isResource(), $param->isArray(), $param->isObject());
print "}\n";
}
?>
--EXPECTF--
Function [ <user> function test ] {
@@ %s 3 - 4
- Parameters [7] {
Parameter #0 [ <required> integer $a ]
Parameter #1 [ <required> double $b ]
Parameter #2 [ <required> string $c ]
Parameter #3 [ <required> boolean $d ]
Parameter #4 [ <required> resource $e ]
Parameter #5 [ <required> array $f ]
Parameter #6 [ <required> object $g ]
}
}
-- Parameter #0: a {
Allows NULL: NULL
Hint Type: integer
Passed to by reference: false
Is optional?: false
Int: 1 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 0
}
-- Parameter #1: b {
Allows NULL: NULL
Hint Type: double
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 1 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 0
}
-- Parameter #2: c {
Allows NULL: NULL
Hint Type: string
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 0 | Bool: 0 | String: 1 | Resource: 0 | Array: 0 | Object: 0
}
-- Parameter #3: d {
Allows NULL: NULL
Hint Type: boolean
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 0 | Bool: 1 | String: 0 | Resource: 0 | Array: 0 | Object: 0
}
-- Parameter #4: e {
Allows NULL: NULL
Hint Type: resource
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 1 | Array: 0 | Object: 0
}
-- Parameter #5: f {
Allows NULL: NULL
Hint Type: array
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 1 | Object: 0
}
-- Parameter #6: g {
Allows NULL: NULL
Hint Type: object
Passed to by reference: false
Is optional?: false
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 1
}
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Parameter type hint - Testing NULL when allowed
--FILE--
<?php
function test_int(int $a = null) {
}
test_int(null);
function test_double(double $a = null) {
}
test_double(null);
function test_bool(bool $a = null) {
}
test_bool(null);
print "Done";
?>
--EXPECT--
Done
-46
View File
@@ -1,46 +0,0 @@
--TEST--
Parameter type hint - Testing parameter with reference
--FILE--
<?php
/* string */
function test_string(string &$a) {
$a .= '!!!';
}
$str = 'foo';
test_string($str);
var_dump($str);
/* integer */
function test_int(int &$b) {
$b += 2;
}
$b = 2;
test_int($b);
var_dump($b);
/* object */
function test_obj(object &$c) {
$c->tested = 1;
}
$c = new stdclass;
test_obj($c);
var_dump($c);
?>
--EXPECT--
string(6) "foo!!!"
int(4)
object(stdClass)#1 (1) {
["tested"]=>
int(1)
}
--UEXPECT--
unicode(6) "foo!!!"
int(4)
object(stdClass)#1 (1) {
[u"tested"]=>
int(1)
}
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Parameter type hint - Testing string type hint with reference
--FILE--
<?php
function test(string &$a) {
$a .= '!!!';
}
$x = 'foo';
test($x);
var_dump($x);
?>
--EXPECT--
string(6) "foo!!!"
--UEXPECT--
unicode(6) "foo!!!"
-17
View File
@@ -1,17 +0,0 @@
--TEST--
Parameter type hint - Testing default parameter value
--FILE--
<?php
function test(string &$a, integer $x = 1) {
var_dump($x);
}
$y = 'foo';
test($y, 2);
test($y);
?>
--EXPECT--
int(2)
int(1)
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Parameter type hint - Testing with heredoc
--FILE--
<?php
function test(string $str) {
}
test(<<<FOO
test!
FOO
);
test(<<<'FOO'
test!
FOO
);
test(<<<"FOO"
test!
FOO
);
print "Ok!";
?>
--EXPECT--
Ok!
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Parameter type hint - Testing default parameter values
--FILE--
<?php
function test(string $a, bool $b = NULL, integer $c, double $d = NULL, $e) {
print "ok\n";
}
test('foo', NULL, 1, NULL, 'bar');
test('foo', true, 0, -1., NULL);
test('true', false, -1, 2.2222, 1.1);
test('1.1', false, -1, 11111111111111111111111111, true);
test('1', false, -1, NULL, new stdClass);
?>
--EXPECT--
ok
ok
ok
ok
ok
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Parameter type hint - Testing default parameter values as constants
--FILE--
<?php
function test(int $foo = PHP_INT_MAX) {
print "ok\n";
}
test();
?>
--EXPECT--
ok
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Parameter type hint - formatting
--FILE--
<?php
function test(int$foo) { print "ok\n";}
test(1);
function test2(int
$foo) { print "ok\n";}
test2(1);
?>
--EXPECT--
ok
ok
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Parameter type hint - scalar type hints, default value
--FILE--
<?php
function bar1(scalar $param = null) {}
function bar2(scalar $param = 123) {}
function bar3(scalar $param = false) {}
function bar4(scalar $param = 988.99) {}
function bar5(scalar $param = "1233") {}
function bar6(scalar $param = array(1,2,3)) {}
?>
--EXPECTF--
Fatal error: Default value for parameters with scalar type hint can only be scalar or NULL in %s on line 8
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Indirect method call by array - Invalid class name
--FILE--
<?php
$arr = array('a', 'b');
$arr();
?>
--EXPECTF--
Fatal error: Class 'a' not found in %s on line %d
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Indirect method call by array - Invalid method name
--FILE--
<?php
$arr = array('stdclass', 'b');
$arr();
?>
--EXPECTF--
Fatal error: Call to undefined method stdClass::b() in %s on line %d
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Indirect method call by array - Calling __call() and __callStatic()
--FILE--
<?php
class foo {
public function __call($a, $b) {
printf("From %s:\n", __METHOD__);
var_dump($a);
var_dump($this);
}
static public function __callStatic($a, $b) {
printf("From %s:\n", __METHOD__);
var_dump($a);
var_dump($this);
}
}
$arr = array('foo', 'abc');
$arr();
$foo = new foo;
$arr = array($foo, 'abc');
$arr();
?>
--EXPECTF--
From foo::__callStatic:
string(3) "abc"
Notice: Undefined variable: this in %s on line %d
NULL
From foo::__call:
string(3) "abc"
object(foo)#%d (0) {
}
+71
View File
@@ -0,0 +1,71 @@
--TEST--
Indirect method call by array - Testing exception and method magics
--FILE--
<?php
class foo {
static public function abc() {
throw new Exception('foo');
}
public function __call($a, $b) {
printf("From %s:\n", __METHOD__);
throw new Exception($a);
}
static public function __callStatic($a, $b) {
printf("From %s:\n", __METHOD__);
throw new Exception($a);
}
}
$arr = array('foo', 'abc');
try {
$arr();
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
}
$arr = array('foo', '123');
try {
$arr();
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
}
echo "------\n";
$foo = new foo;
$arr = array($foo, 'abc');
try {
$arr();
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
}
$foo = new foo;
$arr = array($foo, '123');
try {
$arr();
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
foo
From foo::__callStatic:
123
------
foo
From foo::__call:
123
+1
View File
@@ -849,6 +849,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
exit(-1);
}
CG(unclean_shutdown) = 1;
CG(active_class_entry) = NULL;
CG(in_compilation) = EG(in_execution) = 0;
EG(current_execute_data) = NULL;
LONGJMP(*EG(bailout), FAILURE);
-4
View File
@@ -573,10 +573,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define IS_RESOURCE 7
#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
/* used for type-hinting only */
#define IS_CLASS 10
#define IS_SCALAR 11
#define IS_NUMERIC 12
/* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_TYPE_MASK 0x00f
+14 -7
View File
@@ -205,10 +205,6 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
switch(type) {
case IS_BOOL:
return "boolean";
case IS_SCALAR:
return "scalar";
case IS_NUMERIC:
return "numeric";
case IS_LONG:
return "integer";
case IS_DOUBLE:
@@ -216,7 +212,6 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
case IS_STRING:
return "string";
case IS_OBJECT:
case IS_CLASS:
return "object";
case IS_RESOURCE:
return "resource";
@@ -411,6 +406,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
}
break;
case 'p':
case 's':
{
char **p = va_arg(*va, char **);
@@ -437,17 +433,23 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
}
*p = Z_STRVAL_PP(arg);
*pl = Z_STRLEN_PP(arg);
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
return "a valid path";
}
break;
case IS_OBJECT:
if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
return "a valid path";
}
break;
}
case IS_ARRAY:
case IS_RESOURCE:
default:
return "string";
return c == 's' ? "string" : "a valid path";
}
}
break;
@@ -713,7 +715,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
case 'z': case 'Z':
case 'C': case 'h':
case 'f': case 'A':
case 'H':
case 'H': case 'p':
max_num_args++;
break;
@@ -2773,6 +2775,11 @@ get_function_via_handler:
if (fcc->function_handler) {
retval = 1;
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
if (call_via_handler && !fcc->object_ptr && EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) {
fcc->object_ptr = EG(This);
}
}
}
}
+4 -1
View File
@@ -98,7 +98,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref},
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref},
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_CLASS, allow_null, pass_by_ref},
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, allow_null, pass_by_ref},
#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, allow_null, pass_by_ref},
#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, allow_null, pass_by_ref},
#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \
@@ -526,6 +526,9 @@ END_EXTERN_C()
#define CHECK_ZVAL_STRING_REL(z)
#endif
#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
#define ZVAL_RESOURCE(z, l) do { \
zval *__z = (z); \
Z_LVAL_P(__z) = l; \
+3
View File
@@ -1602,6 +1602,9 @@ ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent
int internal;
if (!heap->use_zend_alloc) {
if (full_shutdown) {
free(heap);
}
return;
}
+33 -53
View File
@@ -1847,10 +1847,9 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
if (class_type->op_type != IS_UNUSED) {
cur_arg_info->allow_null = 0;
cur_arg_info->type_hint = class_type->u.constant.type;
switch (class_type->u.constant.type) {
case IS_CLASS:
if (class_type->u.constant.type != IS_NULL) {
cur_arg_info->type_hint = IS_OBJECT;
if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) {
zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC);
}
@@ -1864,9 +1863,8 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
}
}
break;
case IS_ARRAY:
} else {
cur_arg_info->type_hint = IS_ARRAY;
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
cur_arg_info->allow_null = 1;
@@ -1874,39 +1872,6 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
}
}
break;
/* scalar type hinting */
case IS_SCALAR:
if (op == ZEND_RECV_INIT && Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
break;
}
/* fall through */
/* scalar type hinting */
case IS_NUMERIC:
if (op == ZEND_RECV_INIT && (Z_TYPE(initialization->u.constant) == IS_LONG || Z_TYPE(initialization->u.constant) == IS_DOUBLE)) {
break;
}
/* fall through */
case IS_BOOL:
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
case IS_RESOURCE:
case IS_OBJECT:
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) != class_type->u.constant.type && Z_TYPE(initialization->u.constant) != IS_NULL && (Z_TYPE(initialization->u.constant) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT) {
zend_error(E_COMPILE_ERROR, "Default value for parameters with %s type hint can only be %s or NULL", zend_get_type_by_const(class_type->u.constant.type), zend_get_type_by_const(class_type->u.constant.type));
} else if (Z_TYPE(initialization->u.constant) == IS_NULL) {
cur_arg_info->allow_null = 1;
}
}
break;
default:
zend_error(E_COMPILE_ERROR, "Unknown type hint");
}
}
}
@@ -2256,7 +2221,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
CG(zend_lineno) = opline->lineno;
zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
} else {
/* Label is not defined. Delay to pass 2. */
INC_BPC(op_array);
@@ -2905,7 +2870,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */
}
/* }}} */
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto) /* {{{ */
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
{
zend_uint i;
@@ -2953,11 +2918,24 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
&& strcasecmp(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)!=0) {
char *colon;
if (fe->common.type != ZEND_USER_FUNCTION ||
strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
if (fe->common.type != ZEND_USER_FUNCTION) {
return 0;
} else if (strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
(colon = zend_memrchr(fe->common.arg_info[i].class_name, '\\', fe->common.arg_info[i].class_name_len)) == NULL ||
strcasecmp(colon+1, proto->common.arg_info[i].class_name) != 0) {
return 0;
zend_class_entry **fe_ce, **proto_ce;
int found, found2;
found = zend_lookup_class(fe->common.arg_info[i].class_name, fe->common.arg_info[i].class_name_len, &fe_ce TSRMLS_CC);
found2 = zend_lookup_class(proto->common.arg_info[i].class_name, proto->common.arg_info[i].class_name_len, &proto_ce TSRMLS_CC);
/* Check for class alias */
if (found != SUCCESS || found2 != SUCCESS ||
(*fe_ce)->type == ZEND_INTERNAL_CLASS ||
(*proto_ce)->type == ZEND_INTERNAL_CLASS ||
*fe_ce != *proto_ce) {
return 0;
}
}
}
if (fe->common.arg_info[i].type_hint != proto->common.arg_info[i].type_hint) {
@@ -3040,11 +3018,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
}
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
}
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent)) {
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
}
}
@@ -5020,6 +4998,10 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
zend_register_long_constant(name, len+1, zend_get_scanned_file_offset(TSRMLS_C), CONST_CS, 0 TSRMLS_CC);
pefree(name, 0);
if (CG(in_namespace)) {
zend_do_end_namespace(TSRMLS_C);
}
}
/* }}} */
@@ -6201,14 +6183,12 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
void zend_do_ticks(TSRMLS_D) /* {{{ */
{
if (Z_LVAL(CG(declarables).ticks)) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_TICKS;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
opline->extended_value = Z_LVAL(CG(declarables).ticks);
}
opline->opcode = ZEND_TICKS;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
opline->extended_value = Z_LVAL(CG(declarables).ticks);
}
/* }}} */
+1
View File
@@ -39,6 +39,7 @@
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count++); }
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count--); }
#define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); }
#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
#define RESET_DOC_COMMENT() \
{ \
+1 -1
View File
@@ -141,7 +141,7 @@ void zend_register_standard_constants(TSRMLS_D)
c.value.type = IS_NULL;
zend_register_constant(&c TSRMLS_CC);
c.flags = CONST_PERSISTENT;
c.flags = CONST_PERSISTENT | CONST_CS;
c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE"));
c.name_len = sizeof("ZEND_THREAD_SAFE");
+8 -26
View File
@@ -69,7 +69,7 @@
%left '*' '/' '%'
%right '!'
%nonassoc T_INSTANCEOF
%right '~' T_INC T_DEC T_INT_CAST T_NUMERIC_CAST T_SCALAR_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
%right '['
%nonassoc T_NEW T_CLONE
%token T_EXIT
@@ -130,14 +130,6 @@
%token T_DOUBLE_ARROW
%token T_LIST
%token T_ARRAY
%token T_BOOL_HINT
%token T_STRING_HINT
%token T_INT_HINT
%token T_DOUBLE_HINT
%token T_RESOURCE_HINT
%token T_OBJECT_HINT
%token T_SCALAR_HINT
%token T_NUMERIC_HINT
%token T_CLASS_C
%token T_METHOD_C
%token T_FUNC_C
@@ -221,7 +213,7 @@ inner_statement:
statement:
unticked_statement { zend_do_ticks(TSRMLS_C); }
unticked_statement { DO_TICKS(); }
| T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
;
@@ -301,11 +293,11 @@ unset_variable:
;
function_declaration_statement:
unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); }
unticked_function_declaration_statement { DO_TICKS(); }
;
class_declaration_statement:
unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); }
unticked_class_declaration_statement { DO_TICKS(); }
;
@@ -474,16 +466,8 @@ non_empty_parameter_list:
optional_class_type:
/* empty */ { $$.op_type = IS_UNUSED; }
| T_ARRAY { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_ARRAY; }
| T_BOOL_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_BOOL; }
| T_STRING_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_STRING; }
| T_INT_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_LONG; }
| T_DOUBLE_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_DOUBLE; }
| T_RESOURCE_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_RESOURCE; }
| T_OBJECT_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_OBJECT; }
| T_SCALAR_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_SCALAR; }
| T_NUMERIC_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NUMERIC; }
| fully_qualified_class_name { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_CLASS; }
| T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NULL; }
| fully_qualified_class_name { $$ = $1; }
;
@@ -716,8 +700,6 @@ expr_without_variable:
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); }
| T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); }
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); }
| T_SCALAR_CAST expr { zend_do_cast(&$$, &$2, IS_SCALAR TSRMLS_CC); }
| T_NUMERIC_CAST expr { zend_do_cast(&$$, &$2, IS_NUMERIC TSRMLS_CC); }
| T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); }
| T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); }
| '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
@@ -941,7 +923,7 @@ method:
{ zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
;
method_or_not:
method_or_not:
method { $$ = $1; $$.EA = ZEND_PARSED_METHOD_CALL; zend_do_push_object(&$$ TSRMLS_CC); }
| array_method_dereference { $$ = $1; zend_do_push_object(&$$ TSRMLS_CC); }
| /* empty */ { $$.EA = ZEND_PARSED_MEMBER; }
@@ -964,7 +946,7 @@ variable_class_name:
array_function_dereference:
array_function_dereference '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
| function_call { zend_do_begin_variable_parse(TSRMLS_C); $1.EA = ZEND_PARSED_FUNCTION_CALL; }
| function_call { zend_do_begin_variable_parse(TSRMLS_C); $1.EA = ZEND_PARSED_FUNCTION_CALL; }
'[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$4 TSRMLS_CC); }
;
+2644 -3761
View File
File diff suppressed because it is too large. Load diff
+8 -72
View File
@@ -469,7 +469,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
{
char *file_path = NULL, *buf;
size_t size, offset = 0;
/* The shebang line was read, get the current position to obtain the buffer start */
if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
if ((offset = ftell(file_handle->handle.fp)) == -1) {
@@ -496,7 +496,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
if (size != -1) {
if (CG(multibyte)) {
SCNG(script_org) = buf;
SCNG(script_org_size) = size;
SCNG(script_org_size) = size;
SCNG(script_filtered) = NULL;
zend_multibyte_set_filter(NULL TSRMLS_CC);
@@ -1206,10 +1206,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_STRING_CAST;
}
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"scalar"{TABS_AND_SPACES}")" {
return T_SCALAR_CAST;
}
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" {
return T_ARRAY_CAST;
}
@@ -1314,62 +1310,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_ARRAY;
}
<ST_IN_SCRIPTING>("bool"|"boolean"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
if (yytext[4] == 'e') {
yyless((sizeof("boolean") - 1));
} else {
yyless((sizeof("bool") - 1));
}
return T_BOOL_HINT;
}
<ST_IN_SCRIPTING>("string"|"binary"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
yyless(6);
return T_STRING_HINT;
}
<ST_IN_SCRIPTING>"scalar"{TABS_AND_SPACES}[ \r\n\t&]*"$" {
yyless(6);
return T_SCALAR_HINT;
}
<ST_IN_SCRIPTING>"numeric"{TABS_AND_SPACES}[ \r\n\t&]*"$" {
yyless(7);
return T_NUMERIC_HINT;
}
<ST_IN_SCRIPTING>("int"|"integer"|"long"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
if (yytext[3] == 'e') {
yyless((sizeof("integer") - 1));
} else if (yytext[3] == 'g') {
yyless((sizeof("long") - 1));
} else {
yyless(3);
}
return T_INT_HINT;
}
<ST_IN_SCRIPTING>("real"|"double"|"float"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
if (yytext[4] == 'l') {
yyless((sizeof("double") - 1));
} else if (yytext[4] == 't') {
yyless((sizeof("float") - 1));
} else {
yyless(4);
}
return T_DOUBLE_HINT;
}
<ST_IN_SCRIPTING>"resource"{TABS_AND_SPACES}[ \t\r\n&]*"$" {
yyless((sizeof("resource") - 1));
return T_RESOURCE_HINT;
}
<ST_IN_SCRIPTING>"object"{TABS_AND_SPACES}[ \t\r\n&]*"$" {
yyless((sizeof("object") - 1));
return T_OBJECT_HINT;
}
<ST_IN_SCRIPTING>"++" {
return T_INC;
}
@@ -1628,7 +1568,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
len += strlen(func_name);
}
zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""
@@ -1724,15 +1664,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?=" {
if (CG(short_tags)) {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
} else {
goto inline_char_handler;
}
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sun Apr 3 14:18:11 2011 */
/* Generated by re2c 0.13.5 on Thu Jun 2 17:34:19 2011 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
+12
View File
@@ -31,6 +31,18 @@
else (lval) = __tmpvar; \
} while (0)
#elif defined(__x86_64__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
__asm__ ("imulq %3,%0\n" \
"adcq $0,%1" \
: "=r"(__tmpvar),"=r"(usedval) \
: "0"(a), "r"(b), "1"(0)); \
if (usedval) (dval) = (double) (a) * (double) (b); \
else (lval) = __tmpvar; \
} while (0)
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
-3
View File
@@ -27,13 +27,10 @@
#include "zend_globals.h"
#include "zend_list.h"
#include "zend_API.h"
#include "zend_multiply.h"
#include "zend_strtod.h"
#include "zend_exceptions.h"
#include "zend_closures.h"
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
#if ZEND_USE_TOLOWER_L
#include <locale.h>
static _locale_t current_locale = NULL;
+418
View File
@@ -31,11 +31,14 @@
#endif
#include "zend_strtod.h"
#include "zend_multiply.h"
#if 0&&HAVE_BCMATH
#include "ext/bcmath/libbcmath/src/bcmath.h"
#endif
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
BEGIN_EXTERN_C()
ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -448,6 +451,421 @@ ZEND_API void zend_update_current_locale(void);
#define zend_update_current_locale()
#endif
#ifndef offsetof
#define offsetof(t,f) \
((int)(&((t*)0)->f))
#endif
static zend_always_inline int fast_increment_function(zval *op1)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"incl (%0)\n\t"
"jno 0f\n\t"
"movl $0x0, (%0)\n\t"
"movl $0x41e00000, 0x4(%0)\n\t"
"movb $0x2,0xc(%0)\n"
"0:"
:
: "r"(op1));
#elif defined(__GNUC__) && defined(__x86_64__)
__asm__(
"incq (%0)\n\t"
"jno 0f\n\t"
"movl $0x0, (%0)\n\t"
"movl $0x43e00000, 0x4(%0)\n\t"
"movb $0x2,0x14(%0)\n"
"0:"
:
: "r"(op1));
#else
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MAX)) {
/* switch to double */
Z_DVAL_P(op1) = (double)LONG_MAX + 1.0;
Z_TYPE_P(op1) = IS_DOUBLE;
} else {
Z_LVAL_P(op1)++;
}
#endif
return SUCCESS;
}
return increment_function(op1);
}
static zend_always_inline int fast_decrement_function(zval *op1)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"decl (%0)\n\t"
"jno 0f\n\t"
"movl $0x00200000, (%0)\n\t"
"movl $0xc1e00000, 0x4(%0)\n\t"
"movb $0x2,0xc(%0)\n"
"0:"
:
: "r"(op1));
#elif defined(__GNUC__) && defined(__x86_64__)
__asm__(
"decq (%0)\n\t"
"jno 0f\n\t"
"movl $0x00000000, (%0)\n\t"
"movl $0xc3e00000, 0x4(%0)\n\t"
"movb $0x2,0x14(%0)\n"
"0:"
:
: "r"(op1));
#else
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MIN)) {
/* switch to double */
Z_DVAL_P(op1) = (double)LONG_MIN - 1.0;
Z_TYPE_P(op1) = IS_DOUBLE;
} else {
Z_LVAL_P(op1)--;
}
#endif
return SUCCESS;
}
return decrement_function(op1);
}
static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"movl (%1), %%eax\n\t"
"addl (%2), %%eax\n\t"
"jo 0f\n\t"
"movl %%eax, (%0)\n\t"
"movb $0x1,0xc(%0)\n\t"
"jmp 1f\n"
"0:\n\t"
"fildl (%1)\n\t"
"fildl (%2)\n\t"
"faddp %%st, %%st(1)\n\t"
"movb $0x2,0xc(%0)\n\t"
"fstpl (%0)\n"
"1:"
:
: "r"(result),
"r"(op1),
"r"(op2)
: "eax");
#elif defined(__GNUC__) && defined(__x86_64__)
__asm__(
"movq (%1), %%rax\n\t"
"addq (%2), %%rax\n\t"
"jo 0f\n\t"
"movq %%rax, (%0)\n\t"
"movb $0x1,0x14(%0)\n\t"
"jmp 1f\n"
"0:\n\t"
"fildq (%1)\n\t"
"fildq (%2)\n\t"
"faddp %%st, %%st(1)\n\t"
"movb $0x2,0x14(%0)\n\t"
"fstpl (%0)\n"
"1:"
:
: "r"(result),
"r"(op1),
"r"(op2)
: "rax");
#else
Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
} else {
Z_TYPE_P(result) = IS_LONG;
}
#endif
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) + Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
}
return add_function(result, op1, op2 TSRMLS_CC);
}
static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
#if defined(__GNUC__) && defined(__i386__)
__asm__(
"movl (%1), %%eax\n\t"
"subl (%2), %%eax\n\t"
"jo 0f\n\t"
"movl %%eax, (%0)\n\t"
"movb $0x1,0xc(%0)\n\t"
"jmp 1f\n"
"0:\n\t"
"fildl (%2)\n\t"
"fildl (%1)\n\t"
"fsubp %%st, %%st(1)\n\t"
"movb $0x2,0xc(%0)\n\t"
"fstpl (%0)\n"
"1:"
:
: "r"(result),
"r"(op1),
"r"(op2)
: "eax");
#elif defined(__GNUC__) && defined(__x86_64__)
__asm__(
"movq (%1), %%rax\n\t"
"subq (%2), %%rax\n\t"
"jo 0f\n\t"
"movq %%rax, (%0)\n\t"
"movb $0x1,0x14(%0)\n\t"
"jmp 1f\n"
"0:\n\t"
"fildq (%2)\n\t"
"fildq (%1)\n\t"
"fsubp %%st, %%st(1)\n\t"
"movb $0x2,0x14(%0)\n\t"
"fstpl (%0)\n"
"1:"
:
: "r"(result),
"r"(op1),
"r"(op2)
: "rax");
#else
Z_LVAL_P(result) = Z_LVAL_P(op1) - Z_LVAL_P(op2);
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
} else {
Z_TYPE_P(result) = IS_LONG;
}
#endif
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
}
return sub_function(result, op1, op2 TSRMLS_CC);
}
static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
long overflow;
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) * Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
Z_DVAL_P(result) = Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
}
return mul_function(result, op1, op2 TSRMLS_CC);
}
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN)) {
/* Prevent overflow error/crash */
Z_DVAL_P(result) = (double) LONG_MIN / -1;
Z_TYPE_P(result) = IS_DOUBLE;
} else if (EXPECTED(Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0)) {
/* integer */
Z_LVAL_P(result) = Z_LVAL_P(op1) / Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_LONG;
} else {
Z_DVAL_P(result) = ((double) Z_LVAL_P(op1)) / ((double)Z_LVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
}
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) / Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE) && 0) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = Z_DVAL_P(op1) / Z_DVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
}
Z_DVAL_P(result) = Z_DVAL_P(op1) / ((double)Z_LVAL_P(op2));
Z_TYPE_P(result) = IS_DOUBLE;
return SUCCESS;
}
}
return div_function(result, op1, op2 TSRMLS_CC);
}
static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
zend_error(E_WARNING, "Division by zero");
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_BOOL;
return FAILURE;
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
/* Prevent overflow error/crash if op1==LONG_MIN */
Z_LVAL_P(result) = 0;
Z_TYPE_P(result) = IS_LONG;
return SUCCESS;
}
Z_LVAL_P(result) = Z_LVAL_P(op1) % Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_LONG;
return SUCCESS;
}
}
return mod_function(result, op1, op2 TSRMLS_CC);
}
static zend_always_inline int fast_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) == Z_LVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) == Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) == Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) == 0;
}
static zend_always_inline int fast_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) != Z_LVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) != Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) != Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) != ((double)Z_LVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) != 0;
}
static zend_always_inline int fast_is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) < Z_LVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) < Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) < Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) < ((double)Z_LVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) < 0;
}
static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_LVAL_P(op1) <= Z_LVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return ((double)Z_LVAL_P(op1)) <= Z_DVAL_P(op2);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
return Z_DVAL_P(op1) <= Z_DVAL_P(op2);
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
return Z_DVAL_P(op1) <= ((double)Z_LVAL_P(op2));
}
}
compare_function(result, op1, op2 TSRMLS_CC);
return Z_LVAL_P(result) <= 0;
}
#endif
/*
-1
View File
@@ -32,7 +32,6 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
case IS_STRING:
case IS_CONSTANT:
case IS_CLASS:
CHECK_ZVAL_STRING_REL(zvalue);
STR_FREE_REL(zvalue->value.str.val);
break;
+138 -73
View File
@@ -31,7 +31,7 @@ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
add_function(&EX_T(opline->result.var).tmp_var,
fast_add_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -46,7 +46,7 @@ ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
sub_function(&EX_T(opline->result.var).tmp_var,
fast_sub_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -61,7 +61,7 @@ ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
mul_function(&EX_T(opline->result.var).tmp_var,
fast_mul_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -76,7 +76,7 @@ ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
div_function(&EX_T(opline->result.var).tmp_var,
fast_div_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -91,7 +91,7 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
SAVE_OPLINE();
mod_function(&EX_T(opline->result.var).tmp_var,
fast_mod_function(&EX_T(opline->result.var).tmp_var,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
FREE_OP1();
@@ -184,10 +184,9 @@ ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zval *result = &EX_T(opline->result.var).tmp_var;
SAVE_OPLINE();
compare_function(result,
ZVAL_BOOL(result, fast_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -201,10 +200,9 @@ ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zval *result = &EX_T(opline->result.var).tmp_var;
SAVE_OPLINE();
compare_function(result,
ZVAL_BOOL(result, fast_not_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -218,10 +216,9 @@ ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
zval *result = &EX_T(opline->result.var).tmp_var;
SAVE_OPLINE();
compare_function(result,
ZVAL_BOOL(result, fast_is_smaller_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -235,10 +232,9 @@ ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV
zval *result = &EX_T(opline->result.var).tmp_var;
SAVE_OPLINE();
compare_function(result,
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
GET_OP1_ZVAL_PTR(BP_VAR_R),
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
FREE_OP1();
FREE_OP2();
CHECK_EXCEPTION();
@@ -824,11 +820,11 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
/* proxy object */
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
Z_ADDREF_P(val);
increment_function(val);
fast_increment_function(val);
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
zval_ptr_dtor(&val);
} else {
increment_function(*var_ptr);
fast_increment_function(*var_ptr);
}
if (RETURN_VALUE_USED(opline)) {
@@ -871,11 +867,11 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
/* proxy object */
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
Z_ADDREF_P(val);
decrement_function(val);
fast_decrement_function(val);
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
zval_ptr_dtor(&val);
} else {
decrement_function(*var_ptr);
fast_decrement_function(*var_ptr);
}
if (RETURN_VALUE_USED(opline)) {
@@ -919,11 +915,11 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
/* proxy object */
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
Z_ADDREF_P(val);
increment_function(val);
fast_increment_function(val);
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
zval_ptr_dtor(&val);
} else {
increment_function(*var_ptr);
fast_increment_function(*var_ptr);
}
FREE_OP1_VAR_PTR();
@@ -962,11 +958,11 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
/* proxy object */
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
Z_ADDREF_P(val);
decrement_function(val);
fast_decrement_function(val);
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
zval_ptr_dtor(&val);
} else {
decrement_function(*var_ptr);
fast_decrement_function(*var_ptr);
}
FREE_OP1_VAR_PTR();
@@ -2386,6 +2382,67 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else if (OP2_TYPE != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
zend_class_entry *ce;
zval **method = NULL;
zval **obj = NULL;
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
if (Z_TYPE_PP(method) != IS_STRING) {
zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
}
if (Z_TYPE_PP(obj) == IS_STRING) {
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
if (UNEXPECTED(ce == NULL)) {
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
}
EX(called_scope) = ce;
EX(object) = NULL;
if (ce->get_static_method) {
EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
} else {
EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
}
} else {
EX(object) = *obj;
ce = EX(called_scope) = Z_OBJCE_PP(obj);
EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
if (UNEXPECTED(EX(fbc) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
}
if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
EX(object) = NULL;
} else {
if (!PZVAL_IS_REF(EX(object))) {
Z_ADDREF_P(EX(object)); /* For $this pointer */
} else {
zval *this_ptr;
ALLOC_ZVAL(this_ptr);
INIT_PZVAL_COPY(this_ptr, EX(object));
zval_copy_ctor(this_ptr);
EX(object) = this_ptr;
}
}
}
if (UNEXPECTED(EX(fbc) == NULL)) {
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
}
FREE_OP2();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
zend_error_noreturn(E_ERROR, "Function name must be a string");
}
@@ -3641,58 +3698,66 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
inc_filename = &tmp_inc_filename;
}
switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
}
} else {
switch (opline->extended_value) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
} else {
resolved_path = Z_STRVAL_P(inc_filename);
}
if (failure_retval) {
/* do nothing, file already included */
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
if (resolved_path) {
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
resolved_path = Z_STRVAL_P(inc_filename);
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
efree(resolved_path);
}
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
if (failure_retval) {
/* do nothing, file already included */
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrdup(resolved_path);
}
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
zend_destroy_file_handle(&file_handle TSRMLS_CC);
} else {
zend_file_handle_dtor(&file_handle TSRMLS_CC);
failure_retval=1;
}
} else {
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
} else {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
}
}
if (resolved_path != Z_STRVAL_P(inc_filename)) {
efree(resolved_path);
}
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
break;
case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
+692 -480
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1 +0,0 @@
/* Leave this file alone */
+6 -5
View File
@@ -2412,6 +2412,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
-L$OPENSSL_LIBDIR
])
LIBS=$old_LIBS
PHP_ADD_LIBRARY(ssl,,$1)
PHP_ADD_LIBRARY(crypto,,$1)
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
@@ -2760,17 +2761,17 @@ dnl
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
dnl
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext
pdo_cv_inc_path=$prefix/include/php/ext
fi
])
if test -n "$pdo_inc_path"; then
if test -n "$pdo_cv_inc_path"; then
ifelse([$1],[],:,[$1])
else
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
-1
View File
@@ -32,7 +32,6 @@ all: $(STAMP) $(ALWAYS)
generated_lists:
@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
+1 -7
View File
@@ -25,8 +25,6 @@ LT_TARGETS = ltmain.sh config.guess config.sub
config_h_in = main/php_config.h.in
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
targets = $(TOUCH_FILES) configure $(config_h_in)
PHP_AUTOCONF ?= 'autoconf'
@@ -36,11 +34,7 @@ SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to all
all: $(targets)
acconfig.h: $(acconfig_h_SOURCES)
@echo rebuilding $@
cat $(acconfig_h_SOURCES) > $@
$(config_h_in): configure acconfig.h
$(config_h_in): configure
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@echo rebuilding $@
+4 -12
View File
@@ -28,32 +28,24 @@ if test -z "$PHP_AUTOCONF"; then
PHP_AUTOCONF='autoconf'
fi
# autoconf 2.13 or newer
# autoconf 2.59 or newer
ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.13 or newer installed"
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.13 or newer installed"
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
fi
if test "$1" = "2" && test "$2" -ge "50"; then
echo "buildconf: Your version of autoconf likely contains buggy cache code."
echo " Running vcsclean for you."
echo " To avoid this, install autoconf-2.13."
./vcsclean
stamp=
fi
test -n "$stamp" && touch $stamp
exit 0
+104 -51
View File
@@ -1,28 +1,6 @@
## $Id$ -*- autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
dnl ## Diversion 1 is the autoconf + automake setup phase. We also
dnl ## set the PHP version, deal with platform-specific compile
dnl ## options and check for the basic compile tools.
dnl ## Diversion 2 is the initial checking of OS features, programs,
dnl ## libraries and so on.
dnl ## In diversion 3 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies.
dnl ## This includes whether debugging or short tags are enabled
dnl ## and the default behaviour of php.ini options.
dnl ## This is also where an SAPI interface is selected (choosing between
dnl ## Apache module, CGI etc.)
dnl ## In diversion 4 we check user-configurable general settings.
dnl ## In diversion 5 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
dnl include Zend specific macro definitions first
dnl -------------------------------------------------------------------------
sinclude(Zend/acinclude.m4)
@@ -30,19 +8,119 @@ sinclude(Zend/acinclude.m4)
dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ(2.13)
AC_PREREQ(2.59)
AC_INIT(README.SVN-RULES)
ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
PHP_CONFIG_NICE(config.nice)
PHP_CANONICAL_HOST_TARGET
AC_CONFIG_HEADER(main/php_config.h)
AH_TOP([
#if defined(__GNUC__) && __GNUC__ >= 4
# define ZEND_API __attribute__ ((visibility("default")))
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
#else
# define ZEND_API
# define ZEND_DLEXPORT
#endif
#define ZEND_DLIMPORT
#undef uint
#undef ulong
/* Define if you want to enable memory limit support */
#define MEMORY_LIMIT 0
])
AH_BOTTOM([
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...);
#else
# define zend_sprintf sprintf
#endif
#include <math.h>
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
#define HAVE_ISNAN 1
#define HAVE_ISINF 1
#define HAVE_ISFINITE 1
#endif
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif
#endif
#ifdef HAVE_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#ifdef HAVE_FINITE
#define zend_finite(a) finite(a)
#elif defined(HAVE_ISFINITE) || defined(isfinite)
#define zend_finite(a) isfinite(a)
#elif defined(fpclassify)
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
#else
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#ifdef NETWARE
#ifdef USE_WINSOCK
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
#endif
#endif
#undef PTHREADS
])
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=99
PHP_EXTRA_VERSION="-dev"
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="alpha1"
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`
@@ -289,15 +367,6 @@ sinclude(Zend/Zend.m4)
sinclude(TSRM/threads.m4)
sinclude(TSRM/tsrm.m4)
divert(2)
dnl ## Diversion 2 is where we set PHP-specific options and come up
dnl ## with reasonable default values for them. We check for pthreads here
dnl ## because the information is needed by the SAPI configuration.
dnl ## This is also where an SAPI interface is selected (choosing between
dnl ## Apache module, CGI etc.)
dnl .
dnl -------------------------------------------------------------------------
@@ -343,13 +412,6 @@ if test "$enable_maintainer_zts" = "yes"; then
PTHREADS_FLAGS
fi
divert(3)
dnl ## In diversion 3 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies.
dnl ## This includes whether debugging or short tags are enabled
dnl ## and the default behaviour of php.ini options.
dnl Starting system checks.
dnl -------------------------------------------------------------------------
@@ -689,10 +751,6 @@ if test "x$php_crypt_r" = "x1"; then
PHP_CRYPT_R_STYLE
fi
divert(4)
dnl ## In diversion 4 we check user-configurable general settings.
dnl General settings.
dnl -------------------------------------------------------------------------
PHP_CONFIGURE_PART(General settings)
@@ -927,11 +985,6 @@ else
AC_MSG_RESULT([using system default])
fi
divert(5)
dnl ## In diversion 5 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
dnl Extension configuration.
dnl -------------------------------------------------------------------------
+4 -2
View File
@@ -385,12 +385,14 @@ static PHP_FUNCTION(bzopen)
/* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_PP(file) == IS_STRING) {
convert_to_string_ex(file);
if (Z_STRLEN_PP(file) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
RETURN_FALSE;
}
if (CHECK_ZVAL_NULL_PATH(*file)) {
RETURN_FALSE;
}
stream = php_stream_bz2open(NULL,
Z_STRVAL_PP(file),
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #51997 (SEEK_CUR with 0 value, returns a warning)
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
error_reporting(E_ALL);
$filename = "testfile.bz2";
$str = "This is a test string.\n";
$bz = bzopen($filename, "w");
bzwrite($bz, $str);
bzclose($bz);
$bz = bzopen($filename, "r");
fseek($bz, 0, SEEK_CUR);
print bzread($bz, 10);
print bzread($bz);
bzclose($bz);
unlink($filename);
--EXPECT--
This is a test string.
+2 -2
View File
@@ -379,7 +379,7 @@ CPH_METHOD(SaveToFile)
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
&filename, &filename_len, &remember)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
@@ -443,7 +443,7 @@ CPH_METHOD(LoadFromFile)
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
&filename, &filename_len, &flags)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
+1 -1
View File
@@ -18,7 +18,7 @@ $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
if(!empty($host)) {
// Use the set Environment variable
$url = "$host/get.php";
$url = "$host/get.php?test=1";
} else {
-35
View File
@@ -1,35 +0,0 @@
--TEST--
curl_setopt basic tests.
--CREDITS--
Paul Sohier
#phptestfest utrecht
--INI--
safe_mode=On
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER') || PHP_VERSION_ID < 503099) print "skip"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
// start testing
echo "*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode\n";
$url = "{$host}/";
$ch = curl_init();
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$curl_content = curl_exec($ch);
curl_close($ch);
var_dump( $curl_content );
?>
--EXPECTF--
Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in %s on line %d
bool(false)
+8 -2
View File
@@ -25,6 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
timelib_rel_time *rt;
timelib_time *swp;
timelib_sll dst_h_corr = 0, dst_m_corr = 0;
timelib_time one_backup, two_backup;
rt = timelib_rel_time_ctor();
rt->invert = 0;
@@ -45,6 +46,10 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
dst_m_corr = ((two->z - one->z) % 3600) / 60;
}
/* Save old TZ info */
memcpy(&one_backup, one, sizeof(one_backup));
memcpy(&two_backup, two, sizeof(two_backup));
timelib_apply_localtime(one, 0);
timelib_apply_localtime(two, 0);
@@ -58,8 +63,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
timelib_do_rel_normalize(rt->invert ? one : two, rt);
timelib_apply_localtime(one, 1);
timelib_apply_localtime(two, 1);
/* Restore old TZ info */
memcpy(one, &one_backup, sizeof(one_backup));
memcpy(two, &two_backup, sizeof(two_backup));
return rt;
}
+32703 -18167
View File
File diff suppressed because it is too large. Load diff
+22 -1
View File
@@ -719,6 +719,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return first_found_elem;
}
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
if (!first_found) {
first_found = 1;
first_found_elem = tp;
if (gmtoffset == -1) {
return tp;
}
}
if (tp->gmtoffset == gmtoffset) {
return tp;
}
}
}
if (first_found) {
return first_found_elem;
}
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
@@ -2094,8 +2113,9 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
fptr++;
}
if (*fptr) {
int done = 0;
/* Trailing | and ! specifiers are valid. */
while (*fptr) {
while (*fptr && !done) {
switch (*fptr++) {
case '!': /* reset all fields to default */
timelib_time_reset_fields(s->time);
@@ -2107,6 +2127,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
default:
add_pbf_error(s, "Data missing", string, ptr);
done = 1;
}
}
}
+3
View File
@@ -100,6 +100,7 @@ static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
if (!cbuffer) {
free(buffer);
return;
}
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
@@ -125,6 +126,7 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo));
if (!tz->type) {
free(buffer);
return;
}
@@ -153,6 +155,7 @@ static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
free(leap_buffer);
return;
}
for (i = 0; i < tz->leapcnt; i++) {
+6 -1
View File
@@ -3,8 +3,13 @@ DateInterval::format(), %a
--CREDITS--
Daniel Convissor <danielc@php.net>
# TestFest 2010 BKTK
--INI--
date.timezone=UTC
--SKIPIF--
<?php if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist"); ?>
<?php
if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist");
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
?>
--XFAIL--
Windows VC6 libs' floor()/ceil() choke on floats
--FILE--
+29
View File
@@ -0,0 +1,29 @@
--TEST--
DateTime::add() -- dates
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-dates.inc';
?>
--EXPECT--
test__7: ADD: 2009-01-07 00:00:00 EST + P+0Y0M7DT0H0M0S = **2009-01-14 00:00:00 EST**
test_years_positive__7_by_0_day: ADD: 2000-02-07 00:00:00 EST + P+7Y0M0DT0H0M0S = **2007-02-07 00:00:00 EST**
test_years_positive__7_by_1_day: ADD: 2000-02-07 00:00:00 EST + P+7Y0M1DT0H0M0S = **2007-02-08 00:00:00 EST**
test_years_positive__6_shy_1_day: ADD: 2000-02-07 00:00:00 EST + P+6Y11M30DT0H0M0S = **2007-02-06 00:00:00 EST**
test_years_positive__7_by_1_month: ADD: 2000-02-07 00:00:00 EST + P+7Y1M0DT0H0M0S = **2007-03-07 00:00:00 EST**
test_years_positive__6_shy_1_month: ADD: 2000-02-07 00:00:00 EST + P+6Y11M0DT0H0M0S = **2007-01-07 00:00:00 EST**
test_years_positive__7_by_1_month_split_newyear: ADD: 1999-12-07 00:00:00 EST + P+7Y1M0DT0H0M0S = **2007-01-07 00:00:00 EST**
test_years_positive__6_shy_1_month_split_newyear: ADD: 2000-01-07 00:00:00 EST + P+6Y11M0DT0H0M0S = **2006-12-07 00:00:00 EST**
test_negative__7: ADD: 2009-01-14 00:00:00 EST + P-0Y0M7DT0H0M0S = **2009-01-07 00:00:00 EST**
test_years_negative__7_by_0_day: ADD: 2007-02-07 00:00:00 EST + P-7Y0M0DT0H0M0S = **2000-02-07 00:00:00 EST**
test_years_negative__7_by_1_day: ADD: 2007-02-08 00:00:00 EST + P-7Y0M1DT0H0M0S = **2000-02-07 00:00:00 EST**
test_years_negative__6_shy_1_day: ADD: 2007-02-06 00:00:00 EST + P-6Y11M28DT0H0M0S = **2000-02-07 00:00:00 EST**
test_years_negative__7_by_1_month: ADD: 2007-03-07 00:00:00 EST + P-7Y1M0DT0H0M0S = **2000-02-07 00:00:00 EST**
test_years_negative__6_shy_1_month: ADD: 2007-01-07 00:00:00 EST + P-6Y11M0DT0H0M0S = **2000-02-07 00:00:00 EST**
test_years_negative__7_by_1_month_split_newyear: ADD: 2007-01-07 00:00:00 EST + P-7Y1M0DT0H0M0S = **1999-12-07 00:00:00 EST**
test_years_negative__6_shy_1_month_split_newyear: ADD: 2006-12-07 00:00:00 EST + P-6Y11M0DT0H0M0S = **2000-01-07 00:00:00 EST**
@@ -0,0 +1,51 @@
--TEST--
DateTime::add() -- fall type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-fall-type2-type2.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type2_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_prev_type2_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_prev_type2_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_prev_type2_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_prev_type2_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_prev_type2_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_dt_type2_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_dt_type2_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
test_time_fall_type2_dt_type2_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_dt_type2_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_dt_type2_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_dt_type2_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_redodt_type2_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_redodt_type2_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_redodt_type2_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
test_time_fall_type2_redodt_type2_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_redodt_type2_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_redodt_type2_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_redost_type2_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_redost_type2_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_redost_type2_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_redost_type2_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
test_time_fall_type2_redost_type2_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_redost_type2_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_st_type2_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_st_type2_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_st_type2_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_st_type2_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_st_type2_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
test_time_fall_type2_st_type2_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_post_type2_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_post_type2_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_post_type2_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_post_type2_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_post_type2_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_post_type2_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
@@ -0,0 +1,51 @@
--TEST--
DateTime::add() -- fall type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-fall-type2-type3.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type3_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_prev_type3_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_prev_type3_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_prev_type3_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_prev_type3_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_prev_type3_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_dt_type3_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_dt_type3_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
test_time_fall_type2_dt_type3_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_dt_type3_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_dt_type3_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_dt_type3_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_redodt_type3_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_redodt_type3_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_redodt_type3_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
test_time_fall_type2_redodt_type3_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_redodt_type3_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_redodt_type3_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_redost_type3_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_redost_type3_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_redost_type3_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_redost_type3_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
test_time_fall_type2_redost_type3_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_redost_type3_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_st_type3_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_st_type3_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_st_type3_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_st_type3_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_st_type3_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
test_time_fall_type2_st_type3_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
test_time_fall_type2_post_type3_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
test_time_fall_type2_post_type3_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
test_time_fall_type2_post_type3_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
test_time_fall_type2_post_type3_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
test_time_fall_type2_post_type3_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
test_time_fall_type2_post_type3_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
@@ -0,0 +1,51 @@
--TEST--
DateTime::add() -- fall type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-fall-type3-type2.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type2_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_prev_type2_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_prev_type2_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_prev_type2_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_prev_type2_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_prev_type2_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_dt_type2_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_dt_type2_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
test_time_fall_type3_dt_type2_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_dt_type2_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_dt_type2_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_dt_type2_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_redodt_type2_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_redodt_type2_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_redodt_type2_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
test_time_fall_type3_redodt_type2_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_redodt_type2_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_redodt_type2_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_redost_type2_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_redost_type2_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_redost_type2_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_redost_type2_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
test_time_fall_type3_redost_type2_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_redost_type2_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_st_type2_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_st_type2_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_st_type2_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_st_type2_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_st_type2_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
test_time_fall_type3_st_type2_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_post_type2_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_post_type2_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_post_type2_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_post_type2_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_post_type2_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_post_type2_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
@@ -0,0 +1,51 @@
--TEST--
DateTime::add() -- fall type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-fall-type3-type3.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type3_prev: ADD: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_prev_type3_dt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_prev_type3_redodt: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_prev_type3_redost: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_prev_type3_st: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_prev_type3_post: ADD: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_dt_type3_prev: ADD: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_dt_type3_dt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT**
test_time_fall_type3_dt_type3_redodt: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_dt_type3_redost: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_dt_type3_st: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_dt_type3_post: ADD: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_redodt_type3_prev: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_redodt_type3_dt: ADD: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_redodt_type3_redodt: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT**
test_time_fall_type3_redodt_type3_redost: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_redodt_type3_st: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_redodt_type3_post: ADD: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_redost_type3_prev: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_redost_type3_dt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_redost_type3_redodt: ADD: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_redost_type3_redost: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST**
test_time_fall_type3_redost_type3_st: ADD: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_redost_type3_post: ADD: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_st_type3_prev: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_st_type3_dt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_st_type3_redodt: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_st_type3_redost: ADD: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_st_type3_st: ADD: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST**
test_time_fall_type3_st_type3_post: ADD: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST**
test_time_fall_type3_post_type3_prev: ADD: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT**
test_time_fall_type3_post_type3_dt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT**
test_time_fall_type3_post_type3_redodt: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT**
test_time_fall_type3_post_type3_redost: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST**
test_time_fall_type3_post_type3_st: ADD: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST**
test_time_fall_type3_post_type3_post: ADD: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST**
+77
View File
@@ -0,0 +1,77 @@
--TEST--
DateTime::add() -- february
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-february.inc';
?>
--EXPECT--
test_bug_49081__1: ADD: 2010-03-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081__2: ADD: 2010-03-01 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-04-01 00:00:00 EDT**
test_bug_49081__3: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M1DT0H0M0S = **2010-04-01 00:00:00 EDT**
test_bug_49081__4: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M29DT0H0M0S = **2010-04-29 00:00:00 EDT**
test_bug_49081__5: ADD: 2010-03-31 00:00:00 EDT + P+0Y0M30DT0H0M0S = **2010-04-30 00:00:00 EDT**
test_bug_49081__6: ADD: 2010-03-30 00:00:00 EDT + P+0Y1M0DT0H0M0S = **2010-04-30 00:00:00 EDT**
test_bug_49081__7: ADD: 2010-03-29 00:00:00 EDT + P+0Y1M1DT0H0M0S = **2010-04-30 00:00:00 EDT**
test_bug_49081__8: ADD: 2010-01-01 00:00:00 EST + P+0Y0M28DT0H0M0S = **2010-01-29 00:00:00 EST**
test_bug_49081__9: ADD: 2010-01-01 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-01-30 00:00:00 EST**
test_bug_49081__10: ADD: 2010-01-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081__11: ADD: 2010-01-01 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-02-01 00:00:00 EST**
test_bug_49081__12: ADD: 2010-01-31 00:00:00 EST + P+0Y0M1DT0H0M0S = **2010-02-01 00:00:00 EST**
test_bug_49081__13: ADD: 2010-01-31 00:00:00 EST + P+0Y0M27DT0H0M0S = **2010-02-27 00:00:00 EST**
test_bug_49081__14: ADD: 2010-01-31 00:00:00 EST + P+0Y0M28DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081__15: ADD: 2010-01-30 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081__16: ADD: 2010-01-29 00:00:00 EST + P+0Y0M30DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081__17: ADD: 2010-01-28 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081__18: ADD: 2010-01-27 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081__19: ADD: 2010-01-01 00:00:00 EST + P+0Y2M0DT0H0M0S = **2010-03-01 00:00:00 EST**
test_bug_49081__20: ADD: 2010-01-31 00:00:00 EST + P+0Y0M29DT0H0M0S = **2010-03-01 00:00:00 EST**
test_bug_49081__21: ADD: 2010-01-31 00:00:00 EST + P+0Y1M24DT0H0M0S = **2010-03-27 00:00:00 EDT**
test_bug_49081__22: ADD: 2010-01-31 00:00:00 EST + P+0Y1M25DT0H0M0S = **2010-03-28 00:00:00 EDT**
test_bug_49081__23: ADD: 2010-01-31 00:00:00 EST + P+0Y1M26DT0H0M0S = **2010-03-29 00:00:00 EDT**
test_bug_49081__24: ADD: 2010-01-31 00:00:00 EST + P+0Y1M27DT0H0M0S = **2010-03-30 00:00:00 EDT**
test_bug_49081__25: ADD: 2010-01-31 00:00:00 EST + P+0Y2M0DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081__26: ADD: 2010-01-30 00:00:00 EST + P+0Y2M1DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081__27: ADD: 2009-01-01 00:00:00 EST + P+0Y0M30DT0H0M0S = **2009-01-31 00:00:00 EST**
test_bug_49081__28: ADD: 2010-02-28 00:00:00 EST + P+0Y0M27DT0H0M0S = **2010-03-27 00:00:00 EDT**
test_bug_49081__29: ADD: 2010-02-28 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-03-28 00:00:00 EDT**
test_bug_49081__30: ADD: 2010-02-28 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-03-29 00:00:00 EDT**
test_bug_49081__31: ADD: 2010-02-27 00:00:00 EST + P+0Y1M0DT0H0M0S = **2010-03-27 00:00:00 EDT**
test_bug_49081__32: ADD: 2010-02-26 00:00:00 EST + P+0Y1M1DT0H0M0S = **2010-03-27 00:00:00 EDT**
test_bug_49081_negative__1: ADD: 2010-03-31 00:00:00 EDT + P-0Y0M30DT0H0M0S = **2010-03-01 00:00:00 EST**
test_bug_49081_negative__2: ADD: 2010-04-01 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-03-01 00:00:00 EST**
test_bug_49081_negative__3: ADD: 2010-04-01 00:00:00 EDT + P-0Y0M1DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081_negative__4: ADD: 2010-04-29 00:00:00 EDT + P-0Y0M29DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081_negative__5: ADD: 2010-04-30 00:00:00 EDT + P-0Y0M30DT0H0M0S = **2010-03-31 00:00:00 EDT**
test_bug_49081_negative__6: ADD: 2010-04-30 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-03-30 00:00:00 EDT**
test_bug_49081_negative__7: ADD: 2010-04-30 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-03-29 00:00:00 EDT**
test_bug_49081_negative__8: ADD: 2010-01-29 00:00:00 EST + P-0Y0M28DT0H0M0S = **2010-01-01 00:00:00 EST**
test_bug_49081_negative__9: ADD: 2010-01-30 00:00:00 EST + P-0Y0M29DT0H0M0S = **2010-01-01 00:00:00 EST**
test_bug_49081_negative__10: ADD: 2010-01-31 00:00:00 EST + P-0Y0M30DT0H0M0S = **2010-01-01 00:00:00 EST**
test_bug_49081_negative__11: ADD: 2010-02-01 00:00:00 EST + P-0Y1M0DT0H0M0S = **2010-01-01 00:00:00 EST**
test_bug_49081_negative__12: ADD: 2010-02-01 00:00:00 EST + P-0Y0M1DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__13: ADD: 2010-02-27 00:00:00 EST + P-0Y0M27DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__14: ADD: 2010-02-28 00:00:00 EST + P-0Y0M28DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__15: ADD: 2010-02-28 00:00:00 EST + P-0Y0M29DT0H0M0S = **2010-01-30 00:00:00 EST**
test_bug_49081_negative__16: ADD: 2010-02-28 00:00:00 EST + P-0Y0M30DT0H0M0S = **2010-01-29 00:00:00 EST**
test_bug_49081_negative__17: ADD: 2010-02-28 00:00:00 EST + P-0Y1M0DT0H0M0S = **2010-01-28 00:00:00 EST**
test_bug_49081_negative__18: ADD: 2010-02-28 00:00:00 EST + P-0Y1M1DT0H0M0S = **2010-01-27 00:00:00 EST**
test_bug_49081_negative__19: ADD: 2010-03-01 00:00:00 EST + P-0Y2M0DT0H0M0S = **2010-01-01 00:00:00 EST**
test_bug_49081_negative__20: ADD: 2010-03-01 00:00:00 EST + P-0Y1M1DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__21: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M27DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__22: ADD: 2010-03-28 00:00:00 EDT + P-0Y1M28DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__23: ADD: 2010-03-29 00:00:00 EDT + P-0Y1M29DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__24: ADD: 2010-03-30 00:00:00 EDT + P-0Y1M30DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__25: ADD: 2010-03-31 00:00:00 EDT + P-0Y2M0DT0H0M0S = **2010-01-31 00:00:00 EST**
test_bug_49081_negative__26: ADD: 2010-03-31 00:00:00 EDT + P-0Y2M1DT0H0M0S = **2010-01-30 00:00:00 EST**
test_bug_49081_negative__27: ADD: 2009-01-31 00:00:00 EST + P-0Y0M30DT0H0M0S = **2009-01-01 00:00:00 EST**
test_bug_49081_negative__28: ADD: 2010-03-27 00:00:00 EDT + P-0Y0M27DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081_negative__29: ADD: 2010-03-28 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081_negative__30: ADD: 2010-03-29 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-02-28 00:00:00 EST**
test_bug_49081_negative__31: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M0DT0H0M0S = **2010-02-27 00:00:00 EST**
test_bug_49081_negative__32: ADD: 2010-03-27 00:00:00 EDT + P-0Y1M1DT0H0M0S = **2010-02-26 00:00:00 EST**
+15
View File
@@ -0,0 +1,15 @@
--TEST--
DateTime::add() -- massive
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-massive.inc';
?>
--EXPECT--
test_massive_positive: ADD: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST**
test_massive_negative: ADD: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST**
@@ -0,0 +1,31 @@
--TEST--
DateTime::add() -- spring type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-spring-type2-type2.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type2_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_prev_type2_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_prev_type2_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_prev_type2_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_st_type2_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_st_type2_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
test_time_spring_type2_st_type2_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_st_type2_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_dt_type2_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_dt_type2_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_dt_type2_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
test_time_spring_type2_dt_type2_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
@@ -0,0 +1,31 @@
--TEST--
DateTime::add() -- spring type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-spring-type2-type3.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type3_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_prev_type3_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_prev_type3_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_prev_type3_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_st_type3_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_st_type3_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
test_time_spring_type2_st_type3_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_st_type3_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_dt_type3_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_dt_type3_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_dt_type3_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
test_time_spring_type2_dt_type3_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
test_time_spring_type2_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
@@ -0,0 +1,31 @@
--TEST--
DateTime::add() -- spring type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-spring-type3-type2.inc';
?>
--EXPECT--
test_time_spring_type3_prev_type2_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_prev_type2_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_prev_type2_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_prev_type2_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_st_type2_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_st_type2_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
test_time_spring_type3_st_type2_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_st_type2_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_dt_type2_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_dt_type2_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_dt_type2_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
test_time_spring_type3_dt_type2_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
@@ -0,0 +1,31 @@
--TEST--
DateTime::add() -- spring type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
Various bugs exist
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_ADD);
require 'DateTime_data-spring-type3-type3.inc';
?>
--EXPECT--
test_time_spring_type3_prev_type3_prev: ADD: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_prev_type3_st: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_prev_type3_dt: ADD: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_prev_type3_post: ADD: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_st_type3_prev: ADD: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_st_type3_st: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST**
test_time_spring_type3_st_type3_dt: ADD: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_st_type3_post: ADD: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_dt_type3_prev: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_dt_type3_st: ADD: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_dt_type3_dt: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT**
test_time_spring_type3_dt_type3_post: ADD: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST**
test_time_spring_type3_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
+24
View File
@@ -0,0 +1,24 @@
<?php
/*
* Note: test names match method names in a set of PHPUnit tests
* in a userland package. Please be so kind as to leave them.
*/
date_default_timezone_set('America/New_York');
/*
* Absolute
*/
echo "test_absolute_7: ";
examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7, true);
echo "test_absolute_negative_7: ";
examine_diff('2009-01-07', '2009-01-14', 'P+0Y0M7DT0H0M0S', 7, true);
//14 - 7 = 7
//7 + 7 = 14
//
//7 - 14 = -7
//14 - 7 = 7
+64
View File
@@ -0,0 +1,64 @@
<?php
/*
* Note: test names match method names in a set of PHPUnit tests
* in a userland package. Please be so kind as to leave them.
*/
date_default_timezone_set('America/New_York');
/*
* Particular days
*/
echo "test__7: ";
examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7);
echo "test_years_positive__7_by_0_day: ";
examine_diff('2007-02-07', '2000-02-07', 'P+7Y0M0DT0H0M0S', 2557);
echo "test_years_positive__7_by_1_day: ";
examine_diff('2007-02-08', '2000-02-07', 'P+7Y0M1DT0H0M0S', 2558);
echo "test_years_positive__6_shy_1_day: ";
examine_diff('2007-02-06', '2000-02-07', 'P+6Y11M30DT0H0M0S', 2556);
echo "test_years_positive__7_by_1_month: ";
examine_diff('2007-03-07', '2000-02-07', 'P+7Y1M0DT0H0M0S', 2585);
echo "test_years_positive__6_shy_1_month: ";
examine_diff('2007-01-07', '2000-02-07', 'P+6Y11M0DT0H0M0S', 2526);
echo "test_years_positive__7_by_1_month_split_newyear: ";
examine_diff('2007-01-07', '1999-12-07', 'P+7Y1M0DT0H0M0S', 2588);
echo "test_years_positive__6_shy_1_month_split_newyear: ";
examine_diff('2006-12-07', '2000-01-07', 'P+6Y11M0DT0H0M0S', 2526);
/*
* Particular days, negative
*/
echo "test_negative__7: ";
examine_diff('2009-01-07', '2009-01-14', 'P-0Y0M7DT0H0M0S', 7);
echo "test_years_negative__7_by_0_day: ";
examine_diff('2000-02-07', '2007-02-07', 'P-7Y0M0DT0H0M0S', 2557);
echo "test_years_negative__7_by_1_day: ";
examine_diff('2000-02-07', '2007-02-08', 'P-7Y0M1DT0H0M0S', 2558);
echo "test_years_negative__6_shy_1_day: ";
examine_diff('2000-02-07', '2007-02-06', 'P-6Y11M28DT0H0M0S', 2556);
echo "test_years_negative__7_by_1_month: ";
examine_diff('2000-02-07', '2007-03-07', 'P-7Y1M0DT0H0M0S', 2585);
echo "test_years_negative__6_shy_1_month: ";
examine_diff('2000-02-07', '2007-01-07', 'P-6Y11M0DT0H0M0S', 2526);
echo "test_years_negative__7_by_1_month_split_newyear: ";
examine_diff('1999-12-07', '2007-01-07', 'P-7Y1M0DT0H0M0S', 2588);
echo "test_years_negative__6_shy_1_month_split_newyear: ";
examine_diff('2000-01-07', '2006-12-07', 'P-6Y11M0DT0H0M0S', 2526);
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- fall type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -205,42 +197,3 @@ echo "test_time_fall_type2_post_type2_post: ";
$end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
$start = new DateTime('2010-11-08 18:57:55 EST'); // sp post, zt2
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_fall_type2_prev_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
test_time_fall_type2_prev_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_prev_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_prev_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_prev_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_prev_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
test_time_fall_type2_dt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_dt_type2_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
test_time_fall_type2_dt_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_dt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_dt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_dt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_redodt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type2_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_redodt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_redodt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_redost_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_redost_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_redost_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_redost_type2_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
test_time_fall_type2_redost_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_redost_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_st_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_st_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_st_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_st_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_st_type2_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
test_time_fall_type2_st_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_post_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
test_time_fall_type2_post_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
test_time_fall_type2_post_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
test_time_fall_type2_post_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
test_time_fall_type2_post_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
test_time_fall_type2_post_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- fall type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -217,42 +209,3 @@ echo "test_time_fall_type2_post_type3_post: ";
$end = new DateTime('2010-11-08 19:59:59'); // post, zt3
$start = new DateTime('2010-11-08 18:57:55 EST'); // sp post, zt2
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_fall_type2_prev_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
test_time_fall_type2_prev_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_prev_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_prev_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_prev_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_prev_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
test_time_fall_type2_dt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_dt_type3_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
test_time_fall_type2_dt_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_dt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_dt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_dt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_redodt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type3_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
test_time_fall_type2_redodt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_redodt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_redodt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_redost_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_redost_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_redost_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_redost_type3_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
test_time_fall_type2_redost_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type2_redost_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_st_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type2_st_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type2_st_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type2_st_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type2_st_type3_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
test_time_fall_type2_st_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type2_post_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
test_time_fall_type2_post_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
test_time_fall_type2_post_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
test_time_fall_type2_post_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
test_time_fall_type2_post_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
test_time_fall_type2_post_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- fall type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -219,42 +211,3 @@ echo "test_time_fall_type3_post_type2_post: ";
$end = new DateTime('2010-11-08 19:59:59 EST'); // post, zt2
$start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_fall_type3_prev_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
test_time_fall_type3_prev_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_prev_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_prev_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_prev_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_prev_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
test_time_fall_type3_dt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_dt_type2_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
test_time_fall_type3_dt_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_dt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_dt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_dt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_redodt_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type2_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_redodt_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_redodt_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_redost_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_redost_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_redost_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_redost_type2_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
test_time_fall_type3_redost_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_redost_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_st_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_st_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_st_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_st_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_st_type2_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
test_time_fall_type3_st_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_post_type2_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
test_time_fall_type3_post_type2_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
test_time_fall_type3_post_type2_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
test_time_fall_type3_post_type2_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
test_time_fall_type3_post_type2_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
test_time_fall_type3_post_type2_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- fall type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -229,42 +221,3 @@ echo "test_time_fall_type3_post_type3_post: ";
$end = new DateTime('2010-11-08 19:59:59'); // post, zt3
$start = new DateTime('2010-11-08 18:57:55'); // sp post, zt3
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_fall_type3_prev_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S** | BACK: 2010-10-04 02:18:48 EDT + P+0Y1M2DT16H19M40S = **2010-11-06 18:38:28 EDT** | DAYS: **33**
test_time_fall_type3_prev_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT5H31M52S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_prev_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT6H34M5S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_prev_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT7H36M16S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_prev_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M0DT9H38M27S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_prev_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S** | BACK: 2010-11-06 18:38:28 EDT + P+0Y0M2DT1H21M31S = **2010-11-08 19:59:59 EST** | DAYS: **2**
test_time_fall_type3_dt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S** | BACK: 2010-11-07 00:10:20 EDT + P-0Y0M0DT5H31M52S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_dt_type3_dt: FWD: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT0H5M15S = **2010-11-07 00:15:35 EDT** | DAYS: **0**
test_time_fall_type3_dt_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT1H2M13S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_dt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT2H4M24S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_dt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M0DT4H6M35S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_dt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S** | BACK: 2010-11-07 00:10:20 EDT + P+0Y0M1DT20H49M39S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_redodt_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT6H34M5S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S** | BACK: 2010-11-07 01:12:33 EDT + P-0Y0M0DT1H2M13S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type3_redodt: FWD: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT0H3M2S = **2010-11-07 01:15:35 EDT** | DAYS: **0**
test_time_fall_type3_redodt_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT1H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_redodt_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M0DT3H4M22S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_redodt_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S** | BACK: 2010-11-07 01:12:33 EDT + P+0Y0M1DT19H47M26S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_redost_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT7H36M16S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_redost_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT2H4M24S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_redost_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S** | BACK: 2010-11-07 01:14:44 EST + P-0Y0M0DT1H2M11S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_redost_type3_redost: FWD: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT0H2M10S = **2010-11-07 01:16:54 EST** | DAYS: **0**
test_time_fall_type3_redost_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M0DT2H2M11S = **2010-11-07 03:16:55 EST** | DAYS: **0**
test_time_fall_type3_redost_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S** | BACK: 2010-11-07 01:14:44 EST + P+0Y0M1DT18H45M15S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_st_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT9H38M27S = **2010-11-06 18:38:28 EDT** | DAYS: **0**
test_time_fall_type3_st_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT4H6M35S = **2010-11-07 00:10:20 EDT** | DAYS: **0**
test_time_fall_type3_st_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT3H4M22S = **2010-11-07 01:12:33 EDT** | DAYS: **0**
test_time_fall_type3_st_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S** | BACK: 2010-11-07 03:16:55 EST + P-0Y0M0DT2H2M11S = **2010-11-07 01:14:44 EST** | DAYS: **0**
test_time_fall_type3_st_type3_st: FWD: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M0DT2H3M1S = **2010-11-07 05:19:56 EST** | DAYS: **0**
test_time_fall_type3_st_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S** | BACK: 2010-11-07 03:16:55 EST + P+0Y0M1DT16H43M4S = **2010-11-08 19:59:59 EST** | DAYS: **1**
test_time_fall_type3_post_type3_prev: FWD: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M2DT1H21M31S = **2010-11-06 18:38:28 EDT** | DAYS: **2**
test_time_fall_type3_post_type3_dt: FWD: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT20H49M39S = **2010-11-07 00:10:20 EDT** | DAYS: **1**
test_time_fall_type3_post_type3_redodt: FWD: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT19H47M26S = **2010-11-07 01:12:33 EDT** | DAYS: **1**
test_time_fall_type3_post_type3_redost: FWD: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT18H45M15S = **2010-11-07 01:14:44 EST** | DAYS: **1**
test_time_fall_type3_post_type3_st: FWD: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S** | BACK: 2010-11-08 19:59:59 EST + P-0Y0M1DT16H43M4S = **2010-11-07 03:16:55 EST** | DAYS: **1**
test_time_fall_type3_post_type3_post: FWD: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S** | BACK: 2010-11-08 18:57:55 EST + P+0Y0M0DT1H2M4S = **2010-11-08 19:59:59 EST** | DAYS: **0**
+208
View File
@@ -0,0 +1,208 @@
<?php
/*
* Note: test names match method names in a set of PHPUnit tests
* in a userland package. Please be so kind as to leave them.
*/
date_default_timezone_set('America/New_York');
/*
* Check PHP bug 49081
*/
echo "test_bug_49081__1: ";
examine_diff('2010-03-31', '2010-03-01', 'P+0Y0M30DT0H0M0S', 30);
echo "test_bug_49081__2: ";
examine_diff('2010-04-01', '2010-03-01', 'P+0Y1M0DT0H0M0S', 31);
echo "test_bug_49081__3: ";
examine_diff('2010-04-01', '2010-03-31', 'P+0Y0M1DT0H0M0S', 1);
echo "test_bug_49081__4: ";
examine_diff('2010-04-29', '2010-03-31', 'P+0Y0M29DT0H0M0S', 29);
echo "test_bug_49081__5: ";
examine_diff('2010-04-30', '2010-03-31', 'P+0Y0M30DT0H0M0S', 30);
echo "test_bug_49081__6: ";
examine_diff('2010-04-30', '2010-03-30', 'P+0Y1M0DT0H0M0S', 31);
echo "test_bug_49081__7: ";
examine_diff('2010-04-30', '2010-03-29', 'P+0Y1M1DT0H0M0S', 32);
echo "test_bug_49081__8: ";
examine_diff('2010-01-29', '2010-01-01', 'P+0Y0M28DT0H0M0S', 28);
echo "test_bug_49081__9: ";
examine_diff('2010-01-30', '2010-01-01', 'P+0Y0M29DT0H0M0S', 29);
echo "test_bug_49081__10: ";
examine_diff('2010-01-31', '2010-01-01', 'P+0Y0M30DT0H0M0S', 30);
echo "test_bug_49081__11: ";
examine_diff('2010-02-01', '2010-01-01', 'P+0Y1M0DT0H0M0S', 31);
echo "test_bug_49081__12: ";
examine_diff('2010-02-01', '2010-01-31', 'P+0Y0M1DT0H0M0S', 1);
echo "test_bug_49081__13: ";
examine_diff('2010-02-27', '2010-01-31', 'P+0Y0M27DT0H0M0S', 27);
echo "test_bug_49081__14: ";
examine_diff('2010-02-28', '2010-01-31', 'P+0Y0M28DT0H0M0S', 28);
echo "test_bug_49081__15: ";
examine_diff('2010-02-28', '2010-01-30', 'P+0Y0M29DT0H0M0S', 29);
echo "test_bug_49081__16: ";
examine_diff('2010-02-28', '2010-01-29', 'P+0Y0M30DT0H0M0S', 30);
echo "test_bug_49081__17: ";
examine_diff('2010-02-28', '2010-01-28', 'P+0Y1M0DT0H0M0S', 31);
echo "test_bug_49081__18: ";
examine_diff('2010-02-28', '2010-01-27', 'P+0Y1M1DT0H0M0S', 32);
echo "test_bug_49081__19: ";
examine_diff('2010-03-01', '2010-01-01', 'P+0Y2M0DT0H0M0S', 59);
echo "test_bug_49081__20: ";
examine_diff('2010-03-01', '2010-01-31', 'P+0Y0M29DT0H0M0S', 29);
echo "test_bug_49081__21: ";
examine_diff('2010-03-27', '2010-01-31', 'P+0Y1M24DT0H0M0S', 55);
echo "test_bug_49081__22: ";
examine_diff('2010-03-28', '2010-01-31', 'P+0Y1M25DT0H0M0S', 56);
echo "test_bug_49081__23: ";
examine_diff('2010-03-29', '2010-01-31', 'P+0Y1M26DT0H0M0S', 57);
echo "test_bug_49081__24: ";
examine_diff('2010-03-30', '2010-01-31', 'P+0Y1M27DT0H0M0S', 58);
echo "test_bug_49081__25: ";
examine_diff('2010-03-31', '2010-01-31', 'P+0Y2M0DT0H0M0S', 59);
echo "test_bug_49081__26: ";
examine_diff('2010-03-31', '2010-01-30', 'P+0Y2M1DT0H0M0S', 60);
echo "test_bug_49081__27: ";
examine_diff('2009-01-31', '2009-01-01', 'P+0Y0M30DT0H0M0S', 30);
echo "test_bug_49081__28: ";
examine_diff('2010-03-27', '2010-02-28', 'P+0Y0M27DT0H0M0S', 27);
echo "test_bug_49081__29: ";
examine_diff('2010-03-28', '2010-02-28', 'P+0Y1M0DT0H0M0S', 28);
echo "test_bug_49081__30: ";
examine_diff('2010-03-29', '2010-02-28', 'P+0Y1M1DT0H0M0S', 29);
echo "test_bug_49081__31: ";
examine_diff('2010-03-27', '2010-02-27', 'P+0Y1M0DT0H0M0S', 28);
echo "test_bug_49081__32: ";
examine_diff('2010-03-27', '2010-02-26', 'P+0Y1M1DT0H0M0S', 29);
/*
* Check PHP bug 49081, negative
*/
echo "test_bug_49081_negative__1: ";
examine_diff('2010-03-01', '2010-03-31', 'P-0Y0M30DT0H0M0S', 30);
echo "test_bug_49081_negative__2: ";
examine_diff('2010-03-01', '2010-04-01', 'P-0Y1M0DT0H0M0S', 31);
echo "test_bug_49081_negative__3: ";
examine_diff('2010-03-31', '2010-04-01', 'P-0Y0M1DT0H0M0S', 1);
echo "test_bug_49081_negative__4: ";
examine_diff('2010-03-31', '2010-04-29', 'P-0Y0M29DT0H0M0S', 29);
echo "test_bug_49081_negative__5: ";
examine_diff('2010-03-31', '2010-04-30', 'P-0Y0M30DT0H0M0S', 30);
echo "test_bug_49081_negative__6: ";
examine_diff('2010-03-30', '2010-04-30', 'P-0Y1M0DT0H0M0S', 31);
echo "test_bug_49081_negative__7: ";
examine_diff('2010-03-29', '2010-04-30', 'P-0Y1M1DT0H0M0S', 32);
echo "test_bug_49081_negative__8: ";
examine_diff('2010-01-01', '2010-01-29', 'P-0Y0M28DT0H0M0S', 28);
echo "test_bug_49081_negative__9: ";
examine_diff('2010-01-01', '2010-01-30', 'P-0Y0M29DT0H0M0S', 29);
echo "test_bug_49081_negative__10: ";
examine_diff('2010-01-01', '2010-01-31', 'P-0Y0M30DT0H0M0S', 30);
echo "test_bug_49081_negative__11: ";
examine_diff('2010-01-01', '2010-02-01', 'P-0Y1M0DT0H0M0S', 31);
echo "test_bug_49081_negative__12: ";
examine_diff('2010-01-31', '2010-02-01', 'P-0Y0M1DT0H0M0S', 1);
echo "test_bug_49081_negative__13: ";
examine_diff('2010-01-31', '2010-02-27', 'P-0Y0M27DT0H0M0S', 27);
echo "test_bug_49081_negative__14: ";
examine_diff('2010-01-31', '2010-02-28', 'P-0Y0M28DT0H0M0S', 28);
echo "test_bug_49081_negative__15: ";
examine_diff('2010-01-30', '2010-02-28', 'P-0Y0M29DT0H0M0S', 29);
echo "test_bug_49081_negative__16: ";
examine_diff('2010-01-29', '2010-02-28', 'P-0Y0M30DT0H0M0S', 30);
echo "test_bug_49081_negative__17: ";
examine_diff('2010-01-28', '2010-02-28', 'P-0Y1M0DT0H0M0S', 31);
echo "test_bug_49081_negative__18: ";
examine_diff('2010-01-27', '2010-02-28', 'P-0Y1M1DT0H0M0S', 32);
echo "test_bug_49081_negative__19: ";
examine_diff('2010-01-01', '2010-03-01', 'P-0Y2M0DT0H0M0S', 59);
echo "test_bug_49081_negative__20: ";
examine_diff('2010-01-31', '2010-03-01', 'P-0Y1M1DT0H0M0S', 29);
echo "test_bug_49081_negative__21: ";
examine_diff('2010-01-31', '2010-03-27', 'P-0Y1M27DT0H0M0S', 55);
echo "test_bug_49081_negative__22: ";
examine_diff('2010-01-31', '2010-03-28', 'P-0Y1M28DT0H0M0S', 56);
echo "test_bug_49081_negative__23: ";
examine_diff('2010-01-31', '2010-03-29', 'P-0Y1M29DT0H0M0S', 57);
echo "test_bug_49081_negative__24: ";
examine_diff('2010-01-31', '2010-03-30', 'P-0Y1M30DT0H0M0S', 58);
echo "test_bug_49081_negative__25: ";
examine_diff('2010-01-31', '2010-03-31', 'P-0Y2M0DT0H0M0S', 59);
echo "test_bug_49081_negative__26: ";
examine_diff('2010-01-30', '2010-03-31', 'P-0Y2M1DT0H0M0S', 60);
echo "test_bug_49081_negative__27: ";
examine_diff('2009-01-01', '2009-01-31', 'P-0Y0M30DT0H0M0S', 30);
echo "test_bug_49081_negative__28: ";
examine_diff('2010-02-28', '2010-03-27', 'P-0Y0M27DT0H0M0S', 27);
echo "test_bug_49081_negative__29: ";
examine_diff('2010-02-28', '2010-03-28', 'P-0Y1M0DT0H0M0S', 28);
echo "test_bug_49081_negative__30: ";
examine_diff('2010-02-28', '2010-03-29', 'P-0Y1M1DT0H0M0S', 29);
echo "test_bug_49081_negative__31: ";
examine_diff('2010-02-27', '2010-03-27', 'P-0Y1M0DT0H0M0S', 28);
echo "test_bug_49081_negative__32: ";
examine_diff('2010-02-26', '2010-03-27', 'P-0Y1M1DT0H0M0S', 29);
@@ -1,8 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- massive
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
/*
@@ -10,7 +5,6 @@ Daniel Convissor <danielc@php.net>
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -38,8 +32,3 @@ $start->setDate(333333, 1, 1);
$start->setTime(16, 18, 02);
examine_diff($end, $start, 'P-666666Y0M0DT0H0M0S', 243494757);
?>
--EXPECT--
test_massive_positive: FWD: 333333-01-01 16:18:02 EST - -333333-01-01 16:18:02 EST = **P+666666Y0M0DT0H0M0S** | BACK: -333333-01-01 16:18:02 EST + P+666666Y0M0DT0H0M0S = **333333-01-01 16:18:02 EST** | DAYS: **243494757**
test_massive_negative: FWD: -333333-01-01 16:18:02 EST - 333333-01-01 16:18:02 EST = **P-666666Y0M0DT0H0M0S** | BACK: 333333-01-01 16:18:02 EST + P-666666Y0M0DT0H0M0S = **-333333-01-01 16:18:02 EST** | DAYS: **243494757**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- spring type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -103,22 +95,3 @@ echo "test_time_spring_type2_post_type2_post: ";
$end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
$start = new DateTime('2010-03-15 18:57:55 EDT'); // sp post, zt2
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_spring_type2_prev_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
test_time_spring_type2_prev_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type2_prev_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type2_prev_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
test_time_spring_type2_st_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type2_st_type2_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
test_time_spring_type2_st_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type2_st_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type2_dt_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type2_dt_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type2_dt_type2_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
test_time_spring_type2_dt_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type2_post_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
test_time_spring_type2_post_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
test_time_spring_type2_post_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
test_time_spring_type2_post_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- spring type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -103,22 +95,3 @@ echo "test_time_spring_type2_post_type3_post: ";
$end = new DateTime('2010-03-15 19:59:59'); // post, zt3
$start = new DateTime('2010-03-15 18:57:55 EDT'); // sp post, zt2
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_spring_type2_prev_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
test_time_spring_type2_prev_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type2_prev_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type2_prev_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
test_time_spring_type2_st_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type2_st_type3_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
test_time_spring_type2_st_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type2_st_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type2_dt_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type2_dt_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type2_dt_type3_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
test_time_spring_type2_dt_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type2_post_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
test_time_spring_type2_post_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
test_time_spring_type2_post_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
test_time_spring_type2_post_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- spring type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -103,22 +95,3 @@ echo "test_time_spring_type3_post_type2_post: ";
$end = new DateTime('2010-03-15 19:59:59 EDT'); // post, zt2
$start = new DateTime('2010-03-15 18:57:55'); // sp post, zt3
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_spring_type3_prev_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
test_time_spring_type3_prev_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type3_prev_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type3_prev_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
test_time_spring_type3_st_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type3_st_type2_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
test_time_spring_type3_st_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type3_st_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type3_dt_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type3_dt_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type3_dt_type2_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
test_time_spring_type3_dt_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type3_post_type2_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
test_time_spring_type3_post_type2_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
test_time_spring_type3_post_type2_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
test_time_spring_type3_post_type2_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
@@ -1,10 +1,3 @@
--TEST--
DateTime::diff() add() sub() -- spring type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--XFAIL--
PHP < 5.4 has bugs
--FILE--
<?php
/*
@@ -12,7 +5,6 @@ PHP < 5.4 has bugs
* in a userland package. Please be so kind as to leave them.
*/
require 'examine_diff.inc';
date_default_timezone_set('America/New_York');
@@ -103,22 +95,3 @@ echo "test_time_spring_type3_post_type3_post: ";
$end = new DateTime('2010-03-15 19:59:59'); // post, zt3
$start = new DateTime('2010-03-15 18:57:55'); // sp post, zt3
examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
?>
--EXPECT--
test_time_spring_type3_prev_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S** | BACK: 2010-02-11 02:18:48 EST + P+0Y1M2DT16H19M40S = **2010-03-13 18:38:28 EST** | DAYS: **30**
test_time_spring_type3_prev_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT5H31M52S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type3_prev_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M0DT7H38M27S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type3_prev_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S** | BACK: 2010-03-13 18:38:28 EST + P+0Y0M2DT1H21M31S = **2010-03-15 19:59:59 EDT** | DAYS: **2**
test_time_spring_type3_st_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S** | BACK: 2010-03-14 00:10:20 EST + P-0Y0M0DT5H31M52S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type3_st_type3_st: FWD: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT0H5M15S = **2010-03-14 00:15:35 EST** | DAYS: **0**
test_time_spring_type3_st_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M0DT2H6M35S = **2010-03-14 03:16:55 EDT** | DAYS: **0**
test_time_spring_type3_st_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S** | BACK: 2010-03-14 00:10:20 EST + P+0Y0M1DT18H49M39S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type3_dt_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT7H38M27S = **2010-03-13 18:38:28 EST** | DAYS: **0**
test_time_spring_type3_dt_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S** | BACK: 2010-03-14 03:16:55 EDT + P-0Y0M0DT2H6M35S = **2010-03-14 00:10:20 EST** | DAYS: **0**
test_time_spring_type3_dt_type3_dt: FWD: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M0DT2H3M1S = **2010-03-14 05:19:56 EDT** | DAYS: **0**
test_time_spring_type3_dt_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S** | BACK: 2010-03-14 03:16:55 EDT + P+0Y0M1DT16H43M4S = **2010-03-15 19:59:59 EDT** | DAYS: **1**
test_time_spring_type3_post_type3_prev: FWD: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M2DT1H21M31S = **2010-03-13 18:38:28 EST** | DAYS: **2**
test_time_spring_type3_post_type3_st: FWD: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST** | DAYS: **1**
test_time_spring_type3_post_type3_dt: FWD: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S** | BACK: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT** | DAYS: **1**
test_time_spring_type3_post_type3_post: FWD: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S** | BACK: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT** | DAYS: **0**
@@ -0,0 +1,15 @@
--TEST--
DateTime::diff() days -- absolute
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-absolute.inc';
?>
--EXPECT--
test_absolute_7: DAYS: **7**
test_absolute_negative_7: DAYS: **7**
+29
View File
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() days -- dates
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-dates.inc';
?>
--EXPECT--
test__7: DAYS: **7**
test_years_positive__7_by_0_day: DAYS: **2557**
test_years_positive__7_by_1_day: DAYS: **2558**
test_years_positive__6_shy_1_day: DAYS: **2556**
test_years_positive__7_by_1_month: DAYS: **2585**
test_years_positive__6_shy_1_month: DAYS: **2526**
test_years_positive__7_by_1_month_split_newyear: DAYS: **2588**
test_years_positive__6_shy_1_month_split_newyear: DAYS: **2526**
test_negative__7: DAYS: **7**
test_years_negative__7_by_0_day: DAYS: **2557**
test_years_negative__7_by_1_day: DAYS: **2558**
test_years_negative__6_shy_1_day: DAYS: **2556**
test_years_negative__7_by_1_month: DAYS: **2585**
test_years_negative__6_shy_1_month: DAYS: **2526**
test_years_negative__7_by_1_month_split_newyear: DAYS: **2588**
test_years_negative__6_shy_1_month_split_newyear: DAYS: **2526**
Loaded 100 of 677 files, more files were not shown because too many files have changed in this diff. Show more