Archives for posts with tag: PHP

This post is just one among the various rants available online that use a bad-mouth for PHP despite the fact that it is successfully used in various sites such as Facebook, wikipedias, etc

So here’s what got me thinking working on my GSoC project on SemanticMediaWiki (an extension for MediaWiki), I mistakenly deleted some text from a .php file which was a public variable of a class. I tested and found that things are working fine and committed my patch when looking at the diff I was amazed how things were working. Then I ran some tests

<?php
class hello{

	public function __construct($name){
		$this->name = $name;
	}
}

$wy = new hello('sdfs');
echo $wy->name;

to my amazement this worked perfectly even though I hadn’t initialized $name earlier. This definitely prevents some bugs, but then I prefer bugs than unmanageable code.

Using PHP is the easiest thing these days. NO, you don’t even have to buy a book just the PHP manual available for free download is enough. It has proper documentation and examples. I consider myself good at debugging and so I am learning PHPUnit testing today 🙂