Home  • Programming • PHP

PHP - Examination Question with Answer, Exam- 04, Round- 36 WDPF

Part-01: Descriptive Question with Answer.

1: What are the general language features of php? Answer Practicality: It requires minimum knowledge of programming. Power: It has the ability to interface with databases, form and create pages dynamically. Possibility: Developers are rarely bound to any single implementation solution. Price: It is open source software. 2: What are passing arguments by reference and passing arguments by value? Answer passing arguments by value: Means any changes made to those values within the scope of the function are ignored outside of the function. passing arguments by reference: Means any changes made to those values within the scope of the function are reflected outside of the function. 3: What are class and object? Answer Class: Classes are intended to represent those real-life items that coder like to manipulate within an application. Object: An instance of class is called object. 4: How to use array_pop() function? 5: What are constructor? Answer Constructor: A constructor is defined as a block of code that automatically executes at the time of object instantiation. Constructors can accept parameters, call class methods or other functions.PHP recognizes constructor by the name__construct. The general Syntax→ function__construct([argument1,argument2,….,argumentN]){ //Class initialization code } 6: Define exceptions? Answer Ans: An exception is an abnormal condition that arises in a code sequence at run time. Basically there are four important keywords which form the main pillars of exception handling: try, catch, throw and finally. 7: What are the abstract class and interface? Answer Abstract class: An abstract class is a class that cannot be instantiated. Abstract classes are intended to be inherited by a class that can be instantiated, better known as a concrete class. Abstract classes can be fully implemented, partially implemented or not implemented at all. Interface: An interface defines a general specification for implementing a particular service, declaring the required functions and constants without specifying exactly how it must be implemented. 8: Difference between get and post method? Answer Ans: There are some difference between GET and POST method. They are: ♦ GET method is used for submitting small amount of data. But POST method is used for submitting large amount of data. When we use GET method requested data show in url but not in POST method so , POST method is good for sending sensitive request. 9: What are the PHP's authentication variable? Answer PHP uses two authentication variables as follows: 1. $_SERVER['PHP-AUTH-USER'] 2. $_SERVER['PHP-AUTH-PW'] These variables store the username and password values respectively. 10: What is super global variable? Write name of some superglobal variable? Answer The super global variables are predefined variable in PHP. These are accessible from anywhere within a substantial amount of environment specified information. Name of some super global variable:- $_GET[], $_POST[], $_REQUEST[], $_SERVER[], $_SESSION[], $GLOBAL[], $_COOKE[], $_FILES[] and $_ENV[].

Comments 1


Part-02: MCQ Question with Answer coming soon. please keep following!

Share

About Author
MD. Shafiqul Islam
Copyright © 2024. Powered by Intellect Software Ltd