Talk:PHP/Archive 3

Functional programming in PHP
PHP4+ has some support for functional programming: almost-closures (uncomfortable, outer variables are inherited as values), variable functions (you can bind, receive and/or return named or anonymous functions as variables), and well-known high-order array functions like array_map, array_walk, array_filter or array_reduce which are in the standard library.

If we're saying Python supports functional programming, I think we could say PHP does too, and add it to the language comparison article.

PHP as an alternative to ASP.NET?
"The PHP model can be seen as an alternative to Microsoft's ASP.NET/C#/VB.NET"

Don't you think that this should be removed, as PHP is just a second league when comparing ASP.NET features? Please, be objective and unbiased.


 * Well, by leaving out Macromedia's ColdFusion system, Sun Microsystems' JSP/Java system, the Zope/Python system, the Mod perl/Perl system, and the Ruby on Rails framework, you are implying that ASP.NET/C#/VB.NET is superior to all of these. Is that really the case? And, is it really about which is better, or is it more a question of what is better suited for a specific task.
 * I don't agree that is should be removed - Jerazol 13:49, 11 May 2006 (UTC)


 * "Objective and unbiased" is what it is. "can be seen" is fairly neutral in terms of POV, unlike, er, for example, "just a second league when compared ...."


 * "Can be seen" at least informs us that it's an opinion, not a fact. If it were changed or removed, then your POV would *become* the "fact", and there is therefore no reason to make the change. Renaissongsman 22:59, 6 June 2006 (UTC)


 * PHP is not second rate compared to the Microsoft technology stack. It is a popular, high performance, open source alternative which is just a ubiquitous as Microsoft on the web.  In fact, a more informative statement is: PHP is one of the two dominant technologies for implementing websites (Microsoft's .NET is the other).  --PHPedia 21:10, 11 June 2006 (UTC)


 * There's just one problem with ASP - it's a Microsoft product. 'nuff said. —Preceding unsigned comment added by 67.41.164.192 (talk • contribs)

The mess that is this article
The middle third at least is probably not suitable for this article. You're not reading an encyclopedia to learn how to program. The issue is where to put it. As for the huge list of modules at the end, I'm just going to delete that I think. Chris Cunningham 15:04, 18 May 2006 (UTC)
 * I couldn't agree more. I think that the learning how to program bit is more suited to Wikibooks. Rob.daemon 03:45, 19 May 2006 (UTC)

PHP6
I'm just wondering if this is the place where we can put information about PHP6, as quite a bit of progress has been made in it's development. --TheHeadSage 14:19, 6 June 2006 (UTC)
 * A "development" section would be better than sprinkling it all over the article I think. Chris Cunningham 16:51, 19 June 2006 (UTC)
 * Even another article called php6, referred to from this article? --Draicone 23:05, 28 June 2006 (UTC)
 * No because the information would get lost especially the parts that answer the criticisms such as: Removed: magic quotes, register globals, safe mode. Added: unicode support and namespaces.


 * "Added: unicode support and ***namespaces***". unicode yes, namespaces is a big debate, and judging by the conversation, I'd say there's a 95% chance it won't happen - most of the dev team seem to be against it to me, and there's certainly no support for it in CVS. --Streaky 20:32, 18 August 2006 (UTC)

Criticism
Imo there are a couple of passages in the criticism section that should be removed, as they are incorrect/not verifiable, or simply silly

The many settings in the PHP interpreter's configuration file (php.ini) mean that code that works with one installation of PHP might not work with another. For example, if code is written to work with register_globals turned on, it won't work on another system that has register_globals turned off. This makes writing portable code more difficult as the only way to ensure compatibility is to assume that features will be  unavailable. register_globals is a silly example to use here, since it's a question about backwards compatibility. Code developed after 4.1.2 should anyway use the superglobals, and not rely on register_globals, and should then work under any circumstances. Other showstoppers are f.ex safe mode etc. I don't agree that this is a valid criticism though.

Method / function overloading is not allowed (Obsolete since PHP5). Listing every programming concept which isn't supported in PHP is silly and pointless. There's many other OO concepts that also are not supported in PHP4, less so in PHP5 Jerazol 13:01, 23 June 2006 (UTC)
 * Very true, and very few languages have all the OO concepts. php was meant for powerful web development, not C++-like flexibility. --Draicone 00:20, 30 June 2006 (UTC)
 * I've now removed these two passages in the article. I'm sure even more could be pruned, as the criticism section seems to be populated by issues gathered by ppl who don't like PHP, rather than valid criticisms directed at PHP specifically. Jerazol 08:36, 30 June 2006 (UTC)
 * I noticed you removed a couple of my additions. I'm not objecting, in fact I'm very new and probably missed some documentation regarding quality control, but could you tell me if there's a different way to write those two additions that would be acceptable? I'm referring to and.
 * Well, the statement about PHP being used mainly for OSS is incorrect. PHP is widely used in the comercial web development industry. The other part was simply a bit to technical. It's implementation details which imo isn't really appropriate for this article.

Critism Continued

 * If 'register_globals' is enabled in PHP's configuration file, PHP automatically puts the values of Post, Get, Cookie and Session Parameters into standard variables, which can be a significant security risk for scripts that assume those variables are undefined. Other languages, such as ASP.NET, include functionality to detect and clean harmful cross-site scripting or other malicious code automatically, whereas PHP does not.

First of all this article is not named "PHP vs. ASP".

Secondly, this is quite ridiculous. The thought that the fact that register_globals is optional makes PHP a lesser language is not a valid point. PHP is a more fine-tuned language and is not as heavy as ASP for the same reason. I cannot see this as a weak point, or in fact a point at all.

It also appears that ASP is the prefered language in the article, making the article subjective proposing PHP is a side-line language. Kakugo 12:19, 11 July 2006 (UTC)
 * Editors opinions (on PHP) don't matter. Not mine, not yours. What matters is quoting valid sources. I have found a source that repeats this criticism: http://www.technosailor.com/lessons-in-web-security-php-and-registerglobals/. "let’s look at one of the weaknesses of a common scripting language, PHP. This exploit is actually old and has been closed by default in every PHP release for the past few years." This does seem a good citation, and a valid item to include under criticisms. However, I don't know PHP well enough to draft a paragraph with sufficient accuracy. Please don't be defensive. It is the job of this article to repeat criticisms, provided they have suitable sources. Furthermore it is the job of editors to make sure that in the article their opinion cannot be deduced! Notinasnaid 12:33, 11 July 2006 (UTC)
 * P.S. Reading that, it sounds a bit combative. Sorry, it wasn't supposed to be; just emphasising it's an editors duty to repeat criticisms that are well sourced even if we, personally, believe them to be nonsense. Notinasnaid 13:01, 11 July 2006 (UTC)
 * No, actually, it sounds extremely ignorant and cuntish. Good day? Kakugo 11:02, 1 August 2006 (UTC)


 * It's not a language weakness, it's a developer weakness. --Streaky 20:34, 18 August 2006 (UTC)

Apology
I seem to have accidentally made a raft of changes to the article, under the guise of "copy editing". Not entirely sure how I did this, but I guess I must have used an out of date original, because the history shows many more changes than I actually typed. Sorry for any extra work I generated. There was one bit I would like to propose for reworking and inclusion. In usage: "PHP generally runs on a web server, taking PHP code and (optionally) user choices (typically from a form) as its input and creating Web pages as output." The part in italics is new. I feel that as originally written, it isn't clear how a PHP program could be used as part of an interactive system, since the PHP code itself is fixed, and fixed input would give (usually) fixed output. The resulting language was indeed clumsy. Notinasnaid 09:25, 5 July 2006 (UTC)
 * It seems obvious that a language which supports variables supports some method of input. It might be valuable to mention the link between forms and variables somewhere in the article, but a set of parentheses in an otherwise clear introductory sentence is not the right place. Chris Cunningham 09:52, 5 July 2006 (UTC)

coderwiki
I have posted a link to coderwiki.com twice and twice it has been removed with no more explanation than spam. coderwiki is a wiki thats looking to document all languages. we're starting up and need other programmers to help write articles. our users and i are investing time and money to bring this service to people free. if there is a better place to inform programmers of the site, or perhaps a better way to address it, i would like to know. thx

--da404LewZer 07:20, 15 July 2006 (UTC)


 * Wikipedia is not a promotional device. Your effort sounds useful, but links to nascent sources, especially those that don't currently extend the content of the subject, are almost always removed rather quickly. &mdash;  Stevie is the man!  Talk 18:29, 15 July 2006 (UTC)

allright, thats fair, anyone who would like to help tho, feel free :P --da404LewZer 19:30, 15 July 2006 (UTC)

Criticism section
The criticism section is not an appropriate place for fans of the language to make promises about future corrections. Write a well-sourced "future developments" section or wait until PHP 6 is actually released. I've done a fair amount of reduction of the crits section already without having to resort to clapping my hands for the future. Chris Cunningham 22:07, 2 August 2006 (UTC)


 * Ronabop's point is a sourced fact that is concise and corresponds to the criticism. I have no issue with keeping it.  It doesn't require a fan to point out that there are verified plans by PHP's developers to correct something that is criticized. &mdash;  Stevie is the man!  Talk &bull; Work 22:24, 2 August 2006 (UTC)
 * A new section should be made for future development activities. The criticisms section is not an appropriate place to state future intentions. It reads like a lame attempt to disclaim current flaws. Chris Cunningham 00:30, 3 August 2006 (UTC)
 * Agreed to a new section, but the concise addition to the criticisms section on the verified response by the PHP developers that addresses the criticism is all right, and I will agree to that if Ronabop wants to reinstate it. Thank you. &mdash; Stevie is the man!  Talk &bull; Work 01:52, 3 August 2006 (UTC)

Okay, I might have missed it, but as far as I can see, PHP is the only one out of all the languages mentioned in this article ("Microsoft's ASP.NET system, ColdFusion, Sun Microsystems' JSP, Zope, mod_perl and the Ruby on Rails framework.") that has a Critism Section? Is that to lead us to believe that the other languages don't have any critism? To really keep it fair would require that a critism section be added to more of them OR crtisim not be in the PHP Article. You might be even able to get away with it like the ASP.net article did. The criticism section is basically "Comparison to other platforms" but in reality, there aren't any comparisons made. AlReece45 20:46, 17 August 2006 (UTC)
 * The crits section on here was originally unbearable, but it currently does a pretty good job of evaluating what it is that prevents PHP for being a universal Web scripting language. That other articles don't have crits doesn't necessarily affect this article; to some extent PHP's crits are due to the language implementation being immature in many ways compared to its contemporaries and it's natural that it might have a longer crit section. On top of that, you're looking at the Framework articles, not the Language ones (vb.net, java, python, perl). Chris Cunningham 21:46, 17 August 2006 (UTC)

Looking at the ASP.NET page, I see they have no criticism page, but they do have a fairly lengthy section on improvements from ASP. It seems to me pretty POV, but thats to be discussed elsewhere. I do however think a comparison to PHP4 and PHP5 should be included, and possibly a comparison of features in the upcoming PHP6. Bytebear 18:16, 29 September 2006 (UTC)

Recent edits
Please don't include statements like "amongst thousands of others" in lists of software, it never reads well. PHP is hardly the first language to operate as a filter, and isn't the "de facto standard" for Web development at all. I've reverted the whole lot because I couldn't find any part which made the article read better or more informative without seeming like an advert. Chris Cunningham 09:56, 14 August 2006 (UTC)


 * In all fairness, you could call PHP de facto and not be far off the mark, I wouldn't agree with such a statement being included for other more obvious reasons - namely it being flame-bait for one --Streaky 20:40, 18 August 2006 (UTC)

Delimiters
Somebody added " " as a standard delimeter, but I have never even heard of that and even tested it and it doesn't work. Maybe a special server configuration might be able to add that as a valid one, but not normally. I think it should be removed. GeorgeMoney (talk) 21:57, 23 August 2006 (UTC)
 * I have never seen it, nor would I see a reason why it would be used except to be friendly to someone familiar with .NET. I vote to remove this. The only delimiters I know of are,  , and   (most of which I think have to be turned on in a configuration setting?). --Rballou 00:30, 24 August 2006 (UTC)


 * If you've never seen it you've never read the basic syntax section of the manual. Its available in every standard PHP distribution unless the Official PHP Manual is incorrect. AlReece45 01:54, 24 August 2006 (UTC)

"There are four different pairs of opening and closing tags which can be used in php. Two of those,  and, are always available." http://www.php.net/manual/en/language.basic-syntax.php


 * I think it's unnecesary to keep an exhaustive list of PHP-syntax in this article, and the -type PHP delimiters *is* non-standard in the sense that you will have to search long and hard to find examples of code using them. The manual also goes a long way in saying that the only reason they were added, was as a workaround for editors that had problems dealing with processing instructions like <?php. Jerazol 20:47, 24 August 2006 (UTC)


 * I'll come clean: I've never read the basic syntax page of the manual. I agree with Jerazol, though, that we do not need to list every delimiter that is available especially if it is rare. --Rballou 15:55, 24 August 2006 (UTC)


 * First, when did the manual ever say that was the only reason it was added? All I saw that came close to that was some editors (like FrontPage) don\'t like processing instructions.' And while that was a reason, it never says that was the only'' reason, so can you please point out where the manual goes a 'long way' to state that was the only reason it was added. Second, I agree that we do not need to list every delimiter available, but at the same time I believe it must be clear that  is not the only one. Using any of the other delimeter's as an example would most likely need another statement stating that the delimiter is not available with certain configurations. By using two delimiters that are always available, going into details about which delimiters are required and which aren't is not needed. The delimiter may be rare, but it is the only other delimiter that doesn't need a configuration setting. AlReece45 19:17, 24 August 2006 (UTC)


 * I did not make any such claim, that the manual say the PI-thing was the only reason, but it does say

While the tags seen in examples one and two are both always available, example one is the most commonly used, and recommended, of the two.
 * as well as the example:

echo 'some editors (like FrontPage) don\'t            like processing instructions';
 * while it doesn't explicitly state that the reason for adding the type delimiter was to workaround a problem with some editors, the fact that they make a point of it in the example, at least to me, does indicate that is a factor. This talk by Rasmus Lerdorf, http://talks.php.net/show/oscon2002/9 also states that the syntax is rarely used. Jerazol 21:01, 24 August 2006 (UTC)


 * One thing to consider is that while this delimiter was proposed for removal in PHP6, it appears that the meeting notes imply that the delimiters are going to be kept. http://www.php.net/~derick/meeting-notes.html
 * Another thing to consider is that the documentation makes it appear that  and have been around more than the others. If it wasn't, I would think they would mention it like they did with Short Tags.
 * Finally, unlike the other two options, this is not determined by a configuration option, and is unlikely to be removed until it is in fact moved to a configuration option. AlReece45 02:02, 1 September 2006 (UTC)

This article is not NPOV
I didn't think the Criticisms of PHP are so noteable to make up nearly half this article. Coderx 05:27, 30 August 2006 (UTC)
 * The problem is that the apologists keep coming in and bloating it up with excuses about things being off by default or fixed in some future release or whatever. All the apologies need to be removed, all the PHP6 stuff needs to move to its own section (or article), and the rest of the article needs to be beefed up to address the role PHP plays in more than an introductory manner. The article is incomplete, but it certainly isn't pushing an opinion just because the criticism section (which used to be twice as long) is rather more complete than the rest of the article. Chris Cunningham 08:26, 30 August 2006 (UTC)
 * I've added a stub for the PHP6 wishlist pony people to expand upon how it's going to fix everything. Chris Cunningham 08:51, 30 August 2006 (UTC)
 * I tend to agree with the original poster, that the Criticisms section is too big. It's filled up with criticisims which is not specific to PHP, is not valid for PHP-versions released the last 2-3 years etc. This makes it silly in my pov and it looks more like some people are trying to push their pov of PHP as a crappy language, rather than create an informative article, with valid criticisms.Jerazol 16:08, 31 August 2006 (UTC)
 * I have removed three criticisms. I removed register globals and magic quotes because both have been disabled by default since 2002. I also removed a criticism that discusses mod_php on shared hosting systems which I do not think is relevant to PHP as a whole, but rather to the implementation of PHP by some hosting companies. --Rballou 13:27, 30 August 2006 (UTC)
 * That's the disputed ones gone; the rest are PHP-specific and commonly brought up. I've removed the POV tag but left the refs one on the section. Chris Cunningham 08:13, 1 September 2006 (UTC)

Criticism again
"Criticisms of PHP include those general criticisms ascribed to other scripting programming languages and dynamically typed languages. Some specific criticisms of PHP include the following:

...


 * "PHP's type checking is very loose, potentially causing problems. Variables in PHP are not limited to one type (it is possible to assign an integer value to a variable, then assign a string value, and then assign an array to it). Because type checking using the == operator is not strict, the === operator was introduced to ensure a strict type match. Functions are also not allowed to (directly) force the types of their arguments, unless they are arrays or objects."

The problem here is that the introduction to the list says that the list will address PHP-specific problems, not those attributed to dynamically typed languages. This item is one of the latter and doesn't belong in the list. -  El Americano ( dímelo ) 14:55, 18 September 2006 (UTC)
 * That part was probably folded in from a larger rant about functions at some point. Feel free to remove it. The larger problem is that of PHP not really caring what type something is even after it's been initialised. Chris Cunningham 15:01, 18 September 2006 (UTC)