A to Z View - All Upwork Test Answers

Upwork PHP Test Answers - 2015

Ques: The setrawcookie() method of setting cookies is different from PHP standard method of cookie setting as:

It does not allow expiry time to be set
It can be used only once It does not URL-ENCODE the value on its own
It does not allow domain setting

Ques:
You need to keep an eye on the existing number of objects of a given
class without introducing a non-class varibale. which of the following
makes this happen?

Add a member varibale that gets incremented in the default constructer and decremented the destructer.
Add a local variable that gets incremented in each constructer and decremented in the desructer Add a static member variable that gets incremented in each constructer and decreented in the destructor
This cannot be accomplished since the creation of objects is being done dynamically via “new”

Ques: which of the following variable declaration within a class is invalid in PHP5?