<?php
class B extends A
{
public $attribute2;
function operation2()
{
echo 'operation2';
}
}
$b = new B();
$b->operation1();
$b->operation2();
class A
{
public $attribute1;
function operation1()
{
echo 'operation1';
}
}
It shows the output: operation1operation2
Question:
I put the class A{}
at the end of script, so when it goes to the first line class B extends A
I thought it will show an error message, something like undefined class A
, but it does not, why?