<?php
/*==============================================================================
 * Makes a cURL call to get page3.php content.
 * With line 11, execution stops in debug mode
  ==============================================================================*/
$answer = "";

try {
    $ch = curl_init("http://test1.mco/page3.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: XDEBUG_SESSION=netbeans-xdebug')); 
    
    $answer = curl_exec($ch);
    if ($answer === false) throw new Exception("curl_exec returns FALSE - curlError=".curl_error($ch));
} catch (Throwable $ex) {
    $answer  = 'Exception '.$ex->getCode().' message='.$ex->getMessage();
}
?>
<?=$answer?>