LWN: Comments on "Cracks in the Foundation (PHP Advent)" https://lwn.net/Articles/472673/ This is a special feed containing comments posted to the individual LWN article titled "Cracks in the Foundation (PHP Advent)". en-us Sat, 01 Nov 2025 09:53:17 +0000 Sat, 01 Nov 2025 09:53:17 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/474039/ https://lwn.net/Articles/474039/ etienne <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; returning flags from functions</font><br> <font class="QuotedText">&gt; You mean like the errno variable?</font><br> <p> Not really, errno is a global variable - I was thinking of something very fast at the asssembly level, for the million of use case.<br> Something like (doesn't really work in C):<br> <p> unsigned mybitfield, bitindex;<br> ifzeroset(bitno = ffs(mybitfield)) // ffs = find first bit set<br> error("none bit are set");<br> else<br> bitindex = bitno;<br> <p> Translated in ia32 assembler by:<br> ffs eax,edx<br> jz call_error<br> mov edx,bitindex<br> <p> You can replace ffs by strchr or any basic function which may not be inlined.<br> Maybe it could also be implemented in GCC by:<br> register struct flags {<br> unsigned zero : 1;<br> unsigned carry : 1;<br> ...<br> } flags asm ("cc");<br> but the modification of flags by so many assembly instruction is probably a problem (reordering instructions optimisations).<br> </div> Tue, 03 Jan 2012 12:41:07 +0000 Why is it a mess? https://lwn.net/Articles/473623/ https://lwn.net/Articles/473623/ juliank <div class="FormattedComment"> <font class="QuotedText">&gt; myint &lt;&gt; 0</font><br> <p> Use myint != 0. That other form is deprecated in Python 2, and removed in Python 3.<br> </div> Sun, 25 Dec 2011 14:09:19 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473466/ https://lwn.net/Articles/473466/ jezuch <div class="FormattedComment"> <font class="QuotedText">&gt; Sometimes, in C, I would like a function to return a value (like now) *and* the (processor) flags - for instance the "zero" flag would mean no error occured. Very fast and simple...</font><br> <p> You mean like the errno variable?<br> </div> Fri, 23 Dec 2011 10:09:53 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473300/ https://lwn.net/Articles/473300/ etienne <div class="FormattedComment"> <font class="QuotedText">&gt; Multiple return values</font><br> <p> Sometimes, in C, I would like a function to return a value (like now) *and* the (processor) flags - for instance the "zero" flag would mean no error occured. Very fast and simple...<br> </div> Thu, 22 Dec 2011 11:59:11 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473290/ https://lwn.net/Articles/473290/ justincormack <div class="FormattedComment"> Multiple return values is the real answer here. Exceptions are probably overkill. Dont suppose php will get them though.<br> </div> Thu, 22 Dec 2011 11:20:32 +0000 turing complete https://lwn.net/Articles/473257/ https://lwn.net/Articles/473257/ raven667 <div class="FormattedComment"> Where's the fun in that? Go out guns blazing. <br> </div> Thu, 22 Dec 2011 05:32:06 +0000 turing complete https://lwn.net/Articles/473249/ https://lwn.net/Articles/473249/ bronson <div class="FormattedComment"> If you're going to concede, why not concede gracefully?<br> </div> Thu, 22 Dec 2011 03:18:09 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/473239/ https://lwn.net/Articles/473239/ job <div class="FormattedComment"> On a large shared web host, a very small percentage of the sites are have traffic at any given time, but it's still a lot in absolute numbers.<br> <p> The only possible way to cram as many sites as possible on your host is to run them with a common interpreter, which can pose security problems. That's where mod_php succeeded.<br> <p> (By the way, I got the answer to my specific question below, which is that other restrictions still apply.)<br> </div> Thu, 22 Dec 2011 00:22:49 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473147/ https://lwn.net/Articles/473147/ andreasb <div class="FormattedComment"> [wildspeculation]Maybe Facebook found that they get off cheaper by investing in a handful of people who know how to write compilers and virtual machines so that they can continue to let dime-a-dozen PHP coders do the bulk of the frontend work.[/wildspeculation]<br> </div> Wed, 21 Dec 2011 13:59:19 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/473136/ https://lwn.net/Articles/473136/ andresfreund <div class="FormattedComment"> <font class="QuotedText">&gt; When the number of idle sites are order of magnitudes larger than the number of active sites at any given moment that solution is equivalent to running PHP as CGI. That would price you out of the market. (And spare me the morals please, as much as I'd like to see mod_php dead it is still an important market which drove PHP's success.)</font><br> Right, because idle sites cause that much load that cgi is actually a problem... Its the website that actually use their allotted bandwith/load/whatever that are a problem not the thousand with 3 visitors a day.<br> </div> Wed, 21 Dec 2011 12:02:20 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/473118/ https://lwn.net/Articles/473118/ job <div class="FormattedComment"> That explains it. I thought basedir restrictions was part of safe_mode.<br> </div> Wed, 21 Dec 2011 08:48:52 +0000 Why is it a mess? https://lwn.net/Articles/473111/ https://lwn.net/Articles/473111/ ekj <div class="FormattedComment"> Yeah. But even python considers boolean false and integer zero to be equivalent, and all other integers to be true. Indeed the method to override to define your own behaviour for if object is object.__nonzero__ or object.__len__ <br> <p> From the naming alone it's clear that being "true" by convention means "having length" or "not being zero". (why is the method __nonzero__ and not __zero__ (with opposite semantics) by the way, seems an odd kind of superfluous negation. Returning false hear means that the object is *not* *nonzero* i.e. that it's zero.<br> <p> <p> </div> Wed, 21 Dec 2011 07:37:39 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473088/ https://lwn.net/Articles/473088/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; BUT, what do you do with an integer-function that normally returns an integer (negative, positive, or zero) when it needs to return an error?</font><br> <p> Return success or failure (or a more specific error code), and store the result in a reference parameter? That's the standard C approach. If the possibility of failure exists, you'll need to check for that first anyway before using the result. For uncommon failure modes, in languages which support it, alternate continuations (including, but not limited to, C++-style exception handling) offer a more efficient solution.<br> <p> <font class="QuotedText">&gt; PHP has adopted the general convention that any function that fails will return false; I think this is actually quite sensible once one knows to expect it.</font><br> <p> That's great so long as you don't need to return false in a non-failure situation... The Common Lisp solution to this is rather elegant: return two values, the first being the result or false, and the second (which you can ignore) indicating success or failure. If you know that successful results can't be false you can use the normal return value, but the extended status is there if you need it.<br> </div> Wed, 21 Dec 2011 04:26:23 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473082/ https://lwn.net/Articles/473082/ Richard_J_Neill <div class="FormattedComment"> Perhaps using strpos() wasn't quite such a good example, because -1 could never be a valid answer, and is therefore potentially OK as an error-flag. <br> This is in the same spirit as, for example, C's write() .<br> <p> BUT, what do you do with an integer-function that normally returns an integer (negative, positive, or zero) when it needs to return an error?<br> <p> There are several ways to do it; of which I think that C's strtol() is the worst possible. Some might suggest returning an object, but that's logically equivalent. PHP has adopted the general convention that any function that fails will return false; I think this is actually quite sensible once one knows to expect it.<br> <p> As for the casting rules of "0.0" vs 0.0, it's rather a perverse example, which shouldn't happen in real-life.<br> </div> Wed, 21 Dec 2011 02:37:02 +0000 Why is it a mess? https://lwn.net/Articles/473049/ https://lwn.net/Articles/473049/ pboddie <blockquote>In languages like perl, php and python (which try to "guess" what you meant and "help" you) it's disaster, obviously.</blockquote> <p>Python doesn't "guess" anything. There's a protocol that all classes support which indicates whether an instance is considered true or false.</p> Tue, 20 Dec 2011 23:32:00 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/473044/ https://lwn.net/Articles/473044/ hholzgra <div class="FormattedComment"> The old ext/mysql extension did indeed not support prepared statements (just as the MySQL client protocol did not support them either at the time when ext/mysql created)<br> <p> The newer ext/mysqli extension fixed that around 2003 already when prepared statement support became in MySQL, but somehow lots of people prefer to stay with the "classic" extensions API ...<br> </div> Tue, 20 Dec 2011 23:02:42 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/473043/ https://lwn.net/Articles/473043/ hholzgra <div class="FormattedComment"> Being able to define memory and cpu time limits, and maybe open-basedir restrictions, were (AFAIR) more important to shared hosters than safe-mode (which was never that safe anyway), and all of these still exist.<br> </div> Tue, 20 Dec 2011 22:58:01 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/472976/ https://lwn.net/Articles/472976/ job <div class="FormattedComment"> When the number of idle sites are order of magnitudes larger than the number of active sites at any given moment that solution is equivalent to running PHP as CGI. That would price you out of the market. (And spare me the morals please, as much as I'd like to see mod_php dead it is still an important market which drove PHP's success.)<br> <p> PHP won because of mod_php, but mod_php won the low end market because of safe_mode. My question still stands, what should replace it? Maybe SELinux can?<br> </div> Tue, 20 Dec 2011 16:14:18 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/472971/ https://lwn.net/Articles/472971/ HelloWorld <div class="FormattedComment"> <font class="QuotedText">&gt; At what point do you get so much NIHitis that you think you should be writing your own compilers and VMs for a crappy web language instead of switching to a non-crappy one?</font><br> Well, if it's easier/cheaper to write a better implementation of the language than to switch the language, it's clearly the right thing to do, isn't it?<br> </div> Tue, 20 Dec 2011 15:32:56 +0000 turing complete https://lwn.net/Articles/472955/ https://lwn.net/Articles/472955/ HelloWorld <div class="FormattedComment"> I had actually considered to learn that language, as it seems to be pretty much the only language with first-class cases. I'm pretty busy with other things right now though. <br> </div> Tue, 20 Dec 2011 14:22:11 +0000 turing complete https://lwn.net/Articles/472954/ https://lwn.net/Articles/472954/ Cyberax <div class="FormattedComment"> Heh. Check Ur ( <a href="http://www.impredicative.com/ur/">http://www.impredicative.com/ur/</a> ) one day. It works by treating HTML as a state. <br> </div> Tue, 20 Dec 2011 14:16:29 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/472937/ https://lwn.net/Articles/472937/ sorpigal Am I the only one who thinks this is crazy? At what point do you get so much NIHitis that you think you should be writing your own compilers and VMs for a crappy web language instead of switching to a non-crappy one? The first time it was done could be seen as an emergency measure to help along legact code, but at that point shouldn't your lesson be learned and shouldn't you be trying to find the useful replacement for PHP and not just bandaiding it again and again? Tue, 20 Dec 2011 12:55:38 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/472932/ https://lwn.net/Articles/472932/ smurf Sure it's unreasonable to keep them around. So let them die when they're no longer useful. <p> Large sites increase the likelihood that somebody, somewhere on your system, is running code with a security hole or two. So it's even more important to shield individual customers from each other. <p> Your decision, of course. But the web servers <b>I</b> am responsible for will <b>never</b> load mod_<i>interpreter</i>, much less mod_php. Tue, 20 Dec 2011 12:23:24 +0000 This is funny... https://lwn.net/Articles/472930/ https://lwn.net/Articles/472930/ nix <div class="FormattedComment"> As for last_insert_id et al, well, every abstraction layer has costs. One cost of this one was that you had to use a not-completely-disgusting data model, i.e., that having more than one sequence tracking a single table was not supported. I never felt the lack: compound PKs are all very well, but if you use a sequence (mysql: autoincrement) as a PK it means that nothing else would do. Why on earth would you want to use a compound PK consisting of multiple sequences? That smacks of very bad table design to me. I thought of various more or less ugly ways to fix this but never implemented them because of a total lack of need.<br> <p> (It was not a very pleasant abstraction layer to write, I'll grant you that. But, still, abstracting over this sort of thing *is* the job of an abstraction layer.)<br> <p> </div> Tue, 20 Dec 2011 11:38:24 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/472927/ https://lwn.net/Articles/472927/ job <div class="FormattedComment"> For large web apps this is (and has always been) true. But the issue here is altogether different.<br> <p> A large shared webhost has many thousands of web sites and only a few of them are active at any time. It is unreasonable to keep thousands of idle PHP processes around (and that is without room for concorrency which would be required in production).<br> <p> That is what the web hotel business is all about, very cheap hosting, and this is what made PHP popular.<br> </div> Tue, 20 Dec 2011 11:09:06 +0000 turing complete https://lwn.net/Articles/472925/ https://lwn.net/Articles/472925/ smurf <div class="FormattedComment"> Please engage brain.<br> <p> A PHP without external state is as powerful as a pure Lambda calculus. That's a fact.<br> <p> PHP has features to talk to the external worls, save state, and whatnot, because it's designed to be (mostly) useful. A pure lambda calculus has not, because it's designed to prove computability theorems and related stuff.<br> <p> From a mathematical PoV, that's rather superficial. You can write a Web server in COBOL or Intercal or even Brainfuck if you add the required features somehow, and you can write a Prolog theorem prover in them too.<br> <p> Doesn't mean that doing any of this makes any practical sense whatsoever.<br> </div> Tue, 20 Dec 2011 10:39:44 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/472923/ https://lwn.net/Articles/472923/ smurf <div class="FormattedComment"> FastCGI and separate PHP processes per user, of course.<br> <p> It doesn't make any sense at all to bloat your Apache with mod_php. If you have 200 Apache processes, of which 10 are needed for PHP, the (non-trivial, these days) memory space of 190 PHP interpreters sits idle. It can't even be swapped out because the set of Apache processes working on PHP requests constantly changes.<br> <p> Using FastCGI, you have 10 busy PHP interpreters and 190 "normal" Apache (or lighttp or …) processors, and you get to run each customer's PHP stuff under their own UID – instead of having global access to anything that's readable by www_data when (not if) the next security hole is discovered.<br> </div> Tue, 20 Dec 2011 10:17:13 +0000 turing complete https://lwn.net/Articles/472919/ https://lwn.net/Articles/472919/ HelloWorld <div class="FormattedComment"> <font class="QuotedText">&gt; So your main complaint now is that the untyped lambda calculus can't pretend to be a hardware random number generator?</font><br> No, it's not. But your response shows yet again that this discussion is utterly pointless. You don't want to get the point, fine with me. Have a nice life.<br> </div> Tue, 20 Dec 2011 09:50:10 +0000 Yup https://lwn.net/Articles/472908/ https://lwn.net/Articles/472908/ niner <div class="FormattedComment"> "It must only be used with MySQL, really. If you want to use Oracle and Postgresql then it's much better to use sequences and their “nextval” and “currval” directly."<br> <p> Not really. It covers the simple case quite well which is the vast majority in our applications. If I want to use PostgreSQL features, I'd use returning to get the new ID back to the application without an additional roundtrip.<br> </div> Tue, 20 Dec 2011 07:38:04 +0000 turing complete https://lwn.net/Articles/472899/ https://lwn.net/Articles/472899/ tialaramex <div class="FormattedComment"> So your main complaint now is that the untyped lambda calculus can't pretend to be a hardware random number generator? Are you even paying attention to the discussion? Hardware random number generators aren't a PHP feature. The question wasn't "can a lambda expression correctly simulate the hardware of an entire web server?".<br> <p> Your objection to state cookies is spurious. The state cookie is opaque outside of the lambda expression, all the hard work happens _inside_ the lambda expression. If the state held between requests is small and client-specific you can sidestep this altogether by asking the user agent to hold on to it for you, in your HTTP response. In fact you may recall that recently Microsoft ASP.NET was found to have introduced a serious security vulnerability by transmitting inadequately encrypted session state in user-accessible HTTP cookies.<br> <p> It's certainly not fair to pretend that most, or even many web sites depend somehow upon the "state of the whole world". Usually there's a modest database, and perhaps some files stored on disk. A pure functional system could easily wrap all that material into the state cookie. Many sites _appear_ to integrate content from several other systems, but actually that's usually done client side in the user agent these days, the "integration" from the point of view of PHP or our hypothetical lambda expression is just a few lines of unchanging plain text returned in the HTTP response.<br> <p> There are numerous _practical_ problems which keep web sites from being built out of say, pure Lisp, but theoretically there's no real obstacle.<br> </div> Tue, 20 Dec 2011 04:23:25 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/472894/ https://lwn.net/Articles/472894/ andreasb <div class="FormattedComment"> Specifically, they used to compile PHP to C++ then to native binaries. Now they are deploying a PHP to virtual machine code compiler with a JIT compiling virtual machine.<br> <p> <a href="https://www.facebook.com/note.php?note_id=10150415177928920&amp;hn=2">https://www.facebook.com/note.php?note_id=101504151779289...</a><br> </div> Tue, 20 Dec 2011 01:26:47 +0000 turing complete https://lwn.net/Articles/472889/ https://lwn.net/Articles/472889/ HelloWorld <blockquote>Accusing people of "trolling" when they explain why you're wrong is poor form.</blockquote> I'm not. <blockquote>The general idea you had was fine, there are indeed applications which necessarily involve side effects and the lambda calculus doesn't have side effects. But answering individual HTTP requests (remember PHP isn't a web server, it doesn't need to care about the details of how those requests are made, where they come from, or how answers are returned) isn't really one of those applications. Thus the lack of side effects isn't a deal breaker, and my explanation deliberately didn't use them.</blockquote> Yeah, except that it *is* a deal breaker because you need a lot more than just the contents of the HTTP request in order to do anything meaningful (i. e. something that couldn't be done just as well with JavaScript on the client side). You know, things like access the database or communicate with other hosts. OK, you can get the database thing to work by passing the entire contents of the database to your lambda expression and have it return a tuple containing the response and the complete new database contents. Not only may one consider that "cheating" (as you need a more and more elaborate machinery outside of the lambda calculus expression, to the point that you can't actually claim to have done anything meaningful in said expression any longer), but that approach also quickly leads to a dead end where you'd need to pass the state of the whole world to the lambda expression in order to obtain the desired answer. And actually, even that wouldn't suffice. Imagine a web server with a hardware random number generator and a web application that allows you to query the xth number generated from now on (where x is supplied by the client). Due to Heisenberg's uncertainty principle, you can't possibly measure the state of the RNG well enough to predict what the xth generated number will be, so you clearly need some kind of side effect for that kind of application. The reason I didn't write all this stuff earlier is that I just couldn't be bothered to argue with a troll like nybble41. There's simply no value at all in this discussion, and nothing enlightening is going to come out of it (not for me, anyway). The only reason I engaged in it at all is that I don't like being told I'm wrong when I'm not. Tue, 20 Dec 2011 00:57:25 +0000 Good try... https://lwn.net/Articles/472890/ https://lwn.net/Articles/472890/ khim <p>No, I've never used SQL from python so I never used SQLAlchemy. Looks like fine ORM toolkit, though. As for SQL… as any good SQL driver it includes <a href="http://www.sqlalchemy.org/docs/dialects/index.html">dialects</a>. This is where you can <a href="http://www.sqlalchemy.org/docs/dialects/oracle.html#auto-increment-behavior">specify sequences in Oracle</a>, <a href="http://www.sqlalchemy.org/docs/dialects/mysql.html#keys">disable autoincrement in MySQL</a>, etc.</p> <p>Even so: I can not see how exactly you can chain multiple “INSERT”s in one “BEGIN”/“END” Oracle statement or execute multiquery in MySQL (<a href="http://php.net/manual/ru/mysqli.multi-query.php">like you can do with PHP</a>).</p> Tue, 20 Dec 2011 00:35:25 +0000 This is funny... https://lwn.net/Articles/472888/ https://lwn.net/Articles/472888/ khim <blockquote><font class="QuotedText">Your belief that RETURNING doesn't work in Oracle is untrue. It does (though you have to RETURNING a .nextval, indeed), and is the recommended approach rather than using .currval, because it saves a roundtrip to the database.</font></blockquote> <p>Of course “RETURNING” works, but... how exactly will it save the roundtrip? When you use “nextval”/“currval” idiom you can just batch all your operation in one statement using “BEGIN”/“END” - thus using one single roudtrip. How exactly last_insert_id emulation can beat this is mystery to me.</p> <p>Sure, sometimes you want to do some manipulations in your application before continuing - and in this case it's natural to use last_insert_id with MySQL (but not with Oracle).</p> <blockquote><font class="QuotedText">Writing an abstraction layer which abstracts over all SQL differences is of course over the top... but abstracting over trivial, always-needed stuff like 'what is the sequence number of the row I just inserted' is, well, trivial.</font></blockquote> <p>Actually it's not trivial. In MySQL LAST_INSERT_ID only gives you one number but in Postresql or Oracle you can generate few different numbers. And since one roundtrip can include quite a few elemental operations it's not easy or simple to transform one to another.</p> <blockquote><font class="QuotedText">I've written such an abstraction layer myself more than once, and that was a little one-man thing, and it was not very much effort.</font></blockquote> <p>WOW! Cool.</p> <p>How exactly have you processed Oracle's “insert” statements which used two distinct sequences in MySQL?</p> <blockquote><font class="QuotedText">That PHP couldn't do it says volumes.</font></blockquote> <p>About your unreasonable expectations? Sure. About SQL driver? Not much. DBI example which produces suboptimal results does not expire confidence: I'd rather handle such problems at the application level rather then in intense debugging session which will show that that my perfectly tuned code on some other database uses “insert” over unindexed table "because driver had no other choice". Thnks... but no, thnks.</p> Tue, 20 Dec 2011 00:04:47 +0000 turing complete https://lwn.net/Articles/472879/ https://lwn.net/Articles/472879/ tialaramex <div class="FormattedComment"> Accusing people of "trolling" when they explain why you're wrong is poor form.<br> <p> The general idea you had was fine, there are indeed applications which necessarily involve side effects and the lambda calculus doesn't have side effects. But answering individual HTTP requests (remember PHP isn't a web server, it doesn't need to care about the details of how those requests are made, where they come from, or how answers are returned) isn't really one of those applications. Thus the lack of side effects isn't a deal breaker, and my explanation deliberately didn't use them.<br> <p> All you need are some conventions. The same sort of conventions you'd need if you wanted to write pow() in the lambda calculus, or isalpha().<br> <p> It's also fine that you didn't understand that, and needed to have it spelled out. The problem arises when you discover, oops, that you were wrong and rather than say "Ah, I see, that's not what I thought was going on" you insist that you're being trolled.<br> </div> Mon, 19 Dec 2011 23:37:55 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/472875/ https://lwn.net/Articles/472875/ adamg <blockquote>A reasonable database layer allows one to switch database backends as needed. It allows me to change the backend driver (a one-line edit), and everything should still work afterwards.</blockquote> That always makes me wonder, what kind of argument is that anyway? Do you really find yourself so often in situations where in the middle of the project you decide to switch database backend?<br> <p>If a project developers write SQL queries that are so portable that it as easy to switch to another database backend as doing the mentioned s/my_/pg_/g (or equivalent), my guess is that they are not using much of the initial database features. <p>.. or maybe there is an easy way (which I don't know) to write stored procedures in a portable way. Mon, 19 Dec 2011 22:21:49 +0000 Cracks in the Foundation (PHP Advent) https://lwn.net/Articles/472872/ https://lwn.net/Articles/472872/ job <p>... and code injection has never been as fun :)</p><p>(see for example <a href="https://media.blackhat.com/bh-us-11/Sullivan/BH_US_11_Sullivan_Server_Side_WP.pdf">this</a>)</p> Mon, 19 Dec 2011 22:06:18 +0000 This is the most ridiculous commentary... https://lwn.net/Articles/472869/ https://lwn.net/Articles/472869/ job <div class="FormattedComment"> As a side note, I believe what was important about mod_php was safe_mode. It is a rudimentary file i/o sandbox that only allows you to open files with the same UID your script was created with. That enabled shared script hosting, you don't have to use one process per user which was important for the nascent "web hotel" businesses.<br> <p> Performance was worse than Perl (which was the dominant language at the time, and had decent template frameworks too), security was worse, the language itself was a stripped down Perl 4, but deployment was so easy you just had to install it and you had yourself a shared web hosting environment.<br> <p> I see now that safe_mode is removed from PHP 5.4 so perhaps we're full circle now. I wonder what shared hosts are supposed to replace it with?<br> </div> Mon, 19 Dec 2011 21:58:00 +0000 turing complete https://lwn.net/Articles/472861/ https://lwn.net/Articles/472861/ HelloWorld <div class="FormattedComment"> Sorry, this this pointless, you're clearly confused. Find someplace else to troll. <br> </div> Mon, 19 Dec 2011 20:56:12 +0000 turing complete https://lwn.net/Articles/472859/ https://lwn.net/Articles/472859/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; In PHP, the APIs for accessing the HTTP request data and for setting HTTP response headers and sending data are part of the language; in the untyped lambda calculus, they aren't.</font><br> <p> That's just a matter of standard libraries, which can exist in the untyped lambda calculus just as easily as in PHP. These APIs are a convenience, nothing more.<br> <p> <font class="QuotedText">&gt; Of course, you can alter the language specification of the untyped lambda calculus to include side effects by specifying that your program will be passed an HTTP request and its output will be sent to the client. But if you alter the language that way, it's not the untyped lambda calculus any longer.</font><br> <p> Neither the PHP language nor the lambda calculus define the semantics of the input and output, which depend on the lower software layers and hardware and are outside the scope of language specifications. Applying an additional semantic layer where none existed before is an extension to the specification, not an alteration to the language. There is no such thing as a meaningful program in either the lambda calculus or more common languages like PHP *without* exactly this sort of semantic extension, which is always defined by the implementation, not the abstract language.<br> <p> Note that PHP programs can exist which have nothing to do with HTTP; witness the php-cli command-line environment. The HTTP CGI I/O semantics are one way to interact with PHP programs, but not the only way.<br> </div> Mon, 19 Dec 2011 20:49:52 +0000