- var_dump: documentation ( source)
<?php
function by_ref (&$ref) {
$ref = 42;
}
function by_handle ($handle) {
$handle = 42;
}
$thing1 = new class {};
$thing2 = new class {};
by_ref($thing1);
by_handle($thing2);
var_dump($thing1, $thing2);