Skip to content

Dump & die function #26906

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 1 commit into from
Closed

Dump & die function #26906

wants to merge 1 commit into from

Conversation

gragio
Copy link

@gragio gragio commented Apr 12, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

@stof
Copy link
Member

stof commented Apr 12, 2018

New features are never added in maintenance branch.

And this feature has already been rejected multiple times in the past.

@stloyd
Copy link
Contributor

stloyd commented Apr 12, 2018

Looks like duplicate of at least #13657, #17267 & #19096.

@gragio
Copy link
Author

gragio commented Apr 12, 2018

Why? Is it too simply?

https://laravel.com/docs/5.6/helpers#method-dd

@curry684
Copy link
Contributor

#13657 (comment)

@gragio
Copy link
Author

gragio commented Apr 12, 2018

I think that it's an added value. Otherwise why was this feature requested multiple times?

@gragio gragio changed the title Dump and die function Dump & die function Apr 12, 2018
@curry684
Copy link
Contributor

Count all the people shooting down those 4 requests and the lack of support for them from others 😉

@gragio
Copy link
Author

gragio commented Apr 13, 2018

@curry684
I'm sorry, I couldn't imagine that this feature can disturb the workflow of all these people 😉

@curry684
Copy link
Contributor

curry684 commented Apr 13, 2018

It's code. It has to be maintained. It has to be documented. It's an attack vector.

Every line of code in a project is at some point going to be a burden on people managing the project.

"Code is not done when there's nothing left to add, but when there's nothing left to take away"

Now convenience functions are in themselves not necessarily wrong, assuming they're covering the 80+% use case (technically it becomes a facade then). In this case it most certainly doesn't, I can't remember typing die after a dump call more than a handful of times in the past years, because there's never a reason to - the dump shows up in the profiler toolbar, or in the template rendered, or on the command line. What's the added value of dying except in the handful of cases where you actively need to avoid subsequent code being executed based on the bug you're fixing? And which is, in a well architected structure, usually cleaner done by commenting that offending bit of code than just dying and shortcutting all system shutdown handlers, kernel termination handlers, mail spoolers and everything?

@chalasr
Copy link
Member

chalasr commented Apr 17, 2018

Still -1 for me.

@xabbuh
Copy link
Member

xabbuh commented Apr 17, 2018

👎 for me too. I am closing here as this was already rejected in the past and the core team still isn't convinced about the feature.

@nicolas-grekas
Copy link
Member

For reference, this is being reconsidered in #26970.

fabpot added a commit that referenced this pull request Apr 19, 2018
…s-grekas)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[VarDumper] Add dd() helper == dump() + exit()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

By popular demand, I feel like we should reconsider our refusal for a `dd()` global helper.
For past references, see #26965, #26906, #13657, #17267, #19096.

Commits
-------

a55916a [VarDumper] Add dd() helper == dump() + die()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants