Talk:PHP/Archive 8

Criticism of PHP
It seems odd that there is no Criticism section in this article. I suppose Security does touches on some points, however. Brightgalrs ( /braɪtˈɡæl.ərˌɛs/ )[1] 15:06, 20 November 2015 (UTC)

Probable misleading statement.
Current text states as flat fact a 100% performance improvement. I'm dubious of this unless it's plain php5 without the op code optimization. Lycurgus (talk) 17:53, 6 December 2015 (UTC)

php4-style constructors were NOT removed in php7, merely E_DEPRECATED
quote "Support for legacy PHP 4-style constructor methods was removed[48]", that's wrong, it's still present. the plan is that in the future, only __construct will be used, and the classname will also be a valid, normal, function member. as of php7 (and at least up to 7.0.4), if it encounters a class with only php4-style constructor, it will throw an E_DEPRECATED error with the message "Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; c has a deprecated constructor", but still use the constructor. if it encounters a class with both php5-style AND php4-style constructors, only the __construct will be used. Divinity76 (talk) 07:24, 17 March 2016 (UTC)

Syntax highlighting
has removed the syntax highlighting of the PHP and HTML code on this page. To avoid us both violating WP:3RR I'm bringing this to the talk page. I think that the syntax highlighting is useful: it makes different tokens visually distinct, so it is clearer to the reader what the boundary between parts of source code is. It also shows which tokens are in the same family: similar tokens share the same styling. So I disagree with their assertion that syntax highlighting is useless without a legend, indeed I don't think I've ever seen syntax highlighting done with a legend. The other argument I would have is that other programming language articles also use syntax highlighting, e.g. Pascal and Haskell. Finally, I don't see what harm highlighting causes. Removing it will make things harder to parse for some people and have no effect on others. But it wasn't harming anyone, so why remove it? It being "useless" is not a sufficient reason. &mdash;ajf (talk) 01:33, 18 November 2015 (UTC)
 * I have yet to find an article on WP where highlighting is useful, as most usages only present very short snippets of code without context. The average reader has no concept of what is being highlighted, and an experienced programmer doesn't need it here. In most cases the highlighting is confusing, because invariably the items highlighted are not what is being discussed or intended to be illustrated in the text. The example of inclusion of a PHP code line in HTML is only one obvious example of wrong highlighting, what should be highlighted is the PHP line, not something else, such as the PHP constants in the code.
 * The argument that "if it doesn't harm" anything it may be included is nonsense. Only features proven useful should be included, what is useless and only clutters the article should indeed be removed. This is a general purpose encyclopedia, not a medium to satisfy some specialists' idea of presenting syntax. This is not a programming editor. This is only common sense. Kbrose (talk) 01:47, 18 November 2015 (UTC)
 * In general, I'd say that syntax highlighting is useful. &mdash; Dsimic (talk &#124; contribs) 00:47, 4 January 2016 (UTC)
 * Ditto. II  | (t - c) 15:26, 16 April 2016 (UTC)

Remove Hello World
Some years ago now I added the  to the syntax section. I think both this, and the "HTML" version should be removed. They're both unhelpful and misleading (the HTML one more so).

We should avoid focusing on PHP's use as a templating engine. While it was designed for exactly this, these days it's the last thing you should use it for.

Additionally, the part on PHP's delimiters is incorrect: there is no need to use  if there is nothing after the PHP, and it is recommended not to. — Preceding unsigned comment added by Gisleburt (talk • contribs) 21:44, 2 May 2016 (UTC)


 * Hm, I'm not sure that not using  is actually recommended? &mdash; Dsimic (talk &#124; contribs) 02:31, 31 May 2016 (UTC)
 * It is: http://php.net/manual/en/language.basic-syntax.phptags.php "If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because PHP will start output buffering when there is no intention from the programmer to send any output at that point in the script." — Preceding unsigned comment added by Bbio1092 (talk • contribs) 21:52, 14 July 2016 (UTC)

External links modified
Hello fellow Wikipedians,

I have just added archive links to 1 one external link on PHP. Please take a moment to review my edit. You may add after the link to keep me from modifying it, if I keep adding bad data, but formatting bugs should be reported instead. Alternatively, you can add to keep me off the page altogether, but should be used as a last resort. I made the following changes:
 * Attempted to fix sourcing for http://il.php.net/vote_listing.php3

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).

Cheers.—cyberbot II  Talk to my owner :Online 03:13, 31 March 2016 (UTC)


 * The reference was later replaced with a better one. 80.221.159.67 (talk) 07:56, 17 August 2016 (UTC)

WikiProject PHP
-- 1Wiki8 ........................... (talk) 17:55, 2 September 2016 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified 2 external links on PHP. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20060719204721/http://www.zend.com/zend/zend-engine-summary.php to http://www.zend.com/zend/zend-engine-summary.php
 * Corrected formatting/usage for http://gtk.php.net/manual1/it/html/intro.whatis.php.whatdoes.html

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 18:18, 14 September 2017 (UTC)

Low quality and biased tone
The ‘Criticism’ section is written in very low-quality English and the tone is pretty biased against the criticism it’s reporting. Martenjacobs (talk) 14:38, 18 November 2017 (UTC)

PHP's member visibility features harmful?
'PHP's member visibility features have sometimes been described as "highly useful." However, they have also sometimes been described as "at best irrelevant and at worst positively harmful." '

The referenced article with the "positively harmful" opinion has no credited author. I have no issue with criticism of PHP appearing in this article, but it should come from a non-anonymous, reputable source and not just be a rant, which is what the referenced article appears to be. I suggest removing the sentence, and optionally for balance, finding an credible article from a respected author to quote instead, or removing the positive statement as well. Danielklein (talk) 04:31, 30 April 2018 (UTC)


 * Agreed: I've gone ahead and removed both sentences, because even if these sources were reputable, they're not saying anything particularly noteworthy. The anti-modifier rant, in particular, isn't really about PHP at all, but about the principle of member visibility which was around for decades before PHP incorporated it (although the author doesn't seem to realise this).
 * If there were a reputable or frequently-cited source discussing some problem with *the specifics of visibility as implemented in PHP*, that might be relevant to include; but these weren't. - IMSoP (talk) 20:32, 22 June 2018 (UTC)

But vs. and
The words "but" and "and" each join two assertions; for "but" to be applicable depends pretty much on the first assertion being obsoleted by the second. The notion that the originally intended meaning disappeared into a time warp or some other form of "singularity" is a cute affectation, but for our purposes, the, uh, origin story is part of the encyclopedic topic, and the cuteness achieved by "but" is not just free of encyclopedic significance but also a harmful distraction. --Jerzy•t 05:47, 31 October 2018 (UTC)

PHP object section uses php 7.4 syntax
In the PHP object section the code examples are using typed properties. This isn't yet released and will throw an error in current version of php. A bit confusing to have it in the example section.

public string $name;

should be:

public $name; — Preceding unsigned comment added by 158.174.24.242 (talk) 15:00, 13 June 2019 (UTC)

Making the intro more comprehensable especially when people are reading on other wikipedia articles where PHP is mentioned and they need a quick understanding by invoking the intro
Here's my rewrite; let me know what you think:

PHP: originally stood for "Personal Homepage Page" and came out of Rasmus Lerdorf's need to make a static webpage more dynamic, i.e. interacting with the visitor of the page. Rasmus did so by making the server's programming language "call" little scripts he wrote that would invoke interaction with the user and thus make static webpage more dynamic. Later on these scripts evolved to a programming language where the PHP acronym was held and now is mostly remembered as PHP - a general-purpose Programming language for Hypertext Preprocessing.

PHP was originally created by Rasmus Lerdorf in 1994;[6] the PHP reference implementation is now produced by The PHP Group.[7] PHP originally stood for Personal Home Page,[6] but it now stands for the recursive initialism PHP: Hypertext Preprocessor.[8]

Sincerely,--SvenAERTS (talk) 10:58, 28 November 2019 (UTC)


 * In my opinion that would work as the intro of a textbook chapter on PHP, but not quite as an encyclopedic intro since it goes into the history rather than the current status. I agree we could make the intro a little bit more helpful for the layman reader, it would for example be good to mention how ubiquitous it is/was for web servers and that sites such as Wikipedia, Wordpress and previously Facebook were written in it (although it would probably be undue weight, even if helpful). – Thjarkur (talk) 15:23, 28 November 2019 (UTC)


 * I don't think the suggested rewrite would agree with the Manual of Style, particularly MOS:FIRST. I also share Thjarkur's concerns regarding the weight given the early history. Huon (talk) 19:20, 28 November 2019 (UTC)

Should we match the PHP: Supported Versions designations
Rather than "Old version", "Older version, still maintained" & "Latest version", https://www.php.net/supported-versions.php uses "End of life", "Security fixes only", & "Active support". Should we endeavor to match that? It might be useful to users to know what is deprecated & what is only receiving security fixes. Peaceray (talk) 18:51, 6 February 2020 (UTC)

Bad grammar, confusing sentence
"As of April 2020, over half of sites on the web using PHP are still on discontinued/"EOLed"[13] version 5.6 or older;[14] and with version 7.0 and 7.1 over 68%, that are neither officially supported by The PHP Development Team,[15] while security support is provided by third parties,..." -- what does this mean? Grammar is wrong. 2A00:23C5:FE0C:2100:B576:B877:BD5D:BEF5 (talk) 17:47, 15 May 2020 (UTC)

Talk
I want to know if I can talk with any one here Lunathi Gxekwa (talk) 21:55, 30 June 2020 (UTC)
 * Only if it is relevant to improving the article. IdreamofJeanie (talk) 22:37, 30 June 2020 (UTC)

Not even Debian knows why they're mentioned
No, seriously, is there any relevance to stating that "that not even Debian supports" PHP 5.6 or older?

Is there some common knowledge I'm missing, like Debian having a reputation for supporting very old software? Perhaps this is true, but I don't think it is obvious to the average person or programmer. (Is the point is to emphasize how unsupported PHP 5.6 & below are?)

Either way, the additional side-note that "(while Debian 9 still supports version 7.0 and 7.1, those versions are however already discontinued by The PHP Development Team)" seems wholly unnecessary & off-topic, and (IMHO ) it should be removed.

~ 2600:1700:1261:E730:D4EB:3BD7:B0E:F1D7 (talk) 06:24, 20 September 2020 (UTC)

Template error in infobox
I don't know where to put this as so many different systems are affected, but I assume many watchers of this article are familiar with code going wrong... currently the infobox has an error "Error: first parameter cannot be parsed as a date or time." The error comes from the code. The inner template returns "29 October 2020; 29 October 2020" because apparently it fetches the date both from the latest stable release and the release candidate version. That's not a valid date for the outer template, so we get this error. Is this a more general problem of the wikidata template? Is it expected to return multiple dates? If yes, can we avoid this problem by changing the Wikidata entry? If not, what else can we do to fix the error? We can put the date into the article manually, of course, but that's not a proper fix of the issue. Fetching the version works flawlessly. User:Romainluc last changed the Wikidata entry. --mfb (talk) 21:32, 14 November 2020 (UTC)
 * Try WP:VPT — GhostInTheMachine talk to me 22:11, 14 November 2020 (UTC)
 * I added single to that line of the infobox as a temporary work-around until the underlying problem is identified and solved. I'm not sure what will happen if there is a release candidate that is dated AFTER the date of the last stable release - it might return the wrong date.  davidwr/  (talk)/(contribs)  23:47, 14 November 2020 (UTC)
 * Infoboxes should be using Module:WikidataIB. – Jonesey95 (talk) 01:08, 15 November 2020 (UTC)

It's December
It's past 26 November so shouldn't it be in the past tense? by kaiete (talk) 20:25, 2 December 2020 (UTC)

Syntax highlighting
The  tag does not support modern PHP syntax: or 37.212.37.47 (talk) 17:10, 25 January 2021 (UTC)

Dropping legacy file extensions
The infobox currently has this for file extensions:

php, phtml, php3, php4, php5, php7, phps, php-s, pht, phar

Some of these are extremely rare to see in the wild, like. I am wondering if it would make sense to drop these from the infobox, so we are left with just the common ones (roughly sorted by how common):

php, phar, phps, phtml

And then perhaps we have a line somewhere in the article that explains why you might come across something like  in a legacy system? Modern PHP just does not have all these silly extensions.

Ancarda (talk) 09:13, 3 May 2021 (UTC)

