title: Testing non OOP PHP
body: <p>I want to ask is there any way to test procedural code with unit test or any other way.</p>
  
  <p>For example I have below very simple code:</p>
  
  <pre><code>$a = 10;
  $b = 20;
  
  for($i = $a; $i &lt; $b; $i++){
      echo 'Loop ' . $i . PHP_EOL;
  }
  </code></pre>
  
  <p>I know that I can check with <code>isset()</code> and other build in functions if the variable exists, also can check type of variable, with output buffering I can get output and count how many times loop was executed,
  but...can I check if there is <code>for</code> loop not <code>while</code> loop?</p>
  
  <p>I can get whole php file and with regex found it, but maybe there is some kind of magic function that show me that.</p>