summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Duedal <hd@onlinecity.dk>2011-09-06 17:19:37 +0200
committerHans Duedal <hd@onlinecity.dk>2011-09-06 17:19:37 +0200
commit8ef2d23b838d422ce34f93268d5e65a67cd2a635 (patch)
treea8cd979311274a94360418c3a68ba6bdeace5f87
parent905ba80ab8f0e7410a5699c9c205da0ebc72b27c (diff)
downloadphp-smpp-8ef2d23b838d422ce34f93268d5e65a67cd2a635.zip
php-smpp-8ef2d23b838d422ce34f93268d5e65a67cd2a635.tar.gz
php-smpp-8ef2d23b838d422ce34f93268d5e65a67cd2a635.tar.bz2
Improved compatibility with PHP 5.2
-rw-r--r--smppclient.class.php4
-rw-r--r--sockettransport.class.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/smppclient.class.php b/smppclient.class.php
index 1b7fc11..f7bc954 100644
--- a/smppclient.class.php
+++ b/smppclient.class.php
@@ -83,7 +83,7 @@ class SmppClient
$this->pdu_queue=array();
$this->transport = $transport;
- $this->debugHandler = $debugHandler ?: 'error_log';
+ $this->debugHandler = $debugHandler ? $debugHandler : 'error_log';
$this->mode = null;
}
@@ -1148,6 +1148,6 @@ class SmppTag
*/
public function getBinary()
{
- return pack('nn'.$this->type, $this->id, ($this->length ?: strlen($this->value)), $this->value);
+ return pack('nn'.$this->type, $this->id, ($this->length ? $this->length : strlen($this->value)), $this->value);
}
} \ No newline at end of file
diff --git a/sockettransport.class.php b/sockettransport.class.php
index d6bce99..a2773de 100644
--- a/sockettransport.class.php
+++ b/sockettransport.class.php
@@ -37,7 +37,7 @@ class SocketTransport
public function __construct(array $hosts,$ports,$persist=false,$debugHandler=null)
{
$this->debug = self::$defaultDebug;
- $this->debugHandler = $debugHandler ?: 'error_log';
+ $this->debugHandler = $debugHandler ? $debugHandler : 'error_log';
// Deal with optional port
$h = array();