/    Sign up×
Community /Pin to ProfileBookmark

Fatal Error: Cannot use isset() on the result of an expression

Hi,

I got this error:
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:xampphtdocstestrecord_add.php on line 133

What does it mean ?

The line is this:

[code]
if(isset($form_questions_required_labels[$required_current_count] && $required_current_count && $required_count_end))
[/code]

Context:

[code]
foreach($form_questions_labels as $value)
{
$required_current_count_match = false;
$text_box_current_count_match = false;
$text_area_current_count_match = false;
$radio_button_current_count_match = false;
$drop_down_current_count_match = false;

$current_value_matched = false;

//Check if current Question is a * REQUIRED Question or not.
//There are 7 required questions: $form_questions_required_labels = array().
$required_current_count = ‘0’; $required_count_end = ‘6’; $required_current_count_match = false;
if(isset($form_questions_required_labels[$required_current_count] && $required_current_count && $required_count_end))
{
while($value != $form_questions_required_labels[$required_current_count] || $required_current_count != $required_count_end)
{
if($value == “$form_questions_required_labels[$required_current_count]”)
{
$current_required_label_number = $required_current_count;
$next_required_label_number = $required_current_count++;
$required_current_count_match = true;
$required_current_count = $required_count_end;

$current_value_matched = true;
}
else
{
$required_current_count++;
}
}
}
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 14.2019 — isset() tests a variable (which can include an array element), but you have as its argument a variable _plus_ a comparison operator and something else. You probably just want the parentheses shifted a bit:
<i>
</i>if(isset($form_questions_required_labels[$required_current_count]) &amp;&amp; $required_current_count &amp;&amp; $required_count_end)
×

Success!

Help @developer_web spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...