FUNCTION PHP

FUNCTION PHP

2nd Grade

8 Qs

quiz-placeholder

Similar activities

Website Design

Website Design

KG - University

10 Qs

Third Day Quiz!

Third Day Quiz!

1st - 5th Grade

10 Qs

Functions and Objects

Functions and Objects

1st - 3rd Grade

10 Qs

KA JS Functions

KA JS Functions

KG - University

7 Qs

Functions in Python Quiz

Functions in Python Quiz

2nd Grade

10 Qs

Hari 3 - Kuis Coding & Perkenalan AI

Hari 3 - Kuis Coding & Perkenalan AI

1st - 2nd Grade

10 Qs

Styling CSS

Styling CSS

1st - 3rd Grade

10 Qs

Python Turtle

Python Turtle

KG - Professional Development

11 Qs

FUNCTION PHP

FUNCTION PHP

Assessment

Quiz

Computers

2nd Grade

Medium

Created by

ANIS (PBU)

Used 4+ 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