What are the key differences between PHP4 and PHP5 that developers should be aware of?

One key difference between PHP4 and PHP5 is the introduction of new object-oriented features in PHP5, such as visibility keywords (public, private, protected), abstract classes, and interfaces. Developers should be aware that PHP5 also includes improved error handling with exceptions, as well as better support for XML and web services.

// Example code snippet demonstrating the use of visibility keywords in PHP5
class MyClass {
    public $publicVar;
    private $privateVar;
    protected $protectedVar;

    public function __construct($public, $private, $protected) {
        $this->publicVar = $public;
        $this->privateVar = $private;
        $this->protectedVar = $protected;
    }
}