3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object)[ "id" => 54, "type" => 5, "content" => [ ["id" => 99, "type" => 516], ["id" => 88, "type" => 464], ["id" => 41, "type" => 845] ] ], (object)[ "id" => 54, "type" => 55, "content" => [ ["id" => 54, "type" => 578], ["id" => 54, "type" => 354], ["id" => 75, "type" => 458] ] ], (object)[ "id" => 65, "type" => 59, "content" => [ ["id" => 87, "type" => 5454], ["id" => 65, "type" => 245], ["id" => 65, "type" => 24525] ] ] ]; $id = 54; $type = 55; foreach ($array as $row) { if ($row->id == $id && $row->type == $type) { $ref = &$row->content; } } $ref = 'this has been changed'; var_export($array);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
158.74 ms | 2123 KiB | 9 Q