- var_dump: documentation ( source)
<?php
class Test {
public $test = 0;
public function __construct($x){
$this->test = $x;
}
}
$array = array(
new Test(1),
new Test(2),
new Test(3),
new Test(4),
);
foreach($array as $key=> &$item){
$item->test +=10;
}
var_dump($array);