/** * 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)); }
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)); }
/** * 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); } }
/** * 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; } }
/** * 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); }