S
Size: a a a
S
/
/
S
KN
/** @var \Composer\Autoload\ClassLoader $composer */
$composer = require __DIR__ . '/vendor/autoload.php';
spl_autoload_register(static function (string $class) use ($composer) {
$parent = XXXXX::class;
$constantName = 'YYYY';
if (
// Class loaded
$composer->loadClass($class) &&
// Constant not exists
! \defined($class . '::' . $constantName) &&
// Class is an subtype of $parent
\is_subclass_of($class, $parent)
) {
throw new \LogicException(\sprintf(
'Class %s contains abstract constant (o_0) and must therefore ' .
'be implement the remaining constant (%s::%s)',
$parent,
$class,
$constantName
));
}
}, true, true);
KN
KN
S
KN
️️
KN
S
KN
S
S
KN
KN
KN
KN
const EXAMPLE = 'test';
echo EXAMPLE; // test
KN
FFI::cdef('char *memcpy(char *dst, const char *src, size_t len);')
->memcpy(EXAMPLE, 'asda', 4);
echo EXAMPLE; // asda