<?php
$stdin = fopen('php://stdin', 'r');
function getResponse($socet) {
	$response = '';
	while(($str = fgets($socet)) !== false) {
    	$response .= $str;
	}
	return $response;
}
function getData($response) {
    $data = array();
    $matches = array();
    $count = preg_match_all('/(\d{3,})(\s|-)(.*)/', $response, $matches, PREG_PATTERN_ORDER);
    for($i = 0; $i < $count; $i++) {
        $data[$i]['code'] = $matches[1][$i];
        $data[$i]['message'] = $matches[3][$i];
    }
    return $data;
}
var_dump(getData(getResponse($stdin)));