|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-02-24 18:51 UTC] felipe@php.net
[2021-02-24 18:51 UTC] felipe@php.net
-Status: Open
+Status: Closed
[2021-02-24 19:08 UTC] felipe@php.net
[2021-02-24 20:31 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ Tested in PHP versions 8.0.2 and 7.4.3. When phpdbg can not open the given file it fails with the messages: [Could not open file /missing_file] [Failed to compile /missing_file, cannot run] But the exit code is 0, when it should not. On another hand, when the PHP file exists but has syntax errors it fails with: [PHP Parse error: syntax error, unexpected '!', expecting ';' or ',' in /invalid.php on line 3] If it throws an exception: [Uncaught Exception in /throw-exception.php on line 3] Exception: I'm an exception thrown in /throw-exception.php:3 Stack trace: #0 {main} In both cases, the exit code is then 255 as expected. Test script: --------------- # Tested without Docker in Kubuntu Linux 20.04.2 LTS phpdbg -qrr missing_file; echo $? [Could not open file /missing_file] [Failed to compile /missing_file, cannot run] 0 # Tested in Alpine Linux using Docker docker run --rm --tty php:cli-alpine phpdbg -qrr missing_file; echo $? [Could not open file /missing_file] [Failed to compile /missing_file, cannot run] 0 Expected result: ---------------- A non-zero exit code is expected. Actual result: -------------- The exit code is 0.