Adding a comment in response to a youtube video using php-Collection of common programming errors

I want to post comment to response of some youtube video. I am using youtube data API in PHP can anyone provide me the PHP code for comments???

Here is the complete documentation of this API also about comments but the code provided is not working

$newComment = $yt->newCommentEntry();
$newComment->content = $yt->newContent()->setText('new comment');

// post the comment to the comments feed URL for the video
$commentFeedPostUrl = $videoEntry->getVideoCommentFeedUrl();
$updatedVideoEntry = $yt->insertEntry($newComment, $commentFeedPostUrl,
'Zend_Gdata_YouTube_CommentEntry');

I am not getting how to use the vedioEntry Object. cz there is no demonstration in documentation about this object. Can any one tell how it will work………….
Error

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 401 User authentication required.

User authentication required.

Error 401

' in C:\xampp\htdocs\youtube\Zend\Gdata\App.php:709 Stack trace: #0 C:\xampp\htdocs\youtube\Zend\Gdata.php(221): Zend_Gdata_App->performHttpRequest('POST', 'http://gdata.yo...', Array, '