8888 <div class="php8-code phpcode">
8989 <?php highlight_php_trimmed (
9090 <<<'PHP'
91- final readonly class PhpVersion {
91+ final readonly class PhpVersion
92+ {
9293 public function __construct(
9394 public string $version = 'PHP 8.4',
9495 ) {}
9596
96- public function withVersion(string $version) {
97+ public function withVersion(string $version): self
98+ {
9799 $newObject = clone $this;
98100 $newObject->version = $version;
99101
@@ -119,12 +121,14 @@ PHP
119121 <div class="php8-code phpcode" style="display: table-cell;">
120122 <?php highlight_php_trimmed (
121123 <<<'PHP'
122- final readonly class PhpVersion {
124+ final readonly class PhpVersion
125+ {
123126 public function __construct(
124127 public string $version = 'PHP 8.4',
125128 ) {}
126129
127- public function withVersion(string $version) {
130+ public function withVersion(string $version): self
131+ {
128132 return clone($this, [
129133 'version' => $version,
130134 ]);
@@ -186,8 +190,8 @@ $input = ' Some kind of string. ';
186190
187191$output = $input
188192 |> trim(...)
189- |> (fn (string $string) => str_replace(' ', '-', $string))
190- |> (fn (string $string) => str_replace(['.', '/', '…'], '', $string))
193+ |> (fn( $string) => str_replace(' ', '-', $string))
194+ |> (fn( $string) => str_replace(['.', '/', '…'], '', $string))
191195 |> strtolower(...);
192196
193197var_dump($output);
@@ -339,8 +343,6 @@ curl_exec($ch1);
339343$ch2 = curl_init('https://thephp.foundation/');
340344curl_setopt($ch2, CURLOPT_SHARE, $sh);
341345curl_exec($ch2);
342-
343- curl_share_close($sh);
344346PHP
345347
346348 ); ?>
0 commit comments