bootstrap.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Polyfill\Php73 as p;
  11. if (PHP_VERSION_ID < 70300) {
  12. if (!function_exists('is_countable')) {
  13. function is_countable($var) { return is_array($var) || $var instanceof Countable || $var instanceof ResourceBundle || $var instanceof SimpleXmlElement; }
  14. }
  15. if (!function_exists('hrtime')) {
  16. require_once __DIR__.'/Php73.php';
  17. p\Php73::$startAt = (int) microtime(true);
  18. function hrtime($asNum = false) { return p\Php73::hrtime($asNum); }
  19. }
  20. if (!function_exists('array_key_first')) {
  21. function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } }
  22. }
  23. if (!function_exists('array_key_last')) {
  24. function array_key_last(array $array) { end($array); return key($array); }
  25. }
  26. }