- var_dump: documentation ( source)
<?php
$a = ['array' => 'of stuff', 'toodles' => 14 ];
function boom(array &$b) {
throw new Exception('kablooey');
}
try {
boom($a);
} catch(Exception $e) {
echo var_dump($a);
$aStack = $e->getTrace();
foreach($aStack as &$aItem) {
if(isset($aItem['args'])) {
foreach($aItem['args'] as &$aArg) {
$aArg = 'destroyed';
}
}
}
echo var_dump($a);
}