UNPKG

phpjs

Version:

php.js offers community built php functions in javascript

26 lines (19 loc) 1.62 kB
<!-- Generated by Rakefile:build --> <strong> <a href="http://an3m1.com/" rel="nofollow">????? ????</a> </strong> on 2012-04-04 14:36:34 <br /> If I might —perhaps you should consider adding a few images. I don’t mean to disrespect what you’ve said ; its very enlightening, indeed. However, I think would respond to it more positively if they could be something tangible to your ideas <hr /> <strong> <a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a> </strong> on 2012-03-02 02:37:56 <br /> @Glen: Yes, you are right; as per the notes, this is only really useful for the likes of Firefox extensions (not sure if Mozilla will or has abandoned sorting order). See the array() function source code for the beginnings of an API to allow a more reliable though somewhat uglier syntax like: array({key1:value1}, {key2:value2}). Feel free to implement this using that syntax! <hr /> <strong> Glen </strong> on 2012-03-01 21:12:14 <br /> This routine is strange in that it reads as if it should accept an array yet it returns an object. JS does not guarantee maintaining the order of elements of an object, and while it may work on some browsers, it should not be relied on. So it is pointless to sort an object. This routine should take an array and return an array ... and contain comments to indicate to the user that they shouldn't attempt to create a sorted object in JS. It works well in the PHP world, but unfortunately it doesn't translate directly to JS. In JS, you sometimes need to create an object store and an array store (to indicate order) to get direct access and order. <hr />