Home  >  Article  >  Backend Development  >  Another PHP interview question

Another PHP interview question

WBOY
WBOYOriginal
2016-08-08 09:26:271020browse


This question comes from Brothers Cloud Classroom.
Write the running results: u Function MyFunc ($ argument) {

echo $ argunment + 10;

}

$ variable = 10;

echo "myfunc ($ variable) =". ;

Answer: 1. echo “myfunc($variable)=".myfunc($variable); How will this sentence be executed? ?
The latter part "myfunc($variable);" will be executed first and then echo, so the answer is at least
20myfunc($variable)=. 20 is the execution result of myfunc($variable);. 2. How will echo "myfunc($variable)=". be parsed? Variables enclosed in double quotes will be executed, but functions will not be executed. So equal to:
myfunc(10)=.
So, the answer is at least
20myfunc(10)= .
But look carefully, function myfunc($argument){

                                                                                                                                                     echo $argunment + 10; Therefore, $argunment will not be printed in this function.

The final correct local answer is:

10myfunc(10)=



The above introduces another PHP interview question, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:01The use of stringsNext article:01The use of strings