Why can't I assign a variable inside isset? - php

Recently, I tried to be complex and assign a variable inside the isset function. I tried to do it like this:

if(isset($accountid =$_POST['Recipient']))
{
    // my code here ... 
} 

However, when I do this, I get an error

syntax error, unexpected '=', expecting ',' or ')'

Here is the documentation for isset if you want to reference it in your answer. bool isset ( mixed $var [, mixed $... ] )

This is not the most difficult transaction, but I would be interested to know why I can not do something in this direction!

+4
source share
3 answers

issetis a language construct, not a true function. It is mentioned in the docs:

Warning

isset() , - . , , () .

+6

, . , php.net isset().

http://php.net/manual/en/function.isset.php

isset() , - .

+1

, , .

0

Source: https://habr.com/ru/post/1548636/


All Articles