php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17432 PHP ignores a exit-command
Submitted: 2002-05-26 03:34 UTC Modified: 2002-05-26 05:16 UTC
From: e05 at slashdot dot ch Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.1 OS: Microsoft Windows 2000 SP2
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: e05 at slashdot dot ch
New email:
PHP Version: OS:

 

 [2002-05-26 03:34 UTC] e05 at slashdot dot ch
I wrote a script with an error, and to ignore it I write an exit-command before. But PHP ignores it.

A script that shows this bug:
<?php
phpinfo();
exit(1);
if(
phpinfo();
?>
--
My configuration:
Apache 1.3.24 (win32-build from httpd.apache.org)
PHP 4.2.1 (offical win32 build)
PHP runs as Apache module.
--

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-26 04:09 UTC] derick@php.net
A SCript is parse before it is executed. If it can not be parsed correctly due to a parse error, it will not get executed at all, and thus your exit(1) call has no effect here.

Not a bug -> bogus
 [2002-05-26 05:09 UTC] e05 at slashdot dot ch
I think it?s illogical.
Why?
If you call an function which doesn?t exists, it works.
 [2002-05-26 05:12 UTC] correction at nospam dot please
I think it?s illogical.
Why?
If you call an function which doesn?t exists, it works.
 [2002-05-26 05:15 UTC] derick@php.net
A undefined functionis not a _parse_ error. Function names are evaluated at runtime in the Zend engine (well, uh, sometimes :), so it's quite logical from a techincal point of view.

Derick
 [2002-05-26 05:16 UTC] mfischer@php.net
It's not "illogical". It's simply the way it works and won't change, you'll have to live with it.

Scripts are completely parsed *before* they're executed. That's a fact. If the script can't be parsed, it can't be executed.

Calling missing function is something else, it's a run-time behaviour, that's why this works.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 26 07:00:01 2025 UTC