Skip to content

Commit 452dea9

Browse files
author
Robin Chalas
committed
Make dump() variadic
1 parent 3e0501a commit 452dea9

File tree

1 file changed

+6
-2
lines changed
  • src/Symfony/Component/VarDumper/Resources/functions

1 file changed

+6
-2
lines changed

src/Symfony/Component/VarDumper/Resources/functions/dump.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
/**
1616
* @author Nicolas Grekas <p@tchwork.com>
1717
*/
18-
function dump($var)
18+
function dump(...$vars)
1919
{
20-
foreach (func_get_args() as $var) {
20+
if (!$vars) {
21+
throw new ArgumentCountError('dump() requires at least 1 argument.');
22+
}
23+
24+
foreach ($vars as $var) {
2125
VarDumper::dump($var);
2226
}
2327
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy