- var_dump: documentation ( source)
- usort: documentation ( source)
<?php
class Foo {
public function spam(array $values) {
usort($values, array($this, 'sort'));
return $values;
}
// Protected, expected to not work. But does?!
protected function sort($a, $b) {
return -1;
}
}
$a = array(
3,
4,
1,
2,
);
$foo = new Foo();
var_dump($foo->spam($a));