title: PHP spaceship sort not working with variable
body: <p>I have a sort function with a multidimensional array, but it doesn't work when I use a variable. </p>
  
  <p>This works</p>
  
  <pre><code>function orderdata($l_col, $l_dir, $l_data) {
  
      usort($l_data, function ($a, $b) {
          return $a[0] &lt;=&gt; $b[0];
      });
      return $l_data;
  }
  </code></pre>
  
  <p>This does not work ($l_col is 0)</p>
  
  <pre><code>function orderdata($l_col, $l_dir, $l_data) {
  
      usort($l_data, function ($a, $b) {
          return $a[$l_col] &lt;=&gt; $b[$l_col];
      });
      return $l_data;
  }
  </code></pre>
  
  <p>What is the proper syntax?</p>