UNPKG

phpjs

Version:

php.js offers community built php functions in javascript

34 lines (25 loc) 929 B
<!-- Generated by Rakefile:build --> <strong> <a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a> </strong> on 2012-06-21 21:01:12 <br /> @Mike: Are you talking about this example? <pre><code>$array1 = {'a' : 'green', 0:'red', 1: 'blue'}; $array2 = {'b' : 'green', 0:'yellow', 1:'red'}; $array3 = ['green', 'red']; $result = array_intersect($array1, $array2, $array3); </code></pre> What do you get if you add this to iterate over the properties? <pre><code> for (var i in $result) { alert(i+'::'+$result[i]) }</code></pre> What browser are you using? I am seeing the alert() in the code above run twice with the given example as it should--i.e., it is not empty. <hr /> <strong> Mike </strong> on 2012-06-18 15:25:11 <br /> I found bug with count of parameters for this function. So if we set over than 2 arguments - function returns empty object. You can test own example with colors on this page. <hr />