skip to Main Content

Php – Why doesn't array_diff() work straight away with an array of enums, whereas in_array() or array_udiff() do?

Using PHP 8.4, given the following functions: function test_array_diff($all, $filtered) { return array_diff($all, $filtered); } function test_array_udiff($all, $filtered) { return array_udiff($all, $filtered, fn($item1, $item2) => $item1 != $item2); } function test_in_array($all, $filtered) { $diff = []; foreach ($all as $case)…

VIEW QUESTION

Html – Angular select element not binding to enum value

I have the following in my component.ts file: import {Component, OnInit} from '@angular/core'; import {IBook} from "../../models/book.model"; import {ActivatedRoute} from "@angular/router"; import {BooksService} from "../../services/books.service"; import {BookGenre} from "../../enums/book-genre"; @Component({ selector: 'bookstore-edit-book', templateUrl: './edit-book.component.html', styleUrl: './edit-book.component.css' }) export class EditBookComponent…

VIEW QUESTION
Back To Top
Search