Weird: Variables keep unsetting themselves
<p>For some reason, I cannot access <code>$phone_number</code> within the if block - outside of it works just fine. Please help: code below. Thank you!</p>

<pre><code>protected function _parse_message($message, $phone_number){

    require_once('coupon-classes.php');

    //If there is the need for a coupon, let's make a coupon!
    if(preg_match('/{!cpn}/', $message)){

        $coupon = new pre_coupon;
        $new_coupon = $coupon-&gt;create();

        $coupon-&gt;save($new_coupon, $phone_number);

        $message = preg_replace('/{!cpn}/', $new_coupon, $message);
        //unset($coupon);
    }

    return $message;
}

function parse($message, $phone_number=''){
    return $this-&gt;_parse_message($message, $phone_number);
}
</code></pre>

<p>I used  <code>update_option('api_sms', get_defined_vars());</code> to trace this (I'm working in Wordpress)</p>

<p>Inside the if statement, after $message= $preg_replace.. this is what I get:</p>

<pre><code>  Array
    (
    [message] =&gt; Here is a coupon FF5CB5
    [phone_number] =&gt; 
    [coupon] =&gt; pre_coupon Object
    (
        [client_id:private] =&gt; 1
    )

     [new_coupon] =&gt; FF5CB5
    )
</code></pre>
