So I have this working on my local testing machine and it works fine. However as soon as I upload it to my hosting provider it gives me an HTTP error 500 and wont go any further. The part of the script that is giving trouble is:
function collect_directories_and_files($path) {
$entries = scandir($path);
return array_partition($entries, function($entry) {
return is_dir($entry);
});
}
More specifically:
return array_partition($entries, function($entry) {
This is the line that the error logs are calling out as the problem. I dont see any syntax errors...am I missing something?
EDIT: Apparently this is an issue with PHP 5.2 and annonymous functions.
function. Try renaming it.