debug_backtrace

Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Generates a backtrace
<?php debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0): array
<?php     protected function guessBelongsToRelation()

    {

        [$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);



        return $caller['function'];

    }
<?php     protected function guessBelongsToManyRelation()

    {

        $caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace) {

            return ! in_array(

                $trace['function'],

                array_merge(static::$manyMethods, ['guessBelongsToManyRelation'])
<?php     protected function guessRelationship()

    {

        return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];

    }
<?php             return [$ability, $arguments];

        }



        $method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];



        return [$this->normalizeGuessedAbilityName($method), $ability];

    }
<?php             return call_user_func(static::$dumpSourceResolver);

        }



        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 20);



        $sourceKey = null;
<?php     function once(callable $callback)

    {

        $onceable = Onceable::tryFromTrace(

            debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2),

            $callback,

        );
<?php     protected static function ensureIntlExtensionIsInstalled()

    {

        if (! extension_loaded('intl')) {

            $method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];



            throw new RuntimeException('The "intl" PHP extension is required to use the ['.$method.'] method.');

        }
<?php     public static function create(int $argument, string $type): static

    {

        $stack = debug_backtrace();



        $function = $stack[1]['function'];