Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7921631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:39:24+00:00 2026-06-03T16:39:24+00:00

I am getting following error with PHP 5.1.6: Fatal error: Declaration of Tl1Telnet::ExecuteCommand() must

  • 0

I am getting following error with PHP 5.1.6:

Fatal error: Declaration of Tl1Telnet::ExecuteCommand() must be compatible with that of telnet::ExecuteCommand()

ExecuteCommand is implemented correctly defined in interface.

interface telnet {

public function DoTelnet();
public function ExecuteCommand($command,$fh);
}


class Tl1Telnet implements telnet{
public function ExecuteCommand($command,$fh = NULL){
fputs($this->socketResource,$command);
sleep(2);
$tl1_string = fread($this->socketResource,30000);

if($fh != NULL){
fwrite( $fh, $tl1_string );
}

return $tl1_string;
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:39:27+00:00Added an answer on June 3, 2026 at 4:39 pm

    try removing $fh = NULL from the implementation. that may be causing the problem. as the error clearly states Declaration of Tl1Telnet::ExecuteCommand() must be compatible with that of telnet::ExecuteCommand()

    i am not sure for what reason the error is being generated. you should probably upgrade your PHP version if you can, if not then try using the workaround demonstrated below.

    Example.

    in your interface set the argument to empty.

    interface telnet {
        public function DoTelnet();
        public function ExecuteCommand();
    }
    

    and in the derived class.

    public function ExecuteCommand() {
        $numberOfArgs = func_num_args();
        if($numberOfArgs <= 0) {
            throw new Exception('Missing Argument 1');
        }
        $command = func_get_arg(0);
        $fh = ($numberOfArgs == 2) ? func_get_arg(1) : NULL;
    }
    

    if the first argument is empty it will throw an error. if not it will fetch the first argument and assign it to $command variable. and if it finds the second argument then it will assign it to $fh variable if empty then assign the default value of NULL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little issue with Doctrine. Im getting the following error: PHP Fatal
I am getting the following PHP Fatal Error Fatal error: Uncaught exception 'Exception' with
I'm using PHP 5.2 and getting the following error message: Fatal error: Call to
I am getting the following error when i run a php code. Fatal error:
I am getting the following error: PHP Fatal error: Call to undefined function updateRecord()
I'm getting the following error in PHP : Fatal error: Uncaught exception 'PDOException' with
I'm getting the following error while running Snappy, a PHP binding for WKHTMLTOPDF: Fatal
New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError
I am getting the following error on line 17 Fatal error: Call to a
I'm getting the following error message: Warning: file_get_contents( http://localhost/sample_pie.php ) [function.file-get-contents]: failed to open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.