Skip to content

Commit

Permalink
Optim : Condition is unnecessary because it is checked by 'get_class'
Browse files Browse the repository at this point in the history
  • Loading branch information
s-renier-taonix-fr authored and f3l1x committed Feb 13, 2023
1 parent cc16c86 commit 687c73d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4257,7 +4257,7 @@ function serialize_return()
{
$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
// if fault
if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
if (isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
$this->debug('got a fault object from method');
$this->fault = $this->methodreturn;
return;
Expand Down

1 comment on commit 687c73d

@NielsLinde
Copy link

Choose a reason for hiding this comment

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

This commit is not working with php 8.x, see this example : https://onlinephp.io/c/7ae5d
Without is_object there will be a string param sometimes passed to get_class causing a typeError as described in https://www.php.net/manual/en/function.get-class.php

Please sign in to comment.