Skip to content

Conversation

@tenzap
Copy link
Contributor

@tenzap tenzap commented Oct 15, 2025

RuntimeException: Non-canonical cast (double) is deprecated, use the (float) cast instead on line 7281 in file /path/to/econea/nusoap/src/nusoap.php
RuntimeException: Non-canonical cast (boolean) is deprecated, use the (bool) cast instead on line 7287 in file /path/to/econea/nusoap/src/nusoap.php
RuntimeException: Function xml_parser_free() is deprecated since 8.5, as it has no effect since PHP 8.0 on line 6916 in file /path/to/econea/nusoap/src/nusoap.php

RuntimeException: Non-canonical cast (double) is deprecated, use the (float) cast instead on line 7281 in file /path/to/econea/nusoap/src/nusoap.php
RuntimeException: Non-canonical cast (boolean) is deprecated, use the (bool) cast instead on line 7287 in file /path/to/econea/nusoap/src/nusoap.php
RuntimeException: Function xml_parser_free() is deprecated since 8.5, as it has no effect since PHP 8.0 on line 6916 in file /path/to/econea/nusoap/src/nusoap.php
@f3l1x f3l1x requested a review from Copilot November 8, 2025 19:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses PHP 8.0 compatibility issues and updates type casting to use modern PHP syntax. The changes focus on conditionally calling xml_parser_free() only for PHP versions below 8.0, and updating deprecated type cast syntax.

Key Changes:

  • Conditionally calls xml_parser_free() for PHP versions < 8.0 to avoid deprecation warnings
  • Updates type casts from (double) to (float) and (boolean) to (bool) to align with modern PHP standards

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

xml_parser_free($this->parser);
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of short-circuit evaluation with && for conditionally calling xml_parser_free() is unconventional and potentially confusing. This pattern uses the logical AND operator for side effects rather than its intended purpose of boolean evaluation.

Consider using a more explicit conditional approach:

if (PHP_VERSION_ID < 80000) {
    xml_parser_free($this->parser);
}

This is clearer about intent and follows standard PHP coding practices.

Suggested change
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
if (PHP_VERSION_ID < 80000) {
xml_parser_free($this->parser);
}

Copilot uses AI. Check for mistakes.
$this->debug("XML payload:\n" . $wsdl_string);
$this->setError($errstr);
xml_parser_free($this->parser);
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of short-circuit evaluation with && for conditionally calling xml_parser_free() is unconventional and potentially confusing. This pattern uses the logical AND operator for side effects rather than its intended purpose of boolean evaluation.

Consider using a more explicit conditional approach:

if (PHP_VERSION_ID < 80000) {
    xml_parser_free($this->parser);
}

This is clearer about intent and follows standard PHP coding practices.

Copilot uses AI. Check for mistakes.
}
// free the parser
xml_parser_free($this->parser);
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of short-circuit evaluation with && for conditionally calling xml_parser_free() is unconventional and potentially confusing. This pattern uses the logical AND operator for side effects rather than its intended purpose of boolean evaluation.

Consider using a more explicit conditional approach:

if (PHP_VERSION_ID < 80000) {
    xml_parser_free($this->parser);
}

This is clearer about intent and follows standard PHP coding practices.

Copilot uses AI. Check for mistakes.
}
}
xml_parser_free($this->parser);
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of short-circuit evaluation with && for conditionally calling xml_parser_free() is unconventional and potentially confusing. This pattern uses the logical AND operator for side effects rather than its intended purpose of boolean evaluation.

Consider using a more explicit conditional approach:

if (PHP_VERSION_ID < 80000) {
    xml_parser_free($this->parser);
}

This is clearer about intent and follows standard PHP coding practices.

Suggested change
(PHP_VERSION_ID < 80000) && xml_parser_free($this->parser);
if (PHP_VERSION_ID < 80000) {
xml_parser_free($this->parser);
}

Copilot uses AI. Check for mistakes.
@nikrou
Copy link

nikrou commented Dec 1, 2025

To complete that PR, there's one more warning : the function socket_set_timeout is an alias of stream_set_timeout. The alias is deprecated in php 8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants