php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1531 require() causes flex scanner error
Submitted: 1999-06-12 07:14 UTC Modified: 2001-02-10 13:40 UTC
From: graeme at kc dot co dot nz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 OS: Linux-2.0.36 x86
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: graeme at kc dot co dot nz
New email:
PHP Version: OS:

 

 [1999-06-12 07:14 UTC] graeme at kc dot co dot nz
A condition arose where require() was called with "./" as the file to include. This caused the error "input failure in flex scanner" to occur.
Granted, including "./" is kinda dumb :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 21:06 UTC] jim at cvs dot php dot net
Zeev knows about this one, and I believe it will
be fixed in PHP4. There may actually be a very
old bug on this as well.
 [2000-08-17 10:57 UTC] hholzgra@php.net
still there even in 4.0.1
 [2000-08-17 11:07 UTC] stas@php.net
I don't see problem here. ./ is not a file, and reading it as a file fails. So it should be.
 [2000-08-17 11:21 UTC] hholzgra@php.net
still it should not result in a parse error

it should produce a warning 

  PHP Warning:  Failed opening './' for inclusion 

as with other unknown files
 [2000-08-17 11:48 UTC] hholzgra@php.net
BD>> still it should not result in a parse error

> It's not parse error, please read the message.
> It didn't failed opening, it failed reading. 
> And require is not allowed to fail.
> That's not unknown file, that's known non-file.
>-- 
>Stanislav Malyshev   stas@zend.com          

ok, got it now, i thought it was related to just ./,
not directories in general

but it fails for include to, while including for
example a non-existing file produces the message
i cited above and the error message is very
misleading

so i move this on to feature requests:

1) should give clearer error-message

2) at least include should treat directories
   like nonexistant (or empty?) files
   and issue a warning instead of a fatal error

 
 [2001-02-10 13:25 UTC] jimw@php.net
4.0 still gives the same message.
 [2001-02-10 13:40 UTC] zeev@php.net
intended behavior
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC