PHP Questions

PHP questions suitable for use in interviews or just for fun.

PHP Question: Class Methods

4th May 2011

Question

What is the difference between these two lines of code and can you produce the background code used for them?

PHP Question: Print Object

Question

The following code was executed.

philipnorton42 Thu, 04/28/2011 - 11:29

PHP Question: Form Variables

22nd April 2011

Question

Given the following form:

  1.  

How would you get hold of the value of the input box after the form is submitted?

PHP Question: Pass By Reference

Question

Consider the following:

  1. function doSomething(&$val) {
  2. $val++;
  3. }
  4.  
  5. $a = 1;
  6. doSomething($a);

What does the variable $a now equal?

philipnorton42 Tue, 04/19/2011 - 12:47