PHP Smart Analyzer version 0.6.2 #v11.2.107-2027-ga1808b593a6e
the following code
try {
... some code ...
} catch (SentryDisabled | Raven_Exception $eException) {
... some code ...
}
throws an error
Syntax error: Syntax error, unexpected '|', expecting T_VARIABLE on line 126 in ...
PHP Version:
PHP 7.2.15-0ubuntu0.18.10.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.10.1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
In production this does not result in an error but works as expected (either one of the exceptions is catched). I am not sure if it was possible before PHP7.2, but in 7.2 definitely is valid code.
Using
the following code
throws an error
PHP Version:
In production this does not result in an error but works as expected (either one of the exceptions is catched). I am not sure if it was possible before PHP7.2, but in 7.2 definitely is valid code.