PHP Learners - Study24x7
Social learning Network
phplearners Cover image
phplearners
PHP Learners
  • Followers
  • Latest Feeds
  • Articles
  • Question
  • Course
  • About
  • Review
Interests
PHP
6 followers study24x7 27 Jan 2025 11:35 AM study24x7 study24x7

Which of these is a valid scalar type in PHP?

A

boolean

B

string

C

integer

D

All of the above

study24x7
Write a comment
6 followers study24x7 27 Jan 2025 11:34 AM study24x7 study24x7

What is the syntax for declaring a named argument in PHP?

A

argument: value

B

value => argument

C

argument => value

D

value: argument

study24x7
Write a comment
6 followers study24x7 27 Jan 2025 11:33 AM study24x7 study24x7

Which version of PHP introduced JIT compilation?

A

PHP 7.0

B

PHP 7.4

C

PHP 8.0

D

PHP 8.1

study24x7
Write a comment
6 followers study24x7 24 Jan 2025 11:07 AM study24x7 study24x7

Which tool is commonly used for profiling PHP code?

A

Xdebug

B

PHPUnit

C

Composer

D

phpMyAdmin

study24x7
Write a comment
6 followers study24x7 24 Jan 2025 11:06 AM study24x7 study24x7

Which PHP data structure is fastest for key-value pairs?

A

Array

B

Object

C

HashTable

D

Map

study24x7
Write a comment
6 followers study24x7 24 Jan 2025 10:53 AM study24x7 study24x7

What is the best practice for optimizing database queries?

A

Using prepared statements

B

Using inline SQL queries

C

Fetching unnecessary columns

D

Avoiding indexing

study24x7
Write a comment
6 followers study24x7 23 Jan 2025 10:37 AM study24x7 study24x7

Which function measures script execution time?

A

microtime()

B

execution_time()

C

timer_start()

D

time_elapsed()

study24x7
Write a comment
6 followers study24x7 23 Jan 2025 10:36 AM study24x7 study24x7

What is the purpose of PHP opcache?

A

Optimize CSS files

B

Cache compiled PHP code

C

Minify HTML output

D

Store database queries

study24x7
Write a comment
6 followers study24x7 23 Jan 2025 10:35 AM study24x7 study24x7

What is a secure way to handle passwords in PHP?

A

Store them in plain text

B

Use password_hash() and password_verify()

C

Use MD5 encryption

D

Use base64 encoding

study24x7
Write a comment
6 followers study24x7 22 Jan 2025 11:06 AM study24x7 study24x7

Which directive should be disabled for better security in production?

A

display_errors

B

log_errors

C

error_reporting

D

allow_url_fopen

study24x7
Write a comment
6 followers study24x7 22 Jan 2025 11:03 AM study24x7 study24x7

What is hash_equals() used for?

A

Comparing hashed passwords

B

Timing-safe string comparison

C

Generating cryptographic keys

D

Hashing strings

study24x7
Write a comment
6 followers study24x7 22 Jan 2025 11:02 AM study24x7 study24x7

What is the primary purpose of CSRF tokens?

A

To prevent SQL injection

B

To prevent session hijacking

C

To prevent cross-site request forgery

D

To encrypt data

study24x7
Write a comment
6 followers study24x7 21 Jan 2025 10:14 AM study24x7 study24x7

Which function is used to sanitize user input for HTML output?

A

htmlspecialchars()

B

sanitize_html()

C

htmlentities()

D

Both a and c

study24x7
Write a comment
6 followers study24x7 21 Jan 2025 10:14 AM study24x7 study24x7

Which function escapes special characters in MySQL queries?

A

mysqli_real_escape_string()

B

mysql_escape()

C

string_escape()

D

mysql_real_escape_string()

study24x7
Write a comment
6 followers study24x7 21 Jan 2025 10:13 AM study24x7 study24x7

What is the default fetch mode in PDO?

A

PDO::FETCH_ASSOC

B

PDO::FETCH_OBJ

C

PDO::FETCH_BOTH

D

PDO::FETCH_NUM

study24x7
Write a comment
6 followers study24x7 20 Jan 2025 11:24 AM study24x7 study24x7

Which method is used to fetch all results from a PDO query?

A

fetchAll()

B

fetch()

C

getAll()

D

retrieveAll()

study24x7
Write a comment
6 followers study24x7 20 Jan 2025 11:24 AM study24x7 study24x7

What does PDO stand for in PHP?

A

PHP Database Objects

B

Portable Data Objects

C

Programmed Database Operations

D

Persistent Database Objects

study24x7
Write a comment
6 followers study24x7 20 Jan 2025 11:23 AM study24x7 study24x7

Which extension is commonly used for MySQL database interaction in PHP?

A

mysqli

B

mysql

C

pdo_mysql

D

Both a and c

study24x7
Write a comment
6 followers study24x7 17 Jan 2025 11:07 AM study24x7 study24x7

Which function deletes a file in PHP?

A

delete()

B

unlink()

C

remove()

D

destroy()

study24x7
Write a comment
6 followers study24x7 17 Jan 2025 11:02 AM study24x7 study24x7

What does the filesize() function do?

A

Returns the total size of a directory

B

Returns the size of a file in bytes

C

Deletes a file

D

Checks if a file exists

study24x7
Write a comment
Ratings
0.0
out of 5
0 Ratings
5 study24x7
 
0.0
4 study24x7
 
0.0
3 study24x7
 
0.0
2 study24x7
 
0.0
1 study24x7
 
0.0
Related Pages