Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php class Test { public function __construct(public int $id) {} } $initialErrors = [new Test(1), new Test(2), new Test(3)]; $finalErrors = [new Test(3), new Test(4), new Test(5)]; $initialErrorsIds = array_map($initialErrors, fn(Test $o) => $o->id); $finalErrorsIds = array_map($finalErrors, fn(Test $o) => $o->id); print_r(array_diff($initialErrorsIds, $finalErrorsIds)); print_r(array_diff($finalErrorsIds, $initialErrorsIds));
Copy Clear