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

senior

What does a $$$ mean in PHP?

senior

Explain the Exception Hierarchy introduced in PHP7

junior

What are the different scopes of variables?

Bình luận

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

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