# shiftcontroller/4.9.66/hc3/lib/packedarray.php

ShiftController Employee Shift Scheduling, version 4.9.66. 32 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/hc3/lib/packedarray.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/raw/hc3/lib/packedarray.php
- Modified: 2018-04-25T09:41:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/hc3/lib/packedarray.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class HC3_Lib_PackedArray implements ArrayAccess
{
	private $container = '';

	public function __construct( $size, $fill = 0 )
	{
		$this->container = str_repeat( chr($fill), $size );
	}

	public function offsetSet( $i, $v )
	{
		$this->container[$i] = chr( $v & 0xff ); // store value $v into $x[$i]
	}

	public function offsetExists( $i )
	{
		return TRUE;
		// return isset($this->container[$offset]);
	}

	public function offsetUnset( $i )
	{
		// unset($this->container[$offset]);
	}

	public function offsetGet( $i )
	{
		$return = ord( $this->container[$i] ); // get value $v from $x[$i]
		return $return;
	}
}
```
