Passed the test and there were questions that I did not understand.

  1. What is __ used for (most likely these are two underscores)? Answer - used to refer to magical methods is not true. That's the question for what else.

  2. _____ (probably four underscores) is used for validation and cleanup: $ _REQUEST or $ _SERVER or $ _GET or $ _COOKIES. In the Internet, I do not find something like that. Explain

  • four underscores. but not in a row __DIR__ - ArchDemon
  • Two underscores are used in many frameworks as a function of internationalization. __ ('text') returns the translation. - KAGG Design

1 answer 1

http://php.net/manual/ru/language.oop5.magic.php These are magical methods.

And you can link to the test, just about 4 underscores never heard. and the fact that the two underscores are not magical methods.

  • one
    on UpWork PHP test - Sanya H
  • I found only answers there - Anatoly