PHP Classes

File: test/85_array_first.php

Recommend this page to a friend!
  Classes of ASCOOS CMS   PHP 8 Backwards Compatibility Library   test/85_array_first.php   Download  
File: test/85_array_first.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: PHP 8 Backwards Compatibility Library
Functions of PHP 8 that work in older PHP versions
Author: By
Last change:
Date: 21 days ago
Size: 261 bytes
 

Contents

Class file image Download
<?php

array_first
([1, 2, 3]); // 1
array_first([2, 3]); // 2
array_first(['a' => 2, 'b' => 1]); // 2
array_first([null, 2, 3]); // null
array_first([]); // null
array_first([$obj, 2, 3]); // $obj
array_first([1]); // 1
array_first([true]); // true
?>