Supported Versions: PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
Returns the value of a constant
<?php constant(string $name): mixed
<?php             $event = 'Composer\Installer\PackageEvents::PRE_PACKAGE_'.strtoupper($opType);

            if (defined($event) && $runScripts && $this->eventDispatcher) {

                $this->eventDispatcher->dispatchPackageEvent(constant($event), $devMode, $repo, $allOperations, $operation);

            }



            $dispatcher = $this->eventDispatcher;
<?php             $postExecCallbacks[] = function () use ($opType, $runScripts, $dispatcher, $devMode, $repo, $allOperations, $operation) {

                $event = 'Composer\Installer\PackageEvents::POST_PACKAGE_'.strtoupper($opType);

                if (defined($event) && $runScripts && $dispatcher) {

                    $dispatcher->dispatchPackageEvent(constant($event), $devMode, $repo, $allOperations, $operation);

                }

            };
<?php     public function getConstant($constant, $class = null)

    {

        return constant(ltrim($class.'::'.$constant, ':'));

    }