PHP Classes

File: named_arguments.php

Recommend this page to a friend!
  Classes of Allan Kibet   Learn New PHP 8 Features   named_arguments.php   Download  
File: named_arguments.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Learn New PHP 8 Features
Examples of how to use PHP 8 new features
Author: By
Last change:
Date: 2 years ago
Size: 203 bytes
 

Contents

Class file image Download
<?php

$numbers
= [3,1,0,4,7,2];

// Order of named parameters can be random
$filtered_array = array_filter(callback: function($var){
    return
$var > 2;
}, array:
$numbers);

print_r($filtered_array);