This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/stubs/internal/Accessible.php
2019-02-15 13:44:52 +08:00

55 lines
1.0 KiB
PHP

<?php
namespace Arma\Internal;
/**
* Interface for objects whose elements can be accessed.
*
* @package Arma\Internal
*/
interface Accessible
{
/**
* Get number of rows.
*
* @return int
*/
function nRows();
/**
* Get number of columns.
*
* @return int
*/
function nCols();
/**
* Get number of elements.
*
* @return int
*/
function nElem();
/**
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
* and j-th column.
*
* @param int $i
* @param int $j[optional]
* @return mixed
*/
function &__invoke($i, $j);
/**
* If $j is not specified, access the n-th element. Otherwise, access the element stored at the i-th row
* and j-th column.
*
* Without a bounds check. Not recommended for use unless your code has been thoroughly debugged.
*
* @param int $i
* @param int $j[optional]
* @return mixed
*/
function &at($i, $j);
}