SampleCode replaces Screenshot in this type of Infobox
Hi, SampleCode argument is new and it should be used is instead of the past argument "screenshot". See, SampleCode has an abstract description of the total programming style. It conveys important information about remaining parts of this Infobox. So we should use this argument as the second rendering item, to successfully convey an overview of PHP language. Thanks, Hooman Mallahzadeh (talk) 12:22, 3 February 2022 (UTC)
 * Dear Please read the above paragraph. By the same reason, perhaps we should apply that for Java and Javascript. If you disagree, please discuss that here. Thanks, Hooman Mallahzadeh (talk) 17:55, 3 February 2022 (UTC)

. Interesting, it seems some languages have sample code in a screenshot, I wasn't aware of that. I had a look through the Wayback Machine and it seems the PHP article never did. Nevertheless, the article has many code snippets, e.g. https://en.wikipedia.org/wiki/PHP#Example demonstrates OOP, string concatenation, list usage, closures & functional programming , string interpolation, and one style of comments.

I appreciate the infobox might support a snippet to give a feel of the language, but just having hello world there doesn't seem useful to me. Perhaps it's useful to other people, I'm not sure. I especially feel this as https://en.wikipedia.org/wiki/PHP#Syntax gives two different ways to accomplish hello world. I honestly think a screenshot is fine -- is that deprecated for accessibility reasons? It seems like you'd have to put a lot of text there to make it useful (which you can't fit into the infobox), or somehow make it expand (like an image does today when you click on it).

Do a lot of other languages have this? I will admit I reverted your edit because I had seen previous similar edits reverted too, e.g. https://en.wikipedia.org/w/index.php?title=JavaScript&diff=next&oldid=1069635829&diffmode=source Ancarda (talk) 05:47, 5 February 2022 (UTC)
 * I have a question: What comes at the first glance in your mind when you hear the word "PHP"? For myself at the first glance is a small program like "Hello world", that is a typical instance of the total concept of programming language PHP. What about you? Hooman Mallahzadeh (talk) 06:34, 5 February 2022 (UTC)
 * Or a better guestion: How you would explain the concept of PHP language to a bachelor student at his first term? Perhaps you would use a simple example, and not explain items like "Paradigm", "type discipline", and others. OK? Here we use "Hello World" program at Infobox to introduce PHP for a person who does not have any skill in programming. Hooman Mallahzadeh (talk) 06:40, 5 February 2022 (UTC)

For myself at the first glance is a small program like "Hello world", that is a typical instance of the total concept of programming language PHP

I'm not sure what you mean by total concept. Printing something to the console doesn't seem to demonstrate enough differences between programming languages. Just from hello world, what differences can you see between these two languages:

It looks like you can just substitute some function calls  and change the syntax slightly (i.e. drop parens) to translate Python into Haskell... but you can't. These snippets miss a very important fact that   has side-effects and   actually returns an , i.e. it's monadic. It also misses the fact Python is primarily a scripting language, and so many programs will use  so the programs functions can be included without executing. PHP works this way too; code outside functions will execute immediately.

If we want to give a "feel" for what these languages are like, we could expand the example, which will surface many of the differences:

vs.

Do you see how different the languages look just by doing something slightly more complicated than printing a fixed string to standard out? The issue I have is these snippets are now too large to put in the infobox -- again, my question is why we're replacing the screenshot with a snippet. It seems like a step back to me. If it was discussed and established somewhere, then please let me know (i.e. link me to the decision). If not (i.e. this is your proposal), I really don't see the value. Sorry.

Here we use "Hello World" program at Infobox to introduce PHP for a person who does not have any skill in programming

I've always had the impression Wikipedia is a reference for people who already know quite a bit about the topic they are reading up on, i.e. Wikipedia is not the place to go for an introduction to a topic. Perhaps I'm mistaken. Ancarda (talk) 11:37, 5 February 2022 (UTC)

Security
Graphics processing is a rapidly developing field, so what was 'current' even only recently could be outdated very quickly. Additionally, describing GPU capability by monetary cost isn't particularly descriptive, even if one assumes USD pricing. — Preceding unsigned comment added by 27.96.195.4 (talk) 04:19, 27 March 2023 (UTC)