Compare commits

...
Author SHA1 Message Date
Ilia Alshanetsky 756184bb59 5.3.7RC2 2011-06-30 13:22:31 +00:00
Ilia Alshanetsky 05763e18bb 5.3.7RC2 2011-06-30 13:16:27 +00:00
Gustavo André dos Santos Lopes 3dafd9549d - Fixed bug #55082 (var_export() doesn't escape properties properly). 2011-06-30 09:26:35 +00:00
Adam Harvey 85bf6f0329 Fix bug #55066 (Missing linebreak in NEWS). 2011-06-30 06:14:41 +00:00
Ilia Alshanetsky aa2ec7517e Fixed test 2011-06-28 23:47:05 +00:00
Knut Urdalen 819be8a3b2 working on test coverage for ext/dom, here's 17 more tests 2011-06-28 20:17:15 +00:00
Pierrick Charron 1b416caeb1 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Christopher Jones 0c2ee427d7 Keep the DBA DB4 test status quo after Berkeley DB 5.2 introduced error message prefixes 2011-06-27 22:58:59 +00:00
Hannes Magnusson e788932a91 Fix 5.1 detection on ubuntu natty 2011-06-27 20:28:30 +00:00
Christopher Jones cf6b208cab missed version sync with 5.4 2011-06-27 17:24:55 +00:00
Derick Rethans 93fcf04fc1 - Updated to version 2011.8 (2011h) 2011-06-27 11:47:43 +00:00
Jérôme Loyet c9a0fbe122 - fixed request_timeout and slowlog_timeout from last FPM commit (r312496)
- typo
2011-06-27 11:33:03 +00:00
Felipe Pena c1d43480cc - BFN 2011-06-27 01:39:01 +00:00
Felipe Pena 92ef080a2e - Fixed data type usage in 64bit
Reported by: Leonildo Costa
2011-06-27 01:36:39 +00:00
Jérôme Loyet f5b05ce162 - Replaced shm_slots with a real scoreboard
- Added several improvements to the status page
2011-06-26 15:48:11 +00:00
Pierre Joye 0d7226ed60 - reflection is always enabled 2011-06-25 10:47:54 +00:00
Knut Urdalen 778edca904 fixed temp directory names in spl tests 2011-06-25 07:45:41 +00:00
Knut Urdalen f8e21c395b fixed/refactored some spl tests related to owner/group retrieval 2011-06-25 04:50:42 +00:00
Christopher Jones d70a9f988d Add http_proxy env var support to run-tests.php result submission 2011-06-24 23:10:37 +00:00
Felipe Pena 10c20ceaf4 - Added SKIPIF 2011-06-24 19:18:06 +00:00
Felipe Pena 6c07bc8004 - BFN 2011-06-24 00:53:52 +00:00
Felipe Pena 08ddf683fc - Fixed crash in error_log() (strlen(NULL)) reported by: shm, Maksymilian Arciemowicz 2011-06-23 21:48:15 +00:00
Hannes Magnusson 71a5c3d7ec These are annoyingly slow 2011-06-23 21:27:42 +00:00
Jérôme Loyet bbe8518456 - Added custom access log (also added per request %CPU and memory mesurement) 2011-06-23 08:03:52 +00:00
Hannes Magnusson 12081f5659 Add charset, fixes the validate_on_parse test (confik) 2011-06-22 14:59:20 +00:00
Shein Alexey 113e304dcf Fixed dom tests. 2011-06-22 09:28:14 +00:00
Patrick Allaert d10755c0e6 Fixed typo 2011-06-20 20:42:02 +00:00
Jérôme Loyet 955b801fea Removed pid in debug logs written by chrildren processes 2011-06-20 00:03:39 +00:00
Daniel Convissor 887f30dc61 Make xfail text not reference a particular version now that 5.4 branch exists. 2011-06-19 16:46:32 +00:00
Felipe Pena 8d6e997315 - Opss, restore old behavior 2011-06-19 14:50:44 +00:00
Felipe Pena 0806f78f77 - 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 f4554096e1 - New tests (code coverage++) 2011-06-19 12:33:49 +00:00
Felipe Pena 3964ddd1c4 - Added missing void param checks, and fix arginfo 2011-06-18 22:48:31 +00:00
Felipe Pena e3da6ac3da - Missing change 2011-06-18 17:46:16 +00:00
Felipe Pena 6481440f3f - Fixed ZTS build 2011-06-18 17:41:56 +00:00
Jérôme Loyet 23a5f873fb Added master rlimit_files and rlimit_core in the global configuration settings 2011-06-18 16:27:48 +00:00
Jérôme Loyet 6e1f77ef6b Fixed exit at FPM startup on fpm_resources_prepare 2011-06-18 16:15:15 +00:00
Jérôme Loyet 606d61bd1c ws 2011-06-18 16:05:56 +00:00
Felipe Pena 2b309c8f9e - Added missing arginfos for void params and void param checks 2011-06-18 15:56:14 +00:00
Jérôme Loyet 22be55e6da Remove timestamp in logs written by children process 2011-06-18 15:33:07 +00:00
Daniel Convissor 370d483bcb Provide test for DateTime::add() issue (for discussion on internals, bugs.php.net is down). 2011-06-18 01:00:56 +00:00
Daniel Convissor 249667f9e3 Split DateTime diff/add/sub tests into separate files to make things easier to see, test and (one hopes) fix. 2011-06-18 00:29:52 +00:00
Jérôme Loyet fd0009d8d6 missing doc in the conf file 2011-06-17 23:35:47 +00:00
Jérôme Loyet cff7a300d1 - added xml format to the status page
- clean fpm_status.c code
2011-06-17 23:19:54 +00:00
Christopher Jones 52cc62d825 Remove duplicate lines present in PHP_5_3's .phpt (dtajchreber) 2011-06-17 21:42:40 +00:00
Christopher Jones 21abc2f1c1 Fix skipif to resolve the common reason this test fails 2011-06-17 18:28:34 +00:00
Derick Rethans 4b9857e7a4 - Fixed bug where the DateTime object got changed while using date_diff(). 2011-06-17 16:38:23 +00:00
Felipe Pena f7ee12e928 - Fixed two "jump or move depends on uninitialised value" 2011-06-17 02:00:20 +00:00
Pierre Joye ccae79a2c3 - 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
Johannes Schlüter 262492a187 - Back to -dev 2011-06-16 12:47:39 +00:00
Johannes Schlüter 06d5c9a8f0 5.3.7RC1 2011-06-16 12:40:37 +00:00
Pierre Joye 0ff4d7d811 - fix nts build 2011-06-16 10:20:25 +00:00
Pierre Joye 23c4c46b36 - init win32 rng context once per process 2011-06-16 01:31:10 +00:00
Pierre Joye b498b5dfe5 - install extra headers 2011-06-16 01:21:01 +00:00
Gustavo André dos Santos Lopes ba3498ea33 - Broken overlong (>80 chars) lines.
- Added entry corresponding to r301991, as requested.
2011-06-14 22:18:29 +00:00
Scott MacVicar c2ca352598 Upgrade SQLite to 3.7.6.3 2011-06-14 17:00:49 +00:00
Felipe Pena d42a0aee91 - Added CVE id 2011-06-13 19:47:31 +00:00
Felipe Pena e854b05aea - Fix build on Windows 2011-06-13 17:52:23 +00:00
Timm Friebe 6210bf0dba - MFH suppression of compiler warning noted in bug #55009 2011-06-13 08:45:21 +00:00
Felipe Pena 209bfe82e5 - Fixed bug #54624 (class_alias and type hint) 2011-06-12 21:10:31 +00:00
Felipe Pena 9d80c25005 - Fix test again 2011-06-12 21:05:16 +00:00
Felipe Pena 1a615eeaa2 - Added Bison 2.5 to bison_version_list 2011-06-12 17:26:45 +00:00
Felipe Pena 75fa63b57f - Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload filename)
Reported by: kkotowicz at gmail dot com
2011-06-12 15:14:18 +00:00
Felipe Pena bb16e23891 - Restore test (the change related to this test weren't committed to this branch) 2011-06-12 03:01:12 +00:00
Felipe Pena 0ec1758381 - Fixed bug #54680 (missing TRACK_VARS_SERVER check) 2011-06-12 02:47:48 +00:00
Felipe Pena 86ed2eeb5d - Avoid zend_do_ticks() call for each statement in parsing 2011-06-12 01:43:10 +00:00
Gustavo André dos Santos Lopes a54847a0fb - 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 6a504c6f6b - Fix missing change from r303357 (related to bug #48831) 2011-06-11 23:46:35 +00:00
Timm Friebe 55aab4e6de - MFH Bugfix for bug #53540 2011-06-11 18:55:15 +00:00
Felipe Pena 9b1ba00a1e - Missing fix for bug #54347 2011-06-11 15:11:49 +00:00
Pierre Joye c92904d160 - missing entry for curl.cainfo 2011-06-11 13:23:29 +00:00
Felipe Pena a76f790b58 - Possible fix for bug #55022 (memory_limit exhausted when set charset in sybase_connect) 2011-06-11 01:15:14 +00:00
Christopher Jones 17af8b0179 Fix TSRMLS for Windows build 2011-06-11 00:24:26 +00:00
Felipe Pena c776180f6e - Drop C++ style comments 2011-06-10 23:14:15 +00:00
Felipe Pena 0e37aa144f - Fixed bug #55028 (// is abad comment) 2011-06-10 22:48:36 +00:00
Christopher Jones c7a8bd6a4c Add new OCI8 tests. Refactor skipifs. Sync 5.3/5.4/trunk branches 2011-06-10 19:16:35 +00:00
Christopher Jones f4009b52a3 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
Christopher Jones bc0d535f5a Missed trivial comment sync with PHP_5_4 and trunk 2011-06-10 17:16:00 +00:00
Felipe Pena 60857e013b - 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 ae2e75a657 Fixed test. 2011-06-09 13:09:25 +00:00
Shein Alexey 21fb2a42cc Changed session.save_path to /tmp to make test run. 2011-06-09 08:24:12 +00:00
Shein Alexey 3b37e152c3 Skip reason is now printed if session.save_path is not writable. 2011-06-09 08:18:49 +00:00
Shein Alexey 25adf56921 Fixed session test breakage due to serialize precision issue. 2011-06-09 07:44:10 +00:00
Ilia Alshanetsky cca899148a Fixed test 2011-06-08 23:30:02 +00:00
George Wang 0bcbaa1750 fix socket address parsing code 2011-06-08 16:51:59 +00:00
Ilia Alshanetsky 9277da7d9d Fixed test to account for smaller default floating point # precision 2011-06-08 02:03:14 +00:00
Gustavo André dos Santos Lopes cd7681d273 - 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 031085e0a9 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 f75714650b - Fixed bug #55007 (compiler fail after previous fail) 2011-06-07 22:58:38 +00:00
Ilia Alshanetsky 14ed144318 Fixed test 008 2011-06-07 01:40:54 +00:00
Felipe Pena baf834a00a - BFN 2011-06-07 01:27:29 +00:00
Felipe Pena 68ff1463e7 - Restore fix for #39863 (do not accept paths with NULL in them)
# This was removed by regenerating the VM months ago
2011-06-06 02:34:38 +00:00
Ilia Alshanetsky d846d0e80a Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). 2011-06-05 21:57:01 +00:00
Hannes Magnusson 10da251565 Fixed bug#51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error) 2011-06-05 13:30:01 +00:00
Philip Olson f472141549 Updated the note maintainers credits 2011-06-05 06:57:13 +00:00
Felipe Pena 0afd4bd18b - Possible fix for bug #54609 (Certain implementation(s) of SplFixedArray cause hard crash) 2011-06-05 01:38:12 +00:00
Felipe Pena 087a134b50 - Fixed bug #54929 (Parse error with single quote in sql comment) 2011-06-04 22:54:40 +00:00
Ilia Alshanetsky 00a6dd29b7 Show ICU Data version inside phpinfo() 2011-06-03 18:14:36 +00:00
Hannes Magnusson 14e7d404d9 Fix tests
#Note to self; do not rename tests just before committing
2011-06-03 17:38:37 +00:00
Hannes Magnusson a62829c09e Add tests for broken function arguments 2011-06-03 17:12:59 +00:00
Gustavo André dos Santos Lopes 479a47d8af Merge of fix for bug #54918 (r311745, scottmac) to 5.3. 2011-06-03 09:39:45 +00:00
Gustavo André dos Santos Lopes 7af15a41d9 - Fixed double registering of browscap ini directive. See bug #54896. 2011-06-02 08:46:40 +00:00
Felipe Pena 47315dfdf6 - Fixed bug #54970 (SplFixedArray::setSize() isn't resizing) 2011-06-02 00:40:27 +00:00
Ilia Alshanetsky f7cdabd118 More tests 2011-06-01 16:59:23 +00:00
Ilia Alshanetsky e6c9a31c54 Implemented FR #54561 (Expose ICU Version & ICU Data Version info). 2011-06-01 16:26:21 +00:00
Ilia Alshanetsky 83d01bd81b Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE settings). 2011-06-01 13:23:25 +00:00
Ilia Alshanetsky f4f2aa7583 Fixed bug #54484 (Empty string in json_decode doesn't reset json_last_error()). 2011-06-01 09:44:38 +00:00
George Wang cb7f656de7 fix CLI mode timeout 2011-05-31 22:40:42 +00:00
Rafael Machado Dohms b903587268 Adding testcases to validate imageloadfont input parameter validation, tests were developed at #tek11 testfest 2011-05-31 21:24:10 +00:00
Andrey Hristov b97e76d512 reuse code 2011-05-31 20:42:44 +00:00
Shein Alexey e69b73e0b8 Fixed notice breaking the test. 2011-05-31 12:57:40 +00:00
Andrey Hristov e2ac61225f fix macros 2011-05-31 10:35:07 +00:00
Dmitry Stogov c989a36927 Fixed bug #54910 (Crash when calling call_user_func with unknown function name) 2011-05-31 09:20:51 +00:00
Ilia Alshanetsky 3d7a201eb4 Removed test for functionality available in 5.4+ 2011-05-31 09:01:44 +00:00
Ilia Alshanetsky e91cecb1d3 Removed unnecessary rinit/rshutdown 2011-05-31 08:59:32 +00:00
Philip Olson b7eefa0af7 Updated qa-release.php notes as per the new qa-release.php syntax 2011-05-30 23:26:33 +00:00
Ilia Alshanetsky a65eba016e Fixed bug #52496 (Zero exit code on option parsing failure). 2011-05-30 15:57:50 +00:00
Hannes Magnusson 3b030ec75f Fixed bug #54946 (stream_get_contents infinite loop) 2011-05-29 12:29:19 +00:00
Hannes Magnusson 07bcf1080d Fixed bug #54601 (Removing the doctype node segfaults) 2011-05-29 11:39:49 +00:00
Ilia Alshanetsky 69a12bfb3f Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). 2011-05-29 10:23:06 +00:00
Ilia Alshanetsky ef74038d1d Fixed bug #54137 (file_get_contents POST request sends additional line break). 2011-05-29 09:23:08 +00:00
Felipe Pena 6ff2f7040e - BFN 2011-05-27 23:32:48 +00:00
Felipe Pena 490b75d170 - Fixed bug #54934 (Unresolved symbol strtoull in HP-UX 11.11) 2011-05-27 23:31:30 +00:00
Ilia Alshanetsky 8267eaf1bf Fixed bug #54924 (assert.* is not being reset upon request shutdown). 2011-05-26 18:17:43 +00:00
Pierre Joye 885357a711 -fix bug 54935, php_win_err can lead to crash 2011-05-26 14:37:13 +00:00
Philip Olson 983cedfd94 Fixed test, as per r311323 2011-05-25 00:02:05 +00:00
Felipe Pena 4bf9334a82 - 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 35c42425fa Fixed test 2011-05-24 23:49:04 +00:00
Philip Olson e2caad5f96 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 6814cbec4b - 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 bed49c931d - 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 e38369c532 - Fix #54721, different Hashes on Windows, BSD and Linux on wrong Salt size 2011-05-24 13:48:04 +00:00
Felipe Pena 5cf61f4d8b - Add CVE to bug entry 2011-05-24 12:23:51 +00:00
Pierre Joye 86eae702f2 - fix tests, keep EOL as unix style as the str len is used in expectf 2011-05-24 10:23:13 +00:00
Pierre Joye 0d8e83532a - make svn-eol LF and use one test for unix and windows 2011-05-24 09:44:55 +00:00
Felipe Pena ee920e12ec - Fix the fix
# Arghh, copy and paste error :(
2011-05-24 00:10:00 +00:00
Felipe Pena e9f4cfd6af - Fixed stack buffer overflow in socket_connect().
Found by: Mateusz Kocielski, Marek Kroemeke and Filip Palian
2011-05-24 00:05:50 +00:00
Felipe Pena 00169ec00f - 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 508f926604 - Fixed bug #54269 (Short exception message buffer causes crash) 2011-05-22 19:06:21 +00:00
Rasmus Lerdorf ba8ce4a6d4 Increase the overly conservative pcre backtrack limit from 100000 to 1000000 2011-05-21 19:48:37 +00:00
Felipe Pena f7e6e6cedf - 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
Felipe Pena 6f3c7a8b70 - Fixed bug #54804 (__halt_compiler and imported namespaces) (Pierrick) 2011-05-19 23:20:47 +00:00
Rasmus Lerdorf 00842d6996 Fix CS 2011-05-19 23:18:55 +00:00
Rasmus Lerdorf e40c470c9d Fix bug 54866 2011-05-19 23:09:58 +00:00
Pierre Joye 221a07b669 - initial import, will add all libs later 2011-05-19 13:36:29 +00:00
Scott MacVicar 8e314ae7fc 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
Rasmus Lerdorf edcc7dce4e Fix typo 2011-05-18 19:55:34 +00:00
Rasmus Lerdorf 8f71a6f673 Fix autoconf version check script to make sure people are
not using 2.60 or higher here. It might actually work up to
2.62 or 2.64. If someone could verify that these versions
still work I can massage this further.
2011-05-18 17:27:41 +00:00
Johannes Schlüter 9aa379c724 - handle out of memory 2011-05-18 11:49:49 +00:00
Dmitry Stogov 2ee837aa5e Fixed crash on recursive error handler invocation 2011-05-17 12:27:21 +00:00
Andrey Hristov a417820be3 exchange a "trap" with an error 2011-05-17 09:44:11 +00:00
Johannes Schlüter 1eb7704974 - 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 2ea7c05d75 adding an XFAIL, as we have an open bug for this test 2011-05-16 23:43:12 +00:00
Ferenc Kovacs 85de397a23 adding an XFAIL, as we have an open bug for this test 2011-05-16 23:39:16 +00:00
Ferenc Kovacs 66d5eb12a9 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 f551ed4189 fix the test with the removal of the unnecessary newline 2011-05-16 23:33:05 +00:00
Ferenc Kovacs 23cab07e4f 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 36fde4043b removing XFAIL as #39863 has already been fixed 2011-05-16 23:28:46 +00:00
Ferenc Kovacs a944f7a663 reverting 311103,311105-311109, will commit them to all three branches 2011-05-16 23:22:17 +00:00
Johannes Schlüter c61d125986 - Handle error if tempfile can't be opened, found by parfait 2011-05-16 22:24:41 +00:00
Johannes Schlüter 38c1181cfa - Fix a few more memleaks found by parfait 2011-05-16 21:29:45 +00:00
Ferenc Kovacs 2957b7cbb6 adding an XFAIL, as we have an open bug for this test 2011-05-16 20:11:00 +00:00
Ferenc Kovacs e9efaea7c4 adding an XFAIL, as we have an open bug for this test 2011-05-16 20:10:04 +00:00
Ferenc Kovacs 2f5dc540e0 fix the test via setting the timezone to UTC as suggested by Alexey Shein, and adding an SKIPIF as this test was originaly intended for windows only, maybe we could drop this, as we don't support VC6 anymore 2011-05-16 20:07:55 +00:00
Ferenc Kovacs 76425aaca1 fix the test with the removal of the unnecessary newline 2011-05-16 19:51:39 +00:00
Ferenc Kovacs c4e6beebb3 adding the serialize_precision=100 for the tests, credits to Mats Lindh for reporting it 2011-05-16 19:49:59 +00:00
Johannes Schlüter 9ea582a76c - Fix possible memory leak
# Found by parfait - http://labs.oracle.com/projects/parfait/
2011-05-16 19:46:32 +00:00
Ferenc Kovacs df2ca16fa8 removing XFAIL as #39863 has already been fixed 2011-05-16 19:40:12 +00:00
Johannes Schlüter 3e17b49008 - Fix Bug #53782 (foreach throws irrelevant exception) 2011-05-16 15:37:39 +00:00
Johannes Schlüter 9e5bc2c138 - 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 d257aa42ff Oops, can't cache it here because it won't work
in autoconf2.13 and we still support that version
in this branch
2011-05-15 05:49:34 +00:00
Rasmus Lerdorf 78a15091f9 Cache the pdo include path 2011-05-15 05:03:29 +00:00
Rasmus Lerdorf 24be7e2106 We can't really predict what will happen on an unknown host lookup
since bogus ISPs like Comcast and many others try to "help" by resolving
everything to their own search page.
2011-05-15 01:52:07 +00:00
Martin Jansen 2ce1fd71ea Fixed two failing tests that were caused by arbitrarily chosen
but apparently bogus upper resp. lower limits for mt_rand().
2011-05-14 20:29:46 +00:00
Rasmus Lerdorf 4ab19212e5 en_US locale preferred output has AM/PM and also the timezone 2011-05-14 17:51:38 +00:00
Rasmus Lerdorf d91d06af30 Fix the require in these tests 2011-05-14 17:34:18 +00:00
Rasmus Lerdorf 6613fefb80 Make sure 'E' is included in the variables_order, otherwise
this test won't work.
2011-05-13 21:54:25 +00:00
Scott MacVicar 74b8f72017 Fix Windows build, this really should be in a patch file / README.
I'll fix this up later.
2011-05-13 13:51:07 +00:00
Scott MacVicar 27fc1b889a Update bundled PCRE to 8.12 2011-05-13 07:00:45 +00:00
Scott MacVicar 66ce68e7a4 Update bundled SQLite to 3.7.6.2 2011-05-13 06:11:06 +00:00
Scott MacVicar df0ce635e4 Fix use after free() in XMLReader::xml() 2011-05-13 05:54:34 +00:00
Scott MacVicar a0857d56ac Fixed bug #54723 - getimagesize() doesn't check the full ico signature and misreports mpg files 2011-05-13 05:06:48 +00:00
Rasmus Lerdorf 2954832b97 Check headers first and let the CHECK_LIBRARY macro
handle checking for the library. This makes it 
correctly handle non-standard system paths as long
as gcc knows about them. Should fix the build on
Ubuntu natty.
2011-05-12 08:19:37 +00:00
Philip Olson c2a245f582 Added missing date_default_timezone_set('UTC'); to the appropriate tests. A few now pass by not showing the timezone warning. 2011-05-12 06:51:46 +00:00
Dmitry Stogov 5dcdf5c467 Fixed bug #54367 (Use of closure causes problem in ArrayAccess) 2011-05-11 06:58:33 +00:00
Scott MacVicar cab76530e7 Turns out that more than 1% of users clocks are more than a year out of date, this causes cookies to never get deleted since the date is in the future.
I can only guess its due to batteries on the motherboard being dead.
2011-05-10 19:09:24 +00:00
Adam Harvey a7dbf5a29e Fix bug #54692 (SQLite3::open() Return Value) by correcting the SQLite3::open()
prototype.
2011-05-10 08:14:55 +00:00
Andrey Hristov 229bdc7ccb Fix range
(thanks again nihen)
2011-05-10 07:15:22 +00:00
Andrey Hristov 20f4ea9de8 here comes the news 2011-05-09 16:22:54 +00:00
Andrey Hristov 6242101f2b Fix for bug 54674..typo in the check of SJIS 2011-05-09 16:20:35 +00:00
Johannes Schlüter 4a8eeb7afb - Fix bug #54644 (wrong pathes in php_pdo_mysql_int.h) 2011-05-09 11:34:17 +00:00
Gustavo André dos Santos Lopes 8f77168384 - Merged to 5.3 change in trunk in _php_stream_free. This prevents the segfault
in the testcase for bug #53624. The testcase still has to be fixed though,
  because it only works as intended on Windows.
2011-05-08 19:59:42 +00:00
Felipe Pena cde80bd812 - BFN #54681 2011-05-07 01:59:12 +00:00
Felipe Pena c11e307ae0 - Fixed bug #54681 (addGlob() crashes on invalid flags) 2011-05-07 01:58:26 +00:00
Andrey Hristov 9bf9b88f20 add the BLOCK_LEAVE macro for non-gcc and non-win 2011-05-04 19:09:12 +00:00
Andrey Hristov 3e46e95ac1 reorganize the DBG_ macros, add DBG_BLOCK_XXX 2011-05-04 19:05:19 +00:00
Antony Dovgal 8f8a54ab37 fix tests 2011-05-04 08:44:14 +00:00
Antony Dovgal 176c6fe901 fix test 2011-05-04 08:28:31 +00:00
Dmitry Stogov 0bce4957e5 Fixed crash when passing invalid timestamp (negative integer on win32) 2011-05-04 07:53:22 +00:00
Antony Dovgal 278392a10b fix tests 2011-05-03 11:15:45 +00:00
Andrey Hristov 5bac59b7d1 extend the API in the backward compatible way 2011-05-03 09:37:53 +00:00
Antony Dovgal 93ce043480 fix segfault in ext/standard/tests/network/http-stream.phpt 2011-05-02 16:17:52 +00:00
Antony Dovgal f3cd7fdda4 fix ZTS build for 5_3, too 2011-05-01 19:46:27 +00:00
Gustavo André dos Santos Lopes a2e0e2564d - Fixed bug #54580 (get_browser() segmentation fault when the browscap ini
directive is set in activation time). This commit fixes this by adding a per
  request parsing of the browscap file that's when get_browser is called the
  first time and the directive is set on activation time.w
2011-05-01 18:37:20 +00:00
Gustavo André dos Santos Lopes 02302812e1 - Fixed accidental change. 2011-05-01 04:16:28 +00:00
Gustavo André dos Santos Lopes 6df67ace20 - Fixed bug #54623 (Segfault when when writing to a persistent socket after
closing a copy of the socket).
2011-05-01 03:57:01 +00:00
Derick Rethans 7a80c3a0ed - Updated to version 2011.7 (2011g) 2011-04-30 20:18:51 +00:00
Pierrick Charron 3841295b2a Added support for CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815
# MFH. This addition was already committed to trunk and is backported as requested in #54622
2011-04-29 10:41:44 +00:00
Ilia Alshanetsky fc7ee596f6 #doc
Added 3rd parameter to filter_var_array() and filter_input_array() 
functions that allows disabling addition of empty elements
2011-04-28 12:32:47 +00:00
Rasmus Lerdorf 6c564a7802 Fix test by pointing this at a smaller file that is less likely to break the test 2011-04-27 21:27:00 +00:00
Rasmus Lerdorf a44515caf9 Fix broken test 2011-04-27 15:08:44 +00:00
Hannes Magnusson 3d347be242 Regenerate from the doc sources 2011-04-27 09:29:10 +00:00
Rasmus Lerdorf 8192ba2b60 Someone fixed these in trunk and didn't backport to PHP_5_3 2011-04-27 05:05:32 +00:00
Martin Jansen 1a4897c88e MFH: The project calls itself OpenSSL and not openSSL, so let's keep it
that way in our code as well.
2011-04-25 16:51:12 +00:00
Pierre Joye 2d0ab7c98b - keep node creation check 2011-04-25 09:31:00 +00:00
Pierre Joye cd4928c99a - keep inode creation check 2011-04-25 09:28:08 +00:00
Dmitry Stogov e510daf20b Fixed bug #54585 (track_errors causes segfault) 2011-04-25 07:50:07 +00:00
Rasmus Lerdorf be3d70df4e SSLV2 patch cleanup 2011-04-24 23:27:48 +00:00
Pierre Joye be24877c84 - fix use of unitiliazed var 2011-04-24 22:08:11 +00:00
Rasmus Lerdorf e575557612 Support for openssl without SSLv2 supprot compiled in. Distros are starting to
remove support now and this wasn't compiling anymore on my Debian dev box.
2011-04-24 20:47:22 +00:00
Hannes Magnusson 21f71027e3 2011 2011-04-23 21:14:10 +00:00
Hannes Magnusson e85c367bc7 its force-quit, not -exit (yawk) 2011-04-23 21:12:25 +00:00
Pierrick Charron 1153eaf505 Revert bug #54454 fix from PHP_5_3 branch to avoid BC break in minor release 2011-04-21 01:51:24 +00:00
Dmitry Stogov c157f4b4e6 Fixed bug #54367 (Use of closure causes problem in ArrayAccess). 2011-04-20 12:59:18 +00:00
Pierre Joye 1dd5690af2 - fix build >(btw, has novell man pages too?) 2011-04-19 21:43:22 +00:00
Hannes Magnusson 5ca8ba7ab6 Add an --man-dir to php-config too 2011-04-18 11:13:37 +00:00
Hannes Magnusson a0d805035c Expose PHP_MANDIR
Useful for apps (like the pear installer, phd, .. etc) to install their manpages into the same dir as php did :]
2011-04-18 09:50:32 +00:00
Stanislav Malyshev 339f46237d implement FR #54540 - Allow loading of arbitrary resource bundles when fallback is disabled 2011-04-17 21:56:26 +00:00
Rob Richards 1b6dd18082 Implement FR #48587 (MySQL PDO driver doesn't support SSL connections) 2011-04-15 14:24:40 +00:00
Dmitry Stogov 92e5b10c41 Fixed bug #54268 (Double free when destroy_zend_class fails) 2011-04-15 12:43:20 +00:00
Stanislav Malyshev 833ec62d7c add CVE 2011-04-13 17:33:00 +00:00
Felipe Pena 782c00d744 - Remove undesired line (reported by Gökhan Özbulak) 2011-04-13 13:38:52 +00:00
Stanislav Malyshev 2e206e0761 fix bug #54238 (use-after-free in substr_replace()) 2011-04-13 06:32:41 +00:00
Ilia Alshanetsky 0e80f26207 Fixed bug #54121 (error message format string typo). 2011-04-12 18:33:08 +00:00
Gustavo André dos Santos Lopes 047ed8dfbb - Fixed bug #54440: libxml extension ignores default context. 2011-04-09 18:32:55 +00:00
Gustavo André dos Santos Lopes f2cfb997de - Fixed bug #54494: mb_substr() mishandles UTF-32LE and UCS-2LE. 2011-04-09 16:59:36 +00:00
Dmitry Stogov def1ab1e60 - Fixed bug #54358 (Closure, use and reference)
- Fixed bug #54039 (use() of static variables in lambda functions can break staticness)
2011-04-08 10:02:07 +00:00
Dmitry Stogov 3e36ecd98f Missed tests 2011-04-07 14:34:07 +00:00
Dmitry Stogov 03b6daed4f Fixed bug #54372 (Crash accessing global object itself returned from its __get() handle) 2011-04-07 13:35:27 +00:00
Adam Harvey 840308cfd0 Implement FR #54459 (Range function accuracy) by changing the way range()
calculates values when used with floating point bounds/step.
2011-04-06 10:23:06 +00:00
Adam Harvey f9721d03f7 Fix duplicated test. 2011-04-06 10:16:14 +00:00
Gustavo André dos Santos Lopes cd2cdd256a - Make SplFileInfo::_bad_state_ex final. 2011-04-05 08:38:09 +00:00
Gustavo André dos Santos Lopes 2975308e1a - Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and
SplTempFileObject crash when user-space classes don't call the paren
  constructor).
2011-04-04 02:50:27 +00:00
Pierrick Charron e8486cc374 Fix common typos in the source code (Reported in Bug #54065)
# External libraries were excluded
# Thanks eitan at eitanadler dot com for the first patch :)
2011-04-03 21:46:52 +00:00
Ilia Alshanetsky 47012ccd8f Fixed bug #53037 (FILTER_FLAG_EMPTY_STRING_NULL is not implemented). 2011-04-03 16:30:31 +00:00
Pierrick Charron 4919f3286b Fixed bug #54454 (substr_compare incorrectly reports equality in some cases) 2011-04-03 07:18:27 +00:00
Felipe Pena 2c76af8538 - Improved message and version checking 2011-04-02 01:24:53 +00:00
Pierre Joye 689268a0ba - add CURLINFO_REDIRECT_URL 2011-04-01 17:19:08 +00:00
Derick Rethans 88c1755a14 - Updated to version 2011.5 (2011e) 2011-04-01 11:24:49 +00:00
Antony Dovgal dd5781bcdf fix bug #54423 (classes from dl()'ed extensions are not destroyed) 2011-03-31 11:59:34 +00:00
Christopher Jones ef777fc18e Refactor OCI8 config.m4: improve messages and merge similar conditionals 2011-03-29 21:37:45 +00:00
Felipe Pena 1dbfe6e310 - BFN 2011-03-29 18:44:52 +00:00
Felipe Pena 3c6104e180 - Fixed bug #44989 (64bit Oracle RPMs still not supported by pdo-oci)
patch by: jbnance at tresgeek dot net
2011-03-29 18:40:20 +00:00
Pierre Joye f335f27b7b - not applied yet 2011-03-28 16:45:57 +00:00
Pierre Joye 4551bd57f7 - Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent, windows fix 2011-03-28 16:43:49 +00:00
Pierre Joye 4ad6108b7d - re enable static analyzer, crash fixed with snapshot builds 2011-03-28 10:55:34 +00:00
Nuno Lopes 9aec0c6806 fix last commit:
- fix code coverage build
 - spread static love
2011-03-28 09:10:23 +00:00
Felipe Pena 4929964a5d - Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters) 2011-03-26 17:02:34 +00:00
Andrey Hristov 018013e579 here comes the news 2011-03-24 16:19:01 +00:00
Andrey Hristov 8b33e6fae0 fix buffer overflow - overwriting with 0x0, due to
unchecked buffer size. This can be easily workarouned on 
existing unpatched systems by increasing
mysqlnd.net_cmd_buffer_size ini variable to more than 8k
2011-03-24 16:12:18 +00:00
Ulf Wendel a270348c24 Limit test with 65k params, should crash mysqlnd 2011-03-24 13:40:06 +00:00
Ilia Alshanetsky f2ce3e0201 Fixed a crash inside dtor for error handling. 2011-03-24 12:57:38 +00:00
Felipe Pena 0ab7f1cebf - Fixed bug #54292 (Wrong parameter causes crash in SplFileObject::__construct()) 2011-03-23 22:46:04 +00:00
Christopher Jones 8ca08487b7 Fixed bug #54084 (Fix apxs Apache version test to work with Oracle HTTP Server) (Chris Jones) 2011-03-23 18:56:47 +00:00
Andrey Hristov 3c364cbe52 Fix compressed build, make it easier 2011-03-23 17:14:28 +00:00
Adam Harvey 13a91f86b7 Implement request #54355 (Test for de_DE doesn't use UTF-8 locales). Patch by
Ondřej Surý.
2011-03-23 08:59:11 +00:00
Ulf Wendel 8307f9e892 Coverage for a 'silent server protocol change' from the past for which both mysqlnd and libmysql have workarounds. 2011-03-23 08:57:52 +00:00
Felipe Pena 5b85234b37 - Fixed bug #54283 (new DatePeriod(NULL) causes crash) 2011-03-23 01:22:18 +00:00
Gustavo André dos Santos Lopes 660aa6701d - Updating UPGRADING for r309516 and modest merge to 5.3. 2011-03-23 00:51:22 +00:00
Felipe Pena 0dd448cbf1 - Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator) 2011-03-22 22:41:16 +00:00
Andrey Hristov 5572becc81 palloc is long dead, use more appropriate name 2011-03-22 14:39:58 +00:00
Andrey Hristov 3595f09c28 Fix message 2011-03-22 14:39:36 +00:00
Andrey Hristov 081b001ca1 remove more unneeded includes 2011-03-22 12:54:02 +00:00
Andrey Hristov 9484248c0a remove unneeded includes 2011-03-22 12:22:16 +00:00
Adam Harvey c5c87c5f37 Fix bug #54318 (Non-portable grep option used in PDO pgsql configuration).
Patch by Ben Walton <bwalton at artsci dot utoronto dot ca>.
2011-03-22 09:12:01 +00:00
Adam Harvey 334d2df892 Fix bug #54340 (DateTime::add() method bug). 2011-03-22 08:33:22 +00:00
Adam Harvey 68811c473d Fix bug #54316 (DateTime::createFromFormat does not handle trailing '|'
correctly).
2011-03-21 09:40:52 +00:00
Gustavo André dos Santos Lopes 95a3bfb1bc - Fixed SKIPIF section of bug51958.phpt. 2011-03-20 22:12:11 +00:00
Gustavo André dos Santos Lopes f06e3ba5c1 - Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting
with \0).
2011-03-19 23:15:04 +00:00
Felipe Pena 8a48311a60 - BFN 2011-03-19 17:47:54 +00:00
Felipe Pena ab7992fab2 - Fixed bug #54312 (soap_version logic bug)
Patch by: tom at samplonius dot org
2011-03-19 17:36:01 +00:00
Raphael Geissert 5b55a18622 Add the libraries we actually test and need for LDAP and OpenSSL, fixes bug #53339
Patch by Clint Byrum
2011-03-18 18:47:09 +00:00
Pierrick Charron 5a53a74304 Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment) 2011-03-17 18:02:58 +00:00
Gustavo André dos Santos Lopes be87834321 - Merged fix for bug #51958 socket_accept() fails on IPv6 server sockets.
See r309238 for commit in trunk.
2011-03-17 15:36:52 +00:00
Ulf Wendel 8bbd451647 Test coverage for some of the cases where LAST_INSERT_ID() and API *_insert_id() differ as documented in the MySQL manual in particular the C API reference section 2011-03-17 15:18:22 +00:00
Felipe Pena d37dea8b7b - BFN 2011-03-17 12:03:09 +00:00
Felipe Pena 1e86e8e12c - Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field)
patch by: mjh at hodginsmedia dot com
2011-03-17 11:59:54 +00:00
Johannes Schlüter 07aa25b442 - Fixed bug #54265 (crash when variable gets reassigned in error handler)
(re-apply 309308, dmitry)
2011-03-17 11:49:18 +00:00
Felipe Pena 2b8d0edb45 - Fix infile return on duplicated key (related to bug #54242) 2011-03-17 11:43:05 +00:00
Andrey Hristov 5fb54640c9 here comes the news 2011-03-17 10:31:28 +00:00
Andrey Hristov 56cdee2def Fix for bug #54221 mysqli::get_warnings segfault when used in multi queries 2011-03-17 10:28:53 +00:00
Johannes Schlüter 27e640fdea - Back to dev 2011-03-17 10:13:20 +00:00
Johannes Schlüter f5687db392 PHP 5.3.6 2011-03-17 07:48:29 +00:00
Johannes Schlüter 6f15da050e - Revert r309308 temporarily to get 5.3.6 out 2011-03-17 07:46:57 +00:00
Pierre Joye 6e35b40b4c - news entry for the setlocale fix 2011-03-16 23:57:04 +00:00
Pierre Joye 0778bedbe1 - MFH: make setlocale thread only, drastically reduce TS related crashes in error mgt and other parts like pcre, and actually a good thing (tm) 2011-03-16 23:54:14 +00:00
Dmitry Stogov e90ac23f58 Fixed bug #54265 (crash when variable gets reassigned in error handler) 2011-03-16 15:21:38 +00:00
Dmitry Stogov b78ac8df82 Fixed bug #54262 (Crash when assigning value to a dimension in a non-array) 2011-03-16 11:14:33 +00:00
Felipe Pena d7b8f23e2b - BFN 2011-03-14 22:27:40 +00:00
Derick Rethans 50b56c2c0f - Updated to version 2011.4 (2011d) 2011-03-14 18:56:02 +00:00
Felipe Pena 6da18ca967 - Missing fixes for bug #54247 2011-03-14 14:12:42 +00:00
Felipe Pena 8d816ed0ef - Fixed bug #54247 (format-string vulnerability on Phar) 2011-03-14 13:54:41 +00:00
Pierrick Charron e68e2893c0 # Revert bug fix (will commit it again on 5.3 branch when 5.3.6 will be released) 2011-03-13 17:14:18 +00:00
Pierrick Charron ee832705d1 Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment) 2011-03-13 04:02:56 +00:00
Sebastian Bergmann 7e34334d84 Fix prototype of zend_fetch_debug_backtrace(). 2011-03-11 03:52:39 +00:00
Eyal Teutsch 94b3d60a4f fixed tests to match the new float precision of 53, as described in bug 47168 2011-03-10 13:25:19 +00:00
Scott MacVicar dd68a6239a Add a version number to timelib for other projects that use it.
This has the same version scheme as timezonedb.

