title: array_map not working in classes
body: <p>I am trying to create a class to handle arrays but I can't seem to get <code>array_map()</code> to work in it.</p>
  
  <pre><code>&lt;?php
  //Create the test array
  $array = array(1,2,3,4,5,6,7,8,9,10);
  //create the test class
  class test {
  //variable to save array inside class
  public $classarray;
  
  //function to call array_map function with the given array
  public function adding($data) {
      $this-&gt;classarray = array_map($this-&gt;dash(), $data);
  }
  
  // dash function to add a - to both sides of the number of the input array
  public function dash($item) {
      $item2 = '-' . $item . '-';
      return $item2;
  }
  
  }
  // dumps start array
  var_dump($array);
  //adds line
  echo '&lt;br /&gt;';
  //creates class object
  $test = new test();
  //classes function adding
  $test-&gt;adding($array);
  // should output the array with values -1-,-2-,-3-,-4-... 
  var_dump($test-&gt;classarray);
  </code></pre>
  
  <p><strong>This outputs</strong> </p>
  
  <p><code>array(10) { [0]=&gt; int(1) [1]=&gt; int(2) [2]=&gt; int(3) [3]=&gt; int(4) [4]=&gt; int(5) [5]=&gt; int(6) [6]=&gt; int(7) [7]=&gt; int(8) [8]=&gt; int(9) [9]=&gt; int(10) }</code></p>
  
  <p><code>Warning: Missing argument 1 for test::dash(), called in D:\xampp\htdocs\trainingdvd\arraytesting.php on line 11 and defined in D:\xampp\htdocs\trainingdvd\arraytesting.php on line 15</code></p>
  
  <p><code>Warning: array_map() expects parameter 1 to be a valid callback, function '--' not found or invalid function name in D:\xampp\htdocs\trainingdvd\arraytesting.php on line 11 NULL</code></p>
  
  <p>What am I doing wrong or does this function just not work inside classes?</p>