# Clearing Up Some Annoying PHP Static **Published by:** [Continuations](https://continuations.com/) **Published on:** 2009-08-27 **URL:** https://continuations.com/clearing-up-some-annoying-php-static ## Content While on vacation I started some prep work for using MongoDB at DailyLit, which is mostly written in PHP. The prep work consists of creating a lightweight way of getting PHP objects in and out of MongoDB (I know there are some things out there already, but what’s the fun in that?). Here is a slightly simplified summary what I am shooting for:I like the idea of using static/class methods for retrieval because these will be generating one or more objects and I do not want to have to deal with separate factory or builder classes. Unfortunately, I encountered some annoying PHP static:This prints “Fruit” – what the flagnard? For my plan to work, I need this to print “Apple”. First, lets establish that “Apple” is not an unreasonable expectation. In Python, I can do the following:This prints “Apple” (well, actually it prints “__main__.Apple”). In Ruby, I can do this: ## Publication Information - [Continuations](https://continuations.com/): Publication homepage - [All Posts](https://continuations.com/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@continuations): Subscribe to updates - [Twitter](https://twitter.com/albertwenger): Follow on Twitter ## Optional - [Collect as NFT](https://continuations.com/clearing-up-some-annoying-php-static): Support the author by collecting this post - [View Collectors](https://continuations.com/clearing-up-some-annoying-php-static/collectors): See who has collected this post