doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

Add "die()" as an option to exit a function with return typ "never"

Open ShadyMedic opened this issue 3 years ago • 4 comments

There was only the exit() function mentioned.

ShadyMedic avatar Aug 25 '22 11:08 ShadyMedic

Hmm, according to the docs:

This language construct is equivalent to exit().

IMO, there is no need to explicitly mention die() here.

cmb69 avatar Aug 25 '22 11:08 cmb69

Yeah, I know it's a function/construct with the same output, but at the same time, it's also another way to stop the execution of the script. I think it should be listed to not raise doubts about whether are these two functions really the same.

ShadyMedic avatar Aug 25 '22 17:08 ShadyMedic

I'm not really a fan of this, die is akin to an alias of exit.

Girgias avatar Aug 28 '22 16:08 Girgias

That's unnecessary. If you really insist then something like exit/die would look better, but since it's the exact same language construct, I don't think it's needed at all.

kamil-tekiela avatar Sep 23 '22 16:09 kamil-tekiela

Since there is no interest in listing the alias, should this PR be closed?

afilina avatar Jan 18 '23 16:01 afilina

Yeah, this PR should be closed. Nonetheless, thanks for working on this, @ShadyMedic!

cmb69 avatar Jan 18 '23 16:01 cmb69