-2

Error:

Parse error: syntax error, unexpected T_STRING in ...Ping.php on line 3

In code:

<?php

namespace JJG; // line 3

class Ping {

  private $host;
  private $ttl;
//...
}

I expect the class will work fine, as provided https://github.com/geerlingguy/Ping

But the actual output is:

Parse error: syntax error, unexpected T_STRING in ...Ping.php on line 3

2
  • You seem to have removed the file header comment from the Ping.php file (the namespace JJG; should be line 24). What else have you changed? Commented Jul 24, 2019 at 6:57
  • I remove all exclude code above. Just becouse there is error. Commented Jul 24, 2019 at 6:59

1 Answer 1

-1

OK, I take it.

On this server PHP Version can be only 5.2.5, and seems like there is no full support of namespaces in it yet.

Sign up to request clarification or add additional context in comments.

1 Comment

The namespaces where introduced in PHP 5.3. Which is dead and buried since years ago. Upgrade to PHP 7.2 or newer. The older versions are not maintained any more.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.