Bagaimana cara mendeklarasikan variabel global dalam fungsi PHP?

Latihan soal (2)

Quiz
•
Information Technology (IT)
•
10th Grade
•
Medium
Fakhrul A
Used 1+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
global $var;
$GLOBALS['var'];
use $var;
public $var;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa output dari kode berikut?
$x = 10;
if ($x > 5) {
echo "Besar";
} else {
echo "Kecil";
}
Besar
Kecil
Eror
Tidak ada output
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Kapan kita sebaiknya menggunakan switch daripada if?
Jika ada banyak kondisi dengan nilai tetap
Jika kondisi hanya dua
Jika ada perbandingan > atau <
Jika hanya ada satu kondisi
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bagaimana cara menulis kondisi else if dalam PHP?
else if
elseif
elsif
else: if
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang akan terjadi jika break dihilangkan dalam switch?
Semua case setelahnya tetap dijalankan
Hanya case yang sesuai yang dijalankan
Akan terjadi error
Program akan berhenti
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa output dari kode berikut?
$x = 5;
echo ($x == 5) ? "Lima" : "Bukan Lima";
Lima
Bukan Lima
Error
Tidak ada output
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Operator logika manakah yang digunakan untuk "dan" dalam PHP?
&&
||
!
xor
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Algortima dan Dasar Pemrograman

Quiz
•
10th Grade
13 questions
Latihan soal codingan

Quiz
•
10th Grade
20 questions
perangkat input,output, proses

Quiz
•
10th Grade - University
20 questions
Pemrograman Blokly

Quiz
•
9th Grade - University
15 questions
Fungsi Statistik, if dan Lookup Ms. Excel

Quiz
•
10th Grade
15 questions
KUIS Informatika X Oto Algoritma dan Pemograman

Quiz
•
10th Grade
20 questions
PENGAYAAN ULANGAN HARIAN PYTHOON

Quiz
•
10th Grade
20 questions
DPK 4.1

Quiz
•
10th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for Information Technology (IT)
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade
65 questions
MegaQuiz v2 2025

Quiz
•
9th - 12th Grade
10 questions
GPA Lesson

Lesson
•
9th - 12th Grade
15 questions
SMART Goals

Quiz
•
8th - 12th Grade