with php8 I am now getting warnings on if statements with my variables.
Current
if ($var): echo $var; endif;
Updated Format
if (isset($var)): echo $var; endif;
I am looking for a regex expression to wrap all instances of if ($var)
and if($var)
to if (isset($var)
. the $var
is not always var obviously so I think this could be accomplished with regex . Thanks!
replace: if \(\$(.*)\)
with: if (isset($$$1))
This almost works but it wraps the entire if-statement if it begins with a $
.