Question from the PHP8 test

PHP function with named and positional arguments.

Medium

What is the result of the following example?

<?php

class BookRepository
{
    public function findBy(array $criteria = [], array $orderBy = []): array
    {
        return [];
    }
}

$bookRepository = new BookRepository();
$bookList = $bookRepository->findBy(orderBy: ['title' => 'ASC'], ['category' => 1]);

echo count($bookList) === 0 ? "Nothing" : "Some books";
Author: W3D TeamStatus: PublishedQuestion passed 985 times
Edit
4
Community EvaluationsNo one has reviewed this question yet, be the first!