diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index 7f3011b05c..9c58cdec5f 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -1,10 +1,10 @@ 'PHP 8.5 is a major update of the PHP language, with new features including the Pipe Operator, URI extension, and support for modifying properties while cloning.', + 'common_header' => 'PHP 8.5 is a major update of the PHP language, with new features including the URI Extension, Pipe Operator, and support for modifying properties while cloning.', 'documentation' => 'Doc', 'main_title' => 'Released!', - 'main_subtitle' => 'PHP 8.5 is a major update of the PHP language, with new features including the Pipe Operator, URI extension, and support for modifying properties while cloning.', + 'main_subtitle' => 'PHP 8.5 is a major update of the PHP language, with new features including the URI Extension, Pipe Operator, and support for modifying properties while cloning.', 'upgrade_now' => 'Upgrade to PHP 8.5', 'pipe_operator_title' => 'Pipe Operator', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 460b26399a..246c654a33 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -88,17 +88,17 @@ PHP
@@ -110,15 +110,15 @@ PHP
trim(...) |> (fn($str) => str_replace(' ', '-', $str)) |> (fn($str) => str_replace('.', '', $str)) |> strtolower(...); -var_dump($output); // string(13) "my-test-value" +var_dump($slug); // string(15) "php-85-released" PHP ); ?>
@@ -254,9 +254,34 @@ PHP
start = hrtime(true); + } + + public function stopLap() + { + $fromStart = hrtime(true) - $this->start; + $lastLap = $this->laps !== [] + ? $this->laps[array_key_last($this->laps)] + : 0; + $lapDuration = $fromStart - $lastLap; + + $this->laps[] = $fromStart; + + return $lapDuration; + } +} + +$watch = new Stopwatch(); +for ($i = 1; $i < 5; $i++) { + printf("Lap #%d took %dns\n", $i, $watch->stopLap()); +} PHP ); ?> @@ -268,7 +293,32 @@ PHP
start = hrtime(true); + } + + public function stopLap() + { + $fromStart = hrtime(true) - $this->start; + $lastLap = array_last($this->laps) ?? 0; + $lapDuration = $fromStart - $lastLap; + + $this->laps[] = $fromStart; + + return $lapDuration; + } +} + +$watch = new Stopwatch(); +for ($i = 1; $i < 5; $i++) { + printf("Lap #%d took %dns\n", $i, $watch->stopLap()); +} PHP ); ?>