8000 [VarDumper] Make `dump()` a little bit more easier to use by freekmurze · Pull Request #24280 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] Make dump() a little bit more easier to use #24280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make dump() a slightly bit more developer friendly
Imagine you have this code:

```php
$object->method();
```

If you want to dump the object, this is currently the way to do that:

```php
dump($object);

$object->method();
```

This PR makes adding (and removing) the `dump` function easier.

```php
dump($object)->method();
```
  • Loading branch information
freekmurze authored Sep 21, 2017
commit d43489626210ce4603dceca037327b44cdaa182b
2 changes: 2 additions & 0 deletions src/Symfony/Component/VarDumper/Resources/functions/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ function dump($var, ...$moreVars)
foreach ($moreVars as $var) {
VarDumper::dump($var);
}

return $var;
}
}
0