FUNCTION PHP

FUNCTION PHP

2nd Grade

8 Qs

quiz-placeholder

Similar activities

Python Training Module Quiz

Python Training Module Quiz

KG - University

6 Qs

test

test

1st - 10th Grade

10 Qs

Higher Coding

Higher Coding

KG - University

12 Qs

2.2 EOU Quiz

2.2 EOU Quiz

1st Grade - Professional Development

10 Qs

Computer Languages

Computer Languages

KG - University

10 Qs

Php Web

Php Web

2nd Grade

12 Qs

PHP Tema 1

PHP Tema 1

2nd Grade

12 Qs

Keyword searches and reliable sources

Keyword searches and reliable sources

2nd - 5th Grade

12 Qs

FUNCTION PHP

FUNCTION PHP

Assessment

Quiz

Computers

2nd Grade

Medium

Created by

ANIS (PBU)

Used 3+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a PHP function?

To store variables

To execute a specific task

To print HTML code

To create classes

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a function in PHP?

method

func

def

function

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about function names in PHP?

They cannot start with a number

They cannot contain special characters

They are case-insensitive

They must always start with a dollar sign ($)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the keyword "return" do in a PHP function?

It terminates the function

It echoes a message

It sends a value back to the calling code

It generates an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about parameters in PHP functions is true?

Functions cannot accept parameters

Parameters are optional

Parameters are enclosed in curly braces {}

Parameters are placeholders for values passed to the function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "global" keyword in PHP functions?

To declare a variable as local to the function

To access a variable declared outside of the function

To define a constant

To include another PHP file

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default scope of a PHP function if no scope is specified?

Global

Local

Protected

Private

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "static" keyword in a PHP function?

To define a constant

To declare a variable as local to the function

To retain the value of a variable between function calls

To include another PHP file