fork download
  1. <?php
  2.  
  3. function double($value, $key, $signal) {
  4. echo 2*$signal*$value, PHP_EOL;
  5. }
  6.  
  7. $array = [1, 2, 3, 4];
  8. array_walk($array, "double", -1);
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
-2
-4
-6
-8