php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44020 "php -l" exit code
Submitted: 2008-02-02 01:30 UTC Modified: 2008-11-07 13:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: root at mantoru dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: root at mantoru dot de
New email:
PHP Version: OS:

 

 [2008-02-02 01:30 UTC] root at mantoru dot de
Description:
------------
http://php.net/features.commandline
php -l: "On success [...] the shell return code is 0. On failure, [...] the shell return code is set to 255."

This doesn't seem to be true, at least not on Windows.


Reproduce code:
---------------
C:\> ver
Microsoft Windows XP [Version 5.1.2600]
C:\> cd\php5\scripts
C:\php5\scripts> type victim.php
<?php if {"";?>
C:\php5\scripts> php -d error_reporting=0 -l victim.php
Errors parsing victim.php
C:\php5\scripts> echo %ERRORLEVEL%


Expected result:
----------------
255


Actual result:
--------------
-1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-07 13:11 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

It is PHP internal's FAILURE which is defined to -1.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 13:00:02 2026 UTC