- array_push: documentation ( source)
- var_dump: documentation ( source)
- array_walk: documentation ( source)
<?php
$a = [1,2,3,4];
$m = [];
$b = array_walk($a,function($c){
static $m;
global $m;
$m = array_push($m,$c);
});
var_dump($m);