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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: janusz dot witrykus at gmail dot com
New email:
PHP Version: OS:

 

 [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: Sat May 11 00:01:31 2024 UTC