Urgent request: java interface is written in php syntax

Code:
Set < SearchFieldsEnum > searchFields = new HashSet < SearchFieldsEnum >
();
searchFields.add (SearchFieldsEnum.USER_ID);

question: how to implement this code with php?

Apr.15,2021

Set is not supported in

php, so you can consider using array to implement

.
<?php

Class Set {
    private $arr = [];
    public function add($val) {
        if (!in_array($val, $this->arr)) {
            array_push($this->arr, $val);
        }
        return $this->arr;
    }
}

$set = new Set();
print_r($set->add(2));
print_r($set->add(2));
print_r($set->add(3));
print_r($set->add(4));

the ability is limited, if there is a mistake, please do not hesitate to give advice.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40a70-2c546.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40a70-2c546.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?