3. Which of the following is not valid PHP code?


Вариант ответа 1 - A) $_10

Вариант ответа 2 - B) ${“MyVar”}

Вариант ответа 3 - C) &$something

Вариант ответа 4 - D) $10_somethings

Вариант ответа 5 - E) $aVaR


Комментарий: PHP variables always start with a dollar sign and are a sequence of characters and numbers within the Latin alphabet, plus the underscore character. ${"MyVar"} is a valid variable name that simply uses a slightly less common naming convention, while &$something is a reference to the $something variable. Variables, however cannot start with numbers, making $10_somethings invalid and Answer D correct.

Комментарии

Имя пользователяТекст комментарияВведите код