Warum wird die Resource id#3 angezeigt, wenn die zwei array-Zeilen auskommentiert sind?

The resource id#3 is displayed because the two array lines are being treated as comments and are not being executed. Therefore, the resource id#3 is the result of the last executed statement in the code. To solve this issue, you can uncomment the two array lines or remove them entirely from the code.

<?php
// Uncomment or remove the following two array lines to prevent the resource id#3 from being displayed
//$array1 = array(1, 2, 3);
//$array2 = array('a', 'b', 'c');

$result = mysqli_query($connection, "SELECT * FROM table");
echo mysqli_fetch_field_direct($result, 0)->name;
?>