title: Unknown property (w)
body: <p>I'm getting this error on my nginx hosted server:</p>
  
  <pre><code> Fatal error: TimeElapsedString(): Unknown property (w) in /var/www/script/system/framework.engine.php on line 51 
  </code></pre>
  
  <p>TimeElapsedString:</p>
  
  <pre><code>function TimeElapsedString($datetime, $full = false)
  {
      date_default_timezone_set('UTC');
  
      $now = new DateTime;
      $ago = new DateTime($datetime);
      $diff = $now-&gt;diff($ago);
  
      $diff-&gt;w = floor($diff-&gt;d / 7); // LINE 51
      $diff-&gt;d -= $diff-&gt;w * 7;
  
      $string = array
      (
          'y' =&gt; 'year',
          'm' =&gt; 'month',
          'w' =&gt; 'week',
          'd' =&gt; 'day',
          'h' =&gt; 'hour',
          'i' =&gt; 'minute',
          's' =&gt; 'second',
      );
  
      foreach ($string as $k =&gt; &amp;$v)
      {
          if ($diff-&gt;$k)
          {
              $v = $diff-&gt;$k . ' ' . $v . ($diff-&gt;$k &gt; 1 ? 's' : '');
          }
          else
          {
              unset($string[$k]);
          }
      }
  
      if (!$full) $string = array_slice($string, 0, 1);
      return $string ? implode(', ', $string) . ' ago' : 'just now';
  }
  </code></pre>
  
  <p>Everything just working perfect on the localhost (wamp)
  the php version in the hosted server is 5.3.3 so I ca'nt really see that problem.
  also I used this function in another nginx server and its also working without any problem.</p>
  
  <p>the function is from this answer : <a href="https://stackoverflow.com/questions/1416697/converting-timestamp-to-time-ago-in-php-e-g-1-day-ago-2-days-ago">Converting timestamp to time ago in PHP e.g 1 day ago, 2 days ago...</a></p>