Simple example of pathinfo and array destructuring in PHP 7:
<?php
[ 'basename' => $basename, 'dirname' => $dirname ] = pathinfo('/www/htdocs/inc/lib.inc.php');
var_dump($basename, $dirname);
// result:
// string(11) "lib.inc.php"
// string(15) "/www/htdocs/inc"
?>