Skip navigation.
Home

Add new comment

Hmm... Very strange piece o

Hmm... Very strange piece of code..

<?php
$magedit = "";
// ...
if ( $magdit == null )
{
    $magdit = "nee";
}
?>

This is a subtle WTF.. This code only works because ( "" == NULL ) which in my eyes is a WTF in PHP. "" == 0 == NULL ... Riiiight..

And why oh why is $access first put into $variablelist which is then put into an array $arraytest via an eval (!!) before finally being compared to $cyfer via a foreach...?! Why not just go <?php ( $magdit == $access ) ? 'ja' : 'nee' ; ?> ?!


Even better.. Just use the very conveniently built in boolean logic ... :-P

Reply




*

  • Web and e-mail addresses are automatically converted into links.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <p> <br /> <br>