Ejemplo n.º 1
0
 /**
  * Returns the backtrace trace details for a given offset
  *
  * @param integer $offset The offset of the trace
  * @param integer $wrapFlag The offset wrapping mode to use
  * @return array A list of the backtrace details at the given offset
  */
 public function getTraceByOffset($offset, $wrapFlag = \r8\num\OFFSET_RESTRICT)
 {
     $trace = $this->getTrace();
     if (count($trace) <= 0) {
         return NULL;
     }
     return \r8\Backtrace\Event::from(\r8\ary\offset($trace, $offset, $wrapFlag));
 }
Ejemplo n.º 2
0
 public function testOffset()
 {
     $ary = range(1, 15);
     $this->assertEquals(1, \r8\ary\offset($ary, 0));
     $this->assertEquals(15, \r8\ary\offset($ary, -1));
     $this->assertEquals(8, \r8\ary\offset($ary, 7));
 }
Ejemplo n.º 3
0
/**
 * Get the position of the nth needle in the haystack
 *
 * @param String $needle The string being searched for
 * @param String $haystack The string that you trying to find the needle in
 * @param Boolean $ignoreCase Whether the search should be case sensitive
 * @param Integer $wrapFlag How to handle offset wrapping when the offset, per {@link calcWrapFlag()}.
 * @return Integer Returns the offsets, from 0, of the needle in the haystack
 */
function npos($needle, $haystack, $offset, $ignoreCase = TRUE, $wrapFlag = \r8\ary\OFFSET_RESTRICT)
{
    $found = \r8\str\offsets($needle, $haystack, $ignoreCase);
    if (count($found) <= 0) {
        return FALSE;
    } else {
        return \r8\ary\offset($found, $offset, $wrapFlag);
    }
}
Ejemplo n.º 4
0
 /**
  * Returns a specific argument from this event
  *
  * @param Integer $offset The offset of the argument to return
  * @return Mixed
  */
 public function getArg($offset)
 {
     try {
         return \r8\ary\offset($this->getArgs(), $offset);
     } catch (\r8\Exception\Index $err) {
         return NULL;
     }
 }
Ejemplo n.º 5
0
 /**
  * Returns a specific event from this backtrace
  *
  * @param Integer $offset The offset of the event to fetch
  * @return \r8\Backtrace\Event
  */
 public function getEvent($offset)
 {
     return \r8\ary\offset($this->events, $offset);
 }