PHP Design Patterns PHP Job Interview Questions

As a PHP contractor, consultant, and freelancer, Larry Truett from San Diego, CA going by the alias Fluffycat had a fair number of interviews – and sometimes he’s been asked technical questions. Here are a few to help you prepare for your next PHP job interview.

=,==,=== – what is the difference between these?

= assigns a value, == checks if value is the same, === checks if value is the same and the variables are of the exact same type.

Echo, print, printf – what is the difference between these?

Print and echo both output what is passed to them. Print acts like a function, so you can use it in complex statements. Printf is used to format the output.

Include, include once, require – what is the difference between these?

Include will includes a file each time it is called. Include_once would only include a file one time, so if a php program has a file in two include_once statements only the first will be done. Requre is like include, but if the file included is not available a fatal error occurs and processing stops.

Continue reading

Advertisements