php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5941 Bug in the require() function ?
Submitted: 2000-08-03 11:29 UTC Modified: 2000-08-03 14:58 UTC
From: support at masterbyte dot de Assigned:
Status: Closed Package: Other
PHP Version: 4.0.1pl2 OS: WinNT
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: support at masterbyte dot de
New email:
PHP Version: OS:

 

 [2000-08-03 11:29 UTC] support at masterbyte dot de
I've got the following Problem with require :

I have a script, an in Line 10 is a normal parse error (missing ; or something like that).

In line one, i am including a 309 lines php file with include(); .

Result : Error in script.php line 10 : missing ;  . Correct !

If I use require() instead of include() i get the following error :

Error in includefile.php line 319 : missing ; . Wrong !


Best regards, Nico Blanke

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-03 12:02 UTC] waldschrott@php.net
Please provide a reduced code fragment (<15 lines) producing this behaviour.
 [2000-08-03 12:45 UTC] support at masterbyte dot de
------------------ INCLUDE.PHP
<?php

	$a = 1;
	$b = 1;
	$c = 1;
	$d = 1;
	$e = 1;
	$f = 1;
	$g = 1;
	$h = 1;
	$i = 1;
	$j = 1;

php?>
-------------------- EOF

-------------SCRIPT.PHP
<?php
	require('./include.php');
	$x = 1;
	$y = 2
	$z = 3;
php?>
----------------EOF

As you will notice, there is a missing ; in the code above. If I run the
script, i get the error 

Parse error: parse error in ./include.php on line 18

If i change require() to include(), the CORRECT error message appears :

Parse error: parse error in D:\www\Petra\test\script.php on line 5



Best regards, Nico Blanke .
 [2000-08-03 12:48 UTC] stas@php.net
User feedback:

Parse error: parse error in D:\www\Petra\test\script.php on line 5

------------------ INCLUDE.PHP
<?php

        $a = 1;
        $b = 1;
        $c = 1;
        $d = 1;
        $e = 1;
        $f = 1;
        $g = 1;
        $h = 1;
        $i = 1;
        $j = 1;
php?>

<?php
        require('./include.php');
        $x = 1;
        $y = 2
        $z = 3;
php?>

 [2000-08-03 12:49 UTC] stas@php.net
You shouldn't put php before ?>.
 [2000-08-03 13:00 UTC] support at masterbyte dot de
That has nothing to do with the Problem described above.
The same error, even if I use <? ?> instead of <?php php?>
 [2000-08-03 13:20 UTC] stas@php.net
Please provide _valid_ reproducing script for this behaviour.
 [2000-08-03 14:58 UTC] waldschrott@php.net
I?m sorry that "bug" isn?t reproduceable with your code and
I guess you?ve missed a closing bracket )]} anywhere, that?s
usually the reson for parse errors appearing in the last
line of a script...
 [2021-04-06 10:19 UTC] git@php.net
Automatic comment on behalf of 
Revision: https://github.com/php/pecl-system-expect/commit/743dadd0efe556a0ec05ca422b117fd211a486fd
Log: fixed #5941 (Segfault on INI handlers in ZTS mode)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC