echo ' 1 '. Print (2) +3;
Say your answer, then go to the computer to try!
Reply to discussion (solution)
214. I'll try. I cheated, I went to read the function description of print.
511
That's weird, isn't it?
Actually, it's nothing strange.
Print is not actually a real function (it is a language structure), so you do not need to use the parentheses argument list.
Which means print (2) + 3 is actually print 2 + 3
But he has a return value that is always 1.
511 This 5 is generated by print (2) + 3
5 11 This 1 is produced by the Echo ' 1 '
51 1 This 1 is generated by print.
Are you really 214? What is the PHP version?
214. I'll try. I cheated, I went to read the function description of print.
Are you really 214? What is the PHP version?
214. I'll try. I cheated, I went to read the function description of print.
'; Echo ' 1 '. Print (2); Echo '
'; echo print (2); Echo '
'; echo print (2) +3;echo '
'; $tmp =print (2) +3;echo $tmp; Echo '
';p rint (2) +3;echo '
';p rint ' 3 '; Echo '
';? >
You've done so fast, I've just tried to feel something.
Are you really 214? What is the PHP version?
214. I'll try. I cheated, I went to read the function description of print.
Landlord is not to say first answer to try again?
What do you mean, "I cheated"?
214. I'll try. I cheated, I went to read the function description of print.
Although I looked at the description of the function, I only looked at the type of the return value. Learn the habit of C-language cultivation. That's not a function I didn't even notice. In addition Echo took so long time unexpectedly also didn't notice this is not function, previously learned VB reason bar.
What do you mean, "I cheated"?
I don't know what the return value of print is, and then look at the return value and say my answer, so I cheated.
I don't know, the egg hurts.
511
That's weird, isn't it?
Actually, it's nothing strange.
Print is not actually a real function (it is a language structure), so you do not need to use the parentheses argument list.
Which means print (2) + 3 is actually print 2 + 3
But he has a return value that is always 1.
511 This 5 is generated by print (2) + 3
5 11 This 1 is produced by the Echo ' 1 '
51 1 This 1 is generated by print.
Why not 115?
echo ' 1 '. Print (2) +3;
In ' 1 '. Print (2) +3 This expression must be evaluated before it is passed to the Echo
While print (2) +3 prints 5 and returns 1
So the 5 came to the front.
echo actually prints ' 1 '. 1 That's 11
I understand, the cheating is echo "1". (print "2") +3;