Allowed memory size of 134217728 bytes exhausted (tried to allocate 81690624 bytes)


Allowed memory size of 134217728 bytes exhausted (tried to allocate 81690624 bytes)



I tried to find an answer to this question, but nothing helped me yet. I have a helper function


function a($id, $b = false)
{
$general = Feedbacks::join("bidders","bidders.id","=","feedbacks.bid_id")
->join("projects","bidders.project_id","=","projects.id")

->where([

"bidders.bidder_id" => $id,

"bidders.status" => 2,

"feedbacks.active" => 1,

"bidders.active" => 1,

"projects.active" => config("constant.project_done")
])

->orderBy("feedbacks.created_at","DESC");

print_r($general);die;

}



For Controller side, I am getting the $id and passing it in this function.


$id = Feedbacks::where('active',1)->get(['bid_id']);

$rate = "";

foreach ($id as $val) {

$rate = $val->bid_id;

}

$re = a($rate,true);



So, if I print the value of $id it returns correct, but when I try to print $generalthen it throws the error mentioned in this title. I don't know what is wrong in here. Can anyone please guide me?


$general





Obviously you throw too much data at PHP. Also do not use php functions for dumping and dying use function dd($variable). Try to limit the result set to 10 if you get memory exhaustion error.
– Kyslik
Jun 30 at 11:44


dd($variable)









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Extract Id from Twitch Clip URL

Why are these constructs (using ++) undefined behavior in C?

I'm Still Waiting (Diana Ross song)