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-26 16:58 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: No 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>
 [2018-08-26 16:58 UTC] cmb@php.net
-Status: Feedback +Status: No Feedback
 [2018-08-26 16:58 UTC] cmb@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 23:01:29 2024 UTC