- What does a special set of tags = and ?> do in PHP? - The output is displayed directly to the browser.
- What’s the difference between include and require? - It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
- How do you define a constant? - Via define() directive, like define ("MYCONSTANT", 100);
- Explain the ternary conditional operator in PHP? - Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
- How do I find out the number of parameters passed into function? - func_num_args() function returns the number of parameters passed in.
- What’s the difference between accessing a class method via -> and via ::? - :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization. :: is called as "scope resolution operator".
- How do you call a constructor for a parent class? - parent::constructor($value)
- What are the two new error levels introduced in PHP5.3? -
E_DEPRECATED
The E_DEPRECATED error level is used to indicate that a function or feature has been deprecated.
E_USER_DEPRECATED
The E_USER_DEPRECATED level is intended for indicating deprecated features in user code, similarly to the E_USER_ERROR and E_USER_WARNING levels.
common php questions and answers
Posted by
php helper
at
8:38 PM
Labels: php, php questions
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment
Post your helpful suggestions on this...