diff --git a/MathLaTeXML.php b/MathLaTeXML.php index 765342e..d5ae368 100644 --- a/MathLaTeXML.php +++ b/MathLaTeXML.php @@ -116,8 +116,10 @@ class MathLaTeXML extends MathMathML { if ( $jsonResult && json_last_error() === JSON_ERROR_NONE ) { if ( $this->isValidMathML( $jsonResult->result ) ) { $this->setMathml( $jsonResult->result ); + // Avoid PHP 7.1 warning from passing $this by reference + $renderer = $this; Hooks::run( 'MathRenderingResultRetrieved', - [ &$this, &$jsonResult ] );// Enables debugging of server results + [ &$renderer, &$jsonResult ] );// Enables debugging of server results return true; } else { // Do not print bad mathml. It's probably too verbose and might diff --git a/MathMathML.php b/MathMathML.php index d29210a..e1e6f06 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -521,8 +521,10 @@ class MathMathML extends MathRenderer { if ( $this->getMode() != 'latexml' && $this->inputType != 'pmml' ) { $this->setMathml( $jsonResult->mml ); } + // Avoid PHP 7.1 warning from passing $this by reference + $renderer = $this; Hooks::run( 'MathRenderingResultRetrieved', - [ &$this, &$jsonResult ] ); // Enables debugging of server results + [ &$renderer, &$jsonResult ] ); // Enables debugging of server results return true; } else { $this->lastError = $this->getError( 'math_unknown_error', $host ); diff --git a/MathTexvc.php b/MathTexvc.php index 7e130f9..88c8610 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -275,7 +275,9 @@ class MathTexvc extends MathRenderer { $this->setHash( $newHash ); } - Hooks::run( 'MathAfterTexvc', [ &$this, &$errmsg ] ); + // Avoid PHP 7.1 warning from passing $this by reference + $renderer = $this; + Hooks::run( 'MathAfterTexvc', [ &$renderer, &$errmsg ] ); if ( $errmsg ) { return $errmsg;