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: -
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:
Status: Open 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

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC