[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c branches/PHP_5_4/ext/date/php_date.c trunk/ext/date/php_date.c

2011-08-07 Thread Gwynne Raskind
gwynne   Sun, 07 Aug 2011 18:12:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=314445

Log:
possible use without init fixed

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/branches/PHP_5_4/ext/date/php_date.c
U   php/php-src/trunk/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-08-07 17:51:59 UTC 
(rev 31)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-08-07 18:12:52 UTC 
(rev 314445)
@@ -2378,7 +2378,7 @@
 PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char 
*time_str, int time_str_len, char *format, zval *timezone_object, int ctor 
TSRMLS_DC)
 {
timelib_time   *now;
-   timelib_tzinfo *tzi;
+   timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst;
char *new_abbr;

Modified: php/php-src/branches/PHP_5_4/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_4/ext/date/php_date.c2011-08-07 17:51:59 UTC 
(rev 31)
+++ php/php-src/branches/PHP_5_4/ext/date/php_date.c2011-08-07 18:12:52 UTC 
(rev 314445)
@@ -2373,7 +2373,7 @@
 PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char 
*time_str, int time_str_len, char *format, zval *timezone_object, int ctor 
TSRMLS_DC)
 {
timelib_time   *now;
-   timelib_tzinfo *tzi;
+   timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst;
char *new_abbr;

Modified: php/php-src/trunk/ext/date/php_date.c
===
--- php/php-src/trunk/ext/date/php_date.c   2011-08-07 17:51:59 UTC (rev 
31)
+++ php/php-src/trunk/ext/date/php_date.c   2011-08-07 18:12:52 UTC (rev 
314445)
@@ -2373,7 +2373,7 @@
 PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char 
*time_str, int time_str_len, char *format, zval *timezone_object, int ctor 
TSRMLS_DC)
 {
timelib_time   *now;
-   timelib_tzinfo *tzi;
+   timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst;
char *new_abbr;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-25 Thread Derick Rethans
derick   Tue, 25 Jan 2011 15:08:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307735

Log:
- Let's keep this consistent in the whole file.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/trunk/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-25 14:59:24 UTC 
(rev 307734)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-25 15:08:19 UTC 
(rev 307735)
@@ -897,7 +897,7 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (tzid == NULL) {
+   if (! tzid) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));

Modified: php/php-src/trunk/ext/date/php_date.c
===
--- php/php-src/trunk/ext/date/php_date.c   2011-01-25 14:59:24 UTC (rev 
307734)
+++ php/php-src/trunk/ext/date/php_date.c   2011-01-25 15:08:19 UTC (rev 
307735)
@@ -897,7 +897,7 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (tzid == NULL) {
+   if (! tzid) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Ilia Alshanetsky
iliaaMon, 24 Jan 2011 20:58:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307719

Log:
removed un-used variable

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/trunk/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-24 19:17:45 UTC 
(rev 307718)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-24 20:58:09 UTC 
(rev 307719)
@@ -3527,7 +3527,6 @@
 {
php_interval_obj *obj;
zval tmp_member, tmp_value;
-   int found = 0;

if (member-type != IS_STRING) {
tmp_member = *member;

Modified: php/php-src/trunk/ext/date/php_date.c
===
--- php/php-src/trunk/ext/date/php_date.c   2011-01-24 19:17:45 UTC (rev 
307718)
+++ php/php-src/trunk/ext/date/php_date.c   2011-01-24 20:58:09 UTC (rev 
307719)
@@ -3522,7 +3522,6 @@
 {
php_interval_obj *obj;
zval tmp_member, tmp_value;
-   int found = 0;

if (member-type != IS_STRING) {
tmp_member = *member;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-19 Thread Pierre Joye
pajoye   Thu, 20 Jan 2011 07:05:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307618

Log:
- be sure that we got tzid by adding a default case

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/trunk/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-20 06:58:04 UTC 
(rev 307617)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-01-20 07:05:34 UTC 
(rev 307618)
@@ -889,17 +889,6 @@

switch (GetTimeZoneInformation(tzi))
{
-   /* no DST or not in effect */
-   case TIME_ZONE_ID_UNKNOWN:
-   case TIME_ZONE_ID_STANDARD:
-php_win_std_time:
-   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
-   if (! tzid) {
-   tzid = UTC;
-   }
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
-   break;
-
/* DST in effect */
case TIME_ZONE_ID_DAYLIGHT:
/* If user has disabled DST in the control 
panel, Windows returns 0 here */
@@ -908,11 +897,24 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (! tzid) {
+   if (tzid == NULL) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));
break;
+
+   /* no DST or not in effect */
+   case TIME_ZONE_ID_UNKNOWN:
+   case TIME_ZONE_ID_STANDARD:
+   default:
+php_win_std_time:
+   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
+   if (! tzid) {
+   tzid = UTC;
+   }
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
+   break;
+
}
return tzid;
}

Modified: php/php-src/trunk/ext/date/php_date.c
===
--- php/php-src/trunk/ext/date/php_date.c   2011-01-20 06:58:04 UTC (rev 
307617)
+++ php/php-src/trunk/ext/date/php_date.c   2011-01-20 07:05:34 UTC (rev 
307618)
@@ -889,17 +889,6 @@

switch (GetTimeZoneInformation(tzi))
{
-   /* no DST or not in effect */
-   case TIME_ZONE_ID_UNKNOWN:
-   case TIME_ZONE_ID_STANDARD:
-php_win_std_time:
-   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.StandardBias) * -60, 0);
-   if (! tzid) {
-   tzid = UTC;
-   }
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/no DST' instead, tzid, ((tzi.Bias + 
tzi.StandardBias) / -60.0));
-   break;
-
/* DST in effect */
case TIME_ZONE_ID_DAYLIGHT:
/* If user has disabled DST in the control 
panel, Windows returns 0 here */
@@ -908,11 +897,24 @@
}

tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + tzi.DaylightBias) * -60, 1);
-   if (! tzid) {
+   if (tzid == NULL) {
tzid = UTC;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
DATE_TZ_ERRMSG We selected '%s' for '%.1f/DST' instead, tzid, ((tzi.Bias + 
tzi.DaylightBias) / -60.0));
break;
+
+   /* no DST or not in effect */
+   case TIME_ZONE_ID_UNKNOWN:
+   case TIME_ZONE_ID_STANDARD:
+   default:
+php_win_std_time:
+   tzid = timelib_timezone_id_from_abbr(, 
(tzi.Bias + 

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c php_date.h

2010-11-18 Thread Johannes Schlüter
Derick,

On Sat, 2010-11-13 at 16:31 +, Derick Rethans wrote:
 Changed paths:
 U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
 U   php/php-src/branches/PHP_5_3/ext/date/php_date.h

 -PHPAPI int php_idate(char format, time_t ts, int localtime)
 +PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)

This breaks the ABI in a point release.

 -static zval * date_instantiate(zend_class_entry *pce, zval *object
 TSRMLS_DC)
 +PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object
 TSRMLS_DC)

 -static int date_initialize(php_date_obj *dateobj, /*const*/ char
 *time_str, int time_str_len, char *format, zval *timezone_object, int
 ctor TSRMLS_DC)
 +PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char
 *time_str, int time_str_len, char *format, zval *timezone_object, int
 ctor TSRMLS_DC)

Adding new APIs in point releases has been done before, but should be
done with care.

  /* Backwards compability wrapper */
  PHPAPI signed long php_parse_date(char *string, signed long *now);
  PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
 -PHPAPI int php_idate(char format, time_t ts, int localtime);
 +PHPAPI int php_idate(char format, time_t ts, int localtime
 TSRMLS_DC);
  #if HAVE_STRFTIME
  #define _php_strftime php_strftime
  PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);

Ah, I remember the discussion. How can it be a Backwards compability
wrapper if it isn't backwards compatible in its signature? Or does the
comment apply only to php_parse_date()?

Can we use TSRMLS_FETCH() in 5_3 and move this away from the comment in
trunk?


johannes


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c php_date.h

2010-11-18 Thread Derick Rethans
derick   Thu, 18 Nov 2010 11:24:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305492

Log:
- Revert the ABI changing commit.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/branches/PHP_5_3/ext/date/php_date.h

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 10:47:45 UTC 
(rev 305491)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 11:24:59 UTC 
(rev 305492)
@@ -1203,13 +1203,14 @@

 /* {{{ php_idate
  */
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
+PHPAPI int php_idate(char format, time_t ts, int localtime)
 {
timelib_time   *t;
timelib_tzinfo *tzi;
int retval = -1;
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
+   TSRMLS_FETCH()

t = timelib_time_ctor();


Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.h
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.h2010-11-18 10:47:45 UTC 
(rev 305491)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.h2010-11-18 11:24:59 UTC 
(rev 305492)
@@ -163,7 +163,7 @@
 /* Backwards compability wrapper */
 PHPAPI signed long php_parse_date(char *string, signed long *now);
 PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
+PHPAPI int php_idate(char format, time_t ts, int localtime);
 #if HAVE_STRFTIME
 #define _php_strftime php_strftime
 PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c php_date.h

2010-11-18 Thread Derick Rethans
On Thu, 18 Nov 2010, Johannes Schlüter wrote:

 On Sat, 2010-11-13 at 16:31 +, Derick Rethans wrote:
  Changed paths:
  U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
  U   php/php-src/branches/PHP_5_3/ext/date/php_date.h
 
  -PHPAPI int php_idate(char format, time_t ts, int localtime)
  +PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
 
 This breaks the ABI in a point release.

Ah right, I've fixed that. So much for keeping 5.3 and trunk in sync :-)

   /* Backwards compability wrapper */
   PHPAPI signed long php_parse_date(char *string, signed long *now);
   PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
  -PHPAPI int php_idate(char format, time_t ts, int localtime);
  +PHPAPI int php_idate(char format, time_t ts, int localtime
  TSRMLS_DC);
   #if HAVE_STRFTIME
   #define _php_strftime php_strftime
   PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
 
 Ah, I remember the discussion. How can it be a Backwards compability
 wrapper if it isn't backwards compatible in its signature? Or does the
 comment apply only to php_parse_date()?

 Can we use TSRMLS_FETCH() in 5_3 and move this away from the comment in
 trunk?

The Backwards compability wrapper was there already. The signature 
change should not be. So the comment should stay.

regards,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c

2010-11-18 Thread Derick Rethans
derick   Thu, 18 Nov 2010 11:28:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305493

Log:
- Fixed the call as well.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 11:24:59 UTC 
(rev 305492)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 11:28:07 UTC 
(rev 305493)
@@ -1336,7 +1336,7 @@
ts = time(NULL);
}

-   ret = php_idate(format[0], ts, 0 TSRMLS_CC);
+   ret = php_idate(format[0], ts, 0);
if (ret == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unrecognized date 
format token.);
RETURN_FALSE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c

2010-11-18 Thread Felipe Pena
felipe   Thu, 18 Nov 2010 11:33:42 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305494

Log:
- Fix build

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 11:28:07 UTC 
(rev 305493)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2010-11-18 11:33:42 UTC 
(rev 305494)
@@ -1210,7 +1210,7 @@
int retval = -1;
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
-   TSRMLS_FETCH()
+   TSRMLS_FETCH();

t = timelib_time_ctor();


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/ php_date.c php_date.h

2010-11-13 Thread Derick Rethans
derick   Sat, 13 Nov 2010 16:31:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305320

Log:
- Sync from HEAD.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/php_date.c
U   php/php-src/branches/PHP_5_3/ext/date/php_date.h

Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/php_date.c	2010-11-13 16:30:22 UTC (rev 305319)
+++ php/php-src/branches/PHP_5_3/ext/date/php_date.c	2010-11-13 16:31:01 UTC (rev 305320)
@@ -475,7 +475,6 @@

 static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
 static void date_register_classes(TSRMLS_D);
-static zval * date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
 /* }}} */

 ZEND_DECLARE_MODULE_GLOBALS(date)
@@ -1204,7 +1203,7 @@

 /* {{{ php_idate
  */
-PHPAPI int php_idate(char format, time_t ts, int localtime)
+PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
 {
 	timelib_time   *t;
 	timelib_tzinfo *tzi;
@@ -1215,7 +1214,6 @@
 	t = timelib_time_ctor();

 	if (!localtime) {
-		TSRMLS_FETCH();
 		tzi = get_timezone_info(TSRMLS_C);
 		t-tz_info = tzi;
 		t-zone_type = TIMELIB_ZONETYPE_ID;
@@ -1337,7 +1335,7 @@
 		ts = time(NULL);
 	}

-	ret = php_idate(format[0], ts, 0);
+	ret = php_idate(format[0], ts, 0 TSRMLS_CC);
 	if (ret == -1) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, Unrecognized date format token.);
 		RETURN_FALSE;
@@ -1852,7 +1850,7 @@

 	/* Create new object */
 	MAKE_STD_ZVAL(iterator-current);
-	date_instantiate(date_ce_date, iterator-current TSRMLS_CC);
+	php_date_instantiate(date_ce_date, iterator-current TSRMLS_CC);
 	newdateobj = (php_date_obj *) zend_object_store_get_object(iterator-current TSRMLS_CC);
 	newdateobj-time = timelib_time_ctor();
 	*newdateobj-time = *it_time;
@@ -2089,7 +2087,7 @@

 	dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);

-	props = dateobj-std.properties;
+	props = zend_std_get_properties(object TSRMLS_CC);

 	if (!dateobj-time || GC_G(gc_active)) {
 		return props;
@@ -2232,7 +2230,7 @@

 	intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);

-	props = intervalobj-std.properties;
+	props = zend_std_get_properties(object TSRMLS_CC);

 	if (!intervalobj-initialized || GC_G(gc_active)) {
 		return props;
@@ -2353,7 +2351,7 @@
 }

 /* Advanced Interface */
-static zval * date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
+PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
 {
 	Z_TYPE_P(object) = IS_OBJECT;
 	object_init_ex(object, pce);
@@ -2373,7 +2371,7 @@
 	DATEG(last_errors) = last_errors;
 }

-static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC)
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC)
 {
 	timelib_time   *now;
 	timelib_tzinfo *tzi;
@@ -2468,8 +2466,8 @@
 		RETURN_FALSE;
 	}

-	date_instantiate(date_ce_date, return_value TSRMLS_CC);
-	if (!date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
+	php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
+	if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
 		RETURN_FALSE;
 	}
 }
@@ -2488,8 +2486,8 @@
 		RETURN_FALSE;
 	}

-	date_instantiate(date_ce_date, return_value TSRMLS_CC);
-	if (!date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
+	php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
+	if (!php_date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
 		RETURN_FALSE;
 	}
 }
@@ -2507,7 +2505,7 @@

 	zend_replace_error_handling(EH_THROW, NULL, error_handling TSRMLS_CC);
 	if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sO, time_str, time_str_len, timezone_object, date_ce_timezone)) {
-		date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
+		php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
 	}
 	zend_restore_error_handling(error_handling TSRMLS_CC);
 }
@@ -2534,7 +2532,7 @@
 	case TIMELIB_ZONETYPE_ABBR: {
 		char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
 		snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, %s %s, Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
-		date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0