I have a function that looks like
class NSNode { function insertAfter(NSNode $node) { ... } }
I would like to be able to use this function to indicate that the node is inserted at the beginning, so it does not work. I think of this that null means βnothing,β so I would write my function call as follows:
$myNode->insertAfter(null);
In addition, PHP generates an error saying that it expects an NSNode object. I would like to adhere to strict data entry in my function, but would like to be able to specify a null-esque value.
So, without changing it to function insertAfter($node) { } , is there a way to pass something else to this function?
Update: I accepted Owen's answer because he answered the question itself. All the other proposals were really good, and I will really implement them in this project, thanks!
source share