An abstract class is where some methods may have some body too.
Then any object can extend that abstract class and extend all these methods defined
in that abstract class. A final class is an object which you are not allowed to extend.
In PHP5 you can use all of these.
In PHP4 there are no multiple inheritances for interfaces. That means an interface
can extend only one interface. But in PHP5 multiple inheritance is supported via
implementing multiple interfaces together.
In PHP4, almost everything is static. That means if you declare any method in the
class, you can call it directly without creating an instance of it. For example the
following piece of code is valid in PHP4:
class Abc
{
var $ab;
function abc()
{
$this->ab = 7;
}
function echosomething()
{
echo $this->ab;
}
}
echo abc::echosomething();
?>
OOP vs. Procedural Programming
[ 16 ]
However it is not valid in PHP5 because the method echosomething() uses $this
keyword which is not available in a static call.
There is no class-based constant in PHP4. There is no static property in objects in
PHP4, and there is no destructor in PHP4 objects.
Whenever an object is copied, it is a shallow copy of that object.
Pages:
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33