- var_dump: documentation ( source)
- compact: documentation ( source)
<?php
$title = 'str';
$getView1 = function () use ($title, $viewPath) {
return compact(['title']);
};
$getView2 = fn () => compact(['title']);
var_dump($getView1()); // ['title' => 'str']
var_dump($getView2()); // []