stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
WAD MID TERM REVISION (MCQs) Flashcards | StudBud
Explore
/
WAD MID TERM REVISION (MCQs)
WAD MID TERM REVISION (MCQs)
50 terms
·
StudBud Administration
·
30 plays
Imported from external platform
Flashcards
50 cards
F
Practice quiz
P
Host live
L
Questions
50
Answers
1
__________ is responsible for rendering HTML documents and executing scripts in web browsers.
Web server
Web browser
HTML
DNS
2
What is the purpose of encapsulation in OOP?
Binding data and methods together
Preventing class creation
Allowing inheritance
Removing redundant code
3
What will be the output of the following PHP code?
5
Error
15
105
4
PHP scripts are executed on the client-side and display results directly in the browser.
False
True
5
A PHP variable must begin with an underscore (_) or a letter.
True
False
6
The shift towards dynamic content and increased user interaction was introduced in __________.
Static web
Web 1.0
Web 3.0
Web 2.0
7
What does the regular expression /\d{6}-\d{2}-\d{4}/ match?
An IC number format
A decimal number
Johor local phone number
An IP address
8
The echo statement in PHP can be used with or without parentheses.
True
False
9
What does HTTP stand for in the context of web development?
HyperText Transformation Process
Hyperlink Text Program
Hyperlink Transfer Protocol
HyperText Transfer Protocol
10
What will be the final output of the following PHP code?
None
Error
Two
One
11
What is the result of this PHP code?
Error
0123
012
123
12
What will be the output of the following PHP code?
50.24
12.56
25.12
Error
13
What is the primary function of the World Wide Web (WWW)?
Managing email servers
Developing desktop applications
Creating web servers
Sharing hypertext documents and multimedia resources
14
What is the output of this PHP code? echo "PHP is " . "great!";
PHP isgreat!
Error
PHP is.great!
PHP is great!
15
Which web development stage emphasized dynamic content and user interaction?
Web 2.0
Web 3.0
Static Web
Web 1.0
16
Which operator is used to concatenate two strings in PHP?
&
.
->
+
17
The unique address used to locate a resource on the web is known as a __________.
Server address
URL
Domain name
IP address
18
Which of the following is an access modifier in PHP?
extern
public
internal
variable
19
What will be printed by the following PHP script?
15
105
Error
10
20
What is the correct syntax to create a class in PHP?
define class MyClass { }
class MyClass { }
new class MyClass { }
create class MyClass { }
21
What will be the output of this PHP code?
3
4
5
Error
22
The first version of the web, also known as Web 1.0, was characterized by __________ pages.
Static
Interactive
Multimedia
Dynamic
23
Constants in PHP can be changed once they are defined.
True
False
24
What type of web application allows the content to update dynamically without refreshing the entire page?
Progressive Web Applications (PWA)
Static Web Applications
Multi-Page Applications (MPA)
Single-Page Applications (SPA)
25
Which regular expression operator denotes the start of a string?
+
^
$
*
26
What is the output of the following PHP code?
Error
57
5 + 7
12
27
What is the output of the regular expression [a-z]+?
Matches any string
Matches lowercase letters only
Matches one or more digits
Matches one or more lowercase letters
28
To display the type and value of a variable, PHP provides the var_dump() function.
False
True
29
PHP keywords, functions, and class names are case-sensitive.
True
False
30
What will the following PHP code display?
No output
Undefined variable
Error
10
31
What will the following PHP code output?
Greater
Error
No output
Smaller
32
What is inheritance in Object-Oriented Programming?
Creating objects from a class
Sharing code between two classes
Copying methods from one class to another
Creating a class from an existing class
33
Web __________ involves creating applications that can be accessed via web browsers.
Deployment
Browsing
Hosting
Application Development
34
What will this PHP code output?
2 4 6
Error
2, 4, 6
246
35
What is the purpose of the PHP function define()?
Set the type of a variable
Define a variable
Define a constant
Create a function
36
In PHP, variable names are case-sensitive.
True
False
37
Which PHP function is used to check the data type of a variable?
var_dump()
get_type()
type_check()
data_type()
38
What is the result of this PHP code?
"Hello" "World"
Hello World
Error
HelloWorld
39
Which component of a web address provides the protocol used to access the resource?
HTTP
URL
DNS
IP Address
40
Which method is automatically called when a new object is created from a class?
initialize()
__create()
new()
__construct()
41
Which of the following is correct syntax for starting a PHP script?
<?php
<php?
<php
<script
42
Which PHP function is used to match a regular expression against a string?
match()
regex_match()
preg_match_all()
preg_match()
43
Single-line comments in PHP are written using /* and */.
True
False
44
Which of the following PHP variable names is valid?
$1var
$-var
$_var
$var@
45
Which shorthand character matches any number from 0 to 9?
\n
\d
\n
/d
46
PHP automatically converts variable types depending on the value assigned to the variable.
False
True
47
In PHP, how are properties within a class defined?
Using $ sign only
Using let keyword
Using define keyword
Using public, protected, or private followed by a $ sign
48
What does preg_replace() function do in PHP?
Replaces a string with another string
Splits a string into an array
Replaces all occurrences of a pattern with a string
Validates input against a pattern
49
How can a child class access a method from its parent class?
new parent()
$this->parentMethod()
self::method()
parent::method()
50
The concatenation operator in PHP is the dot (.) symbol.
True
False