The Hawk
The Hawk

Reputation: 1568

Return value for an unset property in php

if I return from a getter and nothing is set for it, what variable type is returned?

like

$nb = $prod->getNewDate();

assume nothing is set for new date. what is $nb? null?

Upvotes: 1

Views: 458

Answers (2)

472084
472084

Reputation: 17895

Just use var_dump() on the variable and it will tell you what it is, NULL in this case.

Upvotes: 4

JvdBerg
JvdBerg

Reputation: 21856

a NULL is then returned, just as a ordinary function.

Upvotes: 2

Related Questions