title: Loops with PHP shell_exec() : Use php for() or bash for-do-done?
body: <p>Let's say I want to execute the command <code>mycommand</code> with PHP <code>shell_exec()</code> 10 times. Should I do a bash loop:</p>
  
  <pre><code>shell_exec('for i in {1 .. 10} do mycommand -i done');
  </code></pre>
  
  <p>or rather a PHP loop:</p>
  
  <pre><code>for($i = 1; $i &lt;=10; ++$i) { shell_exec('mycommand -'.$i); }
  </code></pre>
  
  <p>What are the reasons (security, performance, style, ...) to choose one over the other?</p>