This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
43
get_class($foo->member) returns the name of the calling class if member is NULL
Post Body
<?php
class Box {
function getContentType() {
return get_class($this->content);
}
}
class Foo {
}
$x = new Box();
$x->content = new Foo();
echo $x->getContentType(), "\n"; // outputs 'Foo'
$x = new Box();
echo $x->getContentType(), "\n"; // outputs 'Box'
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 12 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/lolphp/comm...