© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
G. EngebrethPHP 8 Revealedhttps://doi.org/10.1007/978-1-4842-6818-6_3

3. Named Arguments

Gunnard Engebreth1  
(1)
Madison, WI, USA
 

Date: 2013-09-06, significantly updated 2020-05-05

Author: Nikita Popov

Vote: 57/18

Generally, named arguments really change what constitutes a good API and what doesn’t. Things like boolean flags to functions are considered bad design because we do not have named arguments. If I pick out some random Python API, say subprocess.run() ...

subprocess.run(args, *, stdin=None, input=None, stdout=None,
stderr=None, capture_output=False, shell=False, cwd=None, timeout=None,
check=False, encoding=None, errors=None, text=None, env=None,
universal_newlines=None) ...

Get PHP 8 Revealed: Use Attributes, the JIT Compiler, Union Types, and More for Web Development​ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.