3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $changes = ['a', 'b', 'password']; $excludeFields = [ 'password' ]; var_dump(count(array_intersect($changedFields, $excludeFields)) !== 0);
based on IhhNs
Output for 7.3.0beta3 - 7.3.0rc3
Notice: Undefined variable: changedFields in /in/TTv94 on line 10 Warning: array_intersect(): Expected parameter 1 to be an array, null given in /in/TTv94 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/TTv94 on line 10 bool(false)
Output for 7.2.0 - 7.3.0beta2
Notice: Undefined variable: changedFields in /in/TTv94 on line 10 Warning: array_intersect(): Argument #1 is not an array in /in/TTv94 on line 10 Warning: count(): Parameter must be an array or an object that implements Countable in /in/TTv94 on line 10 bool(false)
Output for 5.6.38 - 7.1.23
Notice: Undefined variable: changedFields in /in/TTv94 on line 10 Warning: array_intersect(): Argument #1 is not an array in /in/TTv94 on line 10 bool(false)