Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 631 Bytes

0701.md

File metadata and controls

19 lines (15 loc) · 631 Bytes

Assuming that the code below is in a file named "test.php" and that PHP has full rights over the file, what happens if the file is executed from the command line without any arguments ?

exec("rm -f " . dirname(__FILE__) . "/" .  $argv[0]);
  • A) The file test.php is deleted
  • B) The script exits without doing anything
  • C) A notice is thrown because $argv[0] is not defined and the script fails.
  • D) an error
Answer

Answer: A