Câu hỏi phỏng vấn PHP
Câu hỏi

Differentiate between echo and print()

Câu trả lời

Here is a detailed comparison of the echo and print() constructs in PHP:

Syntax

  • echo can take multiple arguments separated by commas, while print() takes only a single argument.
  • echo is a language construct, while print() is a function.

Return Value

  • echo does not return a value, while print() returns 1 so it can be used in expressions.

Speed

  • echo is slightly faster than print() because it doesn't return a value.

Usability

  • echo is more commonly used because it's a bit more flexible with its argument han...
junior

junior

Gợi ý câu hỏi phỏng vấn

junior

Can you extend a Final defined class?

junior

Is there a difference between isset and !empty ?

junior

How is it possible to set an infinite execution time for PHP script?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào