Is it OK to define constants on the fly?
<p>In php, is it ok to define constants on the go. All these years, I used them only to store database login information. They were set in a file that was never touched.</p>

<p>But is it ok if I do:</p>

<pre><code>if ($userName == $dbUserName) {
define('userName', 'myUserNameHere');
}
</code></pre>

<p>then:</p>

<pre><code>    myFunk();

    function myFunk()
//I'm actually trying to avoid tons of arguments here. 
        If it's a constant, it's available without having to use global or pass it through args.
            {
            echo userName;
            }
</code></pre>
