Slashdot Mirror


User: onerob

onerob's activity in the archive.

Stories
0
Comments
4
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 4

  1. Re:Take PHP outside web pages altogether. on March To Be Month of PHP Bugs · · Score: 1
    functionReturningAnObject()->field doesn't work

    This works fine in PHP 5.1.4:

    class TestClass {
    function TestClass()
    {
    $this->field = 1000;
    }
    }

    function returnAnObject()
    {
    $obj = new TestClass;
    return $obj;
    }

    echo returnAnObject()->field;
    - - - - - - - -

    Now, explain to me why it is that the last item in $a is incremented twice, while all the others are only incremented once?

    Sure (after some fiddling around). As you enter the second foreach loop, $b contains a reference to the last member of the array because that's how the previous foreach left things. Therefore, for each iteration, what you are saying is this: Make the last member of the array ($a[3] as referenced by $b) equal to the current member of the array, plus one.

    If $b added 1 to itself (as might be expected) then the value would end up being 9. What seems to be happening in the second loop is: $a[3] = $a[n] + 1, not $a[3] += 1

    I don't know if that behaviour is right or wrong in a formal sense.
  2. Re:So, PHP means ? on March To Be Month of PHP Bugs · · Score: 2, Informative

    Register Globals has been off by default for years.

    Please don't let us see the return of \'magic quotes\'

  3. Re:If this is true on North Korea Says It Has Conducted Nuclear Test · · Score: 1

    "Everyone in the civilized world knew that Iraq was bombed to stone age on Gulf war"

    Actually, this isn't true. WMD elements were being destroyed in the mid nineties by the U.N (who only found some of it after information was received from defectors).
    Foreign intelligence agencies (not simply U.S and U.K.) were telling their governments that Sadam had most likely NOT destroyed all the gear.

    Not that it was ever a really good idea to invade.

  4. Comodo? on Best of the Free Anti-virus Choices? · · Score: 1