Bug #65240 [Nab]: Return code not updating exit status

From: Date: Thu, 11 Jul 2013 18:48:35 +0000
Subject: Bug #65240 [Nab]: Return code not updating exit status
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-180208@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65240&edit=1

 ID:                 65240
 User updated by:    rkelley at transperfect dot com
 Reported by:        rkelley at transperfect dot com
 Summary:            Return code not updating exit status
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.4.17
 Block user comment: N
 Private report:     N

 New Comment:

I see in the manual where it say return will end the execution if it is in the top level function or
a script but it does not state what it does with the return value explicit for a script. When
filling this bug I referred to C++ where a return 1 in the main function would result in a exit code
of 1 being seen on the shell.


Previous Comments:
------------------------------------------------------------------------
[2013-07-11 06:06:29] laruence@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

php -r 'exit(0);' ; echo $?

------------------------------------------------------------------------
[2013-07-10 20:14:54] rkelley at transperfect dot com

Description:
------------
When the top level function does a return, that code is not reflected in the exit status.

Test script:
---------------
php -r 'return(1);' ; echo $?



Expected result:
----------------
1

Actual result:
--------------
0


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65240&edit=1


Thread (3 messages)

« previous php.bugs (#180208) next »