Commit: a28621c3707dcf565ba1bf15c3bf65184e0b4f2c Author: Ruslan <nar...@yandex.ru> Mon, 9 Nov 2020 22:46:06 +0300 Committer: Sara Golemon <poll...@php.net> Wed, 25 Nov 2020 20:28:13 +0000 Parents: 1e7814bf341464e060163cbdcbcd272ba7d6702d Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=a28621c3707dcf565ba1bf15c3bf65184e0b4f2c Log: Features texts added, an image deleted Changed paths: D images/php8/party-popper.png D images/php8/party-pop...@2x.png D images/php8/party-pop...@3x.png M php8.php M styles/php8.css Diff: diff --git a/images/php8/party-popper.png b/images/php8/party-popper.png deleted file mode 100644 index 031d8b594..000000000 Binary files a/images/php8/party-popper.png and /dev/null differ diff --git a/images/php8/party-pop...@2x.png b/images/php8/party-pop...@2x.png deleted file mode 100644 index e3f00a530..000000000 Binary files a/images/php8/party-pop...@2x.png and /dev/null differ diff --git a/images/php8/party-pop...@3x.png b/images/php8/party-pop...@3x.png deleted file mode 100644 index 1632170c1..000000000 Binary files a/images/php8/party-pop...@3x.png and /dev/null differ diff --git a/php8.php b/php8.php index 4ad0889e1..e026d4bfd 100644 --- a/php8.php +++ b/php8.php @@ -9,10 +9,7 @@ site_header("PHP 8.0", array("current" => "php8", 'css' => array('php8.css'))); <div class="php8-logo"> <img src="/images/php8/logo_php8.svg" alt="php8" height="126" width="343"> </div> - <div class="php8-title"> - <span class="php8-title__text">released!</span> - <img class="php8-title__img" src="/images/php8/party-popper.png" srcset="/images/php8/party-pop...@2x.png 2x, /images/php8/party-pop...@2x.pngx.png 3x" alt="" width="58" height="58"> - </div> + <div class="php8-title">released!</div> <div class="php8-subtitle"> PHP 8.0 is a major update of the PHP language. It contains many new features and optimizations. Including named arguments, union types, attributes, constructor property promotion, match expression, nullsafe operator, JIT, and @@ -42,6 +39,12 @@ site_header("PHP 8.0", array("current" => "php8", 'css' => array('php8.css'))); </div> </div> </div> + <div class="php8-compare__content"> + <ul> + <li>Specify only needed parameters, skipping optional ones.</li> + <li>Arguments are order-independent and self-documented.</li> + </ul> + </div> </div> <div class="php8-compare"> @@ -70,6 +73,9 @@ class User </div> </div> </div> + <div class="php8-compare__content"> + <p>Instead of PHPDoc annotations, you can use structured metadata with native PHP syntax.</p> + </div> </div> <div class="php8-compare"> @@ -112,6 +118,9 @@ class User </div> </div> </div> + <div class="php8-compare__content"> + <p>Less boilerplate code for defining and initializing properties.</p> + </div> </div> <div class="php8-compare"> @@ -152,6 +161,10 @@ new Number('NaN'); // TypeError</pre> </div> </div> </div> + <div class="php8-compare__content"> + <p>Instead of PHPDoc annotations for a combination of types, you can use native union types declarations that + are validated at runtime.</p> + </div> </div> <div class="php8-compare"> @@ -187,6 +200,14 @@ echo $result; </div> </div> </div> + <div class="php8-compare__content"> + <p>The new match is similar to switch and has the following features:</p> + <ul> + <li>Match is an expression, meaning its result can be stored in a variable or returned.</li> + <li>Match arms only support single-line expressions and do not need a break; statement.</li> + <li>Match does strict comparisons.</li> + </ul> + </div> </div> <div class="php8-compare"> @@ -221,6 +242,11 @@ if ($session !== null) { </div> </div> </div> + <div class="php8-compare__content"> + <p>Instead of null check conditions, you can now use a chain of calls with the new nullsafe operator. When the + evaluation of one element in the chain fails the execution of the entire chain is aborted and the entire chain + evaluates to null.</p> + </div> </div> <div class="php8-compare"> @@ -243,6 +269,10 @@ if ($session !== null) { </div> </div> </div> + <div class="php8-compare__content"> + <p>When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to + string and uses a string comparison.</p> + </div> </div> <div class="php8-compare"> @@ -269,6 +299,9 @@ array_chunk([], -1); // ValueError: array_chunk(): Argument #2 ($length) must be </div> </div> </div> + <div class="php8-compare__content"> + <p>Most of the internal functions now throw Fatal Error exception if parameter validation fails.</p> + </div> </div> </section> diff --git a/styles/php8.css b/styles/php8.css index d5718b653..717e6c8df 100644 --- a/styles/php8.css +++ b/styles/php8.css @@ -72,17 +72,6 @@ } } -.php8-title__text { - vertical-align: middle; -} - -.php8-title__img { - width: 0.9666666666667em; - height: 0.9666666666667em; - margin-left: 2px; - vertical-align: middle; -} - .php8-subtitle { margin-top: 48px; font-size: 28px; @@ -270,6 +259,11 @@ color: #fff; } +.php8-compare__content { + text-align: left; + margin-top: 24px; +} + .php8-code { display: -webkit-box; display: -ms-flexbox; -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php