Add a field whose value is calculated using raw PHP; specifically $value = 'foo';
(The recommendation is you write your PHP in a module of your own, and then call that method from the UI - for security and version control reasons).
Note: value is only calculated when nodes are saved (i.e. will initially be empty for existing content).
D8 status; alpha but working.