wp_die // or `die` works in a non-wordpress context wp_die( '<xmp>$somevar: '. print_r( $somevar, true ) .'</xmp>' );