PHP: How not to pollute the global scope
An emerging trend in JavaScript is to wrap entire programs in a single object to prevent conflicts with other scripts. The same can be done with PHP, something I haven’t seen done very often.
An emerging trend in JavaScript is to wrap entire programs in a single object to prevent conflicts with other scripts. The same can be done with PHP, something I haven’t seen done very often.
Writing compact code can save you time. It’s not always recommended and often even strongly discouraged as it makes your code less readable, but for simple operations it can be more efficient. In this post I will give a few examples.
A few days ago I launched Twitchance, a free Twitter lottery. It’s a viral marketing experiment where I’m going to give away some cash ($500.- on the first draw).
The concept is simple; participants post a message from a sponsor on Twitter. After some time a winner is randomly selected and awarded the prize. The sponsor receives amplified outreach to the online world.
Many companies offer services for free on the internet, often powered by advertisements. I figured the same could be done with a lottery. Twitter has a huge user base and tracking specific messages is easy, making it the perfect place for a project like this.
Anyone can join, all you need is a Twitter and Paypal account.
I started this blog to write about my on-line projects and share insights and interesting finds on the web. Occasionally I might post a few tips and tricks for programmers and designers.
I’m a programmer myself, I write most of my applications in PHP and JavaScript. I built websites for a living and often work on experimental projects on the side.
This is my first WordPress blog, I used to share science and technology related articles on Blogger but never published any unique content. I also have a discontinued blog on Tumblr where I posted updates about one of my apps, Wappalyzer. I’m going to post the updates here from now on.
I started off with the Modicus theme from Upstart Blogger and turned it into something completely different. It’s a work in progress.
If you’re interested in what I have to say, please subscribe to my feed and follow me on Twitter.