- var_dump: documentation ( source)
<?php
class Kitchen
{
private $yummy = 'cake';
}
$sweetsThief = function (Kitchen $kitchen) {
return $kitchen->yummy;
};
$kitchen = new Kitchen();
$sweetsThief = Closure::bind($sweetsThief, null, $kitchen);
var_dump($sweetsThief($kitchen));