title: Is Visual Studio Code's PHP debug console interactive?
body: <p>I am using Visual Studio Code 1.16.1 together with Felix Becker's <a href="https://github.com/felixfbecker/vscode-php-debug" rel="noreferrer">PHP Debug extension</a>. I'm connecting to XDebug just fine, can set breakpoints and view variables in the debug pane without any issues.</p>
  
  <p>However, the debug console seems kind of useless, I can only run super basic PHP commands, and I can't seem to evaluate normal PHP commands or interact with my app very well. </p>
  
  <p>I consistently get <code>error evaluating code</code> when attempting to type any PHP statements or expressions in the debug console. It seems like all I am able to do is declare variables, arrays, and objects.</p>
  
  <p>I can't declare classes, functions, use control structures (<code>if</code>, <code>foreach</code>, etc.).</p>
  
  <p><strong>Works:</strong></p>
  
  <pre><code>$x = 4
  //4
  
  $x
  //4
  
  $x = new stdClass();
  //stdClass
  
  $x = [];
  //array(0)
  
  ($x) ? yes : no
  // yes
  
  (!$x) ? yes : no
  // no
  
  preg_replace('/dog/', 'cat', 'The quick brown fox jumps over the lazy dog.')
  // "The quick brown fox jumps over the lazy cat."
  
  request()
  //Illuminate\Http\Request (Laravel helper methods work)
  </code></pre>
  
  <p><strong>Doesn't Work:</strong></p>
  
  <pre><code>echo "yes"
  //error evaluating code
  
  if ($x == 4) { echo "yes" }
  //error evaluating code
  
  for ($i=0; $i &lt; 5; $i++) { }
  //error evaluating code
  
  function foo() {}
  //error evaluating code
  
  class SimpleClass {}
  //error evaluating code
  
  $var_dump($x)
  //null
  </code></pre>
  
  <p>Is the debug console supposed to act like a true REPL? I know PHPStorm's console can evaluate any PHP you throw at it, can Visual Studio Code do the same? Is anyone else facing this problem?</p>
  
  <p>Thanks.</p>
  
  <p><a href="https://i.stack.imgur.com/HqZeP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HqZeP.png" alt="enter image description here"></a></p>