Name:
Anonymous
2008-11-04 12:43
<?php
$foo = array('0' => 'Hello',
'1' => 'Dave');
$zot = array('0' => 'Ping',
'1' => 'Pong');
foreach ($foo as $bar) {
foreach ($zot as $bar) {
// ...
}
echo $bar;
}
?>
Name:
Anonymous
2008-11-04 14:07
HelloDave you dumb shits.
Name:
Anonymous
2008-11-04 14:11
Nothing is printed. Two things are echoed.
Name:
Anonymous
2008-11-04 15:20
it outputs PongPong.
try using a real language:
#!/usr/bin/env perl
@foo = qw(Hello Dave);
@zot = qw(Ping Pong);
for $bar (@foo) {
for $bar (@zot) {
# ...
}
print $bar;
}
Name:
Anonymous
2008-11-04 18:14
>>2-3,6
PHP doesn't have block-level scoping. It only has functional, global, and superglobal.
Name:
Anonymous
2008-11-04 22:50
>>10
it also has ass-backwards
foreach syntax.
Name:
Anonymous
2008-11-05 0:29
foreach (dick => butt) {
butt.put(dick);
}
Name:
Anonymous
2008-11-05 9:09
>>12
Of course the ass is backwards. Is your ass on the front?