we execute dynamic string IF condition in PHP eval() function but the answer is not assign in variable.
Please look below code :
$variable_1 = "if(3>4)";
$variable_1 = "1";
$variable_1 = "0";
$if_val = "$variable_1{ $return_if = $variable_2 } else { $return_if = $variable_3 }";
$final_if_ans = eval($if_val);
$if_valto see what you're actually running.$return_ifis not defined either.eval(), it can be a security risk and should be avoided at all costs!$if_val,$return_ifis not defined and also you've missed;in each condition which will also throw error.