PHP variable behavior or convention
<p>This is my case.(i changed my case)</p>

<p>I have variable let say $var1 from database and method test($var1)</p>

<pre><code>$var1 = getFromDatabase(); 
//now $var1 contaion "This is new variable".$var2
</code></pre>

<p>Then in test method i will do simple string operation from the $var1 equation.</p>

<pre><code>test($var1){
  $var2 = "variable 2";
  //I want to extract $var1 so that string will be combined
  $value = $var1;

  $value_expected = "This is new variable".$var2;
}
</code></pre>

<p>But $value will contain "This is new variable".$var2.
I expect $value contain This is new variable variable 2 from the $var1 equation.</p>

<p>Is there any solution? Is that possible to do?</p>

<p>Thank You.</p>
