I’m not php expert and I don’t know what’s the difference(1) between a and b.
a.)eval('return "'.base64_decode("encoded_text").'";')
b.)base64_decode("encoded_text")
-I THINK, a is php code and b is just string. And my other question is:
What is the difference(2) between c and d?
c.)eval('return "'.base64_decode("encoded_text").'";')
d.)eval(base64_decode("encoded_text"))
So I have 2 questions. Who can answer/help ?
Thanks.
Let’s label your 2 cases as Case X (part a and b) and Y (part c and d).
Case X
For this, both of the parts have no difference from each other. In fact, part a has some redundancy.
If you evaluate them slowly, you will notice how redundant it is:
Part a
In this part, the difference is that you add the
evalstatement withreturnin the string for evaluation.echo eval('return "'.base64_decode("encoded_text").'";');echo eval('return "decoded_text";')'echo "decoded_text";Part b
echo base64_decode("encoded_text");echo "decoded_text";Case Y
For this, there’s grave difference.
Part c
echo eval('return "'.base64_decode("encoded_text").'";');echo eval('return "decoded_text";')'echo "decoded_text";Part d
echo eval(base64_decode("encoded_text"));echo eval("decoded_text");– there may be a syntax error here, becausedecoded_textmay or may not be proper PHP code.