I'm trying to write some code around a single file that somebody else wrote. That file includes some variables, which are originally intended to be changed directly inside that file, but I wanna keep the file itself intact, so that it can be updated via git/composer without conflict.
The variables from that file are immediately called:
// file.php
$VARIABLE = 'foo'; // change this to your settings
echo $VARIABLE;
is it possible to somehow overwrite $VARIABLE from outside that file, so that it will be used in the function call, without needing to make any changes to that file itself?
Edit: I mean in a way that either changes it in between the two lines above or by somehow declaring $VARIABLE = 'bar' globally in a way that just silently ignores the redeclaration to foo, instead of throwing an error.
$VARIABLE = 'foo'; //change this (foo) to your settings$VARIABLE = 'pancake';and you've overwritten it. However, if you echo the variable directly after you've set it tofoo, there's no way for someone to change it in between those line.$VARIABLE = 'pancake'globally in a way that just silently ignores the redeclaration tofoo, instead of throwing an error.