Print object in template_preprocess_page In template_preprocess_page() in my MYTHEME.theme file, I'm trying to validate if node has specific value.
When I dpm($variables) I get:

Array
(
    [node] =&gt; stdClass Object
    (
        [__CLASS__] =&gt; Drupal\node\Entity\Node
        [in_preview] =&gt; 
        [values] =&gt; Array
        (
            [vid] =&gt; Array
                (
                    [x-default] =&gt; 2
                )
...
    [page] =&gt; Array
    (
...


When I dpm($variables['node']) I get:

stdClass Object
(
    [__CLASS__] =&gt; Drupal\node\Entity\Node
    [in_preview] =&gt; 
    [values] =&gt; Array
        (
...


When I dpm($variables['node']-&gt;values) I get empty result.

Why so?
you can use :

dpm($variables['node']->toArray());