phpjs
Version:
30 lines (24 loc) • 1.04 kB
HTML
<!-- Generated by Rakefile:build -->
<strong>
<a href="http://kevin.vanzonneveld.net" rel="nofollow">Kevin van Zonneveld</a>
</strong>
on 2009-01-08 10:15:00 <br />
@ Brett Zamir: Very well!
<hr />
<strong>
<a href="http://bahai-library.com" rel="nofollow">Brett Zamir</a>
</strong>
on 2009-01-07 15:38:36 <br />
Just to keep the relevant items together, I'm resubmitting list() here in case anyone looking at extract() is interested (I fully understand not porting it to the main project given its not following PHP-style (getting the array in by the last argument rather than by assignment)):
<pre><code>
// Only works in global context and deviates (by necessity) from PHP version
list('drink', 'color', 'power', ['coffee', 'brown', 'caffeine']);
function list () {
var arr = arguments[arguments.length-1]
for (var i=0; i &lt; arr.length; i++) {
this[arguments[i]] = arr[i];
}
}
alert(drink +' is '+color+' and '+power +' makes it special.\n'); // Example from PHP manual
</code></pre>
<hr />