PHP :: Bug #67117 :: Interactive shell and suppressed fatals
php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67117 Interactive shell and suppressed fatals
Submitted: 2014-04-23 14:13 UTC Modified: 2018-08-03 13:56 UTC
Votes:5
Avg. Score:3.2 ± 1.0
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:2 (40.0%)
From: joni2back at gmail dot com Assigned: cmb (profile)
Status: Feedback Package: CGI/CLI related
PHP Version: 5.5.11 OS: Debian 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-04-23 14:13 UTC] joni2back at gmail dot com
Description:
------------
Regarding than older versions of PHP such as 5.3 in the interactive shell mode; 
When a fatal error occurs, this shell exits with 255 code.

Actually in 5.5.7, when a fatal error occurs, the shell continues executing code.

So, when a possible fatal error is suppressed, the shell will no alert again to other kind of errors

Test script:
---------------
Example php 5.3 (shell exits with 255):
httpd@dev:~$ php -a; echo exitstatus: $?
Interactive shell
php > @undefined();
exitstatus: 255
httpd@dev:~$ 


Example php 5.5.7 (shell continues):
Interactive shell
httpd@dev55:~$ php -a
php > $var = 3;
php > undefined();
PHP Fatal error:  Call to undefined function undefined() in php shell code on line 1
Fatal error: Call to undefined function undefined() in php shell code on line 1
php > echo $var . "\n";
3


Example php 5.5.7 (shell continues so weird):
php > $var = 3;
php > @undefined();
php > echo $var . "\n";
3
php > notdefined();
php > really_not_defined();
php > @really_not_defined();
php > []+$1 ==== class;
php >


Expected result:
----------------
Alert on next errors

Actual result:
--------------
Not alerting next errors (fatal, warnings, syntax, etc)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-03 13:56 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2018-08-03 13:56 UTC] cmb@php.net
I cannot reproduce this with PHP-7.1.  Can anybody else still
reproduce it with any actively supported PHP version[1]?

[1] <http://php.net/supported-versions.php>
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Aug 15 11:01:25 2018 UTC