gish Posted December 12, 2008 Share Posted December 12, 2008 hi I am having trouble with an if statement that I created in oo and I am wondering does anyone know if what I am doing is correct? this is the statement if ($correction_object->correction_checked() = 1){ this is the error i get Fatal error: Can't use method return value in write context public function correction_function () { // the if statement is for startup will skip correction if gobals // have not had the chance to obtain properties if ($_SESSION['$answer'] = ''){ random_function(); } else { correction_true_false ($_POST['form_value']); if ($correction_object->correction_checked() = 1){ // send it to the correction function random_function (); } else { //needs to return to last figures $_SESSION['$number1']; $_SESSION['$number2']; } } } public function correction_true_false ($correction_post){ if ($_SESSION['random-answer'] == $correction_post){ $this->correction_outcome = 1; } else { $this->correction_outcome = 0; } } Link to comment https://forums.phpfreaks.com/topic/136762-solved-fatal-error-cant-use-method-return-value-in-write-context/ Share on other sites More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 if ($correction_object->correction_checked() == 1){ Link to comment https://forums.phpfreaks.com/topic/136762-solved-fatal-error-cant-use-method-return-value-in-write-context/#findComment-714277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.