menu

PHP Syntax

PHP Syntax - Important Points


11. Which of the following is used to call a function in PHP?

A. function_name();

B. call function_name();

C. function call(function_name);

D. call(function_name);

Discuss Work Space

Answer: option a

Explanation:

function_name(); is used to call a function in PHP.

12. What is the correct syntax to pass arguments to a function in PHP?

A. function_name(arguments)

B. function_name(arguments;)

C. function_name(arguments,)

D. function_name(arguments);

Discuss Work Space

Answer: option d

Explanation:

function_name(arguments); is the correct syntax to pass arguments

13. Which of the following is used to define a class in PHP?

A. define class Class_name {}

B. Class Class_name {}

C. new Class Class_name {}

D. class Class_name {}

Discuss Work Space

Answer: option d

Explanation:

class Class_name {} is used to define a class in PHP.

14. Which of the following is used to create an object of a class in PHP?

A. Class_name = new Class();

B. new Object = Class_name();

C. new Class_name();

D. Object = new Class_name;

Discuss Work Space

Answer: option c

Explanation:

new Class_name(); is used to create an object of a class in PHP.

15. Which of the following is used to access a property of an object in PHP?

A. object_name->property_name;

B. object_name.property_name;

C. object_name[property_name];

D. object_name->(property_name);

Discuss Work Space

Answer: option a

Explanation:

object_name->property_name; is used to access a property of an object in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now