Interview Questions

Q:

What’s the difference between md5( ), crc32( ) and sha1( ) crypto on PHP?

Answer The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 6652
Q:

What is the difference between characters 23 and x23?

Answer The first one is octal 23, the second is hex 23
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 3122
Q:

What’s the special meaning of __sleep and __wakeup?

Answer __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2828
Q:

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?

Answer 100, it’s a reference to existing variable.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2378
Q:

Will comparison of string "10" and integer 11 work in PHP?

Answer Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

1 2555
Q:

I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

Answer PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 6248
Q:

What does a special set of tags do in PHP?

Answer The output is displayed directly to the browser.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2808
Q:

How do I find out the number of parameters passed into function?

Answer func_num_args() function returns the number of parameters passed in.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2690