3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dst = 'a=b'; // $dst has no = leading or trailing or missing if (!in_array(strpos($dst, '='), [0, false, strlen($dst) - 1])) { print $dst; } if (str_contains($dst, '=') && !str_starts_with($dst, '=') && !str_ends_with($dst, '=')) { print $dst; }
Output for 8.2.31 - 8.2.33, 8.3.0 - 8.3.33, 8.4.1 - 8.4.25, 8.5.0 - 8.5.10
a=ba=b

preferences:
58.07 ms | 784 KiB | 4 Q