php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19910 including __FILE__
Submitted: 2002-10-14 18:49 UTC Modified: 2002-10-16 05:27 UTC
From: seba at volja dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.2 OS: Windows NT 5.0 build 2195
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: seba at volja dot net
New email:
PHP Version: OS:

 

 [2002-10-14 18:49 UTC] seba at volja dot net
If you include the file is beeing parsed, either with __FILE__ or with the filename, apache (I just tested on apache and php 4.2.2) will crash.

<?php
include __FILE__;
?>

OR

<?php
// __FILE__ == 'test.php'; true
include 'test.php';
?>

result: Apache.exe has generated errors and will be closed by Windows... (and so on)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-14 19:02 UTC] sniper@php.net
There are also many other ways to crash PHP like this.
This is called "Infinite recursion".
Not a bug.



 [2002-10-15 05:19 UTC] seba at volja dot net
Hmm... I tried another version of the infinite loop:

<?php
while (1) {
	$x++;
}
?>

And the result was just:
Fatal error: Maximum execution time of 30 seconds exceeded in d:\wwwroot\smeti\bug.php on line 3

So I think, that the same must happen with the include (infinite) recursion.
 [2002-10-15 05:20 UTC] seba at volja dot net
Nevermind... I tried with another infinite recursion:
<?php
function a() {
	b();
}
function b() {
	a();
}
a();
?>

And the same happend as the include recursion...
 [2002-10-16 05:27 UTC] mfischer@php.net
Hehe .. just incrementing an integer value doesn't overflow the stack while a recursive functionc all does.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 11 16:01:28 2024 UTC