Merge branch 'PHP-7.4'

This commit is contained in:
Nikita Popov 2019-02-28 15:46:58 +01:00
commit c5d9a44798
3 changed files with 18 additions and 25 deletions

View file

@ -101,8 +101,6 @@ PHP_FUNCTION(mysqli_stmt_prepare);
PHP_FUNCTION(mysqli_stmt_fetch); PHP_FUNCTION(mysqli_stmt_fetch);
PHP_FUNCTION(mysqli_stmt_param_count); PHP_FUNCTION(mysqli_stmt_param_count);
PHP_FUNCTION(mysqli_stmt_send_long_data); PHP_FUNCTION(mysqli_stmt_send_long_data);
PHP_FUNCTION(mysqli_embedded_server_end);
PHP_FUNCTION(mysqli_embedded_server_start);
PHP_FUNCTION(mysqli_sqlstate); PHP_FUNCTION(mysqli_sqlstate);
PHP_FUNCTION(mysqli_ssl_set); PHP_FUNCTION(mysqli_ssl_set);
PHP_FUNCTION(mysqli_stat); PHP_FUNCTION(mysqli_stat);

View file

@ -20,15 +20,6 @@ require_once('skipifconnectfailure.inc');
$methods = get_class_methods($driver); $methods = get_class_methods($driver);
$expected_methods = array(); $expected_methods = array();
if (!$IS_MYSQLND && (isset($methods['embedded_server_start']))) {
/* libmysql only - needs extra compile flag, no way to check properly in the
PHP user land if its compiled in or not */
$expected_methods = array_merge($expected_methods, array(
'embedded_server_start' => true,
'embedded_server_end' => true,
));
}
foreach ($methods as $k => $method) { foreach ($methods as $k => $method) {
if (isset($expected_methods[$method])) { if (isset($expected_methods[$method])) {
unset($expected_methods[$method]); unset($expected_methods[$method]);

View file

@ -86,8 +86,7 @@ PHPAPI zend_class_entry *reflection_reference_ptr;
/* Exception throwing macro */ /* Exception throwing macro */
#define _DO_THROW(msg) \ #define _DO_THROW(msg) \
zend_throw_exception(reflection_exception_ptr, msg, 0); \ zend_throw_exception(reflection_exception_ptr, msg, 0);
return;
#define GET_REFLECTION_OBJECT() do { \ #define GET_REFLECTION_OBJECT() do { \
intern = Z_REFLECTION_P(ZEND_THIS); \ intern = Z_REFLECTION_P(ZEND_THIS); \
@ -1302,6 +1301,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
/* Create object */ /* Create object */
if (object_init_ex(&reflector, ce_ptr) == FAILURE) { if (object_init_ex(&reflector, ce_ptr) == FAILURE) {
_DO_THROW("Could not create reflector"); _DO_THROW("Could not create reflector");
return;
} }
/* Call __construct() */ /* Call __construct() */
@ -1329,6 +1329,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
if (result == FAILURE) { if (result == FAILURE) {
zval_ptr_dtor(&reflector); zval_ptr_dtor(&reflector);
_DO_THROW("Could not create reflector"); _DO_THROW("Could not create reflector");
return;
} }
/* Call static reflection::export */ /* Call static reflection::export */
@ -1350,6 +1351,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
zval_ptr_dtor(&reflector); zval_ptr_dtor(&reflector);
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
_DO_THROW("Could not execute reflection::export()"); _DO_THROW("Could not execute reflection::export()");
return;
} }
if (return_output) { if (return_output) {
@ -1436,7 +1438,7 @@ ZEND_METHOD(reflection, export)
if (result == FAILURE) { if (result == FAILURE) {
_DO_THROW("Invocation of method __toString() failed"); _DO_THROW("Invocation of method __toString() failed");
/* Returns from this function */ return;
} }
if (Z_TYPE(retval) == IS_UNDEF) { if (Z_TYPE(retval) == IS_UNDEF) {
@ -2283,7 +2285,7 @@ ZEND_METHOD(reflection_parameter, __construct)
|| ((method = zend_hash_index_find(Z_ARRVAL_P(reference), 1)) == NULL)) || ((method = zend_hash_index_find(Z_ARRVAL_P(reference), 1)) == NULL))
{ {
_DO_THROW("Expected array($object, $method) or array($classname, $method)"); _DO_THROW("Expected array($object, $method) or array($classname, $method)");
/* returns out of this function */ return;
} }
if (Z_TYPE_P(classref) == IS_OBJECT) { if (Z_TYPE_P(classref) == IS_OBJECT) {
@ -2331,7 +2333,7 @@ ZEND_METHOD(reflection_parameter, __construct)
default: default:
_DO_THROW("The parameter class is expected to be either a string, an array(class, method) or a callable object"); _DO_THROW("The parameter class is expected to be either a string, an array(class, method) or a callable object");
/* returns out of this function */ return;
} }
/* Now, search for the parameter */ /* Now, search for the parameter */
@ -2351,7 +2353,7 @@ ZEND_METHOD(reflection_parameter, __construct)
zval_ptr_dtor(reference); zval_ptr_dtor(reference);
} }
_DO_THROW("The parameter specified by its offset could not be found"); _DO_THROW("The parameter specified by its offset could not be found");
/* returns out of this function */ return;
} }
} else { } else {
uint32_t i; uint32_t i;
@ -2388,7 +2390,7 @@ ZEND_METHOD(reflection_parameter, __construct)
zval_ptr_dtor(reference); zval_ptr_dtor(reference);
} }
_DO_THROW("The parameter specified by its name could not be found"); _DO_THROW("The parameter specified by its name could not be found");
/* returns out of this function */ return;
} }
} }
@ -2973,7 +2975,7 @@ ZEND_METHOD(reflection_method, __construct)
zval_ptr_dtor_str(&ztmp); zval_ptr_dtor_str(&ztmp);
} }
_DO_THROW("The parameter class is expected to be either a string or an object"); _DO_THROW("The parameter class is expected to be either a string or an object");
/* returns out of this function */ return;
} }
if (classname == &ztmp) { if (classname == &ztmp) {
@ -3041,7 +3043,7 @@ ZEND_METHOD(reflection_method, getClosure)
if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) { if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) {
_DO_THROW("Given object is not an instance of the class this method was declared in"); _DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */ return;
} }
/* This is an original closure object and __invoke is to be called. */ /* This is an original closure object and __invoke is to be called. */
@ -3130,7 +3132,7 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic)
efree(params); efree(params);
} }
_DO_THROW("Given object is not an instance of the class this method was declared in"); _DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */ return;
} }
} }
@ -3513,7 +3515,7 @@ ZEND_METHOD(reflection_class_constant, __construct)
default: default:
_DO_THROW("The parameter class is expected to be either a string or an object"); _DO_THROW("The parameter class is expected to be either a string or an object");
/* returns out of this function */ return;
} }
if ((constant = zend_hash_find_ptr(&ce->constants_table, constname)) == NULL) { if ((constant = zend_hash_find_ptr(&ce->constants_table, constname)) == NULL) {
@ -5231,7 +5233,7 @@ ZEND_METHOD(reflection_property, __construct)
default: default:
_DO_THROW("The parameter class is expected to be either a string or an object"); _DO_THROW("The parameter class is expected to be either a string or an object");
/* returns out of this function */ return;
} }
property_info = zend_hash_find_ptr(&ce->properties_info, name); property_info = zend_hash_find_ptr(&ce->properties_info, name);
@ -5428,7 +5430,7 @@ ZEND_METHOD(reflection_property, getValue)
if (!instanceof_function(Z_OBJCE_P(object), ref->prop.ce)) { if (!instanceof_function(Z_OBJCE_P(object), ref->prop.ce)) {
_DO_THROW("Given object is not an instance of the class this property was declared in"); _DO_THROW("Given object is not an instance of the class this property was declared in");
/* Returns from this function */ return;
} }
member_p = zend_read_property_ex(intern->ce, object, ref->unmangled_name, 0, &rv); member_p = zend_read_property_ex(intern->ce, object, ref->unmangled_name, 0, &rv);
@ -5515,7 +5517,7 @@ ZEND_METHOD(reflection_property, isInitialized)
if (!instanceof_function(Z_OBJCE_P(object), ref->prop.ce)) { if (!instanceof_function(Z_OBJCE_P(object), ref->prop.ce)) {
_DO_THROW("Given object is not an instance of the class this property was declared in"); _DO_THROW("Given object is not an instance of the class this property was declared in");
/* Returns from this function */ return;
} }
old_scope = EG(fake_scope); old_scope = EG(fake_scope);
@ -6178,6 +6180,7 @@ ZEND_METHOD(reflection_reference, fromArrayElement)
if (!item) { if (!item) {
_DO_THROW("Array key not found"); _DO_THROW("Array key not found");
return;
} }
if (Z_TYPE_P(item) != IS_REFERENCE) { if (Z_TYPE_P(item) != IS_REFERENCE) {
@ -6207,6 +6210,7 @@ ZEND_METHOD(reflection_reference, getId)
intern = Z_REFLECTION_P(getThis()); intern = Z_REFLECTION_P(getThis());
if (Z_TYPE(intern->obj) != IS_REFERENCE) { if (Z_TYPE(intern->obj) != IS_REFERENCE) {
_DO_THROW("Corrupted ReflectionReference object"); _DO_THROW("Corrupted ReflectionReference object");
return;
} }
if (!REFLECTION_G(key_initialized)) { if (!REFLECTION_G(key_initialized)) {