CoreFiles by mySites.guru
Php85.php50 lines, 1,027 bytes, from Joomla_6.1.0-Stable-Full_Package.zip
Raw History Compare with 6.0.4
md5
497ca2f733dd7bd80aeff3336e2bf221
sha1
975acded634aee662e7e56263b4e24cd13a0e77c
sha256
6ad23082154b74b9b9cdb759964e5b842e81565a6d9c99ca2c07bb83bf6204e9
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Polyfill\Php85;

/**
 * @author Pierre Ambroise <[email protected]>
 *
 * @internal
 */
final class Php85
{
    public static function get_error_handler(): ?callable
    {
        $handler = set_error_handler(null);
        restore_error_handler();

        return $handler;
    }

    public static function get_exception_handler(): ?callable
    {
        $handler = set_exception_handler(null);
        restore_exception_handler();

        return $handler;
    }

    public static function array_first(array $array)
    {
        foreach ($array as $value) {
            return $value;
        }

        return null;
    }

    public static function array_last(array $array)
    {
        return $array ? current(array_slice($array, -1)) : null;
    }
}

The same content is in 21 releases, Joomla 6.1.0-alpha2 to 6.2.0-alpha1. See them all, or every version of this file.