summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-04-02 09:06:46 +0800
committerXinchen Hui <laruence@php.net>2015-04-02 09:06:46 +0800
commit97123042a2520206bfedd1c2f95150297d626234 (patch)
tree97ded19a14a4b14f06349f3ab5a77742f8ab3f2a
parent9433b33ac142502bd7e8a1210d6a0770c5317800 (diff)
parent9806a37a79f9e858c8ea54899942c9a681b98f29 (diff)
downloadphp-git-97123042a2520206bfedd1c2f95150297d626234.tar.gz
Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6
-rw-r--r--UPGRADING1
-rw-r--r--Zend/tests/bug43201.phpt2
-rw-r--r--ext/date/php_date.c35
-rw-r--r--ext/date/php_date.h1
-rw-r--r--ext/date/tests/DateTime_createFromImmutable.phpt26
-rw-r--r--ext/date/tests/DateTime_verify.phpt37
-rw-r--r--ext/mysqli/tests/mysqli_fetch_field_flags.phpt2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt8
8 files changed, 22 insertions, 90 deletions
diff --git a/UPGRADING b/UPGRADING
index 45c96b8e56..52f139de28 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -271,7 +271,6 @@ PHP 5.6 UPGRADE NOTES
- Datetime:
Added DatePeriod::getStartDate(), DatePeriod::getEndDate(), DatePeriod::getDateInterval() in 5.6.5.
- Added DateTime::createFromImmutable() in 5.6.8.
- GMP:
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
diff --git a/Zend/tests/bug43201.phpt b/Zend/tests/bug43201.phpt
index 89e1b66727..53bb5ba98d 100644
--- a/Zend/tests/bug43201.phpt
+++ b/Zend/tests/bug43201.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #43201 (Crash on using unitialized vals and __get/__set)
+Bug #43201 (Crash on using uninitialized vals and __get/__set)
--FILE--
<?php
class Foo {
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index c892c86da1..ca61fb7b68 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -185,10 +185,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_date_format, 0, 0, 2)
ZEND_ARG_INFO(0, format)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_immutable, 0, 0, 1)
- ZEND_ARG_INFO(0, DateTimeImmutable)
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_format, 0, 0, 1)
ZEND_ARG_INFO(0, format)
ZEND_END_ARG_INFO()
@@ -472,7 +468,6 @@ const zend_function_entry date_funcs_date[] = {
PHP_ME(DateTime, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DateTime, __wakeup, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DateTime, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- PHP_ME(DateTime, createFromImmutable, arginfo_date_method_create_from_immutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(createFromFormat, date_create_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(format, date_format, arginfo_date_method_format, 0)
@@ -2786,7 +2781,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
php_date_obj *new_obj = NULL;
php_date_obj *old_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime_object, date_ce_date) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
return;
}
@@ -2917,34 +2912,6 @@ PHP_METHOD(DateTime, __wakeup)
}
/* }}} */
-/* {{{ proto DateTime::createFromImmutable(DateTimeImmutable object)
- Creates new DateTime object from an existing DateTimeImmutable object.
-*/
-PHP_METHOD(DateTime, createFromImmutable)
-{
- zval *datetimeimmutable_object = NULL;
- php_date_obj *new_obj = NULL;
- php_date_obj *old_obj = NULL;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetimeimmutable_object, date_ce_immutable) == FAILURE) {
- return;
- }
-
- php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
- old_obj = (php_date_obj *) zend_object_store_get_object(datetimeimmutable_object TSRMLS_CC);
- new_obj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
-
- new_obj->time = timelib_time_ctor();
- *new_obj->time = *old_obj->time;
- if (old_obj->time->tz_abbr) {
- new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
- }
- if (old_obj->time->tz_info) {
- new_obj->time->tz_info = old_obj->time->tz_info;
- }
-}
-/* }}} */
-
/* Helper function used to add an associative array of warnings and errors to a zval */
static void zval_from_error_container(zval *z, timelib_error_container *error)
{
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index d599e8fb37..34b8a8ebd3 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -50,7 +50,6 @@ PHP_FUNCTION(getdate);
PHP_METHOD(DateTime, __construct);
PHP_METHOD(DateTime, __wakeup);
PHP_METHOD(DateTime, __set_state);
-PHP_METHOD(DateTime, createFromImmutable);
PHP_FUNCTION(date_create);
PHP_FUNCTION(date_create_immutable);
PHP_FUNCTION(date_create_from_format);
diff --git a/ext/date/tests/DateTime_createFromImmutable.phpt b/ext/date/tests/DateTime_createFromImmutable.phpt
deleted file mode 100644
index bfde94d825..0000000000
--- a/ext/date/tests/DateTime_createFromImmutable.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-Tests for DateTime::createFromImmutable.
---INI--
-date.timezone=America/New_York
---FILE--
-<?php
-$current = "2015-03-05 07:00:16";
-
-$i = DateTime::createFromImmutable(date_create_immutable($current));
-var_dump($i);
-
-$i = DateTime::createFromImmutable(date_create($current));
-var_dump($i);
-?>
---EXPECTF--
-object(DateTime)#%d (3) {
- ["date"]=>
- string(26) "2015-03-05 07:00:16.000000"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(16) "America/New_York"
-}
-
-Warning: DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given in %stests%eDateTime_createFromImmutable.php on line %d
-NULL
diff --git a/ext/date/tests/DateTime_verify.phpt b/ext/date/tests/DateTime_verify.phpt
index aa13494d25..c790974729 100644
--- a/ext/date/tests/DateTime_verify.phpt
+++ b/ext/date/tests/DateTime_verify.phpt
@@ -27,7 +27,7 @@ object(ReflectionClass)#%d (1) {
string(8) "DateTime"
}
..and get names of all its methods
-array(19) {
+array(18) {
[0]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
@@ -52,109 +52,102 @@ array(19) {
[3]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
- string(19) "createFromImmutable"
- ["class"]=>
- string(8) "DateTime"
- }
- [4]=>
- &object(ReflectionMethod)#%d (2) {
- ["name"]=>
string(16) "createFromFormat"
["class"]=>
string(8) "DateTime"
}
- [5]=>
+ [4]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(13) "getLastErrors"
["class"]=>
string(8) "DateTime"
}
- [6]=>
+ [5]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(6) "format"
["class"]=>
string(8) "DateTime"
}
- [7]=>
+ [6]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(6) "modify"
["class"]=>
string(8) "DateTime"
}
- [8]=>
+ [7]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(3) "add"
["class"]=>
string(8) "DateTime"
}
- [9]=>
+ [8]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(3) "sub"
["class"]=>
string(8) "DateTime"
}
- [10]=>
+ [9]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(11) "getTimezone"
["class"]=>
string(8) "DateTime"
}
- [11]=>
+ [10]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(11) "setTimezone"
["class"]=>
string(8) "DateTime"
}
- [12]=>
+ [11]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(9) "getOffset"
["class"]=>
string(8) "DateTime"
}
- [13]=>
+ [12]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(7) "setTime"
["class"]=>
string(8) "DateTime"
}
- [14]=>
+ [13]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(7) "setDate"
["class"]=>
string(8) "DateTime"
}
- [15]=>
+ [14]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(10) "setISODate"
["class"]=>
string(8) "DateTime"
}
- [16]=>
+ [15]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(12) "setTimestamp"
["class"]=>
string(8) "DateTime"
}
- [17]=>
+ [16]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(12) "getTimestamp"
["class"]=>
string(8) "DateTime"
}
- [18]=>
+ [17]=>
&object(ReflectionMethod)#%d (2) {
["name"]=>
string(4) "diff"
diff --git a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt
index 8259d2f505..06b936aeed 100644
--- a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt
+++ b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt
@@ -199,7 +199,6 @@ mysqli_close($link);
if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
printf("[008] %s [%d] %s\n", $column_def,
mysqli_errno($link), mysqli_error($link));
- continue;
}
$column_def = array('col1 CHAR(1)', 'col2 CHAR(2)','INDEX idx_col1_col2(col1, col2)');
@@ -220,7 +219,6 @@ mysqli_close($link);
while ($field = mysqli_fetch_field($res)) {
if (!isset($expected_flags[$field->name])) {
printf("[010] Found unexpected field '%s'\n", $field->name);
- continue;
}
list($missing_flags, $unexpected_flags, $flags_found) = checkFlags($field->flags, $expected_flags[$field->name], $flags);
if ($unexpected_flags)
diff --git a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
index 5990ab812e..d59c930328 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_pconnect.phpt
@@ -85,10 +85,12 @@ MySQLPDOTest::skip();
} catch (PDOException $e) {
- printf("[001] %s, [%s] %s\n",
+ printf("[001] %s, [%s] %s [%s] %s\n",
$e->getMessage(),
- (is_object($db)) ? $db->errorCode() : 'n/a',
- (is_object($db)) ? implode(' ', $db->errorInfo()) : 'n/a');
+ (is_object($db1)) ? $db1->errorCode() : 'n/a',
+ (is_object($db1)) ? implode(' ', $db1->errorInfo()) : 'n/a',
+ (is_object($db2)) ? $db2->errorCode() : 'n/a',
+ (is_object($db2)) ? implode(' ', $db2->errorInfo()) : 'n/a');
}
print "done!";