PHP vs Perl

Here's a simple program which calculates, to eight decimal places, the value of the Golden Ratio φ implemented in both PHP and Perl, to demonstrate their similarities. Perl #!/usr/bin/perl $a = 1; $b = 1; $c = undef; $psi_old = undef; print “Approximating psi…\n”; while (1) { $psi = sprintf(‘%.08f’, $b/$a); last if ($psi_old eq … Continued

How PHP programmers get things wrong

Firstly, three disclaimers: PHP is a great programming language, one of my favourites — this website is written in PHP; there are many great PHP programmers out there, some of whom probably never get things wrong; I probably get things wrong a lot of the time. The majority of the database-backed Open Source PHP projects … Continued

Hurrah! A Blog for Toby!

At last, my new CMS is at a stage when I’m able to actually start publishing with it. Now that I have an easy-ish tool to publish with, you can expect that this website will be updated more frequently and with more and better content. Updating this website in the past has been a major … Continued

Re: Building a “modular” PHP site

Tyno Gendo wrote: I have been pondering over building a “modular” site which accepts add-ons built by other people. I was wondering if anyone has any links to any reading material on how you build this kind of facility into your site? The basic technique is this: Firstly, provide a plugin registration function, which we’ll … Continued

PHP UTF-8 Validation Library

lawrence k wrote: What PHP code would give me this kind of 100% certainty? I was bored so wrote this. I’m quite proud of myself, as I wrote it and ran it and it worked first time! 🙂 It not only checks that the UTF-8 is valid, it forces it to be valid.

Re: is PHP less secure than Perl, Python, or Ruby?

walterbyrd wrote: I honestly don’t know. But, I have seen articles and posts about how PHP is terribly insecure. PHP is not inherently insecure, but because it’s very easy to write PHP, it has become rather a popular language amongst people with little, if any, formal training on how to program. Because of this, there … Continued

PHP4 vs PHP5 [was Re: Extending the mysqli class]

Michael Fesser wrote: My scripts make use of many of the new OOP features in PHP 5, so they won’t run at all on PHP 4. Ditto. My current big pet project is http://demiblog.org/. This is PHP 5+ only and supports MySQL 5+ and PostgreSQL 8+. Although I do realise that earlier versions of these … Continued

Re: Random Map Generation

skulkrinbait@googlemail.com wrote: My first prototype for doing this doesn’t give good results, the map being far too random, can someone help me out or point me to a good resource please? Real geography is not random. First, take a grid, say 1001×1001 is size. Now find the middle square of it and set it to … Continued