Return link pages instead of displaying them

<?php
    $defaults = array(
        'before'           => '<p>' . __( 'Pages:' ),
        'after'            => '</p>',
        'link_before'      => '',
        'link_after'       => '',
        'next_or_number'   => 'number',
        'separator'        => ' ',
        'nextpagelink'     => __( 'Next page' ),
        'previouspagelink' => __( 'Previous page' ),
        'pagelink'         => '%',
        'echo'             => 0
    );
 ?>

You have to set the echo parameter to 0. Check the docs

error code: 523