Searching for "%"

Q:

Are objects passed by value or by reference?

Answer Everything is passed by value.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

Explain the ternary conditional operator in PHP?

Answer Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

How do you pass a variable by value?

Answer Just like in C++, put an ampersand in front of it, like $a = &$b
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

How do you define a constant?

Answer Via define() directive, like define ("MYCONSTANT", 100);
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

What’s the difference between include and require?

Answer 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.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

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

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

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