Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

What is printed?

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 12:57

Hello Dave?

Name: Anonymous 2008-11-04 12:58

Name: Anonymous 2008-11-04 13:16

PingPong

Name: Anonymous 2008-11-04 13:18

>>3
HOLY SHIT

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 15:43

>>8
YHBT!

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:16

>>10
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 7:01

>>13
How do you figure?

Name: Anonymous 2008-11-05 8:51

>>14
Just fine, thank you.

Name: Anonymous 2008-11-05 9:09

>>12
Of course the ass is backwards. Is your ass on the front?

Name: Anonymous 2008-11-05 9:35

>>14
Terrible!

Name: ​​​​​​​​​​ 2010-10-22 4:44

Name: Anonymous 2011-02-02 23:22

Name: Anonymous 2011-02-04 17:12

Name: Anonymous 2011-02-18 13:35

check my doubles
Don't change these.
Name: Email:
Entire Thread Thread List