How to check if current page is a parent item or child item in a given menu

I typically use something like:

$submenu = wp_list_pages(
    array(
        'child_of' => $post->ID,
        'echo'     => false,
    )
);

if ( $submenu )
    printf(
        '<ul class="submenu">%s</ul>',
        $submenu
    );

$submenu will evaluate false (empty) if there are no children for the current page.

error code: 523