Jump to content

jmartinsen

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by jmartinsen

  1. Oh, you're absolutely right. I first thought that the @ ignored the error handler altogether, but it doesnt. It calls it, but just doesnt do anything with it. I did a supersimple test and it shows that the ternary operator was 4 times faster. With performance out of the picture any thoughts on using one over the other?
  2. Just setup a script that gets a code, checks it and echoes out the status of it. <?php /** * http://fastrak.com/track.php?code=ABCDEFGHIJ */ // get the CODE from the GET varaible $code = isset($_GET["code"]) ? $_GET["code"] : ""; // to whatever you need to do to check if that $code is valid // if its not valid return an 404 error // then get the status of that code $return = array( "status" => "get this status from the database or whatever", ); // and echo that out echo json_encode($return); ?>
  3. Hi all. What's the best practice with using the Ternary Operator vs. the Error Control Operator when setting a simple varaible? I doubt there is any performance issues? <?php $var = isset($_GET["var"]) ? $_GET["var"] : ""; $var = @$_GET["var"]; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.