Revision as of 00:22, 26 January 2021 editLowercase sigmabot III (talk | contribs)Bots, Template editors2,295,546 editsm Archiving 1 discussion(s) to Talk:PHP/Archive 8) (bot← Previous edit |
Latest revision as of 17:01, 8 November 2024 edit undoPeaceray (talk | contribs)Autopatrolled, Administrators94,384 editsm Rollback edit(s) by 1.37.88.45 (talk): test edits (RW 16.1)Tags: RW Rollback |
(47 intermediate revisions by 26 users not shown) |
Line 1: |
Line 1: |
|
{{Skip to talk}} |
|
{{Skip to talk}} |
|
{{Talk header|noarchive=yes|search=no}} |
|
{{Talk header|noarchive=yes|search=no}} |
|
|
{{Article history |
|
{{Vital article|topic=Technology|level=5|link=Misplaced Pages:Vital articles/Level/5/Technology|anchor=Programming languages (43 articles)|class=A}} |
|
|
{{Article history|action1=PR|action1date=09:46, 23 February 2008|action1link=Misplaced Pages:Peer review/PHP/archive1|action1result=reviewed|action1oldid=193456805 |
|
|action1=PR|action1date=09:46, 23 February 2008|action1link=Misplaced Pages:Peer review/PHP/archive1|action1result=reviewed|action1oldid=193456805 |
|
|action2=PR|action2date=00:02, 25 March 2008|action2link=Misplaced Pages:Peer review/PHP/archive2|action2result=reviewed|action2oldid=200566442 |
|
|action2=PR|action2date=00:02, 25 March 2008|action2link=Misplaced Pages:Peer review/PHP/archive2|action2result=reviewed|action2oldid=200566442 |
|
|action3=GAN|action3date=11:11, 1 April 2008 (UTC)|action3link=Talk:PHP/Archive 6#Good article nomination|action3result=listed|action3oldid=202315889 |
|
|action3=GAN|action3date=11:11, 1 April 2008 (UTC)|action3link=Talk:PHP/Archive 6#Good article nomination|action3result=listed|action3oldid=202315889 |
|
|topic=engtech |
|
|topic=engtech |
|
|
|otd1date=2007-06-08|otd1oldid=136768480 |
⚫ |
|currentstatus=GA |
|
|
|
|otd2date=2008-06-08|otd2oldid=217767227 |
⚫ |
}} |
|
|
|
|otd3date=2009-06-08|otd3oldid=294808489 |
|
{{WikiProjectBannerShell|1= |
|
|
|
|otd4date=2010-06-08|otd4oldid=366892913 |
⚫ |
{{WikiProject Computing|class=GA|importance=Mid|free-software=yes|free-software-importance=High|software=yes}} |
|
|
|
|otd5date=2012-06-08|otd5oldid=496541912 |
⚫ |
{{WikiProject Computer science|class=GA|importance=mid}} |
|
|
|
|otd6date=2015-06-08|otd6oldid=665966658 |
⚫ |
{{WikiProject Internet|class=GA|importance=Mid}} |
|
|
|
|otd7date=2020-06-08|otd7oldid=961374169 |
|
|
|
|
|
|
|action4 = GAR |
⚫ |
{{WikiProject Software|class=GA|importance=mid}} |
|
|
|
|action4date = 22:40, 12 February 2024 (UTC) |
⚫ |
{{WikiProject Spoken Misplaced Pages|En-PHP.ogg|462166234}} |
|
|
|
|action4link = Misplaced Pages:Good article reassessment/PHP/1 |
|
|
|action4result = delisted |
|
|
|action4oldid = 1206545484 |
|
⚫ |
|currentstatus = DGA |
|
⚫ |
}} |
|
|
{{WikiProject banner shell|class=C|vital=yes|1= |
|
⚫ |
{{WikiProject Computing|importance=High|free-software=yes|free-software-importance=High|software=yes}} |
|
⚫ |
{{WikiProject Computer science|importance=high}} |
|
⚫ |
{{WikiProject Internet|importance=high}} |
|
⚫ |
{{WikiProject Software|importance=mid}} |
|
⚫ |
{{WikiProject Spoken Misplaced Pages}} |
|
}} |
|
}} |
|
{{On this day|date1=2007-06-08|oldid1=136768480|date2=2008-06-08|oldid2=217767227|date3=2009-06-08|oldid3=294808489|date4=2010-06-08|oldid4=366892913|date5=2012-06-08|oldid5=496541912|date6=2015-06-08|oldid6=665966658|date7=2020-06-08|oldid7=961374169}} |
|
|
{{Merged-from|Visibility of PHP properties and methods|08:41, July 28, 2010}} |
|
{{Merged-from|Visibility of PHP properties and methods|08:41, July 28, 2010}} |
|
{{Merged-from|PHP Data Objects|date=July 15, 2014}} |
|
{{Merged-from|PHP Data Objects|date=July 15, 2014}} |
Line 30: |
Line 41: |
|
{{archives|search=yes|bot=MiszaBot I|age=100}} |
|
{{archives|search=yes|bot=MiszaBot I|age=100}} |
|
|
|
|
|
|
==GA Reassessment== |
|
== Using Type Declaration instead of Type Hints == |
|
|
|
{{Misplaced Pages:Good article reassessment/PHP/1}} |
|
|
|
|
As my change has been reverted it seems appropriate to discuss the matter. |
|
|
|
|
|
The PHP documentations refers to them as Type declaration, see: https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration, and the original RFC introducing scalar types, uses the word "declaration", see: https://wiki.php.net/rfc/scalar_type_hints_v5 |
|
|
Although it is true that the PHP 5 documentation referred to them as "hints", and that the "Object Typehint" RFC is named as such but for all intent and purposes it is a type declaration. |
|
|
|
|
|
Moreover, the word "declaration" is used in other places correctly instead of "hint", see: |
|
|
|
|
|
{{quote|text=PHP 7 also included new language features. Most notably, it introduces return type ''declarations'' for functions which complement the existing parameter type ''declarations'', and support for the scalar types (integer, float, string, and boolean) in parameter and return type ''declarations''.}} |
|
|
|
|
|
{{quote|text=Unusually for a dynamically typed language, PHP supports type ''declarations'' on function parameters, which are enforced at runtime. This has been supported for classes and interfaces since PHP 5.0, for arrays since PHP 5.1, for "callables" since PHP 5.4, and scalar (integer, float, string and boolean) types since PHP 7.0. PHP 7.0 also has type ''declarations'' for function return types, expressed by placing the type name after the list of parameters, preceded by a colon. For example, the getAdder function from the earlier example could be annotated with types like so in PHP 7:}} |
|
|
|
|
|
{{quote|text=By default, scalar type ''declarations'' follow weak typing principles.}} |
|
|
|
|
|
(Emphasis mine) |
|
|
|
|
|
As I'm new to contributing to Misplaced Pages, I don't know what to do about the following comment from the revert commit |
|
|
{{quote|text="typehint" is the commonly used term in the community.}} |
|
|
|
|
|
As sure it is referred to that but it is not accurate, and my understanding is that Misplaced Pages articles should be accurate. |
|
|
|
|
|
Can someone more experienced clarify? |
|
|
|
|
|
== 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 <code><nowiki>{{start date and age|{{wikidata|qualifier|P348|P577}}}}</nowiki></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 (<code><nowiki>{{wikidata|property|reference|P348}}</nowiki></code>) works flawlessly. ] last changed the Wikidata entry. --] (]) 21:32, 14 November 2020 (UTC) |
|
|
:Try ] — ] <sup>]</sup> 22:11, 14 November 2020 (UTC) |
|
|
:{{re|Mfb}} I added {{para|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'''. ]/<small><small>(])/(])</small></small> 23:47, 14 November 2020 (UTC) |
|
|
::Infoboxes should be using ]. – ] (]) 01:08, 15 November 2020 (UTC) |
|
|
|
|
|
== It's December == |
|
|
|
|
|
It's past 26 November so shouldn't it be in the past tense? ] (]) 20:25, 2 December 2020 (UTC) |
|
|
|
|
|
== Syntax highlighting == |
|
|
|
|
|
The <code>syntaxhighlight</code> tag does not support modern PHP syntax: |
|
|
<syntaxhighlight lang="php"> |
|
|
$person = new class |
|
|
{ |
|
|
public $firstName = "John"; |
|
|
public $lastName = "Smith"; |
|
|
|
|
|
public function name(){ |
|
|
return "$this->firstName $this->lastName"; |
|
|
} |
|
|
}; |
|
|
</syntaxhighlight> |
|
|
or |
|
|
<syntaxhighlight lang="php"> |
|
|
class MyClass |
|
|
{ |
|
|
public string $var1; |
|
|
|
|
|
public array $var2; |
|
|
|
|
|
function pr(string|int $array, array|null $subj): float|false |
|
|
{ |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
$myObj->pr(subj: , array: "John"); |
|
|
|
|
|
</syntaxhighlight> |
|
|
] (]) 17:10, 25 January 2021 (UTC) |
|
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.