How about:


  echo "swap: ".$enc."\n";

// swap 1st and 2nd half of string
  $len= (int)strlen($enc)/2;

  echo "swp2: ".$enc."\n";

  echo "end\n";

Your /2 system wont' work when strlen is an odd number.


-----Original Message-----
From: Jens Kisters [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 19 September 2001 2:43 AM
Subject: [PHP] when logic fails, PHP randomly skips execution of lines

Hello everbody,

I have noticed something quite strange,
i have a piece of code that looks like, i removed some of it to make it

there are no statements in the code that would cause the termination of the
method before reaching the last line, no return, die or whatever.

  echo "\nBegin\n";

/* some code that builds a string of a few hundred bytes*/

/* a loop that ads ads numbers to the ascii vals of those string named $enc

/* a loop that swaps all the neighboring chars in the string */

  echo "swap: ".$enc."\n";

// swap 1st and 2nd half of string

  echo "swp2: ".$enc."\n";

  echo "end\n";


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to