This is an old revision of this page, as edited by Hooman Mallahzadeh (talk | contribs) at 12:22, 3 February 2022 (→SampleCodes is instead of Screenshots in this Infoboxes: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 12:22, 3 February 2022 by Hooman Mallahzadeh (talk | contribs) (→SampleCodes is instead of Screenshots in this Infoboxes: new section)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)Skip to table of contents |
This is the talk page for discussing improvements to the PHP article. This is not a forum for general discussion of the article's subject. |
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
PHP has been listed as one of the Engineering and technology good articles under the good article criteria. If you can improve it further, please do so. If it no longer meets these criteria, you can reassess it. | ||||||||||||||||
| ||||||||||||||||
Current status: Good article |
This article has not yet been rated on Misplaced Pages's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
{{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
{{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
{{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
|
A fact from this article was featured on Misplaced Pages's Main Page in the On this day section on June 8, 2007, June 8, 2008, June 8, 2009, June 8, 2010, June 8, 2012, June 8, 2015, and June 8, 2020. |
The contents of the Visibility of PHP properties and methods page were merged into PHP on 08:41, July 28, 2010. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
The contents of the PHP Data Objects page were merged into PHP on July 15, 2014. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
Archives | ||||||||
|
||||||||
This page has archives. Sections older than 100 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Using Type Declaration instead of Type Hints
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 which complement the existing parameter type declarations, and support for the scalar types (integer, float, string, and boolean) in parameter and return type declarations.
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:
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
"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?
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 syntaxhighlight
tag does not support modern PHP syntax:
$person = new class { public $firstName = "John"; public $lastName = "Smith"; public function name(){ return "$this->firstName $this->lastName"; } };
or
class MyClass { public string $var1; public array $var2; function pr(string|int $array, array|null $subj): float|false { } } $myObj->pr(subj: , array: "John");
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 php3
. 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 .php3
in a legacy system? Modern PHP just does not have all these silly extensions.
Ancarda (talk) 09:13, 3 May 2021 (UTC)
SampleCodes is instead of Screenshots in this Infoboxes
@Ancarda: 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 language. It conveys important information about remaining parts of this Infobox. So we should use this argument as the rendering item, to successfully convey an overview of PHP language. Thanks, Hooman Mallahzadeh (talk) 12:22, 3 February 2022 (UTC)
Categories:- Misplaced Pages good articles
- Engineering and technology good articles
- Old requests for peer review
- All unassessed articles
- GA-Class Computing articles
- Mid-importance Computing articles
- GA-Class software articles
- Unknown-importance software articles
- GA-Class software articles of Unknown-importance
- All Software articles
- GA-Class Free and open-source software articles
- High-importance Free and open-source software articles
- GA-Class Free and open-source software articles of High-importance
- All Free and open-source software articles
- All Computing articles
- GA-Class Computer science articles
- Mid-importance Computer science articles
- WikiProject Computer science articles
- GA-Class Internet articles
- Mid-importance Internet articles
- WikiProject Internet articles
- Mid-importance software articles
- GA-Class software articles of Mid-importance
- Unknown-importance Computing articles
- Selected anniversaries (June 2007)
- Selected anniversaries (June 2008)
- Selected anniversaries (June 2009)
- Selected anniversaries (June 2010)
- Selected anniversaries (June 2012)
- Selected anniversaries (June 2015)
- Selected anniversaries (June 2020)