PHP: Difference between revisions

From Freephile Wiki
m clean up the table
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
parameter, you can force the return value to an array. In the former case, you access the content using object notation. In the latter case, you use array notation.
parameter, you can force the return value to an array. In the former case, you access the content using object notation. In the latter case, you use array notation.
ie.
ie.
<source lang="php">
<syntaxhighlight lang="php">
$data = json_decode($data);
$data = json_decode($data);
$version = $data->query->general->generator;
$version = $data->query->general->generator;
Line 33: Line 33:
$version = $data['query']['general']['generator'];
$version = $data['query']['general']['generator'];


</source>
</syntaxhighlight>




==What's New==
==What's New==
The release notes at PHP Watch give better explanations and more context than the official release notes, but the official ones are obviously canonical and may provide a quicker view of the timeline or metadata.
The release notes at PHP Watch might give better explanations and more context than the official release notes, but the official ones are obviously canonical and may provide a quicker view of the timeline or metadata.


=== Release Notes ===
=== Release Notes ===

Latest revision as of 13:31, 24 February 2025

Who wrote PHP?[edit]

https://www.php.net/credits.php

How do you upgrade?[edit]

See the migrating appendices in the manual

mod_php vs php-fpm[edit]

See the article by Matthew Weier-O'Phinney on Zend.com

Resource Sites[edit]

  1. Aidan Lister from Autstralia has a nice site online (source provided to make your own similar site) which lists many classes and PHP functions for doing routine things that you will inevitabably face in programming. Things like making a directory structure recursively, or checking the size of a directory and it's contents. http://aidanlister.com/
  2. Jeroen (John) Post created http://onlinephpfunctions.com/ which lets you play with PHP code in the browser, and specifically test that code with multiple versions of PHP.


Language Features[edit]

Magic Methods[edit]

JSON[edit]

With json_decode(), you either get an object, or using the optional second parameter, you can force the return value to an array. In the former case, you access the content using object notation. In the latter case, you use array notation. ie.

$data = json_decode($data);
$version = $data->query->general->generator;
    // or     
$data = json_decode($data, true);
$version = $data['query']['general']['generator'];


What's New[edit]

The release notes at PHP Watch might give better explanations and more context than the official release notes, but the official ones are obviously canonical and may provide a quicker view of the timeline or metadata.

Release Notes[edit]

https://www.php.net/releases/

v PHP.net PHP Watch
8.4 php.net/releases/8.4/ php.watch/versions/8.4
8.3 php.net/releases/8.3/ php.watch/versions/8.3
8.2 php.net/releases/8.2/ php.watch/versions/8.2
8.1 php.net/releases/8.1/ php.watch/versions/8.1