RE: [PHP] Include file must be valid
| From: | Jason Stechschulte | Date: | Fri, 28 Jul 2000 20:31:18 +0000 |
| Subject: | RE: [PHP] Include file must be valid | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8848@lists.php.net to get a copy of this message | ||
That was my point exactly.
Jason Stechschulte
jpstech@nc.edu
-----Original Message-----
From: luis@note.amherst.edu
[mailto:luis@note.amherst.edu]
Sent: Friday, July 28, 2000 4:16 PM
To: Jason Stechschulte
Subject: Re: [PHP] Include file must be valid
It seems like breaking up code into incomplete
include files is
really bad form. It would make code next to
impossible to debug, let
alone read. It might make total sense the day you
code it, but what about
when you come back 6 months later, to update code
or add new
functionality, and all your code is split up into
many includes that
depend on the code of other includes to work
correctly?
Or if someone else takes over your project, will
it be immediately obvious
what each include does, and what dependencies they
have on each other?
I like the tighter include scheme in 4, since it
forces you to make
cleaner code. I think in general includes should
be self contained,
and not depend on you having included file A in
the base file for file B
to work. That way, if you come back later to add
more functionality, or
clean up code, you can feel safe editing an
include as long as
you keep the method's contract.
Cheers,
Luis
On Fri, 28 Jul 2000, Jason Stechschulte wrote:
> I fail to see the problem. If someone doesn't
> understand how to create a while structure,
> perhaps they should learn it rather than
creating
> wacky code.
>
> Jason Stechschulte
> jpstech@nc.edu
>
> -----Original Message-----
> From: Simon Biela [mailto:s.biela@netdienste.de]
> Sent: Friday, July 28, 2000 1:36 PM
> To: Zeev Suraski; php-general@lists.php.net
> Subject: Re: [PHP] Include file must be valid
>
>
> But this issure is not really helpful for
> developers. The documentation
> says, that include just pulls the content of the
> file into the other file. I
> don't want that file to be evaluated for itself.
>
> The example I gave, is a help for people who
don't
> understand how to create
> a while structure but want to use it.
>
> Instead of writing
> while ($output[something][$i]) {
>
> or even something more complex, they just have
to
> write
>
> include(whilestart)
>
> What other possibility do I have to solve this
> problem?
>
> Thanks for answer
> Simon
>
>
> >That's true. It's an issue which should be
> documented - it's not a bug.
> >
> >Zeev
>
> On Fri, 28 Jul 2000, Simon Biela wrote:
>
> > Hi there!
> >
> > I just migrated from PHP3 to 4. In 3 it was
> possible to include a file
> which
> > wasn't really valid, for example with an
opened
> while statement, which was
> > then closed in another include file.
> >
> > It seems, that in PHP4 the code in an include
> file must be completely
> valid.
> >
> > here's an example
> >
> > file1.php
> > $i = 0; while($something[$i]) {
> >
> > file2.php
> > $i++; }
> >
> > file3.php
> > include (file1.php);
> > echo $i
> > include (file2.php);
> >
> >
> > ---
> > netdienste GbR
> > internet & multimedia
> > Geisselstrasse 19
> > 50823 Koeln
> >
> > tel: +49 221 - 932 958 2
> > fax: +49 221 - 932 958 5
> >
> > s.biela@netdienste.de
> > http://www.netdienste.de
> >
> > red:pepper - das redaktionssystem
> > www.redpepper.netdienste.de