Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Pop the element off the end of array
<?php array_pop(array &$array): mixed
<?php         if ($input->isInteractive() && $input->getOption('ask')) {

            $parts = explode("/", strtolower($input->getArgument('package')), 2);

            $input->setArgument('directory', $io->ask('New project directory [<comment>'.array_pop($parts).'</comment>]: '));

        }



        $ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
<?php         if (null === $directory) {

            $parts = explode("/", $name, 2);

            $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts);

        }



        $process = new ProcessExecutor($io);
<?php         $this->manipulateJson('addProperty', $name, $value, function (&$config, $key, $val) {

            if (strpos($key, 'extra.') === 0 || strpos($key, 'scripts.') === 0) {

                $bits = explode('.', $key);

                $last = array_pop($bits);

                $arr = &$config[reset($bits)];

                foreach ($bits as $bit) {

                    if (!isset($arr[$bit])) {
<?php         $this->manipulateJson('removeProperty', $name, function (&$config, $key) {

            if (strpos($key, 'extra.') === 0 || strpos($key, 'scripts.') === 0) {

                $bits = explode('.', $key);

                $last = array_pop($bits);

                $arr = &$config[reset($bits)];

                foreach ($bits as $bit) {

                    if (!isset($arr[$bit])) {
<?php         $args = func_get_args();


        array_shift($args);

        $fallback = array_pop($args);



        if ($this->file->exists()) {

            if (!is_writable($this->file->getPath())) {
<?php     public function reset()

    {

        while ($decision = array_pop($this->decisionQueue)) {

            $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;

        }

    }
<?php     public function resetToOffset($offset)

    {

        while (\count($this->decisionQueue) > $offset + 1) {

            $decision = array_pop($this->decisionQueue);

            $this->decisionMap[abs($decision[self::DECISION_LITERAL])] = 0;

        }

    }
<?php     public function revertLast()

    {

        $this->decisionMap[abs($this->lastLiteral())] = 0;

        array_pop($this->decisionQueue);

    }



    public function count(): int
<?php         }



        while (!empty($this->branches) && $this->branches[\count($this->branches) - 1][self::BRANCH_LEVEL] >= $level) {

            array_pop($this->branches);

        }

    }
<?php         $processed = array();



        while (!empty($stack)) {

            $package = array_pop($stack);



            if (isset($processed[spl_object_hash($package)])) {

                continue;
<?php     protected function popEvent()

    {

        return array_pop($this->eventStack);

    }
<?php         $up = false;

        foreach (explode('/', $path) as $chunk) {

            if ('..' === $chunk && ($absolute !== '' || $up)) {

                array_pop($parts);

                $up = !(empty($parts) || '..' === end($parts));

            } elseif ('.' !== $chunk && '' !== $chunk) {

                $parts[] = $chunk;
<?php     public static function restore()

    {

        if (!empty(self::$stack)) {

            error_reporting(array_pop(self::$stack));

        }

    }
<?php             foreach (explode('/', trim($path, '/')) as $segment) {

                if ('..' === $segment) {

                    array_pop($result);

                } elseif ('.' !== $segment && '' !== $segment) {

                    $result[] = $segment;

                }
<?php             return $package->getPrettyName() === 'test/jsonInRootTarFile';

        });

        $this->assertCount(1, $tarPackage);

        $tarPackage = array_pop($tarPackage);

        $this->assertSame('tar', $tarPackage->getDistType());

    }