Skip to content

Commit 283d0f2

Browse files
committed
Update problem file
1 parent 4bd5e8d commit 283d0f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exercises/throw-an-expression/problem/problem.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
You have been given a piece of code (look for `throw-an-expression.php` in your working directory) which is checking the requested URL and throwing an exception when a secret area of the website is accessed.
22

3-
If the request is allowed the `Welcome!` is printed out.
3+
If the request is allowed, `Welcome!` is printed out.
44

5-
Traditionally, pre PHP 8, an exception throw has been a statement. There are certain places where statements can be used, and only expressions can. For example in ternaries and short closures, only expressions can be used.
65

7-
PHP 8 has changed that, throw statements are now expressions.
6+
Traditionally, pre PHP 8, an exception throw has been a statement. There are certain places where statements can be used, and only expressions can be used. For example, in ternaries and short closures, only expressions can be used.
7+
8+
Now with PHP 8, throw statements are expressions making them available to use in pretty much all locations.
89

910
----------------------------------------------------------------------
1011
Your task is to convert the `if` statement to one line of code, using the ternary operator.

0 commit comments

Comments
 (0)