Jump to content

Using New Keyword in PHP


abhishekphp6

Recommended Posts

I copy pasted the following php code

 

<?php

include('XMPPHP/XMPPHP/XMPP.php');

$conn = new XMPP('talk.google.com', 5222, '[email protected]', 'pappu617', 'xmpphp', 'gmail.com', printlog=False, $loglevel=LOGGING_INFO);

$conn->connect();

$conn->processUntil('session_start');

$conn->message('[email protected]', 'this is a test message');

$conn->disconnect();

?>

 

But it gives me error

 

Parse error: syntax error, unexpected '=' in /var/www/foo.php on line 3

 

Do I need to install something before using new?

 

I am using ubuntu linux 9.1.0 php 5.2.10-2ubuntu6.4

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/200794-using-new-keyword-in-php/
Share on other sites

Also, can you please download this library from here http://code.google.com/p/xmpphp/

 

and try to make this code work? for me it simply states that

 

Fatal error: Class 'XMPP' not found in /var/www/XY.php on line 99

 

I am pretty sure that I have included the path to XMPP.php correctly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.