title: Automating A Function / Statement To Excute After Each PHP Statement
body: <p>I'm not sure if it's present in PHP or not, or you might think of it a crazy or a wild idea. But somehow, it would be very convenient for me if I can make a function to execute after each statement in a PHP script.</p>
  
  <p>For example:-</p>
  
  <p>Normal Case:-</p>
  
  <pre><code>&lt;?php
  
  $a = 1;
  $b = 2;
  echo $a . "\n";
  echo $b . "\n";
  
  ?&gt;
  </code></pre>
  
  <p>This should result in:-</p>
  
  <pre><code>1
  2
  </code></pre>
  
  <p>I want a case where I can write a function:-</p>
  
  <pre><code>function should_excute_after_each_php_statement() {
     echo 'a statement completed' . "\n";
  }
  </code></pre>
  
  <p>and the script should result:-</p>
  
  <pre><code>a statement completed
  a statement completed
  1
  a statement completed
  2
  a statement completed
  </code></pre>
  
  <p>Possible?</p>