Talk:PHP

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Former good articlePHP was one of the Engineering and technology good articles, but it has been removed from the list. There are suggestions below for improving the article to meet the good article criteria. Once these issues have been addressed, the article can be renominated. Editors may also seek a reassessment of the decision if they believe there was a mistake.
On this day... Article milestones
DateProcessResult
February 23, 2008Peer reviewReviewed
March 25, 2008Peer reviewReviewed
April 1, 2008Good article nomineeListed
February 12, 2024Good article reassessmentDelisted
On this day... Facts from this article were featured on Wikipedia's Main Page in the "On this day..." column on June 8, 2007, June 8, 2008, June 8, 2009, June 8, 2010, June 8, 2012, June 8, 2015, and June 8, 2020.
Current status: Delisted good article

Using Type Declaration instead of Type Hints[edit]

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:

PHP 7 also included new language features. Most notably, it introduces return type declarations for functions[67] which complement the existing parameter type declarations, and support for the scalar types (integer, float, string, and boolean) in parameter and return type declarations.[68]

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.[68] 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.[67] For example, the getAdder function from the earlier example could be annotated with types like so in PHP 7:

By default, scalar type declarations follow weak typing principles.

(Emphasis mine)

As I'm new to contributing to Wikipedia, I don't know what to do about the following comment from the revert commit

"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 Wikipedia articles should be accurate.

Can someone more experienced clarify?

throws keyword[edit]

The example of the throws keyword does not include the throws keyword in it. Is this even a real keyword? The docs at php.net have nothing about it. 131.200.248.40 (talk) 18:33, 4 January 2024 (UTC)[reply]

GA Reassessment[edit]

PHP[edit]

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.


Article (edit | visual edit | history) · Article talk (edit | history) · WatchWatch article reassessment page • GAN review not found
Result: Delisted. Hog Farm Talk 22:40, 12 February 2024 (UTC)[reply]

Multiple issues. The article is peppered with {{cn}} tags, and is largely based on primary sources (with not enough weight being given to third party sources). There is a one line section covering the PHP Foundation which should probably eithier be integrated into "History" (or removed completely). Additionally there are multiple dubious statements and promotional SEAOFBLUEs in the "Use" section while the "Security" section offers uncited WP:NOTGUIDE advice on security matters Sohom (talk) 08:24, 2 February 2024 (UTC)[reply]

The discussion above 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.

Shortest "hello world" php script[edit]

Arguably, the shortest bit of script which will produce 'hello world' is 'hello world' - without any opening or closing tag... 2A00:23EE:1880:194B:F190:925C:5797:DE7E (talk) 17:14, 16 April 2024 (UTC)[reply]