<?php
// usually, the order of a class definition doesn't matter
$a = new A();
class A {}
// when extending a class and when the parent is defined before the child, it works as well
$b = new B();
class baseB {}
class B extends baseB{}
// but when we try to reverse the order of definition, it fails,
// (though for some reason it says it's C, not baseC cannot be found)
try {
$c = new C();
} catch (Throwable $e){ echo $e->getMessage();}
class C extends baseC {}
class BaseC{}
// So we could think that the order of definition is important
// yet we can define D before baseD this way
class D extends baseD {}
$d = new D();
class baseD{}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Class "C" not found