# PHP class files without <?php at the top

- Thread: https://externals.io/message/59395
- Original archive: https://news-web.php.net/php.internals/59395
- Started by Tom Boutell on 2012-04-07T13:26:01+00:00
- Messages: 65
- Page 1 of 3: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/59395.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #59395 — Tom Boutell — 2012-04-07T13:26:01+00:00

URL: https://externals.io/message/59395#59395

Now that the flamewar has died down a little I'd like to try to have a
civil discussion about this idea - *without* my admittedly
inflammatory suggestion to kill <?php altogether.

So here is what I am seriously suggesting:

* The default behavior doesn't change. The parser starts out in HTML mode.

* If the CLI sees a .phpc file extension, the parser starts out in PHP
mode (no opening <?php is required). It is still possible to shift
into HTML mode after that with ?>.

* If a require/include statement sees a .phpc file extension, the
parser starts out in PHP mode.

* If mod_php and FPM are able to see the path (I'm honestly not sure
if they can or not), they look for .phpc as their indication to start
out in PHP mode. If that's not possible then new options are defined
to allow Apache to be configured to tell mod_php and/or FPM to do the
right thing based on mime types etc.

This way .php continues to behave exactly as it does today, and can
interoperate smoothly with code that uses .phpc. .phpc can require
.php and vice versa. They are friends.

Thoughts?

-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

---

## #59396 — Charlie Somerville — 2012-04-07T13:30:14+00:00

URL: https://externals.io/message/59395#59396 · In reply to: #59395

I'm +1 on this.

<?php isn't a *huge* issue, but it is a bit of an annoyance. 'phpc' would help fix that up IMO. 




> Now that the flamewar has died down a little I'd like to try to have a
> civil discussion about this idea - *without* my admittedly
> inflammatory suggestion to kill <?php altogether.
> 
> So here is what I am seriously suggesting:
> 
> * The default behavior doesn't change. The parser starts out in HTML mode.
> 
> * If the CLI sees a .phpc file extension, the parser starts out in PHP
> mode (no opening <?php is required). It is still possible to shift
> into HTML mode after that with ?>.
> 
> * If a require/include statement sees a .phpc file extension, the
> parser starts out in PHP mode.
> 
> * If mod_php and FPM are able to see the path (I'm honestly not sure
> if they can or not), they look for .phpc as their indication to start
> out in PHP mode. If that's not possible then new options are defined
> to allow Apache to be configured to tell mod_php and/or FPM to do the
> right thing based on mime types etc.
> 
> This way .php continues to behave exactly as it does today, and can
> interoperate smoothly with code that uses .phpc. .phpc can require
> .php and vice versa. They are friends.
> 
> Thoughts?
> 
> -- 
> Tom Boutell
> P'unk Avenue
> 215 755 1330
> punkave.com (http://punkave.com)
> window.punkave.com (http://window.punkave.com)

---

## #59397 — Alain Williams — 2012-04-07T13:32:00+00:00

URL: https://externals.io/message/59395#59397 · In reply to: #59395

> Now that the flamewar has died down a little I'd like to try to have a
> civil discussion about this idea - *without* my admittedly
> inflammatory suggestion to kill <?php altogether.
> 
> So here is what I am seriously suggesting:
> 
> * The default behavior doesn't change. The parser starts out in HTML mode.
> 
> * If the CLI sees a .phpc file extension, the parser starts out in PHP
> mode (no opening <?php is required). It is still possible to shift
> into HTML mode after that with ?>.

Why ? What is the benefit ? You don't have to put <?php at the start of a php
file, so you save a few bytes...

Today PHP does not look at file extensions - so why change that behaviour ?
Extra complication with no real benefit.

Thanks for the idea - but no thanks.

> -- 
> Tom Boutell
> P'unk Avenue
> 215 755 1330

What country would that be ? On a list like this numbers should start +

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h

---

## #59398 — Crocodile — 2012-04-07T13:35:39+00:00

URL: https://externals.io/message/59395#59398 · In reply to: #59395

Hello, Tom...

Are you seriously that bothered with '<?php' at the top of your classes?
Are you serious when talking changing reguire/include behaviour just to
satisfy your wish?

To be also serious, I would mention the possibility of including URLs.
There is no such thing as file name extension in URLs. Thus your idea
should be forgot. Personally, I really think 1st of April is like
continuing in the internals mailing list...

2012/4/7 Tom Boutell <tom@punkave.com>

> Now that the flamewar has died down a little I'd like to try to have a
> civil discussion about this idea - *without* my admittedly
> inflammatory suggestion to kill <?php altogether.
>
> So here is what I am seriously suggesting:
>
> * The default behavior doesn't change. The parser starts out in HTML mode.
>
> * If the CLI sees a .phpc file extension, the parser starts out in PHP
> mode (no opening <?php is required). It is still possible to shift
> into HTML mode after that with ?>.
>
> * If a require/include statement sees a .phpc file extension, the
> parser starts out in PHP mode.
>
> * If mod_php and FPM are able to see the path (I'm honestly not sure
> if they can or not), they look for .phpc as their indication to start
> out in PHP mode. If that's not possible then new options are defined
> to allow Apache to be configured to tell mod_php and/or FPM to do the
> right thing based on mime types etc.
>
> This way .php continues to behave exactly as it does today, and can
> interoperate smoothly with code that uses .phpc. .phpc can require
> .php and vice versa. They are friends.
>
> Thoughts?
>
> --
> Tom Boutell
> P'unk Avenue
> 215 755 1330
> punkave.com
> window.punkave.com

---

## #59399 — Tom Boutell — 2012-04-07T13:39:29+00:00

URL: https://externals.io/message/59395#59399 · In reply to: #59398

From the viewpoint of someone writing reusable classes, the need to
start with <?php and reprimand anybody who accidentally puts a newline
above it is a silly annoyance they don't experience with other tools.

That said, you are making valid points, I'm not convinced myself that
"file extensions" necessarily should or could be determined in every
context. But it seems the most viable way of addressing the issue - if
a viable way even exists. Partly I want to convince myself that this
either can or can't ever be improved, and move on either way (:


> Hello, Tom...
>
> Are you seriously that bothered with '<?php' at the top of your classes? Are
> you serious when talking changing reguire/include behaviour just to satisfy
> your wish?
>
> To be also serious, I would mention the possibility of including URLs. There
> is no such thing as file name extension in URLs. Thus your idea should be
> forgot. Personally, I really think 1st of April is like continuing in the
> internals mailing list...
>
> 2012/4/7 Tom Boutell <tom@punkave.com>
> > […]
>



-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

---

## #59400 — Stuart Dallas — 2012-04-07T13:43:28+00:00

URL: https://externals.io/message/59395#59400 · In reply to: #59399

> From the viewpoint of someone writing reusable classes, the need to
> start with <?php and reprimand anybody who accidentally puts a newline
> above it is a silly annoyance they don't experience with other tools.
> 
> That said, you are making valid points, I'm not convinced myself that
> "file extensions" necessarily should or could be determined in every
> context. But it seems the most viable way of addressing the issue - if
> a viable way even exists. Partly I want to convince myself that this
> either can or can't ever be improved, and move on either way (:

If accidental newlines above the <?php are your only issue surely it makes more sense to have PHP ignore any whitespace before an initial <?php in the file, just like it ignores a carriage return after ?>.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

---

## #59401 — Reindl Harald — 2012-04-07T13:44:36+00:00

URL: https://externals.io/message/59395#59401 · In reply to: #59399

you are not making valid points
you are proposing DANGEROUS changes!

what happens if PHP 5.4.x will follow your wishes
(what never will happen) and your file without
<?php will be called on a machine with a lower
php-version?

what you also do not realize is that the world is not turning
around your windows machine - in the unix world extensions
are meaningless - the sheabing and execute permissions are
the only things controlling if a zexzfile is executeable
and with which interpreter this happens

and no the world is not turning around you or even around PHP
this is how unix-systems and shells are working and there
is no place for funny execptions in this world


Am 07.04.2012 15:39, schrieb Tom Boutell:
> From the viewpoint of someone writing reusable classes, the need to
> start with <?php and reprimand anybody who accidentally puts a newline
> above it is a silly annoyance they don't experience with other tools.
> 
> That said, you are making valid points, I'm not convinced myself that
> "file extensions" necessarily should or could be determined in every
> context. But it seems the most viable way of addressing the issue - if
> a viable way even exists. Partly I want to convince myself that this
> either can or can't ever be improved, and move on either way (:
> 
> 
> > […]
> 
> 
> 

-- 

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

http://www.thelounge.net/signature.asc.what.htm

---

## #59402 — Paul Dragoonis — 2012-04-07T13:48:28+00:00

URL: https://externals.io/message/59395#59402 · In reply to: #59401

<?php is a simple and effective way to enter "php mode". File
extensions are really irrelevant.

This isn't a sensible idea.


> you are not making valid points
> you are proposing DANGEROUS changes!
>
> what happens if PHP 5.4.x will follow your wishes
> (what never will happen) and your file without
> <?php will be called on a machine with a lower
> php-version?
>
> what you also do not realize is that the world is not turning
> around your windows machine - in the unix world extensions
> are meaningless - the sheabing and execute permissions are
> the only things controlling if a zexzfile is executeable
> and with which interpreter this happens
>
> and no the world is not turning around you or even around PHP
> this is how unix-systems and shells are working and there
> is no place for funny execptions in this world
>
>
> Am 07.04.2012 15:39, schrieb Tom Boutell:
> > […]
>
> --
>
> Mit besten Grüßen, Reindl Harald
> the lounge interactive design GmbH
> A-1060 Vienna, Hofmühlgasse 17
> CTO / software-development / cms-solutions
> p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
> icq: 154546673, http://www.thelounge.net/
>
> http://www.thelounge.net/signature.asc.what.htm

---

## #59403 — Reindl Harald — 2012-04-07T13:49:12+00:00

URL: https://externals.io/message/59395#59403 · In reply to: #59400

Am 07.04.2012 15:43, schrieb Stuart Dallas:
> 
> 
> > […]
> 
> If accidental newlines above the <?php are your only issue surely it makes more sense to have PHP ignore any whitespace before an initial <?php in the file, just like it ignores a carriage return after ?>.

the main question is why making them and where should php start
and where better stop to hold users hands?

what is the next? making ; optional and change the interpreter
to a gambling-machine because someone comes out whining it does
not work if he makes syntax errors?

April 1st is over so please stop this useless discussion

---

## #59404 — John Bafford — 2012-04-07T13:50:05+00:00

URL: https://externals.io/message/59395#59404 · In reply to: #59399

> > […]
> start with <?php and reprimand anybody who accidentally puts a newline
> above it is a silly annoyance they don't experience with other tools.
> 
> That said, you are making valid points, I'm not convinced myself that
> "file extensions" necessarily should or could be determined in every
> context. But it seems the most viable way of addressing the issue - if
> a viable way even exists. Partly I want to convince myself that this
> either can or can't ever be improved, and move on either way (:

That "silly annoyance" doesn't seem to bother anyone who writes command line tools, which require the #! line specifying the command interpreter to be the first bytes in the file, with no leading white space whatsoever. Especially on unix systems (but also on the Mac), the file extension does not affirmatively indicate the file type or whether or not it can be executed.

Also, from a CLI perspective, you don't want extensions in the names of your scripts, because then it causes problems/confusion/extra work if you later decide to change the language the script is written in.

-John

--
John Bafford
http://bafford.com/

---

## #59405 — Tom Boutell — 2012-04-07T14:00:21+00:00

URL: https://externals.io/message/59395#59405 · In reply to: #59404

That's a good point too.

I think this is a better proposal:

include_code, require_code, and require_code_once would work just like
include, require and require_once, except that the parser would start
out in PHP mode.

.phpc is then just a convention for naming PHP files that start out
with code - a convention that autoloaders should respect, just as they
now respect the .php convention. "The user asked for the Monkey class,
and I see Monkey.phpc is out there; I'll grab that with
require_code_once."

Putting this decision on the autoloader makes more sense because
autoloaders already contain assumptions about file extensions. They
have to in order to do their job of translating a class name to a
particular path somewhere.

Folks who did not care for this functionality could then choose to
entirely ignore it. Class library developers who liked it would make
autoloaders available that honored it, freeing end-user developers
from thinking about it. It becomes self-contained, and people who are
writing old-school .php standalone scripts or pages are entirely
unaffected.


>
> 
>
> > […]
>
> That "silly annoyance" doesn't seem to bother anyone who writes command line tools, which require the #! line specifying the command interpreter to be the first bytes in the file, with no leading white space whatsoever. Especially on unix systems (but also on the Mac), the file extension does not affirmatively indicate the file type or whether or not it can be executed.
>
> Also, from a CLI perspective, you don't want extensions in the names of your scripts, because then it causes problems/confusion/extra work if you later decide to change the language the script is written in.
>
> -John
>
> --
> John Bafford
> http://bafford.com/
>
>
> --
> 
> 
>



-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

---

## #59406 — Reindl Harald — 2012-04-07T14:06:17+00:00

URL: https://externals.io/message/59395#59406 · In reply to: #59405

Am 07.04.2012 16:00, schrieb Tom Boutell:
> That's a good point too.
> 
> I think this is a better proposal:
> 
> include_code, require_code, and require_code_once would work just like
> include, require and require_once, except that the parser would start
> out in PHP mode.

would you please leave this world in peace?

what do you think happens with hundret thousands of existing
include-files out there which are containing only HTML?

why do you simply not realize that you have way too few knowledge
and tchnical education to partly understand the side effects
small changes in a general behavior are having and that the
benefit has to be a REAL LARGE ONE for everybody to accept
the possible damage - which is not the case here

where are your proposals for bash and other unix shells
hwo they have to work if there is a whitespace before
#!/bin/sh? what have you got as answer there?

again: please leave the world in peace with your poorly
thought proposals - and yes this is a really polite answer
compared with the thoughts running through my mind
while reading your stuff

---

## #59407 — Derick Rethans — 2012-04-07T14:07:29+00:00

URL: https://externals.io/message/59395#59407 · In reply to: #59401

> and no the world is not turning around you or even around PHP

I will once more suggest you tune down your language on the 
mailinglists. It's often rude and offensive. Let this be your last 
warning.

cheers,
Derick

---

## #59408 — Alain Williams — 2012-04-07T14:19:16+00:00

URL: https://externals.io/message/59395#59408 · In reply to: #59406

> 
> 
> Am 07.04.2012 16:00, schrieb Tom Boutell:
> > […]
> 
> would you please leave this world in peace?
> ...

You may not agree with his proposal (neither do I) but please remain kind &
polite to him. He is not trolling.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h

---

## #59409 — Tom Boutell — 2012-04-07T14:23:34+00:00

URL: https://externals.io/message/59395#59409 · In reply to: #59406

>
>
> would you please leave this world in peace?
>
> what do you think happens with hundret thousands of existing
> include-files out there which are containing only HTML?

Nothing happens to them whatsoever. They work exactly the way they did
before. I am introducing separate keywords in this proposal precisely
to avoid creating problems for you. Please read the email you just
replied to.

> why do you simply not realize that you have way too few knowledge
> and tchnical education to partly understand the side effects
> small changes in a general behavior are having

*Sigh*

See this?

http://php.net/manual/en/book.image.php

That's my doing, fella. I am the original author of the gd library
functions described there and the originator of the PNG file format
project as well. You have probably been using my work in your PHP code
for years, if you have done much image manipulation with PHP (although
there are some fine alternatives as well of course). I also wrote the
original WWW FAQ (circa '94) and have helped promote the open web ever
since.

And do you know how much that matters? Not one little bit. if this
proposal stinks, then it should be politely rejected. But not just
because somebody can't be civil (:

There are no side effects in the new proposal in the latest email you
are replying to, at least not that you have accurately identified yet.
The .phpc extension has completely vanished from use cases like yours
in that proposal. Pay attention to what I wrote and respond
thoughtfully.

> benefit has to be a REAL LARGE ONE for everybody to accept
> the possible damage - which is not the case here
>
> where are your proposals for bash and other unix shells
> hwo they have to work if there is a whitespace before
> #!/bin/sh? what have you got as answer there?
>
> again: please leave the world in peace with your poorly
> thought proposals - and yes this is a really polite answer
> compared with the thoughts running through my mind
> while reading your stuff
>



-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

---

## #59411 — Reindl Harald — 2012-04-07T14:47:49+00:00

URL: https://externals.io/message/59395#59411 · In reply to: #59407

Am 07.04.2012 16:07, schrieb Derick Rethans:
> 
> 
> > […]
> 
> I will once more suggest you tune down your language on the 
> mailinglists. It's often rude and offensive. Let this be your last 
> warning

and what is there exactly rude?

this is simply the truth
or do you believe the world is turning around one person or PHP?

if someone brings proposals which are so less thight
what would you giev as answer? wait until enough people
not care enough abut the impacts start to implement
changes and then wait how to live with them?

i was there too often and nobody gives me back the wasted
lifetime for modify things after changes with zero benefit
and large impact - and what you lear after enough such
changes is that a "in my opinion not so a good idea" will
be ignored if someone loves to make changes

---

## #59413 — John Crenshaw — 2012-04-07T14:53:49+00:00

URL: https://externals.io/message/59395#59413 · In reply to: #59405

> From: Tom Boutell [mailto:tom@punkave.com] 
>
> That's a good point too.
>
> I think this is a better proposal:
>
> include_code, require_code, and require_code_once would work just like include, require and require_once, except that the parser would start out in PHP mode.
>

I don't like this, but it's closer. I hate the idea of adding a whole mess of one-off functions just to support a single coding style feature that doesn't seem to have very much support. There are a variety of other ideas that have been floating around that request changes to how the parser handles specific code (different short tags, sandboxing, auto-escaping, etc.).

What if you have just ONE function with a variety of options? Something like:

execute_file('path/to/foo.php', array(
    'require'=>true,
    'once'=>true,
    'begin_code'=>'<?php ',
    'shorttags'=>array('<?=','?>'),
    'autoescape'=>function($str){return htmlentities($str, `ENT_QUOTES` | ENT_HTML5, 'UTF-8');},
    ...
));

This would provide a single consistent hook for any further DSL like features without impacting the behavior of any existing code. Some other options that might make sense:

lint (like command line)
end_code (similar to command line, corresponds with begin_code (also command line)) 
args (also command line)
Any PHP_INI_ALL directives

John Crenshaw
Priacta, Inc.

---

## #59414 — John Bafford — 2012-04-07T14:56:53+00:00

URL: https://externals.io/message/59395#59414 · In reply to: #59405

> That's a good point too.
> 
> I think this is a better proposal:
> 
> include_code, require_code, and require_code_once would work just like
> include, require and require_once, except that the parser would start
> out in PHP mode.

Those might be nice functions to have, but ...

> .phpc is then just a convention for naming PHP files that start out
> with code - a convention that autoloaders should respect, just as they
> now respect the .php convention. "The user asked for the Monkey class,
> and I see Monkey.phpc is out there; I'll grab that with
> require_code_once."

… I think this isn't quite as simple as you make it out to be. Any autoloader that cared about bc would have to have code like

if(file_exists(.phpc)) require_code() else if(file_exists(.php)) require() else HCF()

There's a reason everyone settled around a single extension, and not the plethora we used to have (php, phtml, php3/php4, others?). Even in the rainbows-and-unicorns world where everyone always has an opcode cache and suitably tuned stat cache, that extra call to file_exists that will likely happen while waiting for files to be renamed and tested still isn't free. Also, I'm willing to bet that in the unlikely event you chose to drop out of PHP mode to dump a block of HTML, the awkwardness of a sudden ?> without a leading <?php would make the discussions about whether or not to have a trailing ?> at the end of files look like hyper-civilized discourse in comparison. (Though, it might be an interesting discussion regarding making the hypothetical require_code only (directly) include files that are pure code, with no <?php ?> tags allowed.)

Personally, I think the cognitive overhead the <?php ?> tags impose is pretty tiny. Yeah, you get weird errors sometimes, but once you understand what's going on, it's easy to fix (and generally easy to spot, if you're using version control). I really can't recall the last time it's happened to me and it took more than ten seconds to identify and fix. It's just one of the weird things about php. Every language has its rough edges, and in comparison, I really don't think this one even ranks in the top ten. There are plenty other parts of PHP that are far more awkward that could use addressing first (but won't, because of the bc break involved; haystack, meet needle).

You could also view <?php at the top of the file as a sort of magic number indicating the file type (such as used in many binary file formats: gifs always start with GIF87a/GIF89a, java class files with 0xCAFEBABE, etc). It's unlikely a file that starts with <?php is anything but.

-John

> Putting this decision on the autoloader makes more sense because
> autoloaders already contain assumptions about file extensions. They
> have to in order to do their job of translating a class name to a
> particular path somewhere.
> 
> Folks who did not care for this functionality could then choose to
> entirely ignore it. Class library developers who liked it would make
> autoloaders available that honored it, freeing end-user developers
> from thinking about it. It becomes self-contained, and people who are
> writing old-school .php standalone scripts or pages are entirely
> unaffected.
> 
> 
> > […]
> 
> 
> 
> -- 
> Tom Boutell
> P'unk Avenue
> 215 755 1330
> punkave.com
> window.punkave.com
> 
> -- 
> 
> 
> 

--
John Bafford
http://bafford.com/

---

## #59412 — keisial@gmail.com — 2012-04-07T14:58:44+00:00

URL: https://externals.io/message/59395#59412 · In reply to: #59406

> Am 07.04.2012 16:00, schrieb Tom Boutell:
> > […]
> would you please leave this world in peace?

This is a much better proposal than magic-extensions,
and a backwards-compatible one.
You may not like it (I'm not convinced about it), but your
criticism here is wrong.

> what do you think happens with hundret thousands of existing
> include-files out there which are containing only HTML?
They would obviously continue working as they would be using
the old require code.
Moreover, including a HTML files is bad coding, `readfile()` works
much better.


> why do you simply not realize that you have way too few knowledge
> and tchnical education to partly understand the side effects
> small changes in a general behavior are having and that the
> benefit has to be a REAL LARGE ONE for everybody to accept
> the possible damage - which is not the case here
This is a backwards compatible change.
The benefit of not typing '<?php' may not be worth adding those
new require types, they would also break new scripts on old engines.
But it wouldn't have those catastrophic effects that you seem to foresee.
Care to enlighten us poor myopic souls?


> where are your proposals for bash and other unix shells
> hwo they have to work if there is a whitespace before
> #!/bin/sh? what have you got as answer there?
He is only doing a proposal for php, not for bash.

> again: please leave the world in peace with your poorly
> thought proposals - and yes this is a really polite answer
> compared with the thoughts running through my mind
> while reading your stuff
Please keep trying, it can still be improved.

---

## #59416 — Reindl Harald — 2012-04-07T15:17:54+00:00

URL: https://externals.io/message/59395#59416 · In reply to: #59409

Am 07.04.2012 16:23, schrieb Tom Boutell:
> 
> > […]
> 
> *Sigh*
> 
> See this?
> 
> http://php.net/manual/en/book.image.php
> 
> That's my doing, fella. I am the original author of the gd library
> functions described there and the originator of the PNG file format
> project as well. You have probably been using my work in your PHP code
> for years, if you have done much image manipulation with PHP (although
> there are some fine alternatives as well of course). I also wrote the
> original WWW FAQ (circa '94) and have helped promote the open web ever

that leaves the question open what terrible happened in
your life between all that and the proposals last night
which sounded naive like from a child?

don't get me wrong and with all respect for the work
you have done - that's not an excuse for bring out
proposals like you did or even makes them more worse
as if they are coming from a completly newcomer because
you should know it better

said that: writing good libraries and books makes you not
automatically to a good designer for a programming language

---

## #59417 — Derick Rethans — 2012-04-07T15:22:22+00:00

URL: https://externals.io/message/59395#59417 · In reply to: #59411

> Am 07.04.2012 16:07, schrieb Derick Rethans:
> > […]
> 
> and what is there exactly rude?
> 
> this is simply the truth
> or do you believe the world is turning around one person or PHP?

But it is certainly also not resolving around you.

You repeatly call people stupid, or "like a child" or "what terrible 
happened in your life" and that is *not* allowed behaviour here. If you
(or anyone else for that matter) can't refrain from that, you have no 
place on this list.

Derick

---

## #59418 — John Bafford — 2012-04-07T15:22:50+00:00

URL: https://externals.io/message/59395#59418 · In reply to: #59413

> I don't like this, but it's closer. I hate the idea of adding a whole mess of one-off functions just to support a single coding style feature that doesn't seem to have very much support. There are a variety of other ideas that have been floating around that request changes to how the parser handles specific code (different short tags, sandboxing, auto-escaping, etc.).
> 
> What if you have just ONE function with a variety of options? Something like:
> 
> execute_file('path/to/foo.php', array(
>    'require'=>true,
>    'once'=>true,
>    'begin_code'=>'<?php ',
>    'shorttags'=>array('<?=','?>'),
>    'autoescape'=>function($str){return htmlentities($str, `ENT_QUOTES` | ENT_HTML5, 'UTF-8');},
>    ...
> ));

While there's some elegance with your execute_file (there'd definitely be benefits to one function instead of the four we have now), the extra options would spawn so much Daily WTF material it wouldn't be funny, and I think most people would just stick with include/require/*_once because there'd be a lot less effort in the common case.

> This would provide a single consistent hook for any further DSL like features without impacting the behavior of any existing code. Some other options that might make sense:
> 
> lint (like command line)

Actually, it'd be pretty cool to be able to lint a file without having to include runkit (there is a runkit_lint($code)) or make an external call to php -l.
 
> end_code (similar to command line, corresponds with begin_code (also command line)) 
> args (also command line)
> Any PHP_INI_ALL directives
> 
> John Crenshaw
> Priacta, Inc.


-John

--
John Bafford
http://bafford.com/

---

## #59419 — John Crenshaw — 2012-04-07T15:26:47+00:00

URL: https://externals.io/message/59395#59419 · In reply to: #59416

> that leaves the question open what terrible happened in your life between all that and the proposals last night which sounded naive like from a child?

> Don't get me wrong and with all respect for the work you have done - that's not an excuse for bring out proposals like you did or even makes them more worse as if they are coming from a completly newcomer because you should know it better

> said that: writing good libraries and books makes you not automatically to a good designer for a programming language

Every single reply from this guy in the last 24 hours has been childishly insulting and immature, and only one has contained anything more than personal attacks. Who moderates this list and enforces the rules? Can we please boot this guy, at least temporarily? He's contributing nothing to the discussion and appears to be truly incapable (both in action and by his own admission) of communicating in a civil way. We don't need this here. There have been multiple requests for him to stop from multiple people and it's not getting any better.

John Crenshaw
Priacta, Inc.

---

## #59420 — Kiall Mac Innes — 2012-04-07T15:27:57+00:00

URL: https://externals.io/message/59395#59420 · In reply to: #59417

> You repeatly call people stupid, or "like a child" or "what terrible
> happened in your life" and that is *not* allowed behaviour here. If you
> (or anyone else for that matter) can't refrain from that, you have no
> place on this list.
>
> Derick
>

Couldn't agree more. The behavior exhibited by some people on this list is
disgraceful. This is just the latest example IMO.

Thanks,
Kiall

---

## #59421 — Rasmus Lerdorf — 2012-04-07T15:31:48+00:00

URL: https://externals.io/message/59395#59421 · In reply to: #59420

He's done.


> 
> 
> > […]
> 
> Couldn't agree more. The behavior exhibited by some people on this list is
> disgraceful. This is just the latest example IMO.
> 
> Thanks,
> Kiall

---

Next page: https://externals.io/message/59395.md?page=2
