Merge remote-tracking branch 'origin/master' into native-tls

* origin/master:
  Fix test gc_029_zts.phpt
  Fixed a bug that causes crash when environment variable is access while parsing php.ini
  fix asinh delivering -0 when the arg is 0
  Mark test for full GC root buffer as XFAIL
  Fix two date tests
  Mark three foreach tests as XFAIL
  reveal some newer libcurl features in MINFO
  Fix bug number
  Fix bug #68188
  Fix bug #68133 and bug #68135
This commit is contained in:
Anatol Belski 2014-10-04 11:14:01 +02:00
commit 11cf279196
15 changed files with 64 additions and 21 deletions

21
Zend/tests/bug68118.phpt Normal file
View file

@ -0,0 +1,21 @@
--TEST--
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
--FILE--
<?php
set_error_handler(function() {
$obj = new stdClass;
$obj->test = 'meow';
return true;
});
$a = new stdClass;
$a->undefined .= 'test';
var_dump($a);
?>
--EXPECT--
object(stdClass)#2 (1) {
["undefined"]=>
string(4) "test"
}

View file

@ -34,4 +34,4 @@ unset($bar);
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(3)
int(6)

View file

@ -1,5 +1,7 @@
--TEST--
GC 033: Crash in GC while run with phpspec
--XFAIL--
Full GC root buffer not handled correctly yet
--FILE--
<?php
$a = new stdClass();

View file

@ -815,10 +815,6 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
(guard = zend_get_property_guard(zobj, property_info, member)) == NULL ||
(property_info && ((*guard) & IN_GET))) {
/* we don't have access controls - will just add it */
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name->val, Z_STRVAL_P(member));
}
ZVAL_NULL(&tmp);
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
property_info->offset >= 0) {
@ -830,6 +826,12 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
}
retval = zend_hash_update(zobj->properties, property_info->name, &tmp);
}
/* Notice is thrown after creation of the property, to avoid EG(std_property_info)
* being overwritten in an error handler. */
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name->val, Z_STRVAL_P(member));
}
} else {
/* we do have getter - fail and let it try again with usual get/set */
retval = NULL;

View file

@ -4037,8 +4037,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
ZVAL_DUP(&tmp_inc_filename, inc_filename);
convert_to_string(&tmp_inc_filename);
ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
inc_filename = &tmp_inc_filename;
}

View file

@ -2908,8 +2908,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
ZVAL_DUP(&tmp_inc_filename, inc_filename);
convert_to_string(&tmp_inc_filename);
ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
inc_filename = &tmp_inc_filename;
}
@ -9647,8 +9646,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
ZVAL_DUP(&tmp_inc_filename, inc_filename);
convert_to_string(&tmp_inc_filename);
ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
inc_filename = &tmp_inc_filename;
}
@ -16236,8 +16234,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
ZVAL_DUP(&tmp_inc_filename, inc_filename);
convert_to_string(&tmp_inc_filename);
ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
inc_filename = &tmp_inc_filename;
}
@ -33518,8 +33515,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
ZVAL_UNDEF(&tmp_inc_filename);
if (Z_TYPE_P(inc_filename) != IS_STRING) {
ZVAL_DUP(&tmp_inc_filename, inc_filename);
convert_to_string(&tmp_inc_filename);
ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
inc_filename = &tmp_inc_filename;
}

View file

@ -556,6 +556,12 @@ PHP_MINFO_FUNCTION(curl)
#endif
#if LIBCURL_VERSION_NUM >= 0x071504 /* 7.21.4 */
{"TLS-SRP", CURL_VERSION_TLSAUTH_SRP},
#endif
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
{"HTTP2", CURL_VERSION_HTTP2},
#endif
#if LIBCURL_VERSION_NUM >= 0x072600 /* 7.38.0 */
{"GSSAPI", CURL_VERSION_GSSAPI},
#endif
{NULL, 0}
};

View file

@ -40,6 +40,8 @@ SPNEGO => Yes
SSL => Yes
SSPI => Yes
TLS-SRP => No
HTTP2 => No
GSSAPI => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s

View file

@ -23,4 +23,5 @@ class mydt extends datetime
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
?>
--EXPECTF--
Fatal error: Call to a member function format() on null in %sbug67118.php on line %d
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
Bad date

View file

@ -24,5 +24,12 @@ Done
--EXPECTF--
First try
Second try
NULL
Done
object(Foo)#1 (3) {
["date"]=>
string(26) "2007-09-12 15:49:12.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
Done

View file

@ -220,7 +220,7 @@ static double php_asinh(double z)
return(asinh(z));
#else
# ifdef _WIN64
if (z > 0) {
if (z >= 0) {
return log(z + sqrt(z * z + 1));
}
else {

View file

@ -69,7 +69,7 @@
#define SAPI_LSAPI_MAX_HEADER_LENGTH 2048
static int lsapi_mode = 1;
static int lsapi_mode = 0;
static char *php_self = "";
static char *script_filename = "";
static int source_highlight = 0;
@ -1053,6 +1053,7 @@ int main( int argc, char * argv[] )
LSAPI_Init();
LSAPI_Init_Env_Parameters( NULL );
lsapi_mode = 1;
slow_script_msec = LSAPI_Get_Slow_Req_Msecs();

View file

@ -1,5 +1,7 @@
--TEST--
Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax.
--XFAIL--
Needs major foreach changes to get sane behavior
--FILE--
<?php

View file

@ -1,5 +1,7 @@
--TEST--
Directly modifying a REFERENCED array when foreach'ing over it.
--XFAIL--
Needs major foreach changes to get sane behavior
--FILE--
<?php
@ -553,4 +555,4 @@ array(10) {
string(3) "v.2"
[9]=>
string(3) "v.3"
}
}

View file

@ -1,5 +1,7 @@
--TEST--
Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax.
--XFAIL--
Needs major foreach changes to get sane behavior
--FILE--
<?php