title: PHP usort inside foreach order alphabetically
body: <p>I am trying to figure out why my code wont work as i expect. I have an array:</p>
  
  <pre><code>$persons = array(
      0 =&gt; array(
          'person' =&gt; 'John',
          'children' =&gt; array('Eve', 'Mark', 'Alto')
      ),
      1 =&gt; array(
          'person' =&gt; 'Susy',
          'children' =&gt; array('Ruby', 'Adam', 'Tõnu')
      )
  );
  </code></pre>
  
  <p>Loop the array and sort childrens alphabetically</p>
  
  <pre><code>foreach( $persons as $person ) {
  
      usort($person['children'], function( $a, $b ) {
          return strcmp( $a, $b );
      });
      var_dump($person['children']); //shows children array items alphabetically ordered
  
  }
  </code></pre>
  
  <p>But after foreach chidrens are still in starting order</p>
  
  <pre><code>var_dump($persons); //shows that children names are not ordered alphabetically
  </code></pre>
  
  <p>Thank you for your time</p>