Error Trail · Level 3 of 8

The crew has the last word

Three functions with a return in try, or a throw, and a finally that may return too.

<?phpfunction answer(): string {    try {        return 'from try';    } finally {        echo "finally runs\n";    }}function override(): string {    try {        return 'from try';    } finally {        return 'from finally';    }}function swallow(): string {    try {        throw new Exception('lost');    } finally {        return 'finally wins';    }}echo answer(), "\n";echo override(), "\n";echo swallow(), "\n";

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…
  3. 3…
  4. 4…