How to get language code of a field in a node I have a requirement where in hook_node_insert I need to get the language code of a field

What I have tried is

$langcode = $node-&gt;{$field_name}-&gt;langcode


But this returns null. Any suggestions?

And is it possible that different fields in a node have different langcode?
You can use getLangcode
Try with:

$node-&gt;{$field_name}-&gt;getLangcode()