3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); $b = []; // original result var_dump(!trim(((string)($b['b'] ?? '')))); // applied change to replace above leading to different result var_dump(trim(((string)($b['b'] ?? ''))) !== ''); // replacement with same result would be this, // but it's not clear if the original check has // been ment to be that kind of check and was // obsured away. var_dump(trim(((string)($b['b'] ?? ''))) === '');

preferences:
18.96 ms | 484 KiB | 6 Q