Values & References6 / 16
Up next

Loose equality ==

<?php
declare(strict_types=1);
// == compares by value after coercion
var_dump(1 == "1");
// PHP 8 changed this: 0 == "" is now false
var_dump(0 == "");
// two arrays are == with the same key/value pairs
var_dump([1, 2] == [1, 2]);
What you're solving

value comparison with type juggling