Programming Languages PHP Objective
Sep 23, 2025

What is the correct syntax for PHP 8+ named arguments?

Choose the correct answer:
A) function_name(param: value)
B) function_name(param = value)
C) function_name(param => value)
D) function_name($param: value)
Detailed Explanation

Explanation: PHP 8.0 introduced named arguments using the colon (:) syntax. This allows you to pass arguments to functions based on parameter names rather than position, improving code readability and flexibility.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback