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

后端 未结 15 2256
小鲜肉
小鲜肉 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:49

    I would use the second method as it is more explicit. Otherwise you don't know where the variables are coming from.

    Why do you need to check both GET and POST anyway? Surely using one or the other only makes more sense.

提交回复
热议问题