title: PHP Can you update a var inside a string?
body: <p>If you have</p>
  
  <pre><code>$a = 'World'
  
  $str = 'Hello '.$a
  
  $a = ' John Doe'
  </code></pre>
  
  <p>Is there a way in PHP that <code>$str</code> would now receive the changed value from <code>$a</code>?
  What I know I get: <code>$str = 'Hello World'</code>, what I would like: <code>$str = 'Hello John Doe'</code></p>
  
  <p>I know this could be done by replacing the old value with str_replace, but I would like to ask if there is a way that this var could be passed by reference or something.</p>