Question discussion

In PHP, what happens if the file named in a require statement cannot be found?

1332Medium DSSSB TGT Computer Science 0 replies

In PHP, what happens if the file named in a require statement cannot be found?

  • AA fatal error is raised and the script stops
  • BA warning is raised and the script continues
  • CA notice is raised and the script continues
  • DThe statement is silently ignored
Correct answer: A

Explanation

require produces a fatal error and halts the script, whereas include only gives a warning and continues.

Discussion 0

Nobody has replied yet. Start the discussion!