php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65883 Allow "exit" without parentesis
Submitted: 2013-10-11 12:17 UTC Modified: 2013-10-27 09:03 UTC
From: valentiny510 at yahoo dot es Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: valentiny510 at yahoo dot es
New email:
PHP Version: OS:

 

 [2013-10-11 12:17 UTC] valentiny510 at yahoo dot es
Description:
------------
Since "exit" is a language construct I think will be nice to write it without the parentesis even with status code or text, like include 'something'..
echo 'something'...
print 'something'... etc...
Ok you got the point..



Test script:
---------------
exit 'Something';
exit 0;


Expected result:
----------------
Something



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-27 09:03 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-10-27 09:03 UTC] krakjoe@php.net
The reason that exit uses parenthesis is to avoid conflicts in grammar, it is not possible to write grammar that uses both and has no conflicts.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC