1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Use hasThis() where appropriate (#18967)

This macro was introduced to solve false compilers warning about the getThis()
condition not making sense for the address-taken part of the ternary.
This commit is contained in:
Niels Dossche
2025-06-28 10:12:43 +02:00
committed by GitHub
parent 44955943f9
commit 737db4a7dc
3 changed files with 4 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ PHP_FUNCTION( numfmt_format )
INTL_METHOD_CHECK_STATUS( nfo, "Number formatting failed" );
break;
case FORMAT_TYPE_CURRENCY:
if (getThis()) {
if (hasThis()) {
const char *space;
const char *class_name = get_active_class_name(&space);
zend_argument_value_error(2, "cannot be NumberFormatter::TYPE_CURRENCY constant, "

View File

@@ -86,7 +86,7 @@ PHP_FUNCTION( numfmt_parse )
RETVAL_DOUBLE(val_double);
break;
case FORMAT_TYPE_CURRENCY:
if (getThis()) {
if (hasThis()) {
const char *space;
const char *class_name = get_active_class_name(&space);
zend_argument_value_error(2, "cannot be NumberFormatter::TYPE_CURRENCY constant, "

View File

@@ -327,7 +327,7 @@ PHP_FUNCTION(mysqli_data_seek)
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (mysqli_result_is_unbuffered(result)) {
if (getThis()) {
if (hasThis()) {
zend_throw_error(NULL, "mysqli_result::data_seek() cannot be used in MYSQLI_USE_RESULT mode");
} else {
zend_throw_error(NULL, "mysqli_data_seek() cannot be used in MYSQLI_USE_RESULT mode");
@@ -855,7 +855,7 @@ PHP_FUNCTION(mysqli_free_result)
/* {{{ Get MySQL client info */
PHP_FUNCTION(mysqli_get_client_info)
{
if (getThis()) {
if (hasThis()) {
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
}