Why WordPress should drop PHP 5.2

There's a recurring debate about WordPress and whether they should keep code compatible with PHP 5.2 or drop it and bump the requirements to a newer PHP version. Hey, I have an opinion on this. What's wrong with PHP 5.2? Nothing much, except PHP 5.2 was released in November 2006, and was maintained and developed till January 2011. This means…

Generate Random Pronouceable Words

Ho haï, blog, long time no see! :) I was checking stuff on various URL shorteners and noticed is.gd has one interesting feature: you can generate short URLs that are "pronounceable" (no "vgfhgt"). This is a great little touch: a random but pronounceable word will be more memorable and the probability for typos is reduced, which makes it a killer…

HTTP Authentication on PHP as CGI (like Dreamhost)

Using PHP's HTTP Authentication is a simple way to protect scripts behind a login/password prompt. There's one little problem: it's supposed to work only on PHP as an Apache module, not the CGI version. It took me a while, hair pulling and some googling to get a basic HTTP Auth system working on Dreamhost's PHP as CGI so for my…

Javascript basename() and dirname()

For my next stuff I needed the Javascript equivalents of PHP functions basename() and dirname(). Nothing genius: < View plain text > javascript function basename(path) {     return path.replace(/\\/g,'/').replace( /.*\//, " ); }   function dirname(path) {     return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, ");; } It obviously supports paths like /home/ozh/stuff.php, http://site.com/file.ext or double backslashed Win32 paths such as C:\\dir\\document.txt. Edit:…

WordPress 2.5 ShortCodes API Overview

WordPress 2.5 comes with a very handy API that plugin authors should love: shortcodes, ie. BBcode-like tags, that are parsed when found in post contents. The API is very easy to use, and well done enough that it's relatively foolproof. Shortcode types The API allows for all the possible combinations and forms you'd think of: selfclosing or open tags, attributes…

Headbanging link of the day: MetalAd creates a skyscraper-like banner from your heavy metal tastes (as stored by Last.fm). (my metal ad for instance). The generating PHP script is even open-sourced.

#

Parse error: syntax error, unexpected T_DEC, expecting T_PAAMAYIM_NEKUDOTAYIM (like here for instance) Seriously, what were PHP coders on, when they decided to implement this kind of error message?? For the record, it just means you're missing a :: somewhere.

#