php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67833 exit terminates execution NOT only current script
Submitted: 2014-08-13 09:54 UTC Modified: 2014-10-26 16:23 UTC
From: janusz dot witrykus at gmail dot com Assigned: salathe (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 18 = ?
Subscribe to this entry?

 
 [2014-08-13 09:54 UTC] janusz dot witrykus at gmail dot com
Description:
------------
---
From manual page: http://php.net//manual/en/function.exit.php
---

It is not clear for me, I think, that exit terminates execution not only current script but all scripts above current script.

It terminates execution all application, I think.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-21 06:29 UTC] krakjoe@php.net
-Status: Open +Status: Feedback
 [2014-09-21 06:29 UTC] krakjoe@php.net
I have no idea what the problem is, I don't know what "scripts above current script" means.

Please try to explain the problem precisely.
 [2014-09-21 10:38 UTC] janusz dot witrykus at gmail dot com
-Status: Feedback +Status: Open
 [2014-09-21 10:38 UTC] janusz dot witrykus at gmail dot com
In
http://php.net//manual/en/function.exit.php
we have:
"exit — Output a message and terminate the current script".
What does "current script" there mean?

In 
http://php.net/manual/en/function.return.php
we have:
"If called from the global scope, then execution of the current script file is ended. If the current script file was included or required, then control is passed back to the calling file".

With "exit", all scripts that require or include current script file are terminated too.

Maybe script is not limited to the file, and this is source my misunderstanding, sorry.
 [2014-10-26 16:23 UTC] salathe@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: salathe
 [2014-10-26 16:23 UTC] salathe@php.net
IMHO, "current script" is fine here, and is distinct enough from "current script file".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC