- var_dump: documentation ( source)
<?php
class Foo {
public $i = 0;
public function method() {
return $this->i++;
}
}
$short = [0, 1, 2];
$long = [0, 1, 2];
$foo1 = new Foo();
$foo2 = new Foo();
$long[$foo1->method()] + $long[$foo1->method()] = 1;
$short[$foo2->method()] += 1;
var_dump($long, $short);