Pular para o conteúdo principal

Questão de Programação — PHP — VUNESP 2021

ProgramaçãoPHP
Código
vu065262
Banca
VUNESP
Órgão
Semae de Piracicaba - SP
Ano
2021
Nível
Médio
Cargo
Programador Junior
Considere o seguinte código escrito na linguagem PHP.<?phpfunction inversa($x) {if ($x==0) {throw new Exception(' exception ');}return 1/$x;}try {echo inversa(0);echo " try ";} catch (Exception $e) {echo " catch ";echo $e->getMessage();} finally {echo " finally ";}Ao se executar esse código, será impressa na tela a seguinte sequência de palavras:
  1. Atry catch exception finally
  2. Btry catch finally
  3. Ccatch exception finally
  4. Dcatch exception
  5. Efinally catch exception
Revelar gabarito e comentário

GabaritoC — catch exception finally

Link permanente: /questoes/vu065262