Skip to content

Commit 8063947

Browse files
authored
Null Coalescing Operator
Use Null Coalescing Operator instead of isset ? :
1 parent 4469526 commit 8063947

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

create_framework/routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template as follows:
3535
.. code-block:: html+php
3636

3737
<!-- example.com/src/pages/hello.php -->
38-
Hello <?= htmlspecialchars(isset($name) ? $name : 'World', ENT_QUOTES, 'UTF-8') ?>
38+
Hello <?= htmlspecialchars($name ?? 'World', ENT_QUOTES, 'UTF-8') ?>
3939

4040
Now, we are in good shape to add new features.
4141

0 commit comments

Comments
 (0)