<year><release-padded-to-two>
2011-03-09 20:06:52 +00:00
Jim Jagielski 39d814a205 Close [PHP-BUG] Req #54152...
Apache 2.3.12 (and later) will now work correctly with PHP's fcgi
impl with this patch.
2011-03-09 18:27:30 +00:00
Johannes Schlüter 5009770d65 - PHP 5.3.6RC3 2011-03-09 16:37:58 +00:00
Felipe Pena c7e7de3485 - Fixed bug #49608 (Using CachingIterator on DirectoryIterator instance segfaults) 2011-03-08 19:56:29 +00:00
Felipe Pena 2843030fa1 - Version++ 2011-03-08 18:24:04 +00:00
Felipe Pena e1a746faec - assign CVE 2011-03-08 14:07:25 +00:00
Felipe Pena 4653ef06f9 - Missing "reported by" info 2011-03-08 13:12:52 +00:00
Felipe Pena 06e475e537 - Fixed bug #54193 (Integer overflow in shmop_read()) 2011-03-08 13:11:14 +00:00
Derick Rethans c256372636 - Updated to version 2011.3 (2011c) 2011-03-07 14:55:28 +00:00
Felipe Pena 3986e515da - Reverted fix for bug #54167 (to be committed in soon) 2011-03-06 13:36:44 +00:00
Felipe Pena 2f3f629fd4 - Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field)
# initial patch by: mjh at hodginsmedia dot com (5.3)
# trunk version by me
2011-03-05 23:07:45 +00:00
Johannes Schlüter bf5a3715f4 Back to -dev 2011-03-02 22:03:38 +00:00
Johannes Schlüter 0ec8364402 PHP 5.2.6RC2 2011-03-02 21:26:43 +00:00
Moriyoshi Koizumi a497999481 - Merge from trunk. 2011-03-02 18:35:10 +00:00
Felipe Pena 53b1c76efe - Fixed SplObjectStorage::offsetSet arginfo, reported in bug #54118 2011-03-01 00:13:23 +00:00
Ilia Alshanetsky 5d83ad8c44 Fixed bug #54089 (token_get_all() does not stop after __halt_compiler). 2011-02-28 15:18:27 +00:00
Gustavo André dos Santos Lopes f657ba978b - Fixed bug #54092 (Segmentation fault when using HTTP proxy with the FTP
wrapper).
#php_stream->wrapperdata should hold an array zval (like its zval* type
#indicates...), it's not a place where the wrapper can drop an arbitrary
#pointer. For that, .wrapperthis should be used.
#Also, since the ftp dir wrapper defines its own stream type, it's more
#appropriate to use .abstract to store the stream instance specific data.
2011-02-27 20:23:54 +00:00
Felipe Pena 1f991c8e42 - Possible fix for Bug #54108 (valgrind can not be found if located outside of system's default PATH) 2011-02-27 17:55:39 +00:00
Andrey Hristov a5348bed31 use ifdef all-around in the revert 2011-02-25 13:11:49 +00:00
Andrey Hristov 2eb5b0fe4e revert also the version_id 2011-02-25 12:52:46 +00:00
Andrey Hristov d4a1f5ac06 revert to previous behavior 2011-02-25 12:52:21 +00:00
Andrey Hristov 113cd9dc0f move from macros to functions, which can be overwritten, if needed 2011-02-25 12:25:36 +00:00
Nuno Lopes e79bf567e8 fix lcov build 2011-02-25 09:32:17 +00:00
Felipe Pena a82a9e8f74 - Fixed possible off-by-one overflow in ibase_gen_id() 2011-02-24 02:42:38 +00:00
Ilia Alshanetsky f15452af96 Fixed compiler warning 2011-02-22 15:48:25 +00:00
Johannes Schlüter 0448336c2c - Fix tests. temp dir might be something other than /tmp 2011-02-22 14:49:32 +00:00
Andrey Hristov 7a1f54ff42 fix invalid memory read. Thank you, valgrind 2011-02-21 16:24:37 +00:00
Pierre Joye 00b10c6aa3 - fix bug #54061, memory leak in openssl_decrypt 2011-02-21 12:50:26 +00:00
Pierre Joye 69ba87b183 - fix bug #54061, memory leak in openssl_decrypt 2011-02-21 12:47:38 +00:00
Pierre Joye 7deec592fd - fix test 025 2011-02-21 10:09:50 +00:00
Pierre Joye 5261861d77 - fix bug #54060, memory leak in openssl_encrypt 2011-02-21 10:07:31 +00:00
Scott MacVicar 3242016f28 Fix Bug #54058, invalid utf-8 doesn't set json_encode() in all cases 2011-02-21 08:09:02 +00:00
Gustavo André dos Santos Lopes 1b2d14c5e1 - Fixed bug #54055 (buffer overrun with high values for precision ini
setting).
#This fix (for g/G/k/H modes) is done at a different level than that for the
#modes e/E/f/F, at a bit higher level and therefore with less coverage. I
#chose this because it addresses the problem where it is -- the calling function
#that passes a buffer too small to php_gcvt.
2011-02-21 06:53:24 +00:00
Felipe Pena 54a7e5d7c3 - Fixed memory leak in DirectoryIterator::getExtension() and SplFileInfo::getExtension() 2011-02-20 16:33:53 +00:00
Felipe Pena 5b442c82f0 - Fixed bug #54040 (Logical && where & probably needed in spl_iterators) 2011-02-20 16:09:50 +00:00
Pierre Joye e78a5127c8 - bug #54002 entry 2011-02-18 17:22:27 +00:00
Felipe Pena 5bef6665f9 - Fixed bug #43512 (same parameter name can be used multiple times in method/function definition) 2011-02-17 23:24:50 +00:00
Johannes Schlüter 18127da570 Back to -dev 2011-02-16 20:41:24 +00:00
721 changed files with 24958 additions and 10528 deletions

No files matched your search

+1321 -1320
View File
File diff suppressed because it is too large. Load diff
+262 -2
View File
@@ -1,6 +1,237 @@
PHP NEWS
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 Feb 2011, PHP 5.3.6RC1
30 Jun 2011, PHP 5.3.7 RC2
- Core:
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
. Fixed bug #55082 (var_export() doesn't escape properties properly).
(Gustavo)
- DateTime extension:
. Fixed bug where the DateTime object got changed while using date_diff().
(Derick)
- DBA extension:
. Supress warning on non-existent file open with Berkeley DB 5.2 (Chris Jones)
- PDO ODBC driver:
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
- SPL extension:
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
on true). (Pierrick)
16 Jun 2011, PHP 5.3.7 RC1
- Upgraded bundled SQLite to version 3.7.6.3. (Scott)
- Upgraded bundled PCRE to version 8.12. (Scott)
- Increased the backtrack limit from 100000 to 1000000 (Rasmus)
- Zend Engine:
. Fixed bug #55007 (compiler fail after previous fail). (Felipe)
. Fixed bug #54910 (Crash when calling call_user_func with unknown function
name). (Dmitry)
. Fixed bug #54804 (__halt_compiler and imported namespaces).
(Pierrick, Felipe)
. Fixed bug #54624 (class_alias and type hint). (Felipe)
. Fixed bug #54585 (track_errors causes segfault). (Dmitry)
. Fixed bug #54423 (classes from dl()'ed extensions are not destroyed).
(Tony, Dmitry)
. Fixed bug #54372 (Crash accessing global object itself returned from its
__get() handle). (Dmitry)
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
. Fixed bug #54367 (Use of closure causes problem in ArrayAccess). (Dmitry)
. Fixed bug #54039 (use() of static variables in lambda functions can break
staticness). (Dmitry)
. Fixed bug #54262 (Crash when assigning value to a dimension in a non-array).
(Dmitry)
- Core:
. Implemented FR #54459 (Range function accuracy). (Adam)
. Added PHP_MANDIR constant telling where the manpages were installed into,
and an --man-dir argument to php-config. (Hannes)
. Fixed a crash inside dtor for error handling. (Ilia)
. Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload
filename). (Felipe) Reported by Krzysztof Kotowicz. (CVE-2011-2202)
. Fixed bug #54935 php_win_err can lead to crash. (Pierre)
. Fixed bug #54924 (assert.* is not being reset upon request shutdown). (Ilia)
. Fixed bug #54895 (Fix compiling with older gcc version without need for
membar_producer macro). (mhei at heimpold dot de)
. Fixed bug #54723 (getimagesize() doesn't check the full ico signature).
(Scott)
. Fixed bug #54580 (get_browser() segmentation fault when browscap ini
directive is set through php_admin_value). (Gustavo)
. Fixed bug #54238 (use-after-free in substr_replace()). (Stas)
(CVE-2011-1148)
. Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment).
(tomas dot brastavicius at quantum dot lt, Pierrick)
. Fixed bug #54137 (file_get_contents POST request sends additional line
break). (maurice-php at mertinkat dot net, Ilia)
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
(Dustin Ward)
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
size). (Pierre, os at irj dot ru)
. Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). (Ilia)
. Alternative fix for bug #52550, as applied to the round() function (signed
overflow), as the old fix impacted the algorithm for numbers with magnitude
smaller than 0. (Gustavo)
. Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). (Ilia)
. Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode
filter). (slusarz at curecanti dot org)
. Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
TMPDIR on Windows). (Pierre)
- Apache2 Handler SAPI:
. Fixed bug #54529 (SAPI crashes on apache_config.c:197).
(hebergement at riastudio dot fr)
- CLI SAPI:
. Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia)
- cURL:
. Added ini option curl.cainfo (support for custom cert db). (Pierre)
. Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre)
. Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick)
- DateTime extension:
. Fixed bug #54340 (DateTime::add() method bug). (Adam)
. Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|'
correctly). (Adam)
. Fixed bug #54283 (new DatePeriod(NULL) causes crash). (Felipe)
. Fixed bug #51819 (Case discrepancy in timezone names cause Uncaught
exception and fatal error). (Hannes)
- DBA extension:
. Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe)
- Exif extesion:
. Fixed bug #54121 (error message format string typo). (Ilia)
- Fileinfo extension:
. Fixed bug #54934 (Unresolved symbol strtoull in HP-UX 11.11). (Felipe)
- Filter extension:
. Added 3rd parameter to filter_var_array() and filter_input_array()
functions that allows disabling addition of empty elements. (Ilia)
. Fixed bug #53037 (FILTER_FLAG_EMPTY_STRING_NULL is not implemented). (Ilia)
- Interbase extension:
. Fixed bug #54269 (Short exception message buffer causes crash). (Felipe)
- intl extension:
. Implemented FR #54540 (Allow loading of arbitrary resource bundles when
fallback is disabled). (David Zuelke, Stas)
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
- json extension:
. Fixed bug #54484 (Empty string in json_decode doesn't reset
json_last_error()). (Ilia)
- LDAP extension:
. Fixed bug #53339 (Fails to build when compilng with gcc 4.5 and DSO
libraries). (Clint Byrum, Raphael)
- libxml extension:
. Fixed bug #54601 (Removing the doctype node segfaults). (Hannes)
. Fixed bug #54440 (libxml extension ignores default context). (Gustavo)
- mbstring extension:
. Fixed bug #54494 (mb_substr() mishandles UTF-32LE and UCS-2LE). (Gustavo)
- MySQL Improved extension:
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
(Andrey)
- mysqlnd
. Fixed crash when using more than 28,000 bound parameters. Workaround is to
set mysqlnd.net_cmd_buffer_size to at least 9000. (Andrey)
. Fixed bug #54674 mysqlnd valid_sjis_(head|tail) is using invalid operator
and range). (nihen at megabbs dot com, Andrey)
- OpenSSL extension
. Fixed bug #54992 (Stream not closed and error not returned when SSL
CN_match fails). (Gustavo, laird_ngrps at dodo dot com dot au)
- Oracle Database extension (OCI8):
. Added oci_client_version() returning the runtime Oracle client library
version (Chris Jones)
- PDO extension:
. Fixed bug #54929 (Parse error with single quote in sql comment). (Felipe)
. Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE
settings). (Ilia)
- PDO DBlib driver:
. Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field).
(mjh at hodginsmedia dot com, Felipe)
- PDO MySQL driver:
. Fixed bug #54644 (wrong pathes in php_pdo_mysql_int.h). (Tony, Johannes)
. Fixed bug #53782 (foreach throws irrelevant exception). (Johannes, Andrey)
. Implemented FR #48587 (MySQL PDO driver doesn't support SSL connections).
(Rob)
- PDO PostgreSQL driver:
. Fixed bug #54318 (Non-portable grep option used in PDO pgsql
configuration). (bwalton at artsci dot utoronto dot ca)
- PDO Oracle driver:
. Fixed bug #44989 (64bit Oracle RPMs still not supported by pdo-oci).
(jbnance at tresgeek dot net)
- Phar extension:
. Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters).
(Felipe)
- PHP-FPM SAPI:
. Added xml format to the status page. (fat)
. Removed timestamp in logs written by children processes. (fat)
. Fixed exit at FPM startup on fpm_resources_prepare() errors. (fat)
. Added master rlimit_files and rlimit_core in the global configuration
settings. (fat)
. Removed pid in debug logs written by chrildren processes. (fat)
. Added custom access log (also added per request %CPU and memory
mesurement). (fat)
. Added a real scoreboard and several improvements to the status page. (fat)
- Reflection extension:
. Fixed bug #54347 (reflection_extension does not lowercase module function
name). (Felipe, laruence at yahoo dot com dot cn)
- SOAP extension:
. Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org)
- Sockets extension:
. Fixed stack buffer overflow in socket_connect(). (CVE-2011-1938)
Found by Mateusz Kocielski, Marek Kroemeke and Filip Palian. (Felipe)
. Changed socket_set_block() and socket_set_nonblock() so they emit warnings
on error. (Gustavo)
. Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo)
- SPL extension:
. Fixed bug #54970 (SplFixedArray::setSize() isn't resizing). (Felipe)
. Fixed bug #54609 (Certain implementation(s) of SplFixedArray cause hard
crash). (Felipe)
. Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and
SplTempFileObject crash when user-space classes don't call the paren
constructor). (Gustavo)
. Fixed bug #54292 (Wrong parameter causes crash in
SplFileObject::__construct()). (Felipe)
. Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting
with \0). (Gustavo)
. Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator).
(Felipe)
- Streams:
. Fixed bug #54946 (stream_get_contents infinite loop). (Hannes)
. Fixed bug #54623 (Segfault when writing to a persistent socket after
closing a copy of the socket). (Gustavo)
. Zip extension:
. Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe)
17 Mar 2011, PHP 5.3.6
- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia)
- Upgraded bundled PCRE to version 8.11. (Ilia)
@@ -8,6 +239,8 @@
. Indirect reference to $this fails to resolve if direct $this is never used
in method. (Scott)
. Added options to debug backtrace functions. (Stas)
. Fixed bug numerous crashes due to setlocale (crash on error, pcre, mysql
etc.) on Windows in thread safe mode. (Pierre)
. Fixed Bug #53971 (isset() and empty() produce apparently spurious runtime
error). (Dmitry)
. Fixed Bug #53958 (Closures can't 'use' shared variables by value and by
@@ -16,12 +249,16 @@
. Fixed Bug #51458 (Lack of error context with nested exceptions). (Stas)
. Fixed Bug #47143 (Throwing an exception in a destructor causes a fatal
error). (Stas)
. Fixed bug #43512 (same parameter name can be used multiple times in
method/function definition). (Felipe)
- Core:
. Added ability to connect to HTTPS sites through proxy with basic
authentication using stream_context/http/header/Proxy-Authorization (Dmitry)
. Changed default value of ini directive serialize_precision from 100 to 17.
(Gustavo)
. Fixed bug #54055 (buffer overrun with high values for precision ini
setting). (Gustavo)
. Fixed bug #53959 (reflection data for fgetcsv out-of-date). (Richard)
. Fixed bug #53577 (Regression introduced in 5.3.4 in open_basedir with a
trailing forward slash). (lekensteyn at gmail dot com, Pierre)
@@ -53,6 +290,10 @@
. Fixed bug #52063 (DateTime constructor's second argument doesn't have a
null default value). (Gustavo, Stas)
- Exif extension:
. Fixed bug #54002 (crash on crafted tag, reported by Luca Carettoni).
(Pierre) (CVE-2011-0708)
- Filter extension:
. Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number).
(Ilia, Gustavo)
@@ -107,6 +348,8 @@
- OpenSSL extension:
. Fixed stream_socket_enable_crypto() not honoring the socket timeout in
server mode. (Gustavo)
. Fixed bug #54060 (Memory leaks when openssl_encrypt). (Pierre)
. Fixed bug #54061 (Memory leaks when openssl_decrypt). (Pierre)
. Fixed bug #53592 (stream_socket_enable_crypto() busy-waits in client mode).
(Gustavo)
. Implemented FR #53447 (Cannot disable SessionTicket extension for servers
@@ -128,6 +371,8 @@
(gyp at balabit dot hu)
- Phar extension:
. Fixed bug #54247 (format-string vulnerability on Phar). (Felipe)
(CVE-2011-1153)
. Fixed bug #53541 (format string bug in ext/phar).
(crrodriguez at opensuse dot org, Ilia)
. Fixed bug #53898 (PHAR reports invalid error message, when the directory
@@ -148,6 +393,10 @@
. Fixed bug #53915 (ReflectionClass::getConstant(s) emits fatal error on
constants with self::). (Gustavo)
- Shmop extension:
. Fixed bug #54193 (Integer overflow in shmop_read()). (Felipe)
Reported by Jose Carlos Norte <jose at eyeos dot org> (CVE-2011-1092)
- SNMP extension:
. Fixed bug #51336 (snmprealwalk (snmp v1) does not handle end of OID tree
correctly). (Boris Lytochkin)
@@ -157,9 +406,14 @@
(Mateusz Kocielski, Pierre)
- SPL extension:
. Fixed memory leak in DirectoryIterator::getExtension() and
SplFileInfo::getExtension(). (Felipe)
. Fixed bug #53914 (SPL assumes HAVE_GLOB is defined). (Chris Jones)
. Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0
values). (Felipe)
. Fixed bug #49608 (Using CachingIterator on DirectoryIterator instance
segfaults). (Felipe)
. Added SplFileInfo::getExtension(). FR #48767. (Peter Cowburn)
- SQLite3 extension:
@@ -173,12 +427,18 @@
all of the rows have been fetched). (Scott)
- Streams:
. Fixed bug #54092 (Segmentation fault when using HTTP proxy with the FTP
wrapper). (Gustavo)
. Fixed bug #53913 (Streams functions assume HAVE_GLOB is defined). (Chris
Jones)
. Fixed bug #53903 (userspace stream stat callback does not separate the
elements of the returned array before converting them). (Gustavo)
. Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo)
- Tokenizer Extension
. Fixed bug #54089 (token_get_all() does not stop after __halt_compiler).
(Ilia)
- XSL extension:
. Fixed memory leaked introduced by the NULL poisoning patch.
(Mateusz Kocielski, Pierre)
+10 -14
View File
@@ -100,16 +100,14 @@ 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).
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")
b. ``$CURRENT_QA_RELEASE_4`` = "4.4.7RC1" (``$CURRENT_QA_RELEASE_5`` for PHP5)
c. ``$RELEASE_PROCESS`` = array(4 => true, 5 => true)
Note: Remember to update the MD5 checksum information.
1. Update in ``php-bugs/trunk/include/functions.inc`` the ``show_version_option``
function to include the new RC and commit.
@@ -244,13 +242,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)
--------------------------------------
+17 -2
View File
@@ -629,7 +629,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 {
@@ -704,7 +711,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) {
@@ -1079,6 +1093,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;
}
}
+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
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #54013 (ReflectionParam for duplicate parameter contains garbage)
--FILE--
<?php
class a
{
function b($aaaaaaaa, $aaaaaaaa)
{
$params = func_get_args();
}
}
$c = new a;
$c->b('waa?', 'meukee!');
$reflectionClass = new ReflectionClass($c);
$params = $reflectionClass->getMethod('b')->getParameters();
var_dump($params[0], $params[1]);
?>
--EXPECTF--
object(ReflectionParameter)#%d (1) {
["name"]=>
string(8) "aaaaaaaa"
}
object(ReflectionParameter)#%d (1) {
["name"]=>
string(8) "aaaaaaaa"
}
+58
View File
@@ -0,0 +1,58 @@
--TEST--
Bug #54039 (use() of static variables in lambda functions can break staticness)
--FILE--
<?php
function test_1() {
static $v = 0;
++$v;
echo "Outer function increments \$v to $v\n";
$f = function() use($v) {
echo "Inner function reckons \$v is $v\n";
};
return $f;
}
$f = test_1(); $f();
$f = test_1(); $f();
function test_2() {
static $v = 0;
$f = function() use($v) {
echo "Inner function reckons \$v is $v\n";
};
++$v;
echo "Outer function increments \$v to $v\n";
return $f;
}
$f = test_2(); $f();
$f = test_2(); $f();
function test_3() {
static $v = "";
$v .= 'b';
echo "Outer function catenates 'b' onto \$v to give $v\n";
$f = function() use($v) {
echo "Inner function reckons \$v is $v\n";
};
$v .= 'a';
echo "Outer function catenates 'a' onto \$v to give $v\n";
return $f;
}
$f = test_3(); $f();
$f = test_3(); $f();
--EXPECT--
Outer function increments $v to 1
Inner function reckons $v is 1
Outer function increments $v to 2
Inner function reckons $v is 2
Outer function increments $v to 1
Inner function reckons $v is 0
Outer function increments $v to 2
Inner function reckons $v is 1
Outer function catenates 'b' onto $v to give b
Outer function catenates 'a' onto $v to give ba
Inner function reckons $v is b
Outer function catenates 'b' onto $v to give bab
Outer function catenates 'a' onto $v to give baba
Inner function reckons $v is bab
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #54262 (Crash when assigning value to a dimension in a non-array)
--FILE--
<?php
$a = '0';
var_dump(isset($a['b']));
$simpleString = preg_match('//', '', $a->a);
$simpleString["wrong"] = "f";
echo "ok\n";
?>
--EXPECTF--
bool(true)
Warning: Attempt to modify property of non-object in %s/Zend/tests/bug54262.php on line 4
Warning: Cannot use a scalar value as an array in %s/Zend/tests/bug54262.php on line 5
ok
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #54265 (crash when variable gets reassigned in error handler)
--FILE--
<?php
function my_errorhandler($errno,$errormsg) {
global $my_var;
$my_var = 0;
echo "EROOR: $errormsg\n";
}
set_error_handler("my_errorhandler");
$my_var = str_repeat("A",$my_var[0]->errormsg = "xyz");
echo "ok\n";
?>
--EXPECT--
EROOR: Creating default object from empty value
ok
+35
View File
@@ -0,0 +1,35 @@
--TEST--
Bug #54268 (Double free when destroy_zend_class fails)
--INI--
memory_limit=8M
--SKIPIF--
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
}
?>
--FILE--
<?php
class DestructableObject
{
public function __destruct()
{
DestructableObject::__destruct();
}
}
class DestructorCreator
{
public function __destruct()
{
$this->test = new DestructableObject;
}
}
class Test
{
public static $mystatic;
}
$x = new Test();
Test::$mystatic = new DestructorCreator();
--EXPECTF--
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
+39
View File
@@ -0,0 +1,39 @@
--TEST--
Bug #54358 (Closure, use and reference)
--FILE--
<?php
class asserter {
public function call($function) {
}
}
$asserter = new asserter();
$closure = function() use ($asserter, &$function) {
$asserter->call($function = 'md5');
};
$closure();
var_dump($function);
$closure = function() use ($asserter, $function) {
$asserter->call($function);
};
$closure();
var_dump($function);
$closure = function() use ($asserter, $function) {
$asserter->call($function);
};
$closure();
var_dump($function);
?>
--EXPECT--
string(3) "md5"
string(3) "md5"
string(3) "md5"
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #54367 (Use of closure causes problem in ArrayAccess)
--FILE--
<?php
class MyObjet implements ArrayAccess
{
public function offsetSet($offset, $value) { }
public function offsetExists($offset) { }
public function offsetUnset($offset) { }
public function offsetGet ($offset)
{
return function ($var) use ($offset) { // here is the problem
var_dump($offset, $var);
};
}
}
$a = new MyObjet();
echo $a['p']('foo');
?>
--EXPECT--
string(1) "p"
string(3) "foo"
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #54372 (Crash accessing global object itself returned from its __get() handle)
--FILE--
<?php
class test_class
{
public function __get($name)
{
return $this;
}
public function b()
{
echo "ok\n";
}
}
global $test3;
$test3 = new test_class();
$test3->a->b();
?>
--EXPECT--
ok
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #54585 (track_errors causes segfault)
--INI--
track_errors=On
--FILE--
<?php
function testing($source) {
unset($source[$cos]);
}
testing($_GET);
echo "ok\n";
?>
--EXPECTF--
Notice: Undefined variable: cos in %sbug54585.php on line 3
ok
+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.
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
concat difffent types
concat different types
--INI--
precision=14
--FILE--
+1 -1
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);
+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
+1
View File
@@ -808,6 +808,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);
+22
View File
@@ -2082,6 +2082,22 @@ ZEND_API int zend_get_module_started(const char *module_name) /* {{{ */
}
/* }}} */
static int clean_module_class(const zend_class_entry **ce, int *module_number TSRMLS_DC) /* {{{ */
{
if ((*ce)->type == ZEND_INTERNAL_CLASS && (*ce)->module->module_number == *module_number) {
return ZEND_HASH_APPLY_REMOVE;
} else {
return ZEND_HASH_APPLY_KEEP;
}
}
/* }}} */
static void clean_module_classes(int module_number TSRMLS_DC) /* {{{ */
{
zend_hash_apply_with_argument(EG(class_table), (apply_func_arg_t) clean_module_class, (void *) &module_number TSRMLS_CC);
}
/* }}} */
void module_destructor(zend_module_entry *module) /* {{{ */
{
TSRMLS_FETCH();
@@ -2089,6 +2105,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
if (module->type == MODULE_TEMPORARY) {
zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
clean_module_constants(module->module_number TSRMLS_CC);
clean_module_classes(module->module_number TSRMLS_CC);
}
if (module->module_started && module->module_shutdown_func) {
@@ -2573,6 +2590,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);
}
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@
int zend_startup_builtin_functions(TSRMLS_D);
BEGIN_EXTERN_C()
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int provide_object TSRMLS_DC);
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options TSRMLS_DC);
END_EXTERN_C()
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
+2
View File
@@ -347,6 +347,7 @@ static int zval_copy_static_var(zval **p TSRMLS_DC, int num_args, va_list args,
} else if (Z_ISREF_PP(p)) {
ALLOC_INIT_ZVAL(tmp);
*tmp = **p;
zval_copy_ctor(tmp);
Z_SET_REFCOUNT_P(tmp, 0);
Z_UNSET_ISREF_P(tmp);
} else {
@@ -372,6 +373,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func TSRMLS_DC) /* {
closure = (zend_closure *)zend_object_store_get_object(res TSRMLS_CC);
closure->func = *func;
closure->func.common.prototype = NULL;
if (closure->func.type == ZEND_USER_FUNCTION) {
if (closure->func.op_array.static_variables) {
+30 -14
View File
@@ -387,6 +387,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
result->op_type = IS_CV;
result->u.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len);
result->u.EA.type = 0;
varname->u.constant.value.str.val = CG(active_op_array)->vars[result->u.var].name;
return;
}
}
@@ -2528,7 +2529,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;
@@ -2571,11 +2572,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 ||
(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) {
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) {
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].array_type_hint != proto->common.arg_info[i].array_type_hint) {
@@ -2667,11 +2681,11 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
}
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);
}
}
@@ -3748,6 +3762,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);
}
}
/* }}} */
@@ -4896,14 +4914,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;
opline->op1.u.constant = CG(declarables).ticks;
opline->op1.op_type = IS_CONST;
SET_UNUSED(opline->op2);
}
opline->opcode = ZEND_TICKS;
opline->op1.u.constant = CG(declarables).ticks;
opline->op1.op_type = IS_CONST;
SET_UNUSED(opline->op2);
}
/* }}} */
+1
View File
@@ -39,6 +39,7 @@
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count++); }
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->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() \
{ \
+14 -2
View File
@@ -536,10 +536,22 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
(Z_TYPE_P(object) == IS_BOOL && Z_LVAL_P(object) == 0) ||
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
object_init(*object_ptr);
object = *object_ptr;
Z_ADDREF_P(object);
zend_error(E_STRICT, "Creating default object from empty value");
if (Z_REFCOUNT_P(object) == 1) {
/* object was removed by error handler, nothing to assign to */
zval_ptr_dtor(&object);
if (retval) {
*retval = &EG(uninitialized_zval);
PZVAL_LOCK(*retval);
}
FREE_OP(free_value);
return;
}
Z_DELREF_P(object);
zval_dtor(object);
object_init(object);
} else {
zend_error(E_WARNING, "Attempt to assign property of non-object");
if (!RETURN_VALUE_UNUSED(result)) {
+13 -9
View File
@@ -296,7 +296,9 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
zend_hash_reverse_apply(EG(function_table), (apply_func_t) zend_cleanup_function_data TSRMLS_CC);
}
zend_hash_apply(EG(class_table), (apply_func_t) zend_cleanup_class_data TSRMLS_CC);
} zend_end_try();
zend_try {
zend_vm_stack_destroy(TSRMLS_C);
zend_objects_store_free_object_storage(&EG(objects_store) TSRMLS_CC);
@@ -431,26 +433,28 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
zval *zv = *zval_ptr;
#if DEBUG_ZEND>=2
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, Z_REFCOUNT_PP(zval_ptr), Z_REFCOUNT_PP(zval_ptr) - 1);
#endif
Z_DELREF_PP(zval_ptr);
if (Z_REFCOUNT_PP(zval_ptr) == 0) {
Z_DELREF_P(zv);
if (Z_REFCOUNT_P(zv) == 0) {
TSRMLS_FETCH();
if (*zval_ptr != &EG(uninitialized_zval)) {
GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
zval_dtor(*zval_ptr);
efree_rel(*zval_ptr);
if (zv != &EG(uninitialized_zval)) {
GC_REMOVE_ZVAL_FROM_BUFFER(zv);
zval_dtor(zv);
efree_rel(zv);
}
} else {
TSRMLS_FETCH();
if (Z_REFCOUNT_PP(zval_ptr) == 1) {
Z_UNSET_ISREF_PP(zval_ptr);
if (Z_REFCOUNT_P(zv) == 1) {
Z_UNSET_ISREF_P(zv);
}
GC_ZVAL_CHECK_POSSIBLE_ROOT(*zval_ptr);
GC_ZVAL_CHECK_POSSIBLE_ROOT(zv);
}
}
/* }}} */
+8 -10
View File
@@ -545,9 +545,15 @@ ZEND_API void zend_hash_clean(HashTable *ht)
IS_CONSISTENT(ht);
SET_INCONSISTENT(HT_CLEANING);
p = ht->pListHead;
memset(ht->arBuckets, 0, ht->nTableSize*sizeof(Bucket *));
ht->pListHead = NULL;
ht->pListTail = NULL;
ht->nNumOfElements = 0;
ht->nNextFreeElement = 0;
ht->pInternalPointer = NULL;
while (p != NULL) {
q = p;
p = p->pListNext;
@@ -559,14 +565,6 @@ ZEND_API void zend_hash_clean(HashTable *ht)
}
pefree(q, ht->persistent);
}
memset(ht->arBuckets, 0, ht->nTableSize*sizeof(Bucket *));
ht->pListHead = NULL;
ht->pListTail = NULL;
ht->nNumOfElements = 0;
ht->nNextFreeElement = 0;
ht->pInternalPointer = NULL;
SET_INCONSISTENT(HT_OK);
}
/* This function is used by the various apply() functions.
+3 -3
View File
@@ -211,7 +211,7 @@ inner_statement:
statement:
unticked_statement { zend_do_ticks(TSRMLS_C); }
unticked_statement { DO_TICKS(); }
| T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
;
@@ -291,11 +291,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(); }
;
+5 -1
View File
@@ -374,7 +374,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) /*
} else {
retval = &EG(uninitialized_zval_ptr);
}
zval_ptr_dtor(&object);
if (EXPECTED(*retval != object)) {
zval_ptr_dtor(&object);
} else {
Z_DELREF_P(object);
}
} else {
if (zobj->ce->__get && guard && guard->in_get == 1) {
if (Z_STRVAL_P(member)[0] == '\0') {
+78 -59
View File
@@ -2087,14 +2087,20 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
} else {
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP2_TYPE != IS_CONST &&
if (OP2_TYPE != IS_CONST && OP2_TYPE != IS_TMP_VAR &&
Z_TYPE_P(function_name) == IS_OBJECT &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
if (EX(object)) {
Z_ADDREF_P(EX(object));
}
FREE_OP2();
if (OP2_TYPE == IS_VAR && OP2_FREE &&
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
EX(fbc)->common.prototype = (zend_function*)function_name;
} else {
FREE_OP2();
}
ZEND_VM_NEXT_OPCODE();
}
@@ -2159,6 +2165,10 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
}
}
if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
zval_ptr_dtor((zval**)&op_array->prototype);
}
nested = EX(nested);
zend_vm_stack_free(execute_data TSRMLS_CC);
@@ -2694,10 +2704,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
}
if (OP1_TYPE == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
Z_DELREF_PP(varptr_ptr);
ALLOC_ZVAL(*varptr_ptr);
INIT_ZVAL(**varptr_ptr);
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
ALLOC_INIT_ZVAL(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
@@ -3220,59 +3229,67 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
}
return_value_used = RETURN_VALUE_USED(opline);
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
switch (Z_LVAL(opline->op2.u.constant)) {
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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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);
@@ -3421,12 +3438,14 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
zval *offset;
if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE != IS_VAR || container) {
if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
+317 -279
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2010 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 |
@@ -163,6 +163,10 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
}
}
if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
zval_ptr_dtor((zval**)&op_array->prototype);
}
nested = EX(nested);
zend_vm_stack_free(execute_data TSRMLS_CC);
@@ -750,14 +754,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
} else {
function_name = &opline->op2.u.constant;
if (IS_CONST != IS_CONST &&
if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR &&
Z_TYPE_P(function_name) == IS_OBJECT &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
if (EX(object)) {
Z_ADDREF_P(EX(object));
}
if (IS_CONST == IS_VAR && 0 &&
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
EX(fbc)->common.prototype = (zend_function*)function_name;
} else {
}
ZEND_VM_NEXT_OPCODE();
}
@@ -944,14 +954,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
} else {
function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_TMP_VAR != IS_CONST &&
if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR &&
Z_TYPE_P(function_name) == IS_OBJECT &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
if (EX(object)) {
Z_ADDREF_P(EX(object));
}
zval_dtor(free_op2.var);
if (IS_TMP_VAR == IS_VAR && 1 &&
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
EX(fbc)->common.prototype = (zend_function*)function_name;
} else {
zval_dtor(free_op2.var);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -1045,14 +1061,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
} else {
function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_VAR != IS_CONST &&
if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR &&
Z_TYPE_P(function_name) == IS_OBJECT &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
if (EX(object)) {
Z_ADDREF_P(EX(object));
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
if (IS_VAR == IS_VAR && (free_op2.var != NULL) &&
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
EX(fbc)->common.prototype = (zend_function*)function_name;
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
ZEND_VM_NEXT_OPCODE();
}
@@ -1169,14 +1191,20 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
} else {
function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (IS_CV != IS_CONST &&
if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR &&
Z_TYPE_P(function_name) == IS_OBJECT &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
if (EX(object)) {
Z_ADDREF_P(EX(object));
}
if (IS_CV == IS_VAR && 0 &&
EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
EX(fbc)->common.prototype = (zend_function*)function_name;
} else {
}
ZEND_VM_NEXT_OPCODE();
}
@@ -1881,69 +1909,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
return_value_used = RETURN_VALUE_USED(opline);
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==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);
}
goto done;
}
} else {
switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
switch (Z_LVAL(opline->op2.u.constant)) {
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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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()
}
}
done:
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
@@ -5166,69 +5191,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
return_value_used = RETURN_VALUE_USED(opline);
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==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);
}
goto done;
}
} else {
switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
switch (Z_LVAL(opline->op2.u.constant)) {
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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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()
}
}
done:
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
@@ -8364,10 +8386,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
if (IS_VAR == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
Z_DELREF_PP(varptr_ptr);
ALLOC_ZVAL(*varptr_ptr);
INIT_ZVAL(**varptr_ptr);
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
ALLOC_INIT_ZVAL(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
@@ -8547,69 +8568,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
return_value_used = RETURN_VALUE_USED(opline);
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==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);
}
goto done;
}
} else {
switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
switch (Z_LVAL(opline->op2.u.constant)) {
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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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()
}
}
done:
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
@@ -10731,12 +10749,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *offset = &opline->op2.u.constant;
zval *offset;
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = &opline->op2.u.constant;
if (IS_VAR != IS_VAR || container) {
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -12480,12 +12500,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_VAR != IS_VAR || container) {
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -14280,12 +14302,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_op *opline = EX(opline);
zend_free_op free_op1, free_op2;
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_VAR != IS_VAR || container) {
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -16666,12 +16690,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *offset;
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (IS_VAR != IS_VAR || container) {
if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -17858,12 +17884,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
zend_op *opline = EX(opline);
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = &opline->op2.u.constant;
zval *offset;
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = &opline->op2.u.constant;
if (IS_UNUSED != IS_VAR || container) {
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -18915,12 +18943,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_free_op free_op2;
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_UNUSED != IS_VAR || container) {
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -19972,12 +20002,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zend_op *opline = EX(opline);
zend_free_op free_op2;
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_UNUSED != IS_VAR || container) {
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -21288,12 +21320,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
zend_op *opline = EX(opline);
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *offset;
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (IS_UNUSED != IS_VAR || container) {
if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -22248,10 +22282,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
if (IS_CV == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
Z_DELREF_PP(varptr_ptr);
ALLOC_ZVAL(*varptr_ptr);
INIT_ZVAL(**varptr_ptr);
Z_SET_REFCOUNT_PP(varptr_ptr, 0);
ALLOC_INIT_ZVAL(varptr);
zend_vm_stack_push(varptr TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
@@ -22421,69 +22454,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
return_value_used = RETURN_VALUE_USED(opline);
if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE ||
Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==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);
}
goto done;
}
} else {
switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
zend_file_handle file_handle;
char *resolved_path;
switch (Z_LVAL(opline->op2.u.constant)) {
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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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, (Z_LVAL(opline->op2.u.constant)==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 (Z_LVAL(opline->op2.u.constant)==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(Z_LVAL(opline->op2.u.constant), 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()
}
}
done:
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
@@ -24298,12 +24328,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_op *opline = EX(opline);
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = &opline->op2.u.constant;
zval *offset;
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = &opline->op2.u.constant;
if (IS_CV != IS_VAR || container) {
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -25938,12 +25970,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_CV != IS_VAR || container) {
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -27628,12 +27662,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
zend_op *opline = EX(opline);
zend_free_op free_op2;
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
zval *offset;
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (IS_CV != IS_VAR || container) {
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
@@ -29805,12 +29841,14 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
zend_op *opline = EX(opline);
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *offset;
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (IS_CV != IS_VAR || container) {
if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) {
SEPARATE_ZVAL_IF_NOT_REF(container);
}
switch (Z_TYPE_PP(container)) {
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2010 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 |
+2 -1
View File
@@ -2398,6 +2398,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
])
LIBS=$old_LIBS
PHP_ADD_LIBRARY(ssl,,$1)
PHP_ADD_LIBRARY(crypto,,$1)
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
fi
@@ -2591,7 +2592,7 @@ dnl This macro is used to get a comparable
dnl version for apache1/2.
dnl
AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
ac_output=`$1 -v 2>&1 | grep version`
ac_output=`$1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'`
ac_IFS=$IFS
IFS="- /.
"
+13 -6
View File
@@ -42,14 +42,21 @@ echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.13 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."
if test "$1" = "2" -a "$2" -gt "59"; then
echo "buildconf: You need autoconf 2.59 or lower to build this version of PHP."
echo " You are currently trying to use $ac_version"
echo " Most distros have separate autoconf 2.13 or 2.59 packages."
echo " On Debian/Ubuntu both autoconf2.13 and autoconf2.59 packages exist."
echo " Install autoconf2.13 and set the PHP_AUTOCONF env var to "
echo " autoconf2.13 and try again."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
fi
if test "$1" = "2" -a "$2" -ge "50"; then
./vcsclean
stamp=
fi
+4 -2
View File
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=6
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="RC2"
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`
@@ -1156,6 +1156,7 @@ EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
EXPANDED_BINDIR=`eval echo $bindir`
EXPANDED_SBINDIR=`eval echo $sbindir`
EXPANDED_MANDIR=`eval echo $mandir`
EXPANDED_LIBDIR=$libdir
EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
EXPANDED_DATADIR=$datadir
@@ -1172,6 +1173,7 @@ AC_SUBST(EXPANDED_PEAR_INSTALLDIR)
AC_SUBST(EXPANDED_EXTENSION_DIR)
AC_SUBST(EXPANDED_BINDIR)
AC_SUBST(EXPANDED_SBINDIR)
AC_SUBST(EXPANDED_MANDIR)
AC_SUBST(EXPANDED_LIBDIR)
AC_SUBST(EXPANDED_DATADIR)
AC_SUBST(EXPANDED_SYSCONFDIR)
+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.
+45 -1
View File
@@ -331,6 +331,13 @@ zend_module_entry curl_module_entry = {
ZEND_GET_MODULE (curl)
#endif
/* {{{ PHP_INI_BEGIN */
PHP_INI_BEGIN()
PHP_INI_ENTRY("curl.cainfo", "", PHP_INI_SYSTEM, NULL)
PHP_INI_END()
/* }}} */
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(curl)
@@ -458,6 +465,8 @@ PHP_MINIT_FUNCTION(curl)
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl_multi", module_number);
REGISTER_INI_ENTRIES();
/* See http://curl.haxx.se/lxr/source/docs/libcurl/symbols-in-versions
or curl src/docs/libcurl/symbols-in-versions for a (almost) complete list
of options and which version they were introduced */
@@ -581,6 +590,11 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
#if LIBCURL_VERSION_NUM > 0x070f04 /* CURLOPT_MAX_RECV_SPEED_LARGE & CURLOPT_MAX_SEND_SPEED_LARGE are available since curl 7.15.5 */
REGISTER_CURL_CONSTANT(CURLOPT_MAX_RECV_SPEED_LARGE);
REGISTER_CURL_CONSTANT(CURLOPT_MAX_SEND_SPEED_LARGE);
#endif
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
/* http authentication options */
@@ -632,6 +646,10 @@ PHP_MINIT_FUNCTION(curl)
#if LIBCURL_VERSION_NUM > 0x071301
REGISTER_CURL_CONSTANT(CURLINFO_CERTINFO);
#endif
#if LIBCURL_VERSION_NUM >= 0x071202
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
#endif
/* cURL protocol constants (curl_version) */
REGISTER_CURL_CONSTANT(CURL_VERSION_IPV6);
@@ -879,6 +897,7 @@ PHP_MSHUTDOWN_FUNCTION(curl)
php_curl_openssl_tsl = NULL;
}
#endif
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
/* }}} */
@@ -1427,6 +1446,7 @@ PHP_FUNCTION(curl_init)
zval *clone;
char *url = NULL;
int url_len = 0;
char *cainfo;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
return;
@@ -1453,6 +1473,8 @@ PHP_FUNCTION(curl_init)
MAKE_STD_ZVAL(clone);
ch->clone = clone;
curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0);
curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str);
@@ -1465,6 +1487,12 @@ PHP_FUNCTION(curl_init)
curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
cainfo = INI_STR("curl.cainfo");
if (cainfo && strlen(cainfo) > 0) {
curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
}
#if defined(ZTS)
curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1);
#endif
@@ -1669,6 +1697,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#endif
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
break;
#if LIBCURL_VERSION_NUM > 0x070f04
case CURLOPT_MAX_RECV_SPEED_LARGE:
case CURLOPT_MAX_SEND_SPEED_LARGE:
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, (curl_off_t)Z_LVAL_PP(zvalue));
break;
#endif
case CURLOPT_FOLLOWLOCATION:
convert_to_long_ex(zvalue);
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
@@ -2305,6 +2340,11 @@ PHP_FUNCTION(curl_getinfo)
create_certinfo(ci, listcode TSRMLS_CC);
CAAZ("certinfo", listcode);
}
#endif
#if LIBCURL_VERSION_NUM >= 0x071202
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_URL, &s_code) == CURLE_OK) {
CAAS("redirect_url", s_code);
}
#endif
if (ch->header.str_len > 0) {
CAAS("request_header", ch->header.str);
@@ -2313,7 +2353,11 @@ PHP_FUNCTION(curl_getinfo)
switch (option) {
case CURLINFO_PRIVATE:
case CURLINFO_EFFECTIVE_URL:
case CURLINFO_CONTENT_TYPE: {
case CURLINFO_CONTENT_TYPE:
#if LIBCURL_VERSION_NUM >= 0x071202
case CURLINFO_REDIRECT_URL:
#endif
{
char *s_code = NULL;
if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) {
+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 {
+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;
}
+159 -113
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sat Nov 13 14:58:02 2010 */
/* Generated by re2c 0.13.5 on Sun Jun 5 15:26:42 2011 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -720,6 +721,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++) {
@@ -843,11 +863,11 @@ static int scan(Scanner *s)
std:
s->tok = cursor;
s->len = 0;
#line 969 "ext/date/lib/parse_date.re"
#line 989 "ext/date/lib/parse_date.re"
#line 851 "ext/date/lib/parse_date.c"
#line 871 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -967,7 +987,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
#line 1054 "ext/date/lib/parse_date.re"
#line 1074 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -983,7 +1003,7 @@ yy2:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 987 "ext/date/lib/parse_date.c"
#line 1007 "ext/date/lib/parse_date.c"
yy3:
YYDEBUG(3, *YYCURSOR);
++YYCURSOR;
@@ -1006,7 +1026,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
#line 1636 "ext/date/lib/parse_date.re"
#line 1656 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1019,7 +1039,7 @@ yy4:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1023 "ext/date/lib/parse_date.c"
#line 1043 "ext/date/lib/parse_date.c"
yy5:
YYDEBUG(5, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1330,12 +1350,12 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
#line 1731 "ext/date/lib/parse_date.re"
#line 1751 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1339 "ext/date/lib/parse_date.c"
#line 1359 "ext/date/lib/parse_date.c"
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2392,11 +2412,11 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
#line 1720 "ext/date/lib/parse_date.re"
#line 1740 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2400 "ext/date/lib/parse_date.c"
#line 2420 "ext/date/lib/parse_date.c"
yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2405,12 +2425,12 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
#line 1725 "ext/date/lib/parse_date.re"
#line 1745 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2414 "ext/date/lib/parse_date.c"
#line 2434 "ext/date/lib/parse_date.c"
yy54:
YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2797,7 +2817,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
#line 1704 "ext/date/lib/parse_date.re"
#line 1724 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2812,7 +2832,7 @@ yy73:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2816 "ext/date/lib/parse_date.c"
#line 2836 "ext/date/lib/parse_date.c"
yy74:
YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3574,7 +3594,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
#line 1567 "ext/date/lib/parse_date.re"
#line 1587 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3591,7 +3611,7 @@ yy167:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3595 "ext/date/lib/parse_date.c"
#line 3615 "ext/date/lib/parse_date.c"
yy168:
YYDEBUG(168, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4111,7 +4131,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
#line 1626 "ext/date/lib/parse_date.re"
#line 1646 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4120,7 +4140,7 @@ yy194:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4124 "ext/date/lib/parse_date.c"
#line 4144 "ext/date/lib/parse_date.c"
yy195:
YYDEBUG(195, *YYCURSOR);
++YYCURSOR;
@@ -4171,7 +4191,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
#line 1376 "ext/date/lib/parse_date.re"
#line 1396 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datetextual | datenoyear");
TIMELIB_INIT;
@@ -4183,7 +4203,7 @@ yy199:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4187 "ext/date/lib/parse_date.c"
#line 4207 "ext/date/lib/parse_date.c"
yy200:
YYDEBUG(200, *YYCURSOR);
yyaccept = 6;
@@ -4452,7 +4472,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
#line 1674 "ext/date/lib/parse_date.re"
#line 1694 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4481,7 +4501,7 @@ yy223:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4485 "ext/date/lib/parse_date.c"
#line 4505 "ext/date/lib/parse_date.c"
yy224:
YYDEBUG(224, *YYCURSOR);
yyaccept = 7;
@@ -5179,7 +5199,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
#line 1650 "ext/date/lib/parse_date.re"
#line 1670 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5202,7 +5222,7 @@ yy278:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5206 "ext/date/lib/parse_date.c"
#line 5226 "ext/date/lib/parse_date.c"
yy280:
YYDEBUG(280, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5380,7 +5400,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1350 "ext/date/lib/parse_date.re"
#line 1370 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoday");
TIMELIB_INIT;
@@ -5392,7 +5412,7 @@ yy295:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5396 "ext/date/lib/parse_date.c"
#line 5416 "ext/date/lib/parse_date.c"
yy296:
YYDEBUG(296, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6612,7 +6632,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
#line 1490 "ext/date/lib/parse_date.re"
#line 1510 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextshort");
TIMELIB_INIT;
@@ -6624,7 +6644,7 @@ yy364:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6628 "ext/date/lib/parse_date.c"
#line 6648 "ext/date/lib/parse_date.c"
yy365:
YYDEBUG(365, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7262,7 +7282,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
#line 1546 "ext/date/lib/parse_date.re"
#line 1566 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -7282,7 +7302,7 @@ yy393:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7286 "ext/date/lib/parse_date.c"
#line 7306 "ext/date/lib/parse_date.c"
yy394:
YYDEBUG(394, *YYCURSOR);
yyaccept = 5;
@@ -9032,7 +9052,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
#line 1260 "ext/date/lib/parse_date.re"
#line 1280 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9043,7 +9063,7 @@ yy455:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9047 "ext/date/lib/parse_date.c"
#line 9067 "ext/date/lib/parse_date.c"
yy456:
YYDEBUG(456, *YYCURSOR);
yyaccept = 0;
@@ -9603,7 +9623,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
#line 1389 "ext/date/lib/parse_date.re"
#line 1409 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9614,7 +9634,7 @@ yy476:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9618 "ext/date/lib/parse_date.c"
#line 9638 "ext/date/lib/parse_date.c"
yy477:
YYDEBUG(477, *YYCURSOR);
yyaccept = 10;
@@ -9755,7 +9775,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
#line 1116 "ext/date/lib/parse_date.re"
#line 1136 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9771,7 +9791,7 @@ yy488:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9775 "ext/date/lib/parse_date.c"
#line 9795 "ext/date/lib/parse_date.c"
yy490:
YYDEBUG(490, *YYCURSOR);
yyaccept = 11;
@@ -9784,7 +9804,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
#line 1153 "ext/date/lib/parse_date.re"
#line 1173 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9809,7 +9829,7 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9813 "ext/date/lib/parse_date.c"
#line 9833 "ext/date/lib/parse_date.c"
yy492:
YYDEBUG(492, *YYCURSOR);
yyaccept = 11;
@@ -10119,7 +10139,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
#line 1133 "ext/date/lib/parse_date.re"
#line 1153 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10138,7 +10158,7 @@ yy523:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10142 "ext/date/lib/parse_date.c"
#line 10162 "ext/date/lib/parse_date.c"
yy525:
YYDEBUG(525, *YYCURSOR);
yyaccept = 11;
@@ -10244,7 +10264,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
#line 1311 "ext/date/lib/parse_date.re"
#line 1331 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datefull");
TIMELIB_INIT;
@@ -10257,7 +10277,7 @@ yy535:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10261 "ext/date/lib/parse_date.c"
#line 10281 "ext/date/lib/parse_date.c"
yy536:
YYDEBUG(536, *YYCURSOR);
yych = *++YYCURSOR;
@@ -10994,7 +11014,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
#line 1325 "ext/date/lib/parse_date.re"
#line 1345 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11005,7 +11025,7 @@ yy605:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11009 "ext/date/lib/parse_date.c"
#line 11029 "ext/date/lib/parse_date.c"
yy608:
YYDEBUG(608, *YYCURSOR);
yyaccept = 11;
@@ -11041,7 +11061,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
#line 1337 "ext/date/lib/parse_date.re"
#line 1357 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YY");
TIMELIB_INIT;
@@ -11053,7 +11073,7 @@ yy612:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11057 "ext/date/lib/parse_date.c"
#line 11077 "ext/date/lib/parse_date.c"
yy613:
YYDEBUG(613, *YYCURSOR);
yyaccept = 11;
@@ -11694,7 +11714,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
#line 1298 "ext/date/lib/parse_date.re"
#line 1318 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnudateshort");
TIMELIB_INIT;
@@ -11706,7 +11726,7 @@ yy657:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11710 "ext/date/lib/parse_date.c"
#line 11730 "ext/date/lib/parse_date.c"
yy658:
YYDEBUG(658, *YYCURSOR);
yyaccept = 13;
@@ -11812,7 +11832,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
#line 1245 "ext/date/lib/parse_date.re"
#line 1265 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("americanshort | american");
TIMELIB_INIT;
@@ -11826,7 +11846,7 @@ yy667:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11830 "ext/date/lib/parse_date.c"
#line 11850 "ext/date/lib/parse_date.c"
yy668:
YYDEBUG(668, *YYCURSOR);
yyaccept = 14;
@@ -12059,7 +12079,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
#line 1516 "ext/date/lib/parse_date.re"
#line 1536 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12079,7 +12099,7 @@ yy701:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12083 "ext/date/lib/parse_date.c"
#line 12103 "ext/date/lib/parse_date.c"
yy702:
YYDEBUG(702, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12631,7 +12651,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
#line 1272 "ext/date/lib/parse_date.re"
#line 1292 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date2");
TIMELIB_INIT;
@@ -12643,7 +12663,7 @@ yy764:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12647 "ext/date/lib/parse_date.c"
#line 12667 "ext/date/lib/parse_date.c"
yy765:
YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12682,7 +12702,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
#line 1503 "ext/date/lib/parse_date.re"
#line 1523 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_INIT;
@@ -12694,7 +12714,7 @@ yy771:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12698 "ext/date/lib/parse_date.c"
#line 12718 "ext/date/lib/parse_date.c"
yy773:
YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12832,7 +12852,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
#line 1537 "ext/date/lib/parse_date.re"
#line 1557 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12840,7 +12860,7 @@ yy784:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12844 "ext/date/lib/parse_date.c"
#line 12864 "ext/date/lib/parse_date.c"
yy785:
YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12991,7 +13011,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
#line 1363 "ext/date/lib/parse_date.re"
#line 1383 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenodayrev");
TIMELIB_INIT;
@@ -13003,7 +13023,7 @@ yy794:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 13007 "ext/date/lib/parse_date.c"
#line 13027 "ext/date/lib/parse_date.c"
yy795:
YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13218,7 +13238,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
#line 1471 "ext/date/lib/parse_date.re"
#line 1491 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13236,7 +13256,7 @@ yy815:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13240 "ext/date/lib/parse_date.c"
#line 13260 "ext/date/lib/parse_date.c"
yy816:
YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13246,7 +13266,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
#line 1452 "ext/date/lib/parse_date.re"
#line 1472 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13264,7 +13284,7 @@ yy817:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13268 "ext/date/lib/parse_date.c"
#line 13288 "ext/date/lib/parse_date.c"
yy819:
YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13328,7 +13348,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
#line 1439 "ext/date/lib/parse_date.re"
#line 1459 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgydotd");
TIMELIB_INIT;
@@ -13340,7 +13360,7 @@ yy822:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13344 "ext/date/lib/parse_date.c"
#line 13364 "ext/date/lib/parse_date.c"
yy823:
YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13443,7 +13463,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
#line 1413 "ext/date/lib/parse_date.re"
#line 1433 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13468,7 +13488,7 @@ yy843:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13472 "ext/date/lib/parse_date.c"
#line 13492 "ext/date/lib/parse_date.c"
yy844:
YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13730,7 +13750,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1401 "ext/date/lib/parse_date.re"
#line 1421 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -13741,7 +13761,7 @@ yy849:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13745 "ext/date/lib/parse_date.c"
#line 13765 "ext/date/lib/parse_date.c"
yy850:
YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
@@ -14661,7 +14681,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
#line 1285 "ext/date/lib/parse_date.re"
#line 1305 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnudateshorter");
TIMELIB_INIT;
@@ -14673,7 +14693,7 @@ yy974:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14677 "ext/date/lib/parse_date.c"
#line 14697 "ext/date/lib/parse_date.c"
yy975:
YYDEBUG(975, *YYCURSOR);
yyaccept = 22;
@@ -15682,7 +15702,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
#line 1179 "ext/date/lib/parse_date.re"
#line 1199 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15704,7 +15724,7 @@ yy1068:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15708 "ext/date/lib/parse_date.c"
#line 15728 "ext/date/lib/parse_date.c"
yy1069:
YYDEBUG(1069, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15796,7 +15816,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
#line 1225 "ext/date/lib/parse_date.re"
#line 1245 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -15815,7 +15835,7 @@ yy1076:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15819 "ext/date/lib/parse_date.c"
#line 15839 "ext/date/lib/parse_date.c"
yy1077:
YYDEBUG(1077, *YYCURSOR);
yyaccept = 25;
@@ -16713,7 +16733,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
#line 1609 "ext/date/lib/parse_date.re"
#line 1629 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16729,7 +16749,7 @@ yy1118:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16733 "ext/date/lib/parse_date.c"
#line 16753 "ext/date/lib/parse_date.c"
yy1119:
YYDEBUG(1119, *YYCURSOR);
++YYCURSOR;
@@ -16780,7 +16800,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
#line 1094 "ext/date/lib/parse_date.re"
#line 1114 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16801,7 +16821,7 @@ yy1126:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16805 "ext/date/lib/parse_date.c"
#line 16825 "ext/date/lib/parse_date.c"
yy1128:
YYDEBUG(1128, *YYCURSOR);
yyaccept = 26;
@@ -16909,7 +16929,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
#line 1585 "ext/date/lib/parse_date.re"
#line 1605 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16932,7 +16952,7 @@ yy1142:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16936 "ext/date/lib/parse_date.c"
#line 16956 "ext/date/lib/parse_date.c"
yy1143:
YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
@@ -19609,7 +19629,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
#line 1071 "ext/date/lib/parse_date.re"
#line 1091 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -19631,7 +19651,7 @@ yy1295:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19635 "ext/date/lib/parse_date.c"
#line 19655 "ext/date/lib/parse_date.c"
yy1296:
YYDEBUG(1296, *YYCURSOR);
yyaccept = 28;
@@ -21322,7 +21342,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1029 "ext/date/lib/parse_date.re"
#line 1049 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -21346,7 +21366,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21350 "ext/date/lib/parse_date.c"
#line 21370 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21782,7 +21802,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 1017 "ext/date/lib/parse_date.re"
#line 1037 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -21793,7 +21813,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21797 "ext/date/lib/parse_date.c"
#line 21817 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21828,7 +21848,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 1007 "ext/date/lib/parse_date.re"
#line 1027 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -21837,7 +21857,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21841 "ext/date/lib/parse_date.c"
#line 21861 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23849,7 +23869,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 986 "ext/date/lib/parse_date.re"
#line 1006 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -23857,7 +23877,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23861 "ext/date/lib/parse_date.c"
#line 23881 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23996,7 +24016,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 995 "ext/date/lib/parse_date.re"
#line 1015 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -24007,7 +24027,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24011 "ext/date/lib/parse_date.c"
#line 24031 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24540,7 +24560,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 974 "ext/date/lib/parse_date.re"
#line 994 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -24551,7 +24571,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24555 "ext/date/lib/parse_date.c"
#line 24575 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24724,7 +24744,7 @@ yy1537:
goto yy1531;
}
}
#line 1735 "ext/date/lib/parse_date.re"
#line 1755 "ext/date/lib/parse_date.re"
}
@@ -24815,6 +24835,30 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
add_pbf_error(s, "Unexpected data found.", string, begin); \
}
static void timelib_time_reset_fields(timelib_time *time)
{
assert(time != NULL);
time->y = 1970;
time->m = 1;
time->d = 1;
time->h = time->i = time->s = 0;
time->f = 0.0;
time->tz_info = NULL;
}
static void timelib_time_reset_unset_fields(timelib_time *time)
{
assert(time != NULL);
if (time->y == TIMELIB_UNSET ) time->y = 1970;
if (time->m == TIMELIB_UNSET ) time->m = 1;
if (time->d == TIMELIB_UNSET ) time->d = 1;
if (time->h == TIMELIB_UNSET ) time->h = 0;
if (time->i == TIMELIB_UNSET ) time->i = 0;
if (time->s == TIMELIB_UNSET ) time->s = 0;
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
{
@@ -25013,23 +25057,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '!': /* reset all fields to default */
s->time->y = 1970;
s->time->m = 1;
s->time->d = 1;
s->time->h = s->time->i = s->time->s = 0;
s->time->f = 0.0;
s->time->tz_info = NULL;
timelib_time_reset_fields(s->time);
break; /* break intentionally not missing */
case '|': /* reset all fields to default when not set */
if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
timelib_time_reset_unset_fields(s->time);
break; /* break intentionally not missing */
case '?': /* random char */
@@ -25061,7 +25093,21 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
add_pbf_error(s, "Trailing data", string, ptr);
}
if (*fptr) {
add_pbf_error(s, "Data missing", string, ptr);
/* Trailing | and ! specifiers are valid. */
while (*fptr) {
switch (*fptr++) {
case '!': /* reset all fields to default */
timelib_time_reset_fields(s->time);
break;
case '|': /* reset all fields to default when not set */
timelib_time_reset_unset_fields(s->time);
break;
default:
add_pbf_error(s, "Data missing", string, ptr);
}
}
}
/* clean up a bit */
+61 -15
View File
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -718,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++) {
@@ -1822,6 +1842,30 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
add_pbf_error(s, "Unexpected data found.", string, begin); \
}
static void timelib_time_reset_fields(timelib_time *time)
{
assert(time != NULL);
time->y = 1970;
time->m = 1;
time->d = 1;
time->h = time->i = time->s = 0;
time->f = 0.0;
time->tz_info = NULL;
}
static void timelib_time_reset_unset_fields(timelib_time *time)
{
assert(time != NULL);
if (time->y == TIMELIB_UNSET ) time->y = 1970;
if (time->m == TIMELIB_UNSET ) time->m = 1;
if (time->d == TIMELIB_UNSET ) time->d = 1;
if (time->h == TIMELIB_UNSET ) time->h = 0;
if (time->i == TIMELIB_UNSET ) time->i = 0;
if (time->s == TIMELIB_UNSET ) time->s = 0;
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
{
@@ -2020,23 +2064,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '!': /* reset all fields to default */
s->time->y = 1970;
s->time->m = 1;
s->time->d = 1;
s->time->h = s->time->i = s->time->s = 0;
s->time->f = 0.0;
s->time->tz_info = NULL;
timelib_time_reset_fields(s->time);
break; /* break intentionally not missing */
case '|': /* reset all fields to default when not set */
if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
timelib_time_reset_unset_fields(s->time);
break; /* break intentionally not missing */
case '?': /* random char */
@@ -2068,7 +2100,21 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
add_pbf_error(s, "Trailing data", string, ptr);
}
if (*fptr) {
add_pbf_error(s, "Data missing", string, ptr);
/* Trailing | and ! specifiers are valid. */
while (*fptr) {
switch (*fptr++) {
case '!': /* reset all fields to default */
timelib_time_reset_fields(s->time);
break;
case '|': /* reset all fields to default when not set */
timelib_time_reset_unset_fields(s->time);
break;
default:
add_pbf_error(s, "Data missing", string, ptr);
}
}
}
/* clean up a bit */
+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++) {
+2
View File
@@ -26,6 +26,8 @@
#include <limits.h>
#endif
#define TIMELIB_VERSION 201101
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
#define TIMELIB_NO_CLONE 0x02
+1007 -1179
View File
File diff suppressed because it is too large. Load diff
+3 -5
View File
@@ -2860,14 +2860,13 @@ PHP_FUNCTION(date_add)
if (intobj->diff->invert) {
bias = -1;
}
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
dateobj->time->relative.y = intobj->diff->y * bias;
dateobj->time->relative.m = intobj->diff->m * bias;
dateobj->time->relative.d = intobj->diff->d * bias;
dateobj->time->relative.h = intobj->diff->h * bias;
dateobj->time->relative.i = intobj->diff->i * bias;
dateobj->time->relative.s = intobj->diff->s * bias;
dateobj->time->relative.weekday = 0;
dateobj->time->relative.have_weekday_relative = 0;
}
dateobj->time->have_relative = 1;
dateobj->time->sse_uptodate = 0;
@@ -2907,6 +2906,7 @@ PHP_FUNCTION(date_sub)
bias = -1;
}
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
@@ -2914,8 +2914,6 @@ PHP_FUNCTION(date_sub)
dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
dateobj->time->relative.s = 0 - (intobj->diff->s * bias);
dateobj->time->have_relative = 1;
dateobj->time->relative.weekday = 0;
dateobj->time->relative.have_weekday_relative = 0;
dateobj->time->sse_uptodate = 0;
timelib_update_ts(dateobj->time, NULL);
@@ -3769,7 +3767,7 @@ PHP_METHOD(DatePeriod, __construct)
dpobj = zend_object_store_get_object(getThis() TSRMLS_CC);
dpobj->current = NULL;
if (isostr_len) {
if (isostr) {
date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len TSRMLS_CC);
if (dpobj->start == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
+1
View File
@@ -10,6 +10,7 @@ Daniel Convissor <danielc@php.net>
<?php if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist"); ?>
--FILE--
<?php
date_default_timezone_set('UTC');
$date1 = new DateTime('2000-01-01 00:00:00');
$date2 = new DateTime('2001-03-04 04:05:06');
+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**
@@ -0,0 +1,49 @@
--TEST--
DateTime::diff() days -- fall type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-fall-type2-type2.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type2_prev: DAYS: **33**
test_time_fall_type2_prev_type2_dt: DAYS: **0**
test_time_fall_type2_prev_type2_redodt: DAYS: **0**
test_time_fall_type2_prev_type2_redost: DAYS: **0**
test_time_fall_type2_prev_type2_st: DAYS: **0**
test_time_fall_type2_prev_type2_post: DAYS: **2**
test_time_fall_type2_dt_type2_prev: DAYS: **0**
test_time_fall_type2_dt_type2_dt: DAYS: **0**
test_time_fall_type2_dt_type2_redodt: DAYS: **0**
test_time_fall_type2_dt_type2_redost: DAYS: **0**
test_time_fall_type2_dt_type2_st: DAYS: **0**
test_time_fall_type2_dt_type2_post: DAYS: **1**
test_time_fall_type2_redodt_type2_prev: DAYS: **0**
test_time_fall_type2_redodt_type2_dt: DAYS: **0**
test_time_fall_type2_redodt_type2_redodt: DAYS: **0**
test_time_fall_type2_redodt_type2_redost: DAYS: **0**
test_time_fall_type2_redodt_type2_st: DAYS: **0**
test_time_fall_type2_redodt_type2_post: DAYS: **1**
test_time_fall_type2_redost_type2_prev: DAYS: **0**
test_time_fall_type2_redost_type2_dt: DAYS: **0**
test_time_fall_type2_redost_type2_redodt: DAYS: **0**
test_time_fall_type2_redost_type2_redost: DAYS: **0**
test_time_fall_type2_redost_type2_st: DAYS: **0**
test_time_fall_type2_redost_type2_post: DAYS: **1**
test_time_fall_type2_st_type2_prev: DAYS: **0**
test_time_fall_type2_st_type2_dt: DAYS: **0**
test_time_fall_type2_st_type2_redodt: DAYS: **0**
test_time_fall_type2_st_type2_redost: DAYS: **0**
test_time_fall_type2_st_type2_st: DAYS: **0**
test_time_fall_type2_st_type2_post: DAYS: **1**
test_time_fall_type2_post_type2_prev: DAYS: **2**
test_time_fall_type2_post_type2_dt: DAYS: **1**
test_time_fall_type2_post_type2_redodt: DAYS: **1**
test_time_fall_type2_post_type2_redost: DAYS: **1**
test_time_fall_type2_post_type2_st: DAYS: **1**
test_time_fall_type2_post_type2_post: DAYS: **0**
@@ -0,0 +1,49 @@
--TEST--
DateTime::diff() days -- fall type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-fall-type2-type3.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type3_prev: DAYS: **33**
test_time_fall_type2_prev_type3_dt: DAYS: **0**
test_time_fall_type2_prev_type3_redodt: DAYS: **0**
test_time_fall_type2_prev_type3_redost: DAYS: **0**
test_time_fall_type2_prev_type3_st: DAYS: **0**
test_time_fall_type2_prev_type3_post: DAYS: **2**
test_time_fall_type2_dt_type3_prev: DAYS: **0**
test_time_fall_type2_dt_type3_dt: DAYS: **0**
test_time_fall_type2_dt_type3_redodt: DAYS: **0**
test_time_fall_type2_dt_type3_redost: DAYS: **0**
test_time_fall_type2_dt_type3_st: DAYS: **0**
test_time_fall_type2_dt_type3_post: DAYS: **1**
test_time_fall_type2_redodt_type3_prev: DAYS: **0**
test_time_fall_type2_redodt_type3_dt: DAYS: **0**
test_time_fall_type2_redodt_type3_redodt: DAYS: **0**
test_time_fall_type2_redodt_type3_redost: DAYS: **0**
test_time_fall_type2_redodt_type3_st: DAYS: **0**
test_time_fall_type2_redodt_type3_post: DAYS: **1**
test_time_fall_type2_redost_type3_prev: DAYS: **0**
test_time_fall_type2_redost_type3_dt: DAYS: **0**
test_time_fall_type2_redost_type3_redodt: DAYS: **0**
test_time_fall_type2_redost_type3_redost: DAYS: **0**
test_time_fall_type2_redost_type3_st: DAYS: **0**
test_time_fall_type2_redost_type3_post: DAYS: **1**
test_time_fall_type2_st_type3_prev: DAYS: **0**
test_time_fall_type2_st_type3_dt: DAYS: **0**
test_time_fall_type2_st_type3_redodt: DAYS: **0**
test_time_fall_type2_st_type3_redost: DAYS: **0**
test_time_fall_type2_st_type3_st: DAYS: **0**
test_time_fall_type2_st_type3_post: DAYS: **1**
test_time_fall_type2_post_type3_prev: DAYS: **2**
test_time_fall_type2_post_type3_dt: DAYS: **1**
test_time_fall_type2_post_type3_redodt: DAYS: **1**
test_time_fall_type2_post_type3_redost: DAYS: **1**
test_time_fall_type2_post_type3_st: DAYS: **1**
test_time_fall_type2_post_type3_post: DAYS: **0**
@@ -0,0 +1,49 @@
--TEST--
DateTime::diff() days -- fall type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-fall-type3-type2.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type2_prev: DAYS: **33**
test_time_fall_type3_prev_type2_dt: DAYS: **0**
test_time_fall_type3_prev_type2_redodt: DAYS: **0**
test_time_fall_type3_prev_type2_redost: DAYS: **0**
test_time_fall_type3_prev_type2_st: DAYS: **0**
test_time_fall_type3_prev_type2_post: DAYS: **2**
test_time_fall_type3_dt_type2_prev: DAYS: **0**
test_time_fall_type3_dt_type2_dt: DAYS: **0**
test_time_fall_type3_dt_type2_redodt: DAYS: **0**
test_time_fall_type3_dt_type2_redost: DAYS: **0**
test_time_fall_type3_dt_type2_st: DAYS: **0**
test_time_fall_type3_dt_type2_post: DAYS: **1**
test_time_fall_type3_redodt_type2_prev: DAYS: **0**
test_time_fall_type3_redodt_type2_dt: DAYS: **0**
test_time_fall_type3_redodt_type2_redodt: DAYS: **0**
test_time_fall_type3_redodt_type2_redost: DAYS: **0**
test_time_fall_type3_redodt_type2_st: DAYS: **0**
test_time_fall_type3_redodt_type2_post: DAYS: **1**
test_time_fall_type3_redost_type2_prev: DAYS: **0**
test_time_fall_type3_redost_type2_dt: DAYS: **0**
test_time_fall_type3_redost_type2_redodt: DAYS: **0**
test_time_fall_type3_redost_type2_redost: DAYS: **0**
test_time_fall_type3_redost_type2_st: DAYS: **0**
test_time_fall_type3_redost_type2_post: DAYS: **1**
test_time_fall_type3_st_type2_prev: DAYS: **0**
test_time_fall_type3_st_type2_dt: DAYS: **0**
test_time_fall_type3_st_type2_redodt: DAYS: **0**
test_time_fall_type3_st_type2_redost: DAYS: **0**
test_time_fall_type3_st_type2_st: DAYS: **0**
test_time_fall_type3_st_type2_post: DAYS: **1**
test_time_fall_type3_post_type2_prev: DAYS: **2**
test_time_fall_type3_post_type2_dt: DAYS: **1**
test_time_fall_type3_post_type2_redodt: DAYS: **1**
test_time_fall_type3_post_type2_redost: DAYS: **1**
test_time_fall_type3_post_type2_st: DAYS: **1**
test_time_fall_type3_post_type2_post: DAYS: **0**
@@ -0,0 +1,49 @@
--TEST--
DateTime::diff() days -- fall type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-fall-type3-type3.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type3_prev: DAYS: **33**
test_time_fall_type3_prev_type3_dt: DAYS: **0**
test_time_fall_type3_prev_type3_redodt: DAYS: **0**
test_time_fall_type3_prev_type3_redost: DAYS: **0**
test_time_fall_type3_prev_type3_st: DAYS: **0**
test_time_fall_type3_prev_type3_post: DAYS: **2**
test_time_fall_type3_dt_type3_prev: DAYS: **0**
test_time_fall_type3_dt_type3_dt: DAYS: **0**
test_time_fall_type3_dt_type3_redodt: DAYS: **0**
test_time_fall_type3_dt_type3_redost: DAYS: **0**
test_time_fall_type3_dt_type3_st: DAYS: **0**
test_time_fall_type3_dt_type3_post: DAYS: **1**
test_time_fall_type3_redodt_type3_prev: DAYS: **0**
test_time_fall_type3_redodt_type3_dt: DAYS: **0**
test_time_fall_type3_redodt_type3_redodt: DAYS: **0**
test_time_fall_type3_redodt_type3_redost: DAYS: **0**
test_time_fall_type3_redodt_type3_st: DAYS: **0**
test_time_fall_type3_redodt_type3_post: DAYS: **1**
test_time_fall_type3_redost_type3_prev: DAYS: **0**
test_time_fall_type3_redost_type3_dt: DAYS: **0**
test_time_fall_type3_redost_type3_redodt: DAYS: **0**
test_time_fall_type3_redost_type3_redost: DAYS: **0**
test_time_fall_type3_redost_type3_st: DAYS: **0**
test_time_fall_type3_redost_type3_post: DAYS: **1**
test_time_fall_type3_st_type3_prev: DAYS: **0**
test_time_fall_type3_st_type3_dt: DAYS: **0**
test_time_fall_type3_st_type3_redodt: DAYS: **0**
test_time_fall_type3_st_type3_redost: DAYS: **0**
test_time_fall_type3_st_type3_st: DAYS: **0**
test_time_fall_type3_st_type3_post: DAYS: **1**
test_time_fall_type3_post_type3_prev: DAYS: **2**
test_time_fall_type3_post_type3_dt: DAYS: **1**
test_time_fall_type3_post_type3_redodt: DAYS: **1**
test_time_fall_type3_post_type3_redost: DAYS: **1**
test_time_fall_type3_post_type3_st: DAYS: **1**
test_time_fall_type3_post_type3_post: DAYS: **0**
@@ -0,0 +1,77 @@
--TEST--
DateTime::diff() days -- february
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-february.inc';
?>
--EXPECT--
test_bug_49081__1: DAYS: **30**
test_bug_49081__2: DAYS: **31**
test_bug_49081__3: DAYS: **1**
test_bug_49081__4: DAYS: **29**
test_bug_49081__5: DAYS: **30**
test_bug_49081__6: DAYS: **31**
test_bug_49081__7: DAYS: **32**
test_bug_49081__8: DAYS: **28**
test_bug_49081__9: DAYS: **29**
test_bug_49081__10: DAYS: **30**
test_bug_49081__11: DAYS: **31**
test_bug_49081__12: DAYS: **1**
test_bug_49081__13: DAYS: **27**
test_bug_49081__14: DAYS: **28**
test_bug_49081__15: DAYS: **29**
test_bug_49081__16: DAYS: **30**
test_bug_49081__17: DAYS: **31**
test_bug_49081__18: DAYS: **32**
test_bug_49081__19: DAYS: **59**
test_bug_49081__20: DAYS: **29**
test_bug_49081__21: DAYS: **55**
test_bug_49081__22: DAYS: **56**
test_bug_49081__23: DAYS: **57**
test_bug_49081__24: DAYS: **58**
test_bug_49081__25: DAYS: **59**
test_bug_49081__26: DAYS: **60**
test_bug_49081__27: DAYS: **30**
test_bug_49081__28: DAYS: **27**
test_bug_49081__29: DAYS: **28**
test_bug_49081__30: DAYS: **29**
test_bug_49081__31: DAYS: **28**
test_bug_49081__32: DAYS: **29**
test_bug_49081_negative__1: DAYS: **30**
test_bug_49081_negative__2: DAYS: **31**
test_bug_49081_negative__3: DAYS: **1**
test_bug_49081_negative__4: DAYS: **29**
test_bug_49081_negative__5: DAYS: **30**
test_bug_49081_negative__6: DAYS: **31**
test_bug_49081_negative__7: DAYS: **32**
test_bug_49081_negative__8: DAYS: **28**
test_bug_49081_negative__9: DAYS: **29**
test_bug_49081_negative__10: DAYS: **30**
test_bug_49081_negative__11: DAYS: **31**
test_bug_49081_negative__12: DAYS: **1**
test_bug_49081_negative__13: DAYS: **27**
test_bug_49081_negative__14: DAYS: **28**
test_bug_49081_negative__15: DAYS: **29**
test_bug_49081_negative__16: DAYS: **30**
test_bug_49081_negative__17: DAYS: **31**
test_bug_49081_negative__18: DAYS: **32**
test_bug_49081_negative__19: DAYS: **59**
test_bug_49081_negative__20: DAYS: **29**
test_bug_49081_negative__21: DAYS: **55**
test_bug_49081_negative__22: DAYS: **56**
test_bug_49081_negative__23: DAYS: **57**
test_bug_49081_negative__24: DAYS: **58**
test_bug_49081_negative__25: DAYS: **59**
test_bug_49081_negative__26: DAYS: **60**
test_bug_49081_negative__27: DAYS: **30**
test_bug_49081_negative__28: DAYS: **27**
test_bug_49081_negative__29: DAYS: **28**
test_bug_49081_negative__30: DAYS: **29**
test_bug_49081_negative__31: DAYS: **28**
test_bug_49081_negative__32: DAYS: **29**
+15
View File
@@ -0,0 +1,15 @@
--TEST--
DateTime::diff() days -- massive
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-massive.inc';
?>
--EXPECT--
test_massive_positive: DAYS: **243494757**
test_massive_negative: DAYS: **243494757**
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() days -- spring type2 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-spring-type2-type2.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type2_prev: DAYS: **30**
test_time_spring_type2_prev_type2_st: DAYS: **0**
test_time_spring_type2_prev_type2_dt: DAYS: **0**
test_time_spring_type2_prev_type2_post: DAYS: **2**
test_time_spring_type2_st_type2_prev: DAYS: **0**
test_time_spring_type2_st_type2_st: DAYS: **0**
test_time_spring_type2_st_type2_dt: DAYS: **0**
test_time_spring_type2_st_type2_post: DAYS: **1**
test_time_spring_type2_dt_type2_prev: DAYS: **0**
test_time_spring_type2_dt_type2_st: DAYS: **0**
test_time_spring_type2_dt_type2_dt: DAYS: **0**
test_time_spring_type2_dt_type2_post: DAYS: **1**
test_time_spring_type2_post_type2_prev: DAYS: **2**
test_time_spring_type2_post_type2_st: DAYS: **1**
test_time_spring_type2_post_type2_dt: DAYS: **1**
test_time_spring_type2_post_type2_post: DAYS: **0**
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() days -- spring type2 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-spring-type2-type3.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type3_prev: DAYS: **30**
test_time_spring_type2_prev_type3_st: DAYS: **0**
test_time_spring_type2_prev_type3_dt: DAYS: **0**
test_time_spring_type2_prev_type3_post: DAYS: **2**
test_time_spring_type2_st_type3_prev: DAYS: **0**
test_time_spring_type2_st_type3_st: DAYS: **0**
test_time_spring_type2_st_type3_dt: DAYS: **0**
test_time_spring_type2_st_type3_post: DAYS: **1**
test_time_spring_type2_dt_type3_prev: DAYS: **0**
test_time_spring_type2_dt_type3_st: DAYS: **0**
test_time_spring_type2_dt_type3_dt: DAYS: **0**
test_time_spring_type2_dt_type3_post: DAYS: **1**
test_time_spring_type2_post_type3_prev: DAYS: **2**
test_time_spring_type2_post_type3_st: DAYS: **1**
test_time_spring_type2_post_type3_dt: DAYS: **1**
test_time_spring_type2_post_type3_post: DAYS: **0**
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() days -- spring type3 type2
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-spring-type3-type2.inc';
?>
--EXPECT--
test_time_spring_type3_prev_type2_prev: DAYS: **30**
test_time_spring_type3_prev_type2_st: DAYS: **0**
test_time_spring_type3_prev_type2_dt: DAYS: **0**
test_time_spring_type3_prev_type2_post: DAYS: **2**
test_time_spring_type3_st_type2_prev: DAYS: **0**
test_time_spring_type3_st_type2_st: DAYS: **0**
test_time_spring_type3_st_type2_dt: DAYS: **0**
test_time_spring_type3_st_type2_post: DAYS: **1**
test_time_spring_type3_dt_type2_prev: DAYS: **0**
test_time_spring_type3_dt_type2_st: DAYS: **0**
test_time_spring_type3_dt_type2_dt: DAYS: **0**
test_time_spring_type3_dt_type2_post: DAYS: **1**
test_time_spring_type3_post_type2_prev: DAYS: **2**
test_time_spring_type3_post_type2_st: DAYS: **1**
test_time_spring_type3_post_type2_dt: DAYS: **1**
test_time_spring_type3_post_type2_post: DAYS: **0**
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() days -- spring type3 type3
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
require 'DateTime_data-spring-type3-type3.inc';
?>
--EXPECT--
test_time_spring_type3_prev_type3_prev: DAYS: **30**
test_time_spring_type3_prev_type3_st: DAYS: **0**
test_time_spring_type3_prev_type3_dt: DAYS: **0**
test_time_spring_type3_prev_type3_post: DAYS: **2**
test_time_spring_type3_st_type3_prev: DAYS: **0**
test_time_spring_type3_st_type3_st: DAYS: **0**
test_time_spring_type3_st_type3_dt: DAYS: **0**
test_time_spring_type3_st_type3_post: DAYS: **1**
test_time_spring_type3_dt_type3_prev: DAYS: **0**
test_time_spring_type3_dt_type3_st: DAYS: **0**
test_time_spring_type3_dt_type3_dt: DAYS: **0**
test_time_spring_type3_dt_type3_post: DAYS: **1**
test_time_spring_type3_post_type3_prev: DAYS: **2**
test_time_spring_type3_post_type3_st: DAYS: **1**
test_time_spring_type3_post_type3_dt: DAYS: **1**
test_time_spring_type3_post_type3_post: DAYS: **0**
@@ -0,0 +1,15 @@
--TEST--
DateTime::diff() -- absolute
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
require 'DateTime_data-absolute.inc';
?>
--EXPECT--
test_absolute_7: DIFF: 2009-01-14 00:00:00 EST - 2009-01-07 00:00:00 EST = **P+0Y0M7DT0H0M0S**
test_absolute_negative_7: DIFF: 2009-01-07 00:00:00 EST - 2009-01-14 00:00:00 EST = **P+0Y0M7DT0H0M0S**
+29
View File
@@ -0,0 +1,29 @@
--TEST--
DateTime::diff() -- dates
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
require 'DateTime_data-dates.inc';
?>
--EXPECT--
test__7: DIFF: 2009-01-14 00:00:00 EST - 2009-01-07 00:00:00 EST = **P+0Y0M7DT0H0M0S**
test_years_positive__7_by_0_day: DIFF: 2007-02-07 00:00:00 EST - 2000-02-07 00:00:00 EST = **P+7Y0M0DT0H0M0S**
test_years_positive__7_by_1_day: DIFF: 2007-02-08 00:00:00 EST - 2000-02-07 00:00:00 EST = **P+7Y0M1DT0H0M0S**
test_years_positive__6_shy_1_day: DIFF: 2007-02-06 00:00:00 EST - 2000-02-07 00:00:00 EST = **P+6Y11M30DT0H0M0S**
test_years_positive__7_by_1_month: DIFF: 2007-03-07 00:00:00 EST - 2000-02-07 00:00:00 EST = **P+7Y1M0DT0H0M0S**
test_years_positive__6_shy_1_month: DIFF: 2007-01-07 00:00:00 EST - 2000-02-07 00:00:00 EST = **P+6Y11M0DT0H0M0S**
test_years_positive__7_by_1_month_split_newyear: DIFF: 2007-01-07 00:00:00 EST - 1999-12-07 00:00:00 EST = **P+7Y1M0DT0H0M0S**
test_years_positive__6_shy_1_month_split_newyear: DIFF: 2006-12-07 00:00:00 EST - 2000-01-07 00:00:00 EST = **P+6Y11M0DT0H0M0S**
test_negative__7: DIFF: 2009-01-07 00:00:00 EST - 2009-01-14 00:00:00 EST = **P-0Y0M7DT0H0M0S**
test_years_negative__7_by_0_day: DIFF: 2000-02-07 00:00:00 EST - 2007-02-07 00:00:00 EST = **P-7Y0M0DT0H0M0S**
test_years_negative__7_by_1_day: DIFF: 2000-02-07 00:00:00 EST - 2007-02-08 00:00:00 EST = **P-7Y0M1DT0H0M0S**
test_years_negative__6_shy_1_day: DIFF: 2000-02-07 00:00:00 EST - 2007-02-06 00:00:00 EST = **P-6Y11M28DT0H0M0S**
test_years_negative__7_by_1_month: DIFF: 2000-02-07 00:00:00 EST - 2007-03-07 00:00:00 EST = **P-7Y1M0DT0H0M0S**
test_years_negative__6_shy_1_month: DIFF: 2000-02-07 00:00:00 EST - 2007-01-07 00:00:00 EST = **P-6Y11M0DT0H0M0S**
test_years_negative__7_by_1_month_split_newyear: DIFF: 1999-12-07 00:00:00 EST - 2007-01-07 00:00:00 EST = **P-7Y1M0DT0H0M0S**
test_years_negative__6_shy_1_month_split_newyear: DIFF: 2000-01-07 00:00:00 EST - 2006-12-07 00:00:00 EST = **P-6Y11M0DT0H0M0S**
@@ -0,0 +1,51 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-fall-type2-type2.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S**
test_time_fall_type2_prev_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S**
test_time_fall_type2_prev_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S**
test_time_fall_type2_prev_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S**
test_time_fall_type2_prev_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S**
test_time_fall_type2_prev_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S**
test_time_fall_type2_dt_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S**
test_time_fall_type2_dt_type2_dt: DIFF: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S**
test_time_fall_type2_dt_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S**
test_time_fall_type2_dt_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S**
test_time_fall_type2_dt_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S**
test_time_fall_type2_dt_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S**
test_time_fall_type2_redodt_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S**
test_time_fall_type2_redodt_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S**
test_time_fall_type2_redodt_type2_redodt: DIFF: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S**
test_time_fall_type2_redodt_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S**
test_time_fall_type2_redodt_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S**
test_time_fall_type2_redodt_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S**
test_time_fall_type2_redost_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S**
test_time_fall_type2_redost_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S**
test_time_fall_type2_redost_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S**
test_time_fall_type2_redost_type2_redost: DIFF: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S**
test_time_fall_type2_redost_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S**
test_time_fall_type2_redost_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S**
test_time_fall_type2_st_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S**
test_time_fall_type2_st_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S**
test_time_fall_type2_st_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S**
test_time_fall_type2_st_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S**
test_time_fall_type2_st_type2_st: DIFF: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S**
test_time_fall_type2_st_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S**
test_time_fall_type2_post_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S**
test_time_fall_type2_post_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S**
test_time_fall_type2_post_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S**
test_time_fall_type2_post_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S**
test_time_fall_type2_post_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S**
test_time_fall_type2_post_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,51 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-fall-type2-type3.inc';
?>
--EXPECT--
test_time_fall_type2_prev_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S**
test_time_fall_type2_prev_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S**
test_time_fall_type2_prev_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S**
test_time_fall_type2_prev_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S**
test_time_fall_type2_prev_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S**
test_time_fall_type2_prev_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S**
test_time_fall_type2_dt_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S**
test_time_fall_type2_dt_type3_dt: DIFF: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S**
test_time_fall_type2_dt_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S**
test_time_fall_type2_dt_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S**
test_time_fall_type2_dt_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S**
test_time_fall_type2_dt_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S**
test_time_fall_type2_redodt_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S**
test_time_fall_type2_redodt_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S**
test_time_fall_type2_redodt_type3_redodt: DIFF: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S**
test_time_fall_type2_redodt_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S**
test_time_fall_type2_redodt_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S**
test_time_fall_type2_redodt_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S**
test_time_fall_type2_redost_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S**
test_time_fall_type2_redost_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S**
test_time_fall_type2_redost_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S**
test_time_fall_type2_redost_type3_redost: DIFF: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S**
test_time_fall_type2_redost_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S**
test_time_fall_type2_redost_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S**
test_time_fall_type2_st_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S**
test_time_fall_type2_st_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S**
test_time_fall_type2_st_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S**
test_time_fall_type2_st_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S**
test_time_fall_type2_st_type3_st: DIFF: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S**
test_time_fall_type2_st_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S**
test_time_fall_type2_post_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S**
test_time_fall_type2_post_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S**
test_time_fall_type2_post_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S**
test_time_fall_type2_post_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S**
test_time_fall_type2_post_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S**
test_time_fall_type2_post_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,51 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-fall-type3-type2.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S**
test_time_fall_type3_prev_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S**
test_time_fall_type3_prev_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S**
test_time_fall_type3_prev_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S**
test_time_fall_type3_prev_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S**
test_time_fall_type3_prev_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S**
test_time_fall_type3_dt_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S**
test_time_fall_type3_dt_type2_dt: DIFF: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S**
test_time_fall_type3_dt_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S**
test_time_fall_type3_dt_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S**
test_time_fall_type3_dt_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S**
test_time_fall_type3_dt_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S**
test_time_fall_type3_redodt_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S**
test_time_fall_type3_redodt_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S**
test_time_fall_type3_redodt_type2_redodt: DIFF: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S**
test_time_fall_type3_redodt_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S**
test_time_fall_type3_redodt_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S**
test_time_fall_type3_redodt_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S**
test_time_fall_type3_redost_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S**
test_time_fall_type3_redost_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S**
test_time_fall_type3_redost_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S**
test_time_fall_type3_redost_type2_redost: DIFF: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S**
test_time_fall_type3_redost_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S**
test_time_fall_type3_redost_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S**
test_time_fall_type3_st_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S**
test_time_fall_type3_st_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S**
test_time_fall_type3_st_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S**
test_time_fall_type3_st_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S**
test_time_fall_type3_st_type2_st: DIFF: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S**
test_time_fall_type3_st_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S**
test_time_fall_type3_post_type2_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S**
test_time_fall_type3_post_type2_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S**
test_time_fall_type3_post_type2_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S**
test_time_fall_type3_post_type2_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S**
test_time_fall_type3_post_type2_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S**
test_time_fall_type3_post_type2_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,51 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-fall-type3-type3.inc';
?>
--EXPECT--
test_time_fall_type3_prev_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-10-04 02:18:48 EDT = **P+0Y1M2DT16H19M40S**
test_time_fall_type3_prev_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT5H31M52S**
test_time_fall_type3_prev_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT6H34M5S**
test_time_fall_type3_prev_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT7H36M16S**
test_time_fall_type3_prev_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M0DT9H38M27S**
test_time_fall_type3_prev_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-06 18:38:28 EDT = **P+0Y0M2DT1H21M31S**
test_time_fall_type3_dt_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 00:10:20 EDT = **P-0Y0M0DT5H31M52S**
test_time_fall_type3_dt_type3_dt: DIFF: 2010-11-07 00:15:35 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT0H5M15S**
test_time_fall_type3_dt_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT1H2M13S**
test_time_fall_type3_dt_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT2H4M24S**
test_time_fall_type3_dt_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M0DT4H6M35S**
test_time_fall_type3_dt_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 00:10:20 EDT = **P+0Y0M1DT20H49M39S**
test_time_fall_type3_redodt_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT6H34M5S**
test_time_fall_type3_redodt_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:12:33 EDT = **P-0Y0M0DT1H2M13S**
test_time_fall_type3_redodt_type3_redodt: DIFF: 2010-11-07 01:15:35 EDT - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT0H3M2S**
test_time_fall_type3_redodt_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT1H2M11S**
test_time_fall_type3_redodt_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M0DT3H4M22S**
test_time_fall_type3_redodt_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:12:33 EDT = **P+0Y0M1DT19H47M26S**
test_time_fall_type3_redost_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT7H36M16S**
test_time_fall_type3_redost_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT2H4M24S**
test_time_fall_type3_redost_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 01:14:44 EST = **P-0Y0M0DT1H2M11S**
test_time_fall_type3_redost_type3_redost: DIFF: 2010-11-07 01:16:54 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT0H2M10S**
test_time_fall_type3_redost_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-07 01:14:44 EST = **P+0Y0M0DT2H2M11S**
test_time_fall_type3_redost_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 01:14:44 EST = **P+0Y0M1DT18H45M15S**
test_time_fall_type3_st_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT9H38M27S**
test_time_fall_type3_st_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT4H6M35S**
test_time_fall_type3_st_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-07 03:16:55 EST = **P-0Y0M0DT3H4M22S**
test_time_fall_type3_st_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-07 03:16:55 EST = **P-0Y0M0DT2H2M11S**
test_time_fall_type3_st_type3_st: DIFF: 2010-11-07 05:19:56 EST - 2010-11-07 03:16:55 EST = **P+0Y0M0DT2H3M1S**
test_time_fall_type3_st_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-07 03:16:55 EST = **P+0Y0M1DT16H43M4S**
test_time_fall_type3_post_type3_prev: DIFF: 2010-11-06 18:38:28 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M2DT1H21M31S**
test_time_fall_type3_post_type3_dt: DIFF: 2010-11-07 00:10:20 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT20H49M39S**
test_time_fall_type3_post_type3_redodt: DIFF: 2010-11-07 01:12:33 EDT - 2010-11-08 19:59:59 EST = **P-0Y0M1DT19H47M26S**
test_time_fall_type3_post_type3_redost: DIFF: 2010-11-07 01:14:44 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT18H45M15S**
test_time_fall_type3_post_type3_st: DIFF: 2010-11-07 03:16:55 EST - 2010-11-08 19:59:59 EST = **P-0Y0M1DT16H43M4S**
test_time_fall_type3_post_type3_post: DIFF: 2010-11-08 19:59:59 EST - 2010-11-08 18:57:55 EST = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,77 @@
--TEST--
DateTime::diff() -- february
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
require 'DateTime_data-february.inc';
?>
--EXPECT--
test_bug_49081__1: DIFF: 2010-03-31 00:00:00 EDT - 2010-03-01 00:00:00 EST = **P+0Y0M30DT0H0M0S**
test_bug_49081__2: DIFF: 2010-04-01 00:00:00 EDT - 2010-03-01 00:00:00 EST = **P+0Y1M0DT0H0M0S**
test_bug_49081__3: DIFF: 2010-04-01 00:00:00 EDT - 2010-03-31 00:00:00 EDT = **P+0Y0M1DT0H0M0S**
test_bug_49081__4: DIFF: 2010-04-29 00:00:00 EDT - 2010-03-31 00:00:00 EDT = **P+0Y0M29DT0H0M0S**
test_bug_49081__5: DIFF: 2010-04-30 00:00:00 EDT - 2010-03-31 00:00:00 EDT = **P+0Y0M30DT0H0M0S**
test_bug_49081__6: DIFF: 2010-04-30 00:00:00 EDT - 2010-03-30 00:00:00 EDT = **P+0Y1M0DT0H0M0S**
test_bug_49081__7: DIFF: 2010-04-30 00:00:00 EDT - 2010-03-29 00:00:00 EDT = **P+0Y1M1DT0H0M0S**
test_bug_49081__8: DIFF: 2010-01-29 00:00:00 EST - 2010-01-01 00:00:00 EST = **P+0Y0M28DT0H0M0S**
test_bug_49081__9: DIFF: 2010-01-30 00:00:00 EST - 2010-01-01 00:00:00 EST = **P+0Y0M29DT0H0M0S**
test_bug_49081__10: DIFF: 2010-01-31 00:00:00 EST - 2010-01-01 00:00:00 EST = **P+0Y0M30DT0H0M0S**
test_bug_49081__11: DIFF: 2010-02-01 00:00:00 EST - 2010-01-01 00:00:00 EST = **P+0Y1M0DT0H0M0S**
test_bug_49081__12: DIFF: 2010-02-01 00:00:00 EST - 2010-01-31 00:00:00 EST = **P+0Y0M1DT0H0M0S**
test_bug_49081__13: DIFF: 2010-02-27 00:00:00 EST - 2010-01-31 00:00:00 EST = **P+0Y0M27DT0H0M0S**
test_bug_49081__14: DIFF: 2010-02-28 00:00:00 EST - 2010-01-31 00:00:00 EST = **P+0Y0M28DT0H0M0S**
test_bug_49081__15: DIFF: 2010-02-28 00:00:00 EST - 2010-01-30 00:00:00 EST = **P+0Y0M29DT0H0M0S**
test_bug_49081__16: DIFF: 2010-02-28 00:00:00 EST - 2010-01-29 00:00:00 EST = **P+0Y0M30DT0H0M0S**
test_bug_49081__17: DIFF: 2010-02-28 00:00:00 EST - 2010-01-28 00:00:00 EST = **P+0Y1M0DT0H0M0S**
test_bug_49081__18: DIFF: 2010-02-28 00:00:00 EST - 2010-01-27 00:00:00 EST = **P+0Y1M1DT0H0M0S**
test_bug_49081__19: DIFF: 2010-03-01 00:00:00 EST - 2010-01-01 00:00:00 EST = **P+0Y2M0DT0H0M0S**
test_bug_49081__20: DIFF: 2010-03-01 00:00:00 EST - 2010-01-31 00:00:00 EST = **P+0Y0M29DT0H0M0S**
test_bug_49081__21: DIFF: 2010-03-27 00:00:00 EDT - 2010-01-31 00:00:00 EST = **P+0Y1M24DT0H0M0S**
test_bug_49081__22: DIFF: 2010-03-28 00:00:00 EDT - 2010-01-31 00:00:00 EST = **P+0Y1M25DT0H0M0S**
test_bug_49081__23: DIFF: 2010-03-29 00:00:00 EDT - 2010-01-31 00:00:00 EST = **P+0Y1M26DT0H0M0S**
test_bug_49081__24: DIFF: 2010-03-30 00:00:00 EDT - 2010-01-31 00:00:00 EST = **P+0Y1M27DT0H0M0S**
test_bug_49081__25: DIFF: 2010-03-31 00:00:00 EDT - 2010-01-31 00:00:00 EST = **P+0Y2M0DT0H0M0S**
test_bug_49081__26: DIFF: 2010-03-31 00:00:00 EDT - 2010-01-30 00:00:00 EST = **P+0Y2M1DT0H0M0S**
test_bug_49081__27: DIFF: 2009-01-31 00:00:00 EST - 2009-01-01 00:00:00 EST = **P+0Y0M30DT0H0M0S**
test_bug_49081__28: DIFF: 2010-03-27 00:00:00 EDT - 2010-02-28 00:00:00 EST = **P+0Y0M27DT0H0M0S**
test_bug_49081__29: DIFF: 2010-03-28 00:00:00 EDT - 2010-02-28 00:00:00 EST = **P+0Y1M0DT0H0M0S**
test_bug_49081__30: DIFF: 2010-03-29 00:00:00 EDT - 2010-02-28 00:00:00 EST = **P+0Y1M1DT0H0M0S**
test_bug_49081__31: DIFF: 2010-03-27 00:00:00 EDT - 2010-02-27 00:00:00 EST = **P+0Y1M0DT0H0M0S**
test_bug_49081__32: DIFF: 2010-03-27 00:00:00 EDT - 2010-02-26 00:00:00 EST = **P+0Y1M1DT0H0M0S**
test_bug_49081_negative__1: DIFF: 2010-03-01 00:00:00 EST - 2010-03-31 00:00:00 EDT = **P-0Y0M30DT0H0M0S**
test_bug_49081_negative__2: DIFF: 2010-03-01 00:00:00 EST - 2010-04-01 00:00:00 EDT = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__3: DIFF: 2010-03-31 00:00:00 EDT - 2010-04-01 00:00:00 EDT = **P-0Y0M1DT0H0M0S**
test_bug_49081_negative__4: DIFF: 2010-03-31 00:00:00 EDT - 2010-04-29 00:00:00 EDT = **P-0Y0M29DT0H0M0S**
test_bug_49081_negative__5: DIFF: 2010-03-31 00:00:00 EDT - 2010-04-30 00:00:00 EDT = **P-0Y0M30DT0H0M0S**
test_bug_49081_negative__6: DIFF: 2010-03-30 00:00:00 EDT - 2010-04-30 00:00:00 EDT = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__7: DIFF: 2010-03-29 00:00:00 EDT - 2010-04-30 00:00:00 EDT = **P-0Y1M1DT0H0M0S**
test_bug_49081_negative__8: DIFF: 2010-01-01 00:00:00 EST - 2010-01-29 00:00:00 EST = **P-0Y0M28DT0H0M0S**
test_bug_49081_negative__9: DIFF: 2010-01-01 00:00:00 EST - 2010-01-30 00:00:00 EST = **P-0Y0M29DT0H0M0S**
test_bug_49081_negative__10: DIFF: 2010-01-01 00:00:00 EST - 2010-01-31 00:00:00 EST = **P-0Y0M30DT0H0M0S**
test_bug_49081_negative__11: DIFF: 2010-01-01 00:00:00 EST - 2010-02-01 00:00:00 EST = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__12: DIFF: 2010-01-31 00:00:00 EST - 2010-02-01 00:00:00 EST = **P-0Y0M1DT0H0M0S**
test_bug_49081_negative__13: DIFF: 2010-01-31 00:00:00 EST - 2010-02-27 00:00:00 EST = **P-0Y0M27DT0H0M0S**
test_bug_49081_negative__14: DIFF: 2010-01-31 00:00:00 EST - 2010-02-28 00:00:00 EST = **P-0Y0M28DT0H0M0S**
test_bug_49081_negative__15: DIFF: 2010-01-30 00:00:00 EST - 2010-02-28 00:00:00 EST = **P-0Y0M29DT0H0M0S**
test_bug_49081_negative__16: DIFF: 2010-01-29 00:00:00 EST - 2010-02-28 00:00:00 EST = **P-0Y0M30DT0H0M0S**
test_bug_49081_negative__17: DIFF: 2010-01-28 00:00:00 EST - 2010-02-28 00:00:00 EST = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__18: DIFF: 2010-01-27 00:00:00 EST - 2010-02-28 00:00:00 EST = **P-0Y1M1DT0H0M0S**
test_bug_49081_negative__19: DIFF: 2010-01-01 00:00:00 EST - 2010-03-01 00:00:00 EST = **P-0Y2M0DT0H0M0S**
test_bug_49081_negative__20: DIFF: 2010-01-31 00:00:00 EST - 2010-03-01 00:00:00 EST = **P-0Y1M1DT0H0M0S**
test_bug_49081_negative__21: DIFF: 2010-01-31 00:00:00 EST - 2010-03-27 00:00:00 EDT = **P-0Y1M27DT0H0M0S**
test_bug_49081_negative__22: DIFF: 2010-01-31 00:00:00 EST - 2010-03-28 00:00:00 EDT = **P-0Y1M28DT0H0M0S**
test_bug_49081_negative__23: DIFF: 2010-01-31 00:00:00 EST - 2010-03-29 00:00:00 EDT = **P-0Y1M29DT0H0M0S**
test_bug_49081_negative__24: DIFF: 2010-01-31 00:00:00 EST - 2010-03-30 00:00:00 EDT = **P-0Y1M30DT0H0M0S**
test_bug_49081_negative__25: DIFF: 2010-01-31 00:00:00 EST - 2010-03-31 00:00:00 EDT = **P-0Y2M0DT0H0M0S**
test_bug_49081_negative__26: DIFF: 2010-01-30 00:00:00 EST - 2010-03-31 00:00:00 EDT = **P-0Y2M1DT0H0M0S**
test_bug_49081_negative__27: DIFF: 2009-01-01 00:00:00 EST - 2009-01-31 00:00:00 EST = **P-0Y0M30DT0H0M0S**
test_bug_49081_negative__28: DIFF: 2010-02-28 00:00:00 EST - 2010-03-27 00:00:00 EDT = **P-0Y0M27DT0H0M0S**
test_bug_49081_negative__29: DIFF: 2010-02-28 00:00:00 EST - 2010-03-28 00:00:00 EDT = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__30: DIFF: 2010-02-28 00:00:00 EST - 2010-03-29 00:00:00 EDT = **P-0Y1M1DT0H0M0S**
test_bug_49081_negative__31: DIFF: 2010-02-27 00:00:00 EST - 2010-03-27 00:00:00 EDT = **P-0Y1M0DT0H0M0S**
test_bug_49081_negative__32: DIFF: 2010-02-26 00:00:00 EST - 2010-03-27 00:00:00 EDT = **P-0Y1M1DT0H0M0S**
+15
View File
@@ -0,0 +1,15 @@
--TEST--
DateTime::diff() -- massive
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?php
require 'examine_diff.inc';
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DIFF);
require 'DateTime_data-massive.inc';
?>
--EXPECT--
test_massive_positive: DIFF: 333333-01-01 16:18:02 EST - -333333-01-01 16:18:02 EST = **P+666666Y0M0DT0H0M0S**
test_massive_negative: DIFF: -333333-01-01 16:18:02 EST - 333333-01-01 16:18:02 EST = **P-666666Y0M0DT0H0M0S**
@@ -0,0 +1,31 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-spring-type2-type2.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S**
test_time_spring_type2_prev_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S**
test_time_spring_type2_prev_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S**
test_time_spring_type2_prev_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S**
test_time_spring_type2_st_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S**
test_time_spring_type2_st_type2_st: DIFF: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S**
test_time_spring_type2_st_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S**
test_time_spring_type2_st_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S**
test_time_spring_type2_dt_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S**
test_time_spring_type2_dt_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S**
test_time_spring_type2_dt_type2_dt: DIFF: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S**
test_time_spring_type2_dt_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S**
test_time_spring_type2_post_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S**
test_time_spring_type2_post_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S**
test_time_spring_type2_post_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S**
test_time_spring_type2_post_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,31 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-spring-type2-type3.inc';
?>
--EXPECT--
test_time_spring_type2_prev_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S**
test_time_spring_type2_prev_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S**
test_time_spring_type2_prev_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S**
test_time_spring_type2_prev_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S**
test_time_spring_type2_st_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S**
test_time_spring_type2_st_type3_st: DIFF: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S**
test_time_spring_type2_st_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S**
test_time_spring_type2_st_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S**
test_time_spring_type2_dt_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S**
test_time_spring_type2_dt_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S**
test_time_spring_type2_dt_type3_dt: DIFF: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S**
test_time_spring_type2_dt_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S**
test_time_spring_type2_post_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S**
test_time_spring_type2_post_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S**
test_time_spring_type2_post_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S**
test_time_spring_type2_post_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,31 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-spring-type3-type2.inc';
?>
--EXPECT--
test_time_spring_type3_prev_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S**
test_time_spring_type3_prev_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S**
test_time_spring_type3_prev_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S**
test_time_spring_type3_prev_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S**
test_time_spring_type3_st_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S**
test_time_spring_type3_st_type2_st: DIFF: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S**
test_time_spring_type3_st_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S**
test_time_spring_type3_st_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S**
test_time_spring_type3_dt_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S**
test_time_spring_type3_dt_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S**
test_time_spring_type3_dt_type2_dt: DIFF: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S**
test_time_spring_type3_dt_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S**
test_time_spring_type3_post_type2_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S**
test_time_spring_type3_post_type2_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S**
test_time_spring_type3_post_type2_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S**
test_time_spring_type3_post_type2_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S**
@@ -0,0 +1,31 @@
--TEST--
DateTime::diff() -- 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_DIFF);
require 'DateTime_data-spring-type3-type3.inc'
?>
--EXPECT--
test_time_spring_type3_prev_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-02-11 02:18:48 EST = **P+0Y1M2DT16H19M40S**
test_time_spring_type3_prev_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-13 18:38:28 EST = **P+0Y0M0DT5H31M52S**
test_time_spring_type3_prev_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M0DT7H38M27S**
test_time_spring_type3_prev_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-13 18:38:28 EST = **P+0Y0M2DT1H21M31S**
test_time_spring_type3_st_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 00:10:20 EST = **P-0Y0M0DT5H31M52S**
test_time_spring_type3_st_type3_st: DIFF: 2010-03-14 00:15:35 EST - 2010-03-14 00:10:20 EST = **P+0Y0M0DT0H5M15S**
test_time_spring_type3_st_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M0DT2H6M35S**
test_time_spring_type3_st_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 00:10:20 EST = **P+0Y0M1DT18H49M39S**
test_time_spring_type3_dt_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT7H38M27S**
test_time_spring_type3_dt_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-14 03:16:55 EDT = **P-0Y0M0DT2H6M35S**
test_time_spring_type3_dt_type3_dt: DIFF: 2010-03-14 05:19:56 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M0DT2H3M1S**
test_time_spring_type3_dt_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-14 03:16:55 EDT = **P+0Y0M1DT16H43M4S**
test_time_spring_type3_post_type3_prev: DIFF: 2010-03-13 18:38:28 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M2DT1H21M31S**
test_time_spring_type3_post_type3_st: DIFF: 2010-03-14 00:10:20 EST - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT18H49M39S**
test_time_spring_type3_post_type3_dt: DIFF: 2010-03-14 03:16:55 EDT - 2010-03-15 19:59:59 EDT = **P-0Y0M1DT16H43M4S**
test_time_spring_type3_post_type3_post: DIFF: 2010-03-15 19:59:59 EDT - 2010-03-15 18:57:55 EDT = **P+0Y0M0DT1H2M4S**
@@ -1,29 +0,0 @@
--TEST--
DateTime::diff() add() sub() -- absolute
--CREDITS--
Daniel Convissor <danielc@php.net>
--FILE--
<?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.
*/
require './examine_diff.inc';
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);
?>
--EXPECT--
test_absolute_7: FWD: 2009-01-14 00:00:00 EST - 2009-01-07 00:00:00 EST = **P+0Y0M7DT0H0M0S** | BACK: 2009-01-07 00:00:00 EST + P+0Y0M7DT0H0M0S = **2009-01-14 00:00:00 EST** | DAYS: **7**
test_absolute_negative_7: FWD: 2009-01-07 00:00:00 EST - 2009-01-14 00:00:00 EST = **P+0Y0M7DT0H0M0S** | BACK: 2009-01-14 00:00:00 EST - P+0Y0M7DT0H0M0S = **2009-01-07 00:00:00 EST** | DAYS: **7**
Loaded 100 of 721 files, more files were not shown because too many files have changed in this diff. Show more