[presentations] master: Tweak examples
[email protected] (Derick Rethans) Wed, 19 Apr 2023 11:20:16 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Author: Derick Rethans (derickr)
Date: 2023-04-19T12:06:22+01:00
Commit: https://github.com/php/presentations/commit/abbb226b82c0bb41ff74445c23bd6533b5c0427c
Raw diff: https://github.com/php/presentations/commit/abbb226b82c0bb41ff74445c23bd6533b5c0427c.diff
Tweak examples
Changed paths:
M slides/internals/php82-dnf-types.xml
M slides/internals/php82-random.xml
Diff:
diff --git a/slides/internals/php82-dnf-types.xml b/slides/internals/php82-dnf-types.xml
index 33255c32..3569a5c0 100644
--- a/slides/internals/php82-dnf-types.xml
+++ b/slides/internals/php82-dnf-types.xml
@@ -48,7 +48,7 @@ class Foreachy {
$this->foreachableData = $foreachable;
}
- public function getIterator(): *array(Traversable&Countable)* {
+ public function getIterator(): *array|(Traversable&Countable)* {
return $this->foreachableData;
}
}
diff --git a/slides/internals/php82-random.xml b/slides/internals/php82-random.xml
index 0f807907..1c89f79b 100644
--- a/slides/internals/php82-random.xml
+++ b/slides/internals/php82-random.xml
@@ -11,7 +11,7 @@ echo bin2hex( $r->getBytes( 8 ) ), "\n";
echo $r->getInt(1, 100), "\n";
echo $r->nextInt(), "\n";
-$fruits = [ 'red' => '🍎', 'green' => '🍏', 'pink' => '🍑' ];
+$fruits = ['red' => '🍎', 'green' => '🥝', 'yellow' => '🍌', 'purple' => '🍇'];
echo "Keys: ", join( ', ', $r->pickArrayKeys( $fruits, 2 ) ), "\n";
echo "Salad: ", join( ', ', $r->shuffleArray( $fruits ) ), "\n";