The include 'sample.php';
or require_once 'classes/DB.php';
is a preferred way.
Is preferred, it will prevent your peers from giving you a hard time and a trivial conversation about what require really is.
Side Notes:
1. require/include
not a function they are language construct same as echo
. Credits: @Rahil comment.
2. Also it will save time of pressing two keystroke (
& )
for a lazy developers like us :p