PHP Multiple Choice Questions
- In which circumstance it is not possible to assign default value to a parameter while declaring a function?
- When the parameter is Boolean
- When the function is being declared as a member of a class
- When the parameter is being declared as passed by reference
- When the function contains only one parameter
Answer :
C
Explanation:
We cannot specify default value for parameter declared as passed by reference.
Added By : Manish Kumar
- Which of the following tags is not a valid way t o begin and end a PHP code block?
- <% %>
- <! !>
- <? ?>
- <?= ?>
Added By : Manish Kumar
- Which of the following is invalid PHP code?
- $_20
- &$myVar
- $20_var
- ${"var"}
Answer :
C
Explanation:
Variable in PHP always start with $ sign and are sequence of character and numbers plus underscore however Variable cannot start with number.
Added By : Manish Kumar
- Which is correct syntax to declare constant?
- define("CONSTANT", "Placement Question");
- const CONSTANT = 'Placement Question';
- constant CONSTANT = 'Placement Question';
- A & B
Added By : Rohit
- Which is correct statement to terminate PHP statement?
- Semicolon at the end of each statement
- The closing tag of a block of PHP code automatically implies a semicolon;
- Colon at the end of each statement
- A & B
Added By : Rohit
- What option should be enable to allow php short tags in php.ini?
- short_tag
- short_open_tag
- asp_tag
- allow_all_tag
Added By : Rohit
- __FILE__ is ?
- Language construct
- Keyword
- Compile-time constant
- None of the above
Added By : Abhijit Kumar
- list in PHP is ?
- Language construct
- Keyword
- A & C Both
- None of the above
Added By : Abhijit Kumar
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015