What is the difference between abstract classes and interfaces in PHP?

Abstract classes in PHP can contain both abstract and non-abstract methods, while interfaces can only contain method signatures without any implementation. Abstract classes can have properties, while interfaces cannot. Abstract classes can provide a partial implementation of a class, while interfaces define a contract that classes must adhere to.

<?php

// Abstract class
abstract class Animal {
    protected $name;

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

    abstract public function makeSound();
}

// Interface
interface Vehicle {
    public function start();
    public function stop();
}

?>