0% found this document useful (0 votes)
9 views

Technical Questions Based On PHP

The document contains technical questions about PHP with answers. It includes questions about PHP classes, interfaces, properties, functions, sessions, files and more. The questions cover a wide range of PHP topics from basics to advanced concepts.

Uploaded by

Shail Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Technical Questions Based On PHP

The document contains technical questions about PHP with answers. It includes questions about PHP classes, interfaces, properties, functions, sessions, files and more. The questions cover a wide range of PHP topics from basics to advanced concepts.

Uploaded by

Shail Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Technical Questions based on PHP

• If class implementing the interface does not use exact same method signatures as are
defined in the interface. Will show.
Compilation error

• Static properties cannot be initialized using.


A literal or constant

• If property of class is declare using var then PHP5 will treat the property as?
It accelerates as public property.

• Class member variables are also called?

• How to typecast a variable to Boolean?


Using the bool and Boolean keyword

• include_once is a __used to embed the PHP code from another file______.


• microtime() returns ___timestamp in microseconds____.

• What will range('a', 'z') return?


An array of alphabet.

• Which PHP function or variable will return the value of current session id?
SESSION_ID() is used to get set the session id for the current session.

• What is the simplest method of computing the sum of all the elements of an array?
The array Sum() function

• What is the name of function used to convert an array into a string?


The serialized() function.

• __asort()_____ function is used to sort an array in ascending order by value while


preserving key associations.
• Array values are keyed by ___string___ values (called indexed arrays) or using
___Boolean___ values (called associative arrays).

• Which object-oriented pattern would you use to implement a class that must be
instantiated only once for the entire lifespan of a script?
Singleton

• In PHP 5, how can you write a class so that some of its properties cannot be accessed
from outside its methods?

In PHP 5, you can achieve encapsulation, which restricts access to certain class
properties from outside its methods, by using the private visibility modifier for those
properties.

• The _____nl2br()______ function automatically transforms newline characters into


HTML tags.

• By default, PHP stores session data in _____the server / tmp directory_________.

• How are session variables accessed through?


Using the global variable $_SESSION.

• If cookie expiration time is not set explicitly, what happens to it?


The cookie will expire at the end of the session.

• PECL stands for?


PHP extension Community library.

• PEAR stands for?


PHP extension and application repository.

• How does the identity operator === compare two values?


“Type safe Comparison”.
• __FILE__ is?
It is native global variable that holds the path of the script that being executed.

• list in PHP is ?

• PHP allow which commenting style?


“#” or “||”

• In terms of keywords and language syntax, PHP is similar to?


C-style syntax

• What is most appropriate way to open file "placementquestion.txt" in write mode?


‘Fopen’ function with “W” mode.

• In PHP, variable always start with _____?


The $ sign (Dollar sign).

• A PHP scripting block always starts with


“<? Php” and ends with “?>”

• PHP stands for


Hypertext preprocesses

You might also like