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

PHPize | SQLize | SQLtest

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

A A A
Login    Share code      Blog   FAQ
Copy Format Clear

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

Copy Clear
Copy Format Clear
<?php class User { public $id; public $name; } function areUsersEqual($user1, $user2) { if ($user1 instanceof User && $user2 instanceof User) { return $user1->id === $user2->id; } return false; } $user1 = new User(); $user1->id = 1; $user1->name = 'Petr'; $user2 = new \App\User(); $user2->id = 1; $user2->name = 'Ignat'; $point2 = areUsersEqual($user1, $user2); print_r($point2);
Copy Clear