phpjs
Version:
97 lines (75 loc) • 2.8 kB
HTML
<!-- Generated by Rakefile:build -->
<strong>
<a href="http://an3m1.com/" rel="nofollow">????? ???????</a>
</strong>
on 2012-04-11 15:46:10 <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>
Itsacon
</strong>
on 2010-01-22 09:39:34 <br />
Ah, much better.
Strange, the problem cropped up when I updated my php.js, so maybe the version in the lib-build-tool is also still using the older one.
Thanks for the quick response (and the explanation)
<hr />
<strong>
<a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a>
</strong>
on 2010-01-22 02:44:43 <br />
@Itsacon, Thanks...The fix had already been applied a while ago (indexOf is supported in Firefox, etc., so that was the reason for the mistake). Anyhow, you can see the current version if you click "raw js source". Btw, the reason for the rest of the "convoluted" code is to support tracking of the array "pointer" (as in PHP). end() moves the pointer to the end. We use the "this.php_js" global (or object property in the namespaced version) to hold this information. See next(), prev(), etc. for some other functions which keep track of the array's pointer.
@Kevin, what will it take to get the site to update to reflect the latest git updates? It seems this fix was made a month ago...Thanks...
<hr />
<strong>
Itsacon
</strong>
on 2010-01-21 16:09:39 <br />
The current version fails hard in Internet Explorer (both versions 7 and 8)
indexOf() is a method of the String object, not of the Array object, so calling it on pointers (an Array()) isn't valid javascript code.
I've reverted to the older version, which was less convoluted and worked fine:
<pre><code>function end(array)
{
var last_elm,key;
if(array.constructor==Array)
{
last_elm=array[(array.length-1)];
}
else
{
for(key in array)
{
last_elm=array[key];
}
}
return last_elm;
}</code></pre>
<hr />
<strong>
<a href="http://kevin.vanzonneveld.net" rel="nofollow">Kevin van Zonneveld</a>
</strong>
on 2008-06-16 00:21:26 <br />
@ J A R: Much better, thank you!
<hr />
<strong>
J A R
</strong>
on 2008-06-15 04:15:18 <br />
Doesn't .pop() return the last element from an array?
<pre><code>
function end ( array ) {
return array.pop();
}
</code></pre>
<hr />
<strong>
<a href="http://kevin.vanzonneveld.net" rel="nofollow">Kevin van Zonneveld</a>
</strong>
on 2008-01-09 17:27:39 <br />
@ Legaev Andrey: I sure did ;)
<hr />
<strong>
Legaev Andrey
</strong>
on 2008-01-09 17:09:00 <br />
Did you mean &quot;return last_elm&quot; ?
<hr />