Among $_REQUEST, $_GET and $_POST which one is the fastest?

后端 未结 15 2477
小鲜肉
小鲜肉 2020-11-22 05:04

Which of these code will be faster?

$temp = $_REQUEST[\'s\'];

or

if (isset($_GET[\'s\'])) {
  $temp = $_GET[\'s\'];
}
else          


        
15条回答
  •  无人共我
    2020-11-22 05:36

    if (isset($_GET['s'])) {
      $temp = $_GET['s'];
    }
    else {
      $temp = $_POST['s'];
    }
    

    Use that because it is safer and it won't make noticeable speed difference

提交回复
热议问题