mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 07:26:38 +00:00
Compare commits
203
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b7a2e0af9 | ||
|
|
ed87dbab91 | ||
|
|
de5254743e | ||
|
|
bbf1904f3d | ||
|
|
4b0e699051 | ||
|
|
177612ca4d | ||
|
|
7f04d85d31 | ||
|
|
90789cf0a7 | ||
|
|
f417c732a9 | ||
|
|
868b808f4c | ||
|
|
d8782ddaeb | ||
|
|
b9746b0ba6 | ||
|
|
6765a19d23 | ||
|
|
fbb5aae32c | ||
|
|
772768f41c | ||
|
|
8c3335b96b | ||
|
|
72c4e72570 | ||
|
|
63db6d1435 | ||
|
|
94cd08457b | ||
|
|
886cf1a318 | ||
|
|
eefbc4398a | ||
|
|
ebf9db550f | ||
|
|
e63f59191d | ||
|
|
2a852af8f7 | ||
|
|
a8068a676b | ||
|
|
dec96a12fa | ||
|
|
3a5d2b2129 | ||
|
|
444289e03e | ||
|
|
68c8c34a77 | ||
|
|
9437d4cea4 | ||
|
|
740285307d | ||
|
|
0a7292087c | ||
|
|
104cd28e95 | ||
|
|
25849ab967 | ||
|
|
358316b2ed | ||
|
|
1717764476 | ||
|
|
240653bad7 | ||
|
|
af482a4fc8 | ||
|
|
08e7b84b7b | ||
|
|
a5974fdba8 | ||
|
|
a96426874a | ||
|
|
fcff17524a | ||
|
|
5670174b66 | ||
|
|
c9e41e8901 | ||
|
|
0333b86f2d | ||
|
|
907fd926e5 | ||
|
|
fb2ce0bb00 | ||
|
|
7a0bd8b967 | ||
|
|
2b8026cfff | ||
|
|
bc6cb0c70d | ||
|
|
80d432ca62 | ||
|
|
8d52500d41 | ||
|
|
f277d8a22f | ||
|
|
bc9c089f3a | ||
|
|
e2a48862f7 | ||
|
|
d2c47040f5 | ||
|
|
f641cf8b2c | ||
|
|
ea2cad7e76 | ||
|
|
191df85605 | ||
|
|
15f5dd5cb3 | ||
|
|
7bc6fbc448 | ||
|
|
a643bda32d | ||
|
|
199510ef07 | ||
|
|
02023fc8fe | ||
|
|
cee9b6603c | ||
|
|
4cd96965fb | ||
|
|
b99e1ba2d8 | ||
|
|
060ceea06e | ||
|
|
efb6757e16 | ||
|
|
0a0443f07c | ||
|
|
6e668453ac | ||
|
|
80f46ca2c5 | ||
|
|
9622d0050d | ||
|
|
ddaddf6c2a | ||
|
|
c27079d9e0 | ||
|
|
707e6dac61 | ||
|
|
08b3d76cbf | ||
|
|
af43d306c0 | ||
|
|
a3ddc02e8e | ||
|
|
a641ccb774 | ||
|
|
de2291689c | ||
|
|
d86b3633cf | ||
|
|
66ac89a00b | ||
|
|
32b5f8a1a3 | ||
|
|
a311dc2443 | ||
|
|
6f56bf1cfc | ||
|
|
eed6bdb5c7 | ||
|
|
513faa54bb | ||
|
|
8f3e6433b2 | ||
|
|
86209a3919 | ||
|
|
148120e1e9 | ||
|
|
2da7edbc8d | ||
|
|
5fac6a938f | ||
|
|
45f4c5dd7e | ||
|
|
f57cbfcaa1 | ||
|
|
e1a5443f97 | ||
|
|
31b91d7cdb | ||
|
|
a1ae8af54c | ||
|
|
3837f1205b | ||
|
|
aea69cb06a | ||
|
|
e18618905c | ||
|
|
0c107d3bf3 | ||
|
|
76cbcc7f66 | ||
|
|
ce966baaa4 | ||
|
|
767f924665 | ||
|
|
329eae2a7a | ||
|
|
b8ffccb3ab | ||
|
|
a8b8fe1f7f | ||
|
|
a7dfb31557 | ||
|
|
6406521a44 | ||
|
|
ce816cb883 | ||
|
|
11f667e82d | ||
|
|
f848423608 | ||
|
|
c270347c0b | ||
|
|
6fca028fc5 | ||
|
|
eaeb4537ec | ||
|
|
0de3cd84a5 | ||
|
|
3300cc8e38 | ||
|
|
c76af7c041 | ||
|
|
f5779d5e16 | ||
|
|
9392b9cd73 | ||
|
|
2c03acef35 | ||
|
|
34de2c30c5 | ||
|
|
d2b11712ff | ||
|
|
8199f8dcfc | ||
|
|
845d0805a8 | ||
|
|
c16bfe403f | ||
|
|
c2f796c58b | ||
|
|
a2390fca5d | ||
|
|
28edcb949d | ||
|
|
d1ea827f27 | ||
|
|
565d4bc695 | ||
|
|
5c9080d3a6 | ||
|
|
378cf70c81 | ||
|
|
f5b67e09b9 | ||
|
|
ad0666eb94 | ||
|
|
07e9cfe6a5 | ||
|
|
76ec6924cb | ||
|
|
708017dd3f | ||
|
|
04d0210c8e | ||
|
|
59c102bf51 | ||
|
|
6f594fc5ea | ||
|
|
1056c57fa9 | ||
|
|
b60f6774dc | ||
|
|
70f4069138 | ||
|
|
388fa176be | ||
|
|
9eb5cb6571 | ||
|
|
a95a021509 | ||
|
|
a6acb1f09e | ||
|
|
f5a9e17f9c | ||
|
|
964f44a280 | ||
|
|
30f19bd524 | ||
|
|
1101293b3f | ||
|
|
4ad9f1970c | ||
|
|
01a6840bbd | ||
|
|
3012b74e96 | ||
|
|
fe790643ca | ||
|
|
fceeb296e6 | ||
|
|
3cb4de03dc | ||
|
|
c24ef71e63 | ||
|
|
1e2aa4416c | ||
|
|
6fad717299 | ||
|
|
0a17fe52fb | ||
|
|
4b450a0f85 | ||
|
|
1e3b32c777 | ||
|
|
cfdd25d5c0 | ||
|
|
e6368659a7 | ||
|
|
778273291d | ||
|
|
85eb08885b | ||
|
|
469b6d2b9e | ||
|
|
5d10bb6231 | ||
|
|
52c1db4b7d | ||
|
|
41533cdee1 | ||
|
|
6b593349cb | ||
|
|
a93c3ddbb7 | ||
|
|
ac96bcdc90 | ||
|
|
0f7d022eea | ||
|
|
db6a29e533 | ||
|
|
a546b3207f | ||
|
|
a5eeecb13f | ||
|
|
75ec1fedc7 | ||
|
|
27dd44db95 | ||
|
|
a90b7da435 | ||
|
|
8ab4c89d0b | ||
|
|
353077d234 | ||
|
|
c0748c7856 | ||
|
|
6f9d0a25fd | ||
|
|
245d15fdc6 | ||
|
|
8e256774b0 | ||
|
|
d19c366c4a | ||
|
|
654aa838cd | ||
|
|
0f29950d9c | ||
|
|
516c2f5920 | ||
|
|
1ca8acda40 | ||
|
|
6c513876d0 | ||
|
|
8c3428eeb8 | ||
|
|
a377c4c580 | ||
|
|
499006bbb8 | ||
|
|
bc4588b1d9 | ||
|
|
a99e0b69df | ||
|
|
84f1562f99 | ||
|
|
cfdfcac8aa | ||
|
|
8ad52ac7c1 |
No files matched your search
+2
-2
@@ -497,8 +497,8 @@ STATUS: Working
|
||||
SINCE: 4.0.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
PRIMARY MAINTAINER: Boris Lytochkin <lytboris@php.net>, Rasmus Lerdorf <rasmus@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sockets
|
||||
|
||||
@@ -51,6 +51,7 @@ Type specifiers
|
||||
L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
|
||||
o - object of any type (zval*)
|
||||
O - object of specific type given by class entry (zval*, zend_class_entry)
|
||||
p - valid path (string without null bytes in the middle) and its length (char*, int)
|
||||
r - resource (zval*)
|
||||
s - string (with possible null bytes) and its length (char*, int)
|
||||
z - the actual zval (zval*)
|
||||
|
||||
+10
-13
@@ -104,16 +104,15 @@ Derick) run the following commands for you:
|
||||
|
||||
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
|
||||
|
||||
3. Update the MD5 sums in ``web/qa/trunk/include/rc-md5sums.txt`` (no empty lines, ordered by filename, odler version number first, .bz2 before .gz).
|
||||
3. Update ``web/qa/trunk/include/release-qa.php`` with the appropriate information.
|
||||
See the documentation within release-qa.php for more information, but all releases
|
||||
and RCs are configured here. Only $QA_RELEASES needs to be edited.
|
||||
|
||||
4. Update in ``web/qa/trunk/include/release-qa.php`` constants with the new RC and
|
||||
commit this.
|
||||
Example: When rolling an RC, set the 'rc' with appropriate information for the
|
||||
given version.
|
||||
|
||||
a. ``$BUILD_TEST_RELEASES`` = array("4.4.7RC1", "5.2.2RC1")
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
b. ``$CURRENT_QA_RELEASE_4`` = "4.4.7RC1" (``$CURRENT_QA_RELEASE_5`` for PHP5)
|
||||
|
||||
c. ``$RELEASE_PROCESS`` = array(4 => true, 5 => true)
|
||||
|
||||
1. Update in ``web/php-bugs/trunk/include/php_versions.php`` to include the new RC and commit.
|
||||
|
||||
@@ -247,13 +246,11 @@ number, and remove the RC from there.
|
||||
|
||||
11. Update ``qaweb/include/release-qa.php``
|
||||
|
||||
a. Update the $BUILD_TEST_RELEASES array with the release name
|
||||
- Update $QA_RELEASES with the appropriate information, which means bumping
|
||||
the version number to an upcoming version.
|
||||
|
||||
b. Update $RELEASE_PROCESS array (set to false)
|
||||
|
||||
I. For PHP4: Set $CURRENT_QA_RELEASE_4 to false
|
||||
|
||||
II. For PHP5: Set $CURRENT_QA_RELEASE_5 to false
|
||||
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
|
||||
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
--------------------------------------
|
||||
|
||||
+8
-4
@@ -43,13 +43,17 @@ Having said that, here are the organizational rules::
|
||||
|
||||
Currently we have the following branches in use::
|
||||
|
||||
trunk Will become PHP 6.0. This CVS branch is for active development.
|
||||
trunk The active development branch.
|
||||
|
||||
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
branches/PHP_5_4 Is used to release the PHP 5.4.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
branches/PHP_5_3 Is used to release the PHP 5.3.x series. This is current
|
||||
stable version and is open for bugfixes and small
|
||||
improvements (check with RMs if in doubt).
|
||||
|
||||
branches/PHP_5_2 Is used to release the PHP 5.2.x series. It is closed for
|
||||
changes now.
|
||||
|
||||
branches/PHP_5_1 This branch is closed.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#undef PTHREADS
|
||||
+1
-1
@@ -33,7 +33,7 @@ $(makefile_in_files): $(makefile_am_files)
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.in acconfig.h
|
||||
$(config_h_in): configure.in
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
|
||||
@@ -7,6 +7,10 @@ AC_INIT(TSRM.c)
|
||||
AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine)
|
||||
AM_CONFIG_HEADER(tsrm_config.h)
|
||||
|
||||
AH_TOP([
|
||||
#undef PTHREADS
|
||||
])
|
||||
|
||||
sinclude(tsrm.m4)
|
||||
|
||||
TSRM_BASIC_CHECKS
|
||||
|
||||
+17
-2
@@ -617,7 +617,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
}
|
||||
|
||||
free(r);
|
||||
return;
|
||||
} else {
|
||||
@@ -692,7 +699,14 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
|
||||
if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) {
|
||||
realpath_cache_bucket *r = *bucket;
|
||||
*bucket = (*bucket)->next;
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
|
||||
/* if the pointers match then only subtract the length of the path */
|
||||
if(r->path == r->realpath) {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
|
||||
} else {
|
||||
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
|
||||
}
|
||||
|
||||
free(r);
|
||||
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
|
||||
memcmp(path, (*bucket)->path, path_len) == 0) {
|
||||
@@ -1067,6 +1081,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
}
|
||||
if (is_dir && !directory) {
|
||||
/* not a directory */
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +170,12 @@ UPGRADE NOTES - PHP X.Y
|
||||
- fclose() closes streams with resource refcount > 1; it doesn't merely
|
||||
decrement the resource refcount.
|
||||
- socket_set_options() and socket_get_options() now support multicast options.
|
||||
- Arrays cast from SimpleXMLElement now always contain all nodes instead of
|
||||
just the first matching node.
|
||||
- All SimpleXMLElement children are now always printed when using var_dump(),
|
||||
var_export(), and print_r().
|
||||
- The raw data parameter in openssl_encrypt()/openssl_decrypt() is now an options
|
||||
integer rather than a boolean. A value of true produces the same behaviour.
|
||||
|
||||
===================================
|
||||
5. Changes made to existing methods
|
||||
@@ -352,10 +358,15 @@ UPGRADE NOTES - PHP X.Y
|
||||
|
||||
- Core:
|
||||
- get_declared_traits()
|
||||
- hex2bin()
|
||||
- http_response_code()
|
||||
- trait_exists()
|
||||
- stream_set_chunk_size()
|
||||
- socket_import_stream()
|
||||
- trait_exists()
|
||||
|
||||
- LDAP:
|
||||
- ldap_control_paged_results()
|
||||
- ldap_control_paged_results_response()
|
||||
|
||||
f. New global constants
|
||||
|
||||
@@ -384,6 +395,8 @@ UPGRADE NOTES - PHP X.Y
|
||||
- IPV6_MULTICAST_LOOP
|
||||
- IPPROTO_IP
|
||||
- IPPROTO_IPV6
|
||||
- OPENSSL_RAW_DATA
|
||||
- OPENSSL_ZERO_PADDING
|
||||
|
||||
g. New classes
|
||||
|
||||
|
||||
-127
@@ -1,127 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define ZEND_API __attribute__ ((visibility("default")))
|
||||
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define ZEND_API
|
||||
# define ZEND_DLEXPORT
|
||||
#endif
|
||||
|
||||
#define ZEND_DLIMPORT
|
||||
|
||||
@TOP@
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#else
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#endif
|
||||
|
||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||
|
||||
#ifdef NETWARE
|
||||
#ifdef USE_WINSOCK
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*/
|
||||
+1
-1
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
# we only support certain bison versions
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3"
|
||||
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
|
||||
|
||||
# for standalone build of Zend Engine
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ $(makefile_in_files): $(makefile_am_files)
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.in acconfig.h
|
||||
$(config_h_in): configure.in
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
|
||||
@@ -11,6 +11,105 @@ AM_PROG_CC_STDC
|
||||
ZEND_VERSION=$VERSION
|
||||
AC_ZEND_C_BIGENDIAN
|
||||
|
||||
AH_TOP([
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define ZEND_API __attribute__ ((visibility("default")))
|
||||
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define ZEND_API
|
||||
# define ZEND_DLEXPORT
|
||||
#endif
|
||||
|
||||
#define ZEND_DLIMPORT
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
])
|
||||
|
||||
AH_BOTTOM([
|
||||
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#else
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#endif
|
||||
|
||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||
|
||||
#ifdef NETWARE
|
||||
#ifdef USE_WINSOCK
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
namespace b\c {}
|
||||
namespace b\d {}
|
||||
@@ -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
|
||||
@@ -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'
|
||||
@@ -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,5 +1,5 @@
|
||||
--TEST--
|
||||
Persistent case insensetive and user defined constants
|
||||
Persistent case insensitive and user defined constants
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(ZEND_THREAD_safe);
|
||||
@@ -7,5 +7,6 @@ define("ZEND_THREAD_safe", 123);
|
||||
var_dump(ZEND_THREAD_safe);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(%s)
|
||||
Notice: Use of undefined constant ZEND_THREAD_safe - assumed 'ZEND_THREAD_safe' in %s on line %d
|
||||
string(16) "ZEND_THREAD_safe"
|
||||
int(123)
|
||||
@@ -1,12 +1,18 @@
|
||||
--TEST--
|
||||
Testing declare statement with several type values
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("mbstring")) {
|
||||
die("skip Requires ext/mbstring");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
zend.multibyte=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
declare(encoding = 1);
|
||||
declare(encoding = 1123131232131312321);
|
||||
declare(encoding = 112313123213131232100);
|
||||
declare(encoding = NULL);
|
||||
declare(encoding = 'utf-8');
|
||||
declare(encoding = M_PI);
|
||||
@@ -17,8 +23,8 @@ print 'DONE';
|
||||
--EXPECTF--
|
||||
Warning: Unsupported encoding [1] in %sdeclare_001.php on line %d
|
||||
|
||||
Warning: Unsupported encoding [1.1231312321313E+18] in %sdeclare_001.php on line %d
|
||||
Warning: Unsupported encoding [1.1231312321313E+20] in %sdeclare_001.php on line %d
|
||||
|
||||
Warning: Unsupported encoding [] in %sdeclare_001.php on line %d
|
||||
|
||||
Fatal error: Cannot use constants as encoding in %sdeclare_001.php on line %d
|
||||
Fatal error: Cannot use constants as encoding in %sdeclare_001.php on line %d
|
||||
@@ -5,6 +5,9 @@ Testing declare statement with several type values
|
||||
if (!ini_get("zend.multibyte")) {
|
||||
die("skip Requires zend.multibyte=1");
|
||||
}
|
||||
if (!extension_loaded("mbstring")) {
|
||||
die("skip Requires ext/mbstring");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Testing declare statement with several type values
|
||||
--INI--
|
||||
precision=15
|
||||
zend.multibyte=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
declare(encoding = 1);
|
||||
declare(encoding = 11111111111111);
|
||||
declare(encoding = NULL);
|
||||
declare(encoding = M_PI);
|
||||
|
||||
print 'DONE';
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Unsupported encoding [1] in %sdeclare_003.php on line %d
|
||||
|
||||
Warning: Unsupported encoding [11111111111111] in %sdeclare_003.php on line %d
|
||||
|
||||
Warning: Unsupported encoding [] in %sdeclare_003.php on line %d
|
||||
|
||||
Fatal error: Cannot use constants as encoding in %sdeclare_003.php on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Testing declare statement with several type values
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!ini_get("zend.multibyte")) {
|
||||
die("skip Requires zend.multibyte=1");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
declare(encoding = 1);
|
||||
declare(encoding = 1123131232131312321);
|
||||
declare(encoding = NULL);
|
||||
declare(encoding = M_PI);
|
||||
|
||||
print 'DONE';
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Unsupported encoding [%d] in %sdeclare_004.php on line 3
|
||||
|
||||
Warning: Unsupported encoding [%f] in %sdeclare_004.php on line 4
|
||||
|
||||
Warning: Unsupported encoding [] in %sdeclare_004.php on line 5
|
||||
|
||||
Fatal error: Cannot use constants as encoding in %sdeclare_004.php on line 6
|
||||
@@ -0,0 +1,150 @@
|
||||
--TEST--
|
||||
Calling method from array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Hello {
|
||||
public function world($x) {
|
||||
echo "Hello, $x\n"; return $this;
|
||||
}
|
||||
}
|
||||
|
||||
class Hello2 {
|
||||
static public function world($x) {
|
||||
echo "Hello, $x\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Magic {
|
||||
public function __call($f, $a) {
|
||||
printf("%s called (%s)!\n", __METHOD__, $f);
|
||||
}
|
||||
}
|
||||
|
||||
class Magic2 {
|
||||
public static function __callStatic($f, $a) {
|
||||
printf("%s called (%s)!\n", __METHOD__, $f);
|
||||
}
|
||||
}
|
||||
|
||||
class Magic3 {
|
||||
public static function __callStatic($f, $a) {
|
||||
printf("%s called (%s)!\n", __METHOD__, $f);
|
||||
}
|
||||
public function __call($f, $a) {
|
||||
printf("%s called (%s)!\n", __METHOD__, $f);
|
||||
}
|
||||
}
|
||||
|
||||
$f = array('Hello','world');
|
||||
var_dump($f('you'));
|
||||
var_dump(call_user_func($f, 'you'));
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$h= new Hello;
|
||||
$f = array($h,'world');
|
||||
var_dump($f('again'));
|
||||
var_dump(call_user_func($f, 'again'));
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
function bar() {
|
||||
return array(new Hello,'world');
|
||||
}
|
||||
$f = bar();
|
||||
var_dump($f('there'));
|
||||
var_dump(call_user_func($f, 'there'));
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$x = function ($c,$v) { return array($c, $v); };
|
||||
|
||||
$c = new Hello;
|
||||
$m = 'world';
|
||||
$f = $x($c, $m);
|
||||
var_dump($f('devs'));
|
||||
var_dump(call_user_func($f, 'devs'));
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$f = array(new Magic, 'foo');
|
||||
$f();
|
||||
call_user_func($f);
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$f = array('Magic2', 'foo');
|
||||
$f();
|
||||
call_user_func($f);
|
||||
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$f = array('Magic3', 'foo');
|
||||
$f();
|
||||
call_user_func($f);
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$f = array(new Magic3, 'foo');
|
||||
$f();
|
||||
call_user_func($f);
|
||||
|
||||
printf("-----\n");
|
||||
|
||||
$f = array(new Hello2, 'world');
|
||||
var_dump($f('you'));
|
||||
var_dump(call_user_func($f, 'you'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Non-static method Hello::world() should not be called statically in %s on line %d
|
||||
Hello, you
|
||||
|
||||
Notice: Undefined variable: this in %s on line %d
|
||||
NULL
|
||||
|
||||
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Hello::world() should not be called statically in %s on line %d
|
||||
Hello, you
|
||||
|
||||
Notice: Undefined variable: this in %s on line %d
|
||||
NULL
|
||||
-----
|
||||
Hello, again
|
||||
object(Hello)#1 (0) {
|
||||
}
|
||||
Hello, again
|
||||
object(Hello)#1 (0) {
|
||||
}
|
||||
-----
|
||||
Hello, there
|
||||
object(Hello)#2 (0) {
|
||||
}
|
||||
Hello, there
|
||||
object(Hello)#2 (0) {
|
||||
}
|
||||
-----
|
||||
Hello, devs
|
||||
object(Hello)#4 (0) {
|
||||
}
|
||||
Hello, devs
|
||||
object(Hello)#4 (0) {
|
||||
}
|
||||
-----
|
||||
Magic::__call called (foo)!
|
||||
Magic::__call called (foo)!
|
||||
-----
|
||||
Magic2::__callStatic called (foo)!
|
||||
Magic2::__callStatic called (foo)!
|
||||
-----
|
||||
Magic3::__callStatic called (foo)!
|
||||
Magic3::__callStatic called (foo)!
|
||||
-----
|
||||
Magic3::__call called (foo)!
|
||||
Magic3::__call called (foo)!
|
||||
-----
|
||||
Hello, you
|
||||
NULL
|
||||
Hello, you
|
||||
NULL
|
||||
@@ -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
|
||||
|
||||
@@ -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,97 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Reflection
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int $a, double $b, string $c, boolean $d = true, resource $e, array $f = array(), object $g) {
|
||||
}
|
||||
|
||||
$func = new ReflectionFunction('test');
|
||||
Reflection::Export($func);
|
||||
|
||||
foreach ($func->getParameters() as $i => $param) {
|
||||
printf(
|
||||
"-- Parameter #%d: %s {\n".
|
||||
" Allows NULL: %s\n".
|
||||
" Hint Type: %s\n".
|
||||
" Passed to by reference: %s\n".
|
||||
" Is optional?: %s\n",
|
||||
$i,
|
||||
$param->getName(),
|
||||
var_export($param->getClass(), 1),
|
||||
$param->getTypeHint(),
|
||||
var_export($param->allowsNull(), 1),
|
||||
var_export($param->isPassedByReference(), 1),
|
||||
$param->isOptional() ? 'yes' : 'no'
|
||||
);
|
||||
printf(" Int: %d | Double: %d | Bool: %d | String: %d | Resource: %d | Array: %d | Object: %d\n",
|
||||
$param->isInt(), $param->isDouble(), $param->isBool(), $param->isString(),
|
||||
$param->isResource(), $param->isArray(), $param->isObject());
|
||||
print "}\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Function [ <user> function test ] {
|
||||
@@ %s 3 - 4
|
||||
|
||||
- Parameters [7] {
|
||||
Parameter #0 [ <required> integer $a ]
|
||||
Parameter #1 [ <required> double $b ]
|
||||
Parameter #2 [ <required> string $c ]
|
||||
Parameter #3 [ <required> boolean $d ]
|
||||
Parameter #4 [ <required> resource $e ]
|
||||
Parameter #5 [ <required> array $f ]
|
||||
Parameter #6 [ <required> object $g ]
|
||||
}
|
||||
}
|
||||
|
||||
-- Parameter #0: a {
|
||||
Allows NULL: NULL
|
||||
Hint Type: integer
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 1 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 0
|
||||
}
|
||||
-- Parameter #1: b {
|
||||
Allows NULL: NULL
|
||||
Hint Type: double
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 1 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 0
|
||||
}
|
||||
-- Parameter #2: c {
|
||||
Allows NULL: NULL
|
||||
Hint Type: string
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 0 | Bool: 0 | String: 1 | Resource: 0 | Array: 0 | Object: 0
|
||||
}
|
||||
-- Parameter #3: d {
|
||||
Allows NULL: NULL
|
||||
Hint Type: boolean
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 0 | Bool: 1 | String: 0 | Resource: 0 | Array: 0 | Object: 0
|
||||
}
|
||||
-- Parameter #4: e {
|
||||
Allows NULL: NULL
|
||||
Hint Type: resource
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 1 | Array: 0 | Object: 0
|
||||
}
|
||||
-- Parameter #5: f {
|
||||
Allows NULL: NULL
|
||||
Hint Type: array
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 1 | Object: 0
|
||||
}
|
||||
-- Parameter #6: g {
|
||||
Allows NULL: NULL
|
||||
Hint Type: object
|
||||
Passed to by reference: false
|
||||
Is optional?: false
|
||||
Int: 0 | Double: 0 | Bool: 0 | String: 0 | Resource: 0 | Array: 0 | Object: 1
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing NULL when allowed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test_int(int $a = null) {
|
||||
}
|
||||
test_int(null);
|
||||
|
||||
function test_double(double $a = null) {
|
||||
}
|
||||
test_double(null);
|
||||
|
||||
function test_bool(bool $a = null) {
|
||||
}
|
||||
test_bool(null);
|
||||
|
||||
print "Done";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Done
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing parameter with reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* string */
|
||||
function test_string(string &$a) {
|
||||
$a .= '!!!';
|
||||
}
|
||||
|
||||
$str = 'foo';
|
||||
test_string($str);
|
||||
var_dump($str);
|
||||
|
||||
/* integer */
|
||||
function test_int(int &$b) {
|
||||
$b += 2;
|
||||
}
|
||||
|
||||
$b = 2;
|
||||
test_int($b);
|
||||
var_dump($b);
|
||||
|
||||
/* object */
|
||||
function test_obj(object &$c) {
|
||||
$c->tested = 1;
|
||||
}
|
||||
$c = new stdclass;
|
||||
test_obj($c);
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foo!!!"
|
||||
int(4)
|
||||
object(stdClass)#1 (1) {
|
||||
["tested"]=>
|
||||
int(1)
|
||||
}
|
||||
--UEXPECT--
|
||||
unicode(6) "foo!!!"
|
||||
int(4)
|
||||
object(stdClass)#1 (1) {
|
||||
[u"tested"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing string type hint with reference
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(string &$a) {
|
||||
$a .= '!!!';
|
||||
}
|
||||
|
||||
$x = 'foo';
|
||||
|
||||
test($x);
|
||||
|
||||
var_dump($x);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foo!!!"
|
||||
--UEXPECT--
|
||||
unicode(6) "foo!!!"
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing default parameter value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(string &$a, integer $x = 1) {
|
||||
var_dump($x);
|
||||
}
|
||||
|
||||
$y = 'foo';
|
||||
test($y, 2);
|
||||
test($y);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(1)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing with heredoc
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(string $str) {
|
||||
}
|
||||
|
||||
test(<<<FOO
|
||||
test!
|
||||
FOO
|
||||
);
|
||||
|
||||
test(<<<'FOO'
|
||||
test!
|
||||
FOO
|
||||
);
|
||||
|
||||
test(<<<"FOO"
|
||||
test!
|
||||
FOO
|
||||
);
|
||||
|
||||
print "Ok!";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok!
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing default parameter values
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(string $a, bool $b = NULL, integer $c, double $d = NULL, $e) {
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
test('foo', NULL, 1, NULL, 'bar');
|
||||
test('foo', true, 0, -1., NULL);
|
||||
test('true', false, -1, 2.2222, 1.1);
|
||||
test('1.1', false, -1, 11111111111111111111111111, true);
|
||||
test('1', false, -1, NULL, new stdClass);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - Testing default parameter values as constants
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int $foo = PHP_INT_MAX) {
|
||||
print "ok\n";
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - formatting
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(int$foo) { print "ok\n";}
|
||||
test(1);
|
||||
|
||||
function test2(int
|
||||
|
||||
|
||||
$foo) { print "ok\n";}
|
||||
test2(1);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
ok
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Parameter type hint - scalar type hints, default value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function bar1(scalar $param = null) {}
|
||||
function bar2(scalar $param = 123) {}
|
||||
function bar3(scalar $param = false) {}
|
||||
function bar4(scalar $param = 988.99) {}
|
||||
function bar5(scalar $param = "1233") {}
|
||||
function bar6(scalar $param = array(1,2,3)) {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Default value for parameters with scalar type hint can only be scalar or NULL in %s on line 8
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Indirect method call by array - Invalid class name
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arr = array('a', 'b');
|
||||
$arr();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class 'a' not found in %s on line %d
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Indirect method call by array - Invalid method name
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$arr = array('stdclass', 'b');
|
||||
$arr();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Call to undefined method stdClass::b() in %s on line %d
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Indirect method call by array - Calling __call() and __callStatic()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
public function __call($a, $b) {
|
||||
printf("From %s:\n", __METHOD__);
|
||||
var_dump($a);
|
||||
var_dump($this);
|
||||
}
|
||||
static public function __callStatic($a, $b) {
|
||||
printf("From %s:\n", __METHOD__);
|
||||
var_dump($a);
|
||||
var_dump($this);
|
||||
}
|
||||
}
|
||||
|
||||
$arr = array('foo', 'abc');
|
||||
$arr();
|
||||
|
||||
$foo = new foo;
|
||||
$arr = array($foo, 'abc');
|
||||
$arr();
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
From foo::__callStatic:
|
||||
string(3) "abc"
|
||||
|
||||
Notice: Undefined variable: this in %s on line %d
|
||||
NULL
|
||||
From foo::__call:
|
||||
string(3) "abc"
|
||||
object(foo)#%d (0) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
--TEST--
|
||||
Indirect method call by array - Testing exception and method magics
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
static public function abc() {
|
||||
throw new Exception('foo');
|
||||
}
|
||||
public function __call($a, $b) {
|
||||
printf("From %s:\n", __METHOD__);
|
||||
throw new Exception($a);
|
||||
}
|
||||
static public function __callStatic($a, $b) {
|
||||
printf("From %s:\n", __METHOD__);
|
||||
throw new Exception($a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$arr = array('foo', 'abc');
|
||||
|
||||
try {
|
||||
$arr();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
$arr = array('foo', '123');
|
||||
|
||||
try {
|
||||
$arr();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
|
||||
echo "------\n";
|
||||
|
||||
$foo = new foo;
|
||||
$arr = array($foo, 'abc');
|
||||
|
||||
try {
|
||||
$arr();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
|
||||
$foo = new foo;
|
||||
$arr = array($foo, '123');
|
||||
|
||||
try {
|
||||
$arr();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
foo
|
||||
From foo::__callStatic:
|
||||
123
|
||||
------
|
||||
foo
|
||||
From foo::__call:
|
||||
123
|
||||
@@ -849,6 +849,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
|
||||
exit(-1);
|
||||
}
|
||||
CG(unclean_shutdown) = 1;
|
||||
CG(active_class_entry) = NULL;
|
||||
CG(in_compilation) = EG(in_execution) = 0;
|
||||
EG(current_execute_data) = NULL;
|
||||
LONGJMP(*EG(bailout), FAILURE);
|
||||
|
||||
@@ -573,10 +573,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define IS_RESOURCE 7
|
||||
#define IS_CONSTANT 8
|
||||
#define IS_CONSTANT_ARRAY 9
|
||||
/* used for type-hinting only */
|
||||
#define IS_CLASS 10
|
||||
#define IS_SCALAR 11
|
||||
#define IS_NUMERIC 12
|
||||
|
||||
/* Ugly hack to support constants as static array indices */
|
||||
#define IS_CONSTANT_TYPE_MASK 0x00f
|
||||
|
||||
+14
-7
@@ -205,10 +205,6 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
|
||||
switch(type) {
|
||||
case IS_BOOL:
|
||||
return "boolean";
|
||||
case IS_SCALAR:
|
||||
return "scalar";
|
||||
case IS_NUMERIC:
|
||||
return "numeric";
|
||||
case IS_LONG:
|
||||
return "integer";
|
||||
case IS_DOUBLE:
|
||||
@@ -216,7 +212,6 @@ ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
|
||||
case IS_STRING:
|
||||
return "string";
|
||||
case IS_OBJECT:
|
||||
case IS_CLASS:
|
||||
return "object";
|
||||
case IS_RESOURCE:
|
||||
return "resource";
|
||||
@@ -411,6 +406,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 's':
|
||||
{
|
||||
char **p = va_arg(*va, char **);
|
||||
@@ -437,17 +433,23 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
|
||||
}
|
||||
*p = Z_STRVAL_PP(arg);
|
||||
*pl = Z_STRLEN_PP(arg);
|
||||
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
|
||||
return "a valid path";
|
||||
}
|
||||
break;
|
||||
|
||||
case IS_OBJECT:
|
||||
if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
|
||||
return "a valid path";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IS_ARRAY:
|
||||
case IS_RESOURCE:
|
||||
default:
|
||||
return "string";
|
||||
return c == 's' ? "string" : "a valid path";
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -713,7 +715,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
|
||||
case 'z': case 'Z':
|
||||
case 'C': case 'h':
|
||||
case 'f': case 'A':
|
||||
case 'H':
|
||||
case 'H': case 'p':
|
||||
max_num_args++;
|
||||
break;
|
||||
|
||||
@@ -2773,6 +2775,11 @@ get_function_via_handler:
|
||||
if (fcc->function_handler) {
|
||||
retval = 1;
|
||||
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
|
||||
if (call_via_handler && !fcc->object_ptr && EG(This) &&
|
||||
Z_OBJ_HT_P(EG(This))->get_class_entry &&
|
||||
instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) {
|
||||
fcc->object_ptr = EG(This);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -98,7 +98,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
|
||||
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref},
|
||||
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref},
|
||||
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_CLASS, allow_null, pass_by_ref},
|
||||
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, allow_null, pass_by_ref},
|
||||
#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, allow_null, pass_by_ref},
|
||||
#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, allow_null, pass_by_ref},
|
||||
#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \
|
||||
@@ -526,6 +526,9 @@ END_EXTERN_C()
|
||||
#define CHECK_ZVAL_STRING_REL(z)
|
||||
#endif
|
||||
|
||||
#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
|
||||
#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
|
||||
|
||||
#define ZVAL_RESOURCE(z, l) do { \
|
||||
zval *__z = (z); \
|
||||
Z_LVAL_P(__z) = l; \
|
||||
|
||||
@@ -1602,6 +1602,9 @@ ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent
|
||||
int internal;
|
||||
|
||||
if (!heap->use_zend_alloc) {
|
||||
if (full_shutdown) {
|
||||
free(heap);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+33
-53
@@ -1847,10 +1847,9 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
|
||||
|
||||
if (class_type->op_type != IS_UNUSED) {
|
||||
cur_arg_info->allow_null = 0;
|
||||
cur_arg_info->type_hint = class_type->u.constant.type;
|
||||
|
||||
switch (class_type->u.constant.type) {
|
||||
case IS_CLASS:
|
||||
if (class_type->u.constant.type != IS_NULL) {
|
||||
cur_arg_info->type_hint = IS_OBJECT;
|
||||
if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) {
|
||||
zend_resolve_class_name(class_type, &opline->extended_value, 1 TSRMLS_CC);
|
||||
}
|
||||
@@ -1864,9 +1863,8 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
|
||||
zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IS_ARRAY:
|
||||
} else {
|
||||
cur_arg_info->type_hint = IS_ARRAY;
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
@@ -1874,39 +1872,6 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con
|
||||
zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* scalar type hinting */
|
||||
case IS_SCALAR:
|
||||
if (op == ZEND_RECV_INIT && Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
/* scalar type hinting */
|
||||
case IS_NUMERIC:
|
||||
if (op == ZEND_RECV_INIT && (Z_TYPE(initialization->u.constant) == IS_LONG || Z_TYPE(initialization->u.constant) == IS_DOUBLE)) {
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
case IS_BOOL:
|
||||
case IS_STRING:
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
case IS_RESOURCE:
|
||||
case IS_OBJECT:
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) != class_type->u.constant.type && Z_TYPE(initialization->u.constant) != IS_NULL && (Z_TYPE(initialization->u.constant) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT) {
|
||||
zend_error(E_COMPILE_ERROR, "Default value for parameters with %s type hint can only be %s or NULL", zend_get_type_by_const(class_type->u.constant.type), zend_get_type_by_const(class_type->u.constant.type));
|
||||
} else if (Z_TYPE(initialization->u.constant) == IS_NULL) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
zend_error(E_COMPILE_ERROR, "Unknown type hint");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2256,7 +2221,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
CG(zend_lineno) = opline->lineno;
|
||||
zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
|
||||
zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
|
||||
} else {
|
||||
/* Label is not defined. Delay to pass 2. */
|
||||
INC_BPC(op_array);
|
||||
@@ -2905,7 +2870,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto) /* {{{ */
|
||||
static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
@@ -2953,11 +2918,24 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
&& strcasecmp(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)!=0) {
|
||||
char *colon;
|
||||
|
||||
if (fe->common.type != ZEND_USER_FUNCTION ||
|
||||
strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
|
||||
if (fe->common.type != ZEND_USER_FUNCTION) {
|
||||
return 0;
|
||||
} else if (strchr(proto->common.arg_info[i].class_name, '\\') != NULL ||
|
||||
(colon = zend_memrchr(fe->common.arg_info[i].class_name, '\\', fe->common.arg_info[i].class_name_len)) == NULL ||
|
||||
strcasecmp(colon+1, proto->common.arg_info[i].class_name) != 0) {
|
||||
return 0;
|
||||
zend_class_entry **fe_ce, **proto_ce;
|
||||
int found, found2;
|
||||
|
||||
found = zend_lookup_class(fe->common.arg_info[i].class_name, fe->common.arg_info[i].class_name_len, &fe_ce TSRMLS_CC);
|
||||
found2 = zend_lookup_class(proto->common.arg_info[i].class_name, proto->common.arg_info[i].class_name_len, &proto_ce TSRMLS_CC);
|
||||
|
||||
/* Check for class alias */
|
||||
if (found != SUCCESS || found2 != SUCCESS ||
|
||||
(*fe_ce)->type == ZEND_INTERNAL_CLASS ||
|
||||
(*proto_ce)->type == ZEND_INTERNAL_CLASS ||
|
||||
*fe_ce != *proto_ce) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fe->common.arg_info[i].type_hint != proto->common.arg_info[i].type_hint) {
|
||||
@@ -3040,11 +3018,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
|
||||
}
|
||||
|
||||
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent)) {
|
||||
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
|
||||
}
|
||||
}
|
||||
@@ -5020,6 +4998,10 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
|
||||
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
|
||||
zend_register_long_constant(name, len+1, zend_get_scanned_file_offset(TSRMLS_C), CONST_CS, 0 TSRMLS_CC);
|
||||
pefree(name, 0);
|
||||
|
||||
if (CG(in_namespace)) {
|
||||
zend_do_end_namespace(TSRMLS_C);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -6201,14 +6183,12 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
|
||||
|
||||
void zend_do_ticks(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (Z_LVAL(CG(declarables).ticks)) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = ZEND_TICKS;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = Z_LVAL(CG(declarables).ticks);
|
||||
}
|
||||
opline->opcode = ZEND_TICKS;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = Z_LVAL(CG(declarables).ticks);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count++); }
|
||||
#define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count--); }
|
||||
#define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); }
|
||||
#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
|
||||
|
||||
#define RESET_DOC_COMMENT() \
|
||||
{ \
|
||||
|
||||
@@ -141,7 +141,7 @@ void zend_register_standard_constants(TSRMLS_D)
|
||||
c.value.type = IS_NULL;
|
||||
zend_register_constant(&c TSRMLS_CC);
|
||||
|
||||
c.flags = CONST_PERSISTENT;
|
||||
c.flags = CONST_PERSISTENT | CONST_CS;
|
||||
|
||||
c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE"));
|
||||
c.name_len = sizeof("ZEND_THREAD_SAFE");
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
%left '*' '/' '%'
|
||||
%right '!'
|
||||
%nonassoc T_INSTANCEOF
|
||||
%right '~' T_INC T_DEC T_INT_CAST T_NUMERIC_CAST T_SCALAR_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
|
||||
%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
|
||||
%right '['
|
||||
%nonassoc T_NEW T_CLONE
|
||||
%token T_EXIT
|
||||
@@ -130,14 +130,6 @@
|
||||
%token T_DOUBLE_ARROW
|
||||
%token T_LIST
|
||||
%token T_ARRAY
|
||||
%token T_BOOL_HINT
|
||||
%token T_STRING_HINT
|
||||
%token T_INT_HINT
|
||||
%token T_DOUBLE_HINT
|
||||
%token T_RESOURCE_HINT
|
||||
%token T_OBJECT_HINT
|
||||
%token T_SCALAR_HINT
|
||||
%token T_NUMERIC_HINT
|
||||
%token T_CLASS_C
|
||||
%token T_METHOD_C
|
||||
%token T_FUNC_C
|
||||
@@ -221,7 +213,7 @@ inner_statement:
|
||||
|
||||
|
||||
statement:
|
||||
unticked_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_statement { DO_TICKS(); }
|
||||
| T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
@@ -301,11 +293,11 @@ unset_variable:
|
||||
;
|
||||
|
||||
function_declaration_statement:
|
||||
unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_function_declaration_statement { DO_TICKS(); }
|
||||
;
|
||||
|
||||
class_declaration_statement:
|
||||
unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); }
|
||||
unticked_class_declaration_statement { DO_TICKS(); }
|
||||
;
|
||||
|
||||
|
||||
@@ -474,16 +466,8 @@ non_empty_parameter_list:
|
||||
|
||||
optional_class_type:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_ARRAY { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_ARRAY; }
|
||||
| T_BOOL_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_BOOL; }
|
||||
| T_STRING_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_STRING; }
|
||||
| T_INT_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_LONG; }
|
||||
| T_DOUBLE_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_DOUBLE; }
|
||||
| T_RESOURCE_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_RESOURCE; }
|
||||
| T_OBJECT_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_OBJECT; }
|
||||
| T_SCALAR_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_SCALAR; }
|
||||
| T_NUMERIC_HINT { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NUMERIC; }
|
||||
| fully_qualified_class_name { $$ = $1; $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_CLASS; }
|
||||
| T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NULL; }
|
||||
| fully_qualified_class_name { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -716,8 +700,6 @@ expr_without_variable:
|
||||
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); }
|
||||
| T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); }
|
||||
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); }
|
||||
| T_SCALAR_CAST expr { zend_do_cast(&$$, &$2, IS_SCALAR TSRMLS_CC); }
|
||||
| T_NUMERIC_CAST expr { zend_do_cast(&$$, &$2, IS_NUMERIC TSRMLS_CC); }
|
||||
| T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); }
|
||||
| T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); }
|
||||
| '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
|
||||
@@ -941,7 +923,7 @@ method:
|
||||
{ zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
|
||||
;
|
||||
|
||||
method_or_not:
|
||||
method_or_not:
|
||||
method { $$ = $1; $$.EA = ZEND_PARSED_METHOD_CALL; zend_do_push_object(&$$ TSRMLS_CC); }
|
||||
| array_method_dereference { $$ = $1; zend_do_push_object(&$$ TSRMLS_CC); }
|
||||
| /* empty */ { $$.EA = ZEND_PARSED_MEMBER; }
|
||||
@@ -964,7 +946,7 @@ variable_class_name:
|
||||
|
||||
array_function_dereference:
|
||||
array_function_dereference '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| function_call { zend_do_begin_variable_parse(TSRMLS_C); $1.EA = ZEND_PARSED_FUNCTION_CALL; }
|
||||
| function_call { zend_do_begin_variable_parse(TSRMLS_C); $1.EA = ZEND_PARSED_FUNCTION_CALL; }
|
||||
'[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$4 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
+2644
-3761
File diff suppressed because it is too large.
Load diff
@@ -469,7 +469,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
{
|
||||
char *file_path = NULL, *buf;
|
||||
size_t size, offset = 0;
|
||||
|
||||
|
||||
/* The shebang line was read, get the current position to obtain the buffer start */
|
||||
if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
|
||||
if ((offset = ftell(file_handle->handle.fp)) == -1) {
|
||||
@@ -496,7 +496,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
|
||||
if (size != -1) {
|
||||
if (CG(multibyte)) {
|
||||
SCNG(script_org) = buf;
|
||||
SCNG(script_org_size) = size;
|
||||
SCNG(script_org_size) = size;
|
||||
SCNG(script_filtered) = NULL;
|
||||
|
||||
zend_multibyte_set_filter(NULL TSRMLS_CC);
|
||||
@@ -1206,10 +1206,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
return T_STRING_CAST;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"scalar"{TABS_AND_SPACES}")" {
|
||||
return T_SCALAR_CAST;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" {
|
||||
return T_ARRAY_CAST;
|
||||
}
|
||||
@@ -1314,62 +1310,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
return T_ARRAY;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>("bool"|"boolean"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
if (yytext[4] == 'e') {
|
||||
yyless((sizeof("boolean") - 1));
|
||||
} else {
|
||||
yyless((sizeof("bool") - 1));
|
||||
}
|
||||
return T_BOOL_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>("string"|"binary"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
yyless(6);
|
||||
return T_STRING_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"scalar"{TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
yyless(6);
|
||||
return T_SCALAR_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"numeric"{TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
yyless(7);
|
||||
return T_NUMERIC_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>("int"|"integer"|"long"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
if (yytext[3] == 'e') {
|
||||
yyless((sizeof("integer") - 1));
|
||||
} else if (yytext[3] == 'g') {
|
||||
yyless((sizeof("long") - 1));
|
||||
} else {
|
||||
yyless(3);
|
||||
}
|
||||
return T_INT_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>("real"|"double"|"float"){TABS_AND_SPACES}[ \r\n\t&]*"$" {
|
||||
if (yytext[4] == 'l') {
|
||||
yyless((sizeof("double") - 1));
|
||||
} else if (yytext[4] == 't') {
|
||||
yyless((sizeof("float") - 1));
|
||||
} else {
|
||||
yyless(4);
|
||||
}
|
||||
return T_DOUBLE_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"resource"{TABS_AND_SPACES}[ \t\r\n&]*"$" {
|
||||
yyless((sizeof("resource") - 1));
|
||||
return T_RESOURCE_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"object"{TABS_AND_SPACES}[ \t\r\n&]*"$" {
|
||||
yyless((sizeof("object") - 1));
|
||||
return T_OBJECT_HINT;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"++" {
|
||||
return T_INC;
|
||||
}
|
||||
@@ -1628,7 +1568,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
len += strlen(func_name);
|
||||
}
|
||||
|
||||
zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
|
||||
zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s",
|
||||
class_name ? class_name : "",
|
||||
class_name && func_name ? "::" : "",
|
||||
func_name ? func_name : ""
|
||||
@@ -1724,15 +1664,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
|
||||
|
||||
<INITIAL>"<?=" {
|
||||
if (CG(short_tags)) {
|
||||
zendlval->value.str.val = yytext; /* no copying - intentional */
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_OPEN_TAG_WITH_ECHO;
|
||||
} else {
|
||||
goto inline_char_handler;
|
||||
}
|
||||
zendlval->value.str.val = yytext; /* no copying - intentional */
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_OPEN_TAG_WITH_ECHO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Apr 3 14:18:11 2011 */
|
||||
/* Generated by re2c 0.13.5 on Thu Jun 2 17:34:19 2011 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -31,6 +31,18 @@
|
||||
else (lval) = __tmpvar; \
|
||||
} while (0)
|
||||
|
||||
#elif defined(__x86_64__) && defined(__GNUC__)
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __tmpvar; \
|
||||
__asm__ ("imulq %3,%0\n" \
|
||||
"adcq $0,%1" \
|
||||
: "=r"(__tmpvar),"=r"(usedval) \
|
||||
: "0"(a), "r"(b), "1"(0)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
else (lval) = __tmpvar; \
|
||||
} while (0)
|
||||
|
||||
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
|
||||
@@ -27,13 +27,10 @@
|
||||
#include "zend_globals.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_multiply.h"
|
||||
#include "zend_strtod.h"
|
||||
#include "zend_exceptions.h"
|
||||
#include "zend_closures.h"
|
||||
|
||||
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
|
||||
|
||||
#if ZEND_USE_TOLOWER_L
|
||||
#include <locale.h>
|
||||
static _locale_t current_locale = NULL;
|
||||
|
||||
@@ -31,11 +31,14 @@
|
||||
#endif
|
||||
|
||||
#include "zend_strtod.h"
|
||||
#include "zend_multiply.h"
|
||||
|
||||
#if 0&&HAVE_BCMATH
|
||||
#include "ext/bcmath/libbcmath/src/bcmath.h"
|
||||
#endif
|
||||
|
||||
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
|
||||
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
|
||||
@@ -448,6 +451,421 @@ ZEND_API void zend_update_current_locale(void);
|
||||
#define zend_update_current_locale()
|
||||
#endif
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(t,f) \
|
||||
((int)(&((t*)0)->f))
|
||||
#endif
|
||||
|
||||
static zend_always_inline int fast_increment_function(zval *op1)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
__asm__(
|
||||
"incl (%0)\n\t"
|
||||
"jno 0f\n\t"
|
||||
"movl $0x0, (%0)\n\t"
|
||||
"movl $0x41e00000, 0x4(%0)\n\t"
|
||||
"movb $0x2,0xc(%0)\n"
|
||||
"0:"
|
||||
:
|
||||
: "r"(op1));
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
__asm__(
|
||||
"incq (%0)\n\t"
|
||||
"jno 0f\n\t"
|
||||
"movl $0x0, (%0)\n\t"
|
||||
"movl $0x43e00000, 0x4(%0)\n\t"
|
||||
"movb $0x2,0x14(%0)\n"
|
||||
"0:"
|
||||
:
|
||||
: "r"(op1));
|
||||
#else
|
||||
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MAX)) {
|
||||
/* switch to double */
|
||||
Z_DVAL_P(op1) = (double)LONG_MAX + 1.0;
|
||||
Z_TYPE_P(op1) = IS_DOUBLE;
|
||||
} else {
|
||||
Z_LVAL_P(op1)++;
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
return increment_function(op1);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_decrement_function(zval *op1)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
__asm__(
|
||||
"decl (%0)\n\t"
|
||||
"jno 0f\n\t"
|
||||
"movl $0x00200000, (%0)\n\t"
|
||||
"movl $0xc1e00000, 0x4(%0)\n\t"
|
||||
"movb $0x2,0xc(%0)\n"
|
||||
"0:"
|
||||
:
|
||||
: "r"(op1));
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
__asm__(
|
||||
"decq (%0)\n\t"
|
||||
"jno 0f\n\t"
|
||||
"movl $0x00000000, (%0)\n\t"
|
||||
"movl $0xc3e00000, 0x4(%0)\n\t"
|
||||
"movb $0x2,0x14(%0)\n"
|
||||
"0:"
|
||||
:
|
||||
: "r"(op1));
|
||||
#else
|
||||
if (UNEXPECTED(Z_LVAL_P(op1) == LONG_MIN)) {
|
||||
/* switch to double */
|
||||
Z_DVAL_P(op1) = (double)LONG_MIN - 1.0;
|
||||
Z_TYPE_P(op1) = IS_DOUBLE;
|
||||
} else {
|
||||
Z_LVAL_P(op1)--;
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
return decrement_function(op1);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"addl (%2), %%eax\n\t"
|
||||
"jo 0f\n\t"
|
||||
"movl %%eax, (%0)\n\t"
|
||||
"movb $0x1,0xc(%0)\n\t"
|
||||
"jmp 1f\n"
|
||||
"0:\n\t"
|
||||
"fildl (%1)\n\t"
|
||||
"fildl (%2)\n\t"
|
||||
"faddp %%st, %%st(1)\n\t"
|
||||
"movb $0x2,0xc(%0)\n\t"
|
||||
"fstpl (%0)\n"
|
||||
"1:"
|
||||
:
|
||||
: "r"(result),
|
||||
"r"(op1),
|
||||
"r"(op2)
|
||||
: "eax");
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
__asm__(
|
||||
"movq (%1), %%rax\n\t"
|
||||
"addq (%2), %%rax\n\t"
|
||||
"jo 0f\n\t"
|
||||
"movq %%rax, (%0)\n\t"
|
||||
"movb $0x1,0x14(%0)\n\t"
|
||||
"jmp 1f\n"
|
||||
"0:\n\t"
|
||||
"fildq (%1)\n\t"
|
||||
"fildq (%2)\n\t"
|
||||
"faddp %%st, %%st(1)\n\t"
|
||||
"movb $0x2,0x14(%0)\n\t"
|
||||
"fstpl (%0)\n"
|
||||
"1:"
|
||||
:
|
||||
: "r"(result),
|
||||
"r"(op1),
|
||||
"r"(op2)
|
||||
: "rax");
|
||||
#else
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
|
||||
|
||||
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
|
||||
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
|
||||
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
} else {
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) + Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2));
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return add_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
__asm__(
|
||||
"movl (%1), %%eax\n\t"
|
||||
"subl (%2), %%eax\n\t"
|
||||
"jo 0f\n\t"
|
||||
"movl %%eax, (%0)\n\t"
|
||||
"movb $0x1,0xc(%0)\n\t"
|
||||
"jmp 1f\n"
|
||||
"0:\n\t"
|
||||
"fildl (%2)\n\t"
|
||||
"fildl (%1)\n\t"
|
||||
"fsubp %%st, %%st(1)\n\t"
|
||||
"movb $0x2,0xc(%0)\n\t"
|
||||
"fstpl (%0)\n"
|
||||
"1:"
|
||||
:
|
||||
: "r"(result),
|
||||
"r"(op1),
|
||||
"r"(op2)
|
||||
: "eax");
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
__asm__(
|
||||
"movq (%1), %%rax\n\t"
|
||||
"subq (%2), %%rax\n\t"
|
||||
"jo 0f\n\t"
|
||||
"movq %%rax, (%0)\n\t"
|
||||
"movb $0x1,0x14(%0)\n\t"
|
||||
"jmp 1f\n"
|
||||
"0:\n\t"
|
||||
"fildq (%2)\n\t"
|
||||
"fildq (%1)\n\t"
|
||||
"fsubp %%st, %%st(1)\n\t"
|
||||
"movb $0x2,0x14(%0)\n\t"
|
||||
"fstpl (%0)\n"
|
||||
"1:"
|
||||
:
|
||||
: "r"(result),
|
||||
"r"(op1),
|
||||
"r"(op2)
|
||||
: "rax");
|
||||
#else
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) - Z_LVAL_P(op2);
|
||||
|
||||
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
|
||||
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
|
||||
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
} else {
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2));
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return sub_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
long overflow;
|
||||
|
||||
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
|
||||
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) * Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2));
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return mul_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_BOOL;
|
||||
return FAILURE;
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN)) {
|
||||
/* Prevent overflow error/crash */
|
||||
Z_DVAL_P(result) = (double) LONG_MIN / -1;
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
} else if (EXPECTED(Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0)) {
|
||||
/* integer */
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) / Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
} else {
|
||||
Z_DVAL_P(result) = ((double) Z_LVAL_P(op1)) / ((double)Z_LVAL_P(op2));
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
}
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_BOOL;
|
||||
return FAILURE;
|
||||
}
|
||||
Z_DVAL_P(result) = ((double)Z_LVAL_P(op1)) / Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
if (UNEXPECTED(Z_DVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_BOOL;
|
||||
return FAILURE;
|
||||
}
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) / Z_DVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_BOOL;
|
||||
return FAILURE;
|
||||
}
|
||||
Z_DVAL_P(result) = Z_DVAL_P(op1) / ((double)Z_LVAL_P(op2));
|
||||
Z_TYPE_P(result) = IS_DOUBLE;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return div_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_BOOL;
|
||||
return FAILURE;
|
||||
} else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
|
||||
/* Prevent overflow error/crash if op1==LONG_MIN */
|
||||
Z_LVAL_P(result) = 0;
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
Z_LVAL_P(result) = Z_LVAL_P(op1) % Z_LVAL_P(op2);
|
||||
Z_TYPE_P(result) = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
return mod_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_LVAL_P(op1) == Z_LVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return ((double)Z_LVAL_P(op1)) == Z_DVAL_P(op2);
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return Z_DVAL_P(op1) == Z_DVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2));
|
||||
}
|
||||
}
|
||||
compare_function(result, op1, op2 TSRMLS_CC);
|
||||
return Z_LVAL_P(result) == 0;
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_LVAL_P(op1) != Z_LVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return ((double)Z_LVAL_P(op1)) != Z_DVAL_P(op2);
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return Z_DVAL_P(op1) != Z_DVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_DVAL_P(op1) != ((double)Z_LVAL_P(op2));
|
||||
}
|
||||
}
|
||||
compare_function(result, op1, op2 TSRMLS_CC);
|
||||
return Z_LVAL_P(result) != 0;
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_LVAL_P(op1) < Z_LVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return ((double)Z_LVAL_P(op1)) < Z_DVAL_P(op2);
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return Z_DVAL_P(op1) < Z_DVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_DVAL_P(op1) < ((double)Z_LVAL_P(op2));
|
||||
}
|
||||
}
|
||||
compare_function(result, op1, op2 TSRMLS_CC);
|
||||
return Z_LVAL_P(result) < 0;
|
||||
}
|
||||
|
||||
static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_LVAL_P(op1) <= Z_LVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return ((double)Z_LVAL_P(op1)) <= Z_DVAL_P(op2);
|
||||
}
|
||||
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
|
||||
return Z_DVAL_P(op1) <= Z_DVAL_P(op2);
|
||||
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
return Z_DVAL_P(op1) <= ((double)Z_LVAL_P(op2));
|
||||
}
|
||||
}
|
||||
compare_function(result, op1, op2 TSRMLS_CC);
|
||||
return Z_LVAL_P(result) <= 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -32,7 +32,6 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
|
||||
case IS_STRING:
|
||||
case IS_CONSTANT:
|
||||
case IS_CLASS:
|
||||
CHECK_ZVAL_STRING_REL(zvalue);
|
||||
STR_FREE_REL(zvalue->value.str.val);
|
||||
break;
|
||||
|
||||
+138
-73
@@ -31,7 +31,7 @@ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zend_free_op free_op1, free_op2;
|
||||
|
||||
SAVE_OPLINE();
|
||||
add_function(&EX_T(opline->result.var).tmp_var,
|
||||
fast_add_function(&EX_T(opline->result.var).tmp_var,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
@@ -46,7 +46,7 @@ ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zend_free_op free_op1, free_op2;
|
||||
|
||||
SAVE_OPLINE();
|
||||
sub_function(&EX_T(opline->result.var).tmp_var,
|
||||
fast_sub_function(&EX_T(opline->result.var).tmp_var,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
@@ -61,7 +61,7 @@ ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zend_free_op free_op1, free_op2;
|
||||
|
||||
SAVE_OPLINE();
|
||||
mul_function(&EX_T(opline->result.var).tmp_var,
|
||||
fast_mul_function(&EX_T(opline->result.var).tmp_var,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
@@ -76,7 +76,7 @@ ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zend_free_op free_op1, free_op2;
|
||||
|
||||
SAVE_OPLINE();
|
||||
div_function(&EX_T(opline->result.var).tmp_var,
|
||||
fast_div_function(&EX_T(opline->result.var).tmp_var,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
@@ -91,7 +91,7 @@ ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zend_free_op free_op1, free_op2;
|
||||
|
||||
SAVE_OPLINE();
|
||||
mod_function(&EX_T(opline->result.var).tmp_var,
|
||||
fast_mod_function(&EX_T(opline->result.var).tmp_var,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
@@ -184,10 +184,9 @@ ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zval *result = &EX_T(opline->result.var).tmp_var;
|
||||
|
||||
SAVE_OPLINE();
|
||||
compare_function(result,
|
||||
ZVAL_BOOL(result, fast_equal_function(result,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
CHECK_EXCEPTION();
|
||||
@@ -201,10 +200,9 @@ ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zval *result = &EX_T(opline->result.var).tmp_var;
|
||||
|
||||
SAVE_OPLINE();
|
||||
compare_function(result,
|
||||
ZVAL_BOOL(result, fast_not_equal_function(result,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
CHECK_EXCEPTION();
|
||||
@@ -218,10 +216,9 @@ ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
zval *result = &EX_T(opline->result.var).tmp_var;
|
||||
|
||||
SAVE_OPLINE();
|
||||
compare_function(result,
|
||||
ZVAL_BOOL(result, fast_is_smaller_function(result,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
CHECK_EXCEPTION();
|
||||
@@ -235,10 +232,9 @@ ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV
|
||||
zval *result = &EX_T(opline->result.var).tmp_var;
|
||||
|
||||
SAVE_OPLINE();
|
||||
compare_function(result,
|
||||
ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result,
|
||||
GET_OP1_ZVAL_PTR(BP_VAR_R),
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
|
||||
ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
|
||||
GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
CHECK_EXCEPTION();
|
||||
@@ -824,11 +820,11 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
|
||||
/* proxy object */
|
||||
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
Z_ADDREF_P(val);
|
||||
increment_function(val);
|
||||
fast_increment_function(val);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
|
||||
zval_ptr_dtor(&val);
|
||||
} else {
|
||||
increment_function(*var_ptr);
|
||||
fast_increment_function(*var_ptr);
|
||||
}
|
||||
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -871,11 +867,11 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
|
||||
/* proxy object */
|
||||
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
Z_ADDREF_P(val);
|
||||
decrement_function(val);
|
||||
fast_decrement_function(val);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
|
||||
zval_ptr_dtor(&val);
|
||||
} else {
|
||||
decrement_function(*var_ptr);
|
||||
fast_decrement_function(*var_ptr);
|
||||
}
|
||||
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -919,11 +915,11 @@ ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
|
||||
/* proxy object */
|
||||
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
Z_ADDREF_P(val);
|
||||
increment_function(val);
|
||||
fast_increment_function(val);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
|
||||
zval_ptr_dtor(&val);
|
||||
} else {
|
||||
increment_function(*var_ptr);
|
||||
fast_increment_function(*var_ptr);
|
||||
}
|
||||
|
||||
FREE_OP1_VAR_PTR();
|
||||
@@ -962,11 +958,11 @@ ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
|
||||
/* proxy object */
|
||||
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
Z_ADDREF_P(val);
|
||||
decrement_function(val);
|
||||
fast_decrement_function(val);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
|
||||
zval_ptr_dtor(&val);
|
||||
} else {
|
||||
decrement_function(*var_ptr);
|
||||
fast_decrement_function(*var_ptr);
|
||||
}
|
||||
|
||||
FREE_OP1_VAR_PTR();
|
||||
@@ -2386,6 +2382,67 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
}
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else if (OP2_TYPE != IS_CONST &&
|
||||
EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
|
||||
zend_class_entry *ce;
|
||||
zval **method = NULL;
|
||||
zval **obj = NULL;
|
||||
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(method) != IS_STRING) {
|
||||
zend_error_noreturn(E_ERROR, "Second array member is not a valid method");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) == IS_STRING) {
|
||||
ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(obj));
|
||||
}
|
||||
EX(called_scope) = ce;
|
||||
EX(object) = NULL;
|
||||
|
||||
if (ce->get_static_method) {
|
||||
EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC);
|
||||
} else {
|
||||
EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
EX(object) = *obj;
|
||||
ce = EX(called_scope) = Z_OBJCE_PP(obj);
|
||||
|
||||
EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC);
|
||||
if (UNEXPECTED(EX(fbc) == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
|
||||
}
|
||||
|
||||
if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
|
||||
EX(object) = NULL;
|
||||
} else {
|
||||
if (!PZVAL_IS_REF(EX(object))) {
|
||||
Z_ADDREF_P(EX(object)); /* For $this pointer */
|
||||
} else {
|
||||
zval *this_ptr;
|
||||
ALLOC_ZVAL(this_ptr);
|
||||
INIT_PZVAL_COPY(this_ptr, EX(object));
|
||||
zval_copy_ctor(this_ptr);
|
||||
EX(object) = this_ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (UNEXPECTED(EX(fbc) == NULL)) {
|
||||
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method));
|
||||
}
|
||||
FREE_OP2();
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
} else {
|
||||
zend_error_noreturn(E_ERROR, "Function name must be a string");
|
||||
}
|
||||
@@ -3641,58 +3698,66 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
|
||||
+692
-480
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
/* Leave this file alone */
|
||||
+6
-5
@@ -2412,6 +2412,7 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
LIBS=$old_LIBS
|
||||
PHP_ADD_LIBRARY(ssl,,$1)
|
||||
PHP_ADD_LIBRARY(crypto,,$1)
|
||||
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
|
||||
@@ -2760,17 +2761,17 @@ dnl
|
||||
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
|
||||
dnl
|
||||
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
|
||||
AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [
|
||||
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
|
||||
AC_MSG_CHECKING([for PDO includes])
|
||||
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
|
||||
pdo_inc_path=$abs_srcdir/ext
|
||||
pdo_cv_inc_path=$abs_srcdir/ext
|
||||
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
|
||||
pdo_inc_path=$abs_srcdir/ext
|
||||
pdo_cv_inc_path=$abs_srcdir/ext
|
||||
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
|
||||
pdo_inc_path=$prefix/include/php/ext
|
||||
pdo_cv_inc_path=$prefix/include/php/ext
|
||||
fi
|
||||
])
|
||||
if test -n "$pdo_inc_path"; then
|
||||
if test -n "$pdo_cv_inc_path"; then
|
||||
ifelse([$1],[],:,[$1])
|
||||
else
|
||||
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
|
||||
|
||||
@@ -32,7 +32,6 @@ all: $(STAMP) $(ALWAYS)
|
||||
|
||||
generated_lists:
|
||||
@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
|
||||
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
|
||||
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
|
||||
|
||||
|
||||
+1
-7
@@ -25,8 +25,6 @@ LT_TARGETS = ltmain.sh config.guess config.sub
|
||||
|
||||
config_h_in = main/php_config.h.in
|
||||
|
||||
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
|
||||
|
||||
targets = $(TOUCH_FILES) configure $(config_h_in)
|
||||
|
||||
PHP_AUTOCONF ?= 'autoconf'
|
||||
@@ -36,11 +34,7 @@ SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to all
|
||||
|
||||
all: $(targets)
|
||||
|
||||
acconfig.h: $(acconfig_h_SOURCES)
|
||||
@echo rebuilding $@
|
||||
cat $(acconfig_h_SOURCES) > $@
|
||||
|
||||
$(config_h_in): configure acconfig.h
|
||||
$(config_h_in): configure
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@echo rebuilding $@
|
||||
|
||||
+4
-12
@@ -28,32 +28,24 @@ if test -z "$PHP_AUTOCONF"; then
|
||||
PHP_AUTOCONF='autoconf'
|
||||
fi
|
||||
|
||||
# autoconf 2.13 or newer
|
||||
# autoconf 2.59 or newer
|
||||
ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " You need autoconf version 2.59 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $ac_version; IFS=' '
|
||||
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
|
||||
if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " You need autoconf version 2.59 or newer installed"
|
||||
echo " to build PHP from SVN."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
fi
|
||||
|
||||
if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
echo "buildconf: Your version of autoconf likely contains buggy cache code."
|
||||
echo " Running vcsclean for you."
|
||||
echo " To avoid this, install autoconf-2.13."
|
||||
./vcsclean
|
||||
stamp=
|
||||
fi
|
||||
|
||||
test -n "$stamp" && touch $stamp
|
||||
|
||||
exit 0
|
||||
+104
-51
@@ -1,28 +1,6 @@
|
||||
## $Id$ -*- autoconf -*-
|
||||
dnl ## Process this file with autoconf to produce a configure script.
|
||||
|
||||
divert(1)
|
||||
|
||||
dnl ## Diversion 1 is the autoconf + automake setup phase. We also
|
||||
dnl ## set the PHP version, deal with platform-specific compile
|
||||
dnl ## options and check for the basic compile tools.
|
||||
|
||||
dnl ## Diversion 2 is the initial checking of OS features, programs,
|
||||
dnl ## libraries and so on.
|
||||
|
||||
dnl ## In diversion 3 we check for compile-time options to the PHP
|
||||
dnl ## core and how to deal with different system dependencies.
|
||||
dnl ## This includes whether debugging or short tags are enabled
|
||||
dnl ## and the default behaviour of php.ini options.
|
||||
dnl ## This is also where an SAPI interface is selected (choosing between
|
||||
dnl ## Apache module, CGI etc.)
|
||||
|
||||
dnl ## In diversion 4 we check user-configurable general settings.
|
||||
|
||||
dnl ## In diversion 5 we check which extensions should be compiled.
|
||||
dnl ## All of these are normally in the extension directories.
|
||||
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
|
||||
|
||||
dnl include Zend specific macro definitions first
|
||||
dnl -------------------------------------------------------------------------
|
||||
sinclude(Zend/acinclude.m4)
|
||||
@@ -30,19 +8,119 @@ sinclude(Zend/acinclude.m4)
|
||||
dnl Basic autoconf + automake initialization, generation of config.nice.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ(2.13)
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT(README.SVN-RULES)
|
||||
ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
|
||||
|
||||
PHP_CONFIG_NICE(config.nice)
|
||||
|
||||
PHP_CANONICAL_HOST_TARGET
|
||||
|
||||
AC_CONFIG_HEADER(main/php_config.h)
|
||||
AH_TOP([
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define ZEND_API __attribute__ ((visibility("default")))
|
||||
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define ZEND_API
|
||||
# define ZEND_DLEXPORT
|
||||
#endif
|
||||
|
||||
#define ZEND_DLIMPORT
|
||||
|
||||
#undef uint
|
||||
#undef ulong
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
])
|
||||
AH_BOTTOM([
|
||||
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* To enable the is_nan, is_infinite and is_finite PHP functions */
|
||||
#ifdef NETWARE
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISFINITE 1
|
||||
#endif
|
||||
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#else
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#endif
|
||||
|
||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||
|
||||
#ifdef NETWARE
|
||||
#ifdef USE_WINSOCK
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
|
||||
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef PTHREADS
|
||||
])
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=99
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="alpha1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -289,15 +367,6 @@ sinclude(Zend/Zend.m4)
|
||||
sinclude(TSRM/threads.m4)
|
||||
sinclude(TSRM/tsrm.m4)
|
||||
|
||||
|
||||
divert(2)
|
||||
|
||||
dnl ## Diversion 2 is where we set PHP-specific options and come up
|
||||
dnl ## with reasonable default values for them. We check for pthreads here
|
||||
dnl ## because the information is needed by the SAPI configuration.
|
||||
dnl ## This is also where an SAPI interface is selected (choosing between
|
||||
dnl ## Apache module, CGI etc.)
|
||||
|
||||
dnl .
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
@@ -343,13 +412,6 @@ if test "$enable_maintainer_zts" = "yes"; then
|
||||
PTHREADS_FLAGS
|
||||
fi
|
||||
|
||||
divert(3)
|
||||
|
||||
dnl ## In diversion 3 we check for compile-time options to the PHP
|
||||
dnl ## core and how to deal with different system dependencies.
|
||||
dnl ## This includes whether debugging or short tags are enabled
|
||||
dnl ## and the default behaviour of php.ini options.
|
||||
|
||||
dnl Starting system checks.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
@@ -689,10 +751,6 @@ if test "x$php_crypt_r" = "x1"; then
|
||||
PHP_CRYPT_R_STYLE
|
||||
fi
|
||||
|
||||
divert(4)
|
||||
|
||||
dnl ## In diversion 4 we check user-configurable general settings.
|
||||
|
||||
dnl General settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
PHP_CONFIGURE_PART(General settings)
|
||||
@@ -927,11 +985,6 @@ else
|
||||
AC_MSG_RESULT([using system default])
|
||||
fi
|
||||
|
||||
divert(5)
|
||||
|
||||
dnl ## In diversion 5 we check which extensions should be compiled.
|
||||
dnl ## All of these are normally in the extension directories.
|
||||
|
||||
dnl Extension configuration.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
|
||||
+4
-2
@@ -385,12 +385,14 @@ static PHP_FUNCTION(bzopen)
|
||||
|
||||
/* If it's not a resource its a string containing the filename to open */
|
||||
if (Z_TYPE_PP(file) == IS_STRING) {
|
||||
convert_to_string_ex(file);
|
||||
|
||||
if (Z_STRLEN_PP(file) == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (CHECK_ZVAL_NULL_PATH(*file)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
stream = php_stream_bz2open(NULL,
|
||||
Z_STRVAL_PP(file),
|
||||
|
||||
@@ -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.
|
||||
@@ -379,7 +379,7 @@ CPH_METHOD(SaveToFile)
|
||||
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
|
||||
&filename, &filename_len, &remember)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
@@ -443,7 +443,7 @@ CPH_METHOD(LoadFromFile)
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
|
||||
&filename, &filename_len, &flags)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
curl_setopt basic tests.
|
||||
--CREDITS--
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--INI--
|
||||
safe_mode=On
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER') || PHP_VERSION_ID < 503099) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo "*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode\n";
|
||||
|
||||
$url = "{$host}/";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
|
||||
*** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode
|
||||
|
||||
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in %s on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -25,6 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
timelib_rel_time *rt;
|
||||
timelib_time *swp;
|
||||
timelib_sll dst_h_corr = 0, dst_m_corr = 0;
|
||||
timelib_time one_backup, two_backup;
|
||||
|
||||
rt = timelib_rel_time_ctor();
|
||||
rt->invert = 0;
|
||||
@@ -45,6 +46,10 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
dst_m_corr = ((two->z - one->z) % 3600) / 60;
|
||||
}
|
||||
|
||||
/* Save old TZ info */
|
||||
memcpy(&one_backup, one, sizeof(one_backup));
|
||||
memcpy(&two_backup, two, sizeof(two_backup));
|
||||
|
||||
timelib_apply_localtime(one, 0);
|
||||
timelib_apply_localtime(two, 0);
|
||||
|
||||
@@ -58,8 +63,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
|
||||
timelib_do_rel_normalize(rt->invert ? one : two, rt);
|
||||
|
||||
timelib_apply_localtime(one, 1);
|
||||
timelib_apply_localtime(two, 1);
|
||||
/* Restore old TZ info */
|
||||
memcpy(one, &one_backup, sizeof(one_backup));
|
||||
memcpy(two, &two_backup, sizeof(two_backup));
|
||||
|
||||
return rt;
|
||||
}
|
||||
+32703
-18167
File diff suppressed because it is too large.
Load diff
@@ -719,6 +719,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
for (tp = timelib_timezone_lookup; tp->name; tp++) {
|
||||
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
|
||||
if (!first_found) {
|
||||
first_found = 1;
|
||||
first_found_elem = tp;
|
||||
if (gmtoffset == -1) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
if (tp->gmtoffset == gmtoffset) {
|
||||
return tp;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (first_found) {
|
||||
return first_found_elem;
|
||||
}
|
||||
|
||||
|
||||
/* Still didn't find anything, let's find the zone solely based on
|
||||
* offset/isdst then */
|
||||
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
|
||||
@@ -2094,8 +2113,9 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
fptr++;
|
||||
}
|
||||
if (*fptr) {
|
||||
int done = 0;
|
||||
/* Trailing | and ! specifiers are valid. */
|
||||
while (*fptr) {
|
||||
while (*fptr && !done) {
|
||||
switch (*fptr++) {
|
||||
case '!': /* reset all fields to default */
|
||||
timelib_time_reset_fields(s->time);
|
||||
@@ -2107,6 +2127,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
|
||||
default:
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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--
|
||||
|
||||
@@ -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**
|
||||
@@ -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**
|
||||
@@ -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**
|
||||
@@ -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
|
||||
@@ -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);
|
||||
-47
@@ -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**
|
||||
-47
@@ -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**
|
||||
-47
@@ -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**
|
||||
-47
@@ -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**
|
||||
@@ -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);
|
||||
-11
@@ -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**
|
||||
-27
@@ -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**
|
||||
-27
@@ -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**
|
||||
-27
@@ -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**
|
||||
-27
@@ -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**
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
DateTime::diff() days -- dates
|
||||
--CREDITS--
|
||||
Daniel Convissor <danielc@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'examine_diff.inc';
|
||||
define('PHPT_DATETIME_SHOW', PHPT_DATETIME_SHOW_DAYS);
|
||||
require 'DateTime_data-dates.inc';
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
test__7: DAYS: **7**
|
||||
test_years_positive__7_by_0_day: DAYS: **2557**
|
||||
test_years_positive__7_by_1_day: DAYS: **2558**
|
||||
test_years_positive__6_shy_1_day: DAYS: **2556**
|
||||
test_years_positive__7_by_1_month: DAYS: **2585**
|
||||
test_years_positive__6_shy_1_month: DAYS: **2526**
|
||||
test_years_positive__7_by_1_month_split_newyear: DAYS: **2588**
|
||||
test_years_positive__6_shy_1_month_split_newyear: DAYS: **2526**
|
||||
test_negative__7: DAYS: **7**
|
||||
test_years_negative__7_by_0_day: DAYS: **2557**
|
||||
test_years_negative__7_by_1_day: DAYS: **2558**
|
||||
test_years_negative__6_shy_1_day: DAYS: **2556**
|
||||
test_years_negative__7_by_1_month: DAYS: **2585**
|
||||
test_years_negative__6_shy_1_month: DAYS: **2526**
|
||||
test_years_negative__7_by_1_month_split_newyear: DAYS: **2588**
|
||||
test_years_negative__6_shy_1_month_split_newyear: DAYS: **2526**
|
||||
Loaded 100 of 677 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user