Re: [PHP] Function returning but continues execution

# david@xxxxxxxxxxxxxxx / 2007-01-22 15:31:55 +0000:
Roman Neuhauser wrote:
# david@xxxxxxxxxxxxxxx / 2007-01-22 15:17:16 +0000:
The key is that the function is returning false but it continues to
execute! If I stick in an exit; after the in_array() check at point #4,
this doesn't happen. There are no other places where this function is
called, and it is only called once.

Strangely, if I force the values of the 2 variables
before the in_array() check:

$_SESSION['user']['friends'] = array(0 => 3);
$friend['user_id'] = 3;

it reacts as expected - the function returns false and no further code
is executed.

Anyone have any suggestions?

You have a bug somewhere in your code.

I can't see how there is a bug in my code if when I echo the contents of
the 2 variables, they are exactly the same as when I set them manually.
Except in the former the function "continues executing" but in the
latter it doesn't.

I also cannot see how the function can return false and execute the SQl
query when it is only called once.

You have presented no proof that there's a bug in the PHP. What you
have presented looks like you have a bug, and the function gets called
more than once. Have you used a debugger? See

How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE.

Relevant Pages

  • buffer allocation bug in DBD::mysql leading to failures (was: DBD::mysql mysql_server_prepare=1 cach
    ... I now believe this is simply a bug in the prepared ... blackhole for DBD::mysql bug reports nowadays, ... provided by Wouter. ... The first execute works, and fetchrow_arrayref returns the result row. ...
  • Re: execute() vs executeUpdate() on a prepared statement
    ... The issue was that a cursor may error out if the back-end function is too ... execute may attempt to create a cursor. ... the 2005 driver is NOT using the same code ... See bug FDBK44661. ...
  • Re: ODBC app in Ruby - I dont believe it.
    ... My mistake on the gem commands. ... I copied the libmySQL.dll and the simple.rb script now ... script produces an error that seems to indicate a bug in the either ruby ...
  • Re: USB SCanners
    ... > As root, execute ... > Unfortunately, until a bug is fixed, you will have to do this each time you ... > executing scanimage as you did. ... I've only just started to try to get sane working for my scanner. ...
  • Re: closing a macro completely upon connect
    ... fixed the bug associated with SET KEY and terminal mode, ... invoking a macro as a kverb works. ... interactively from the command prompt. ... A macro mapped to a key will not execute if you enter CONNECT mode ...