Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created March 27, 2013 13:20
Show Gist options
  • Select an option

  • Save assertchris/5254105 to your computer and use it in GitHub Desktop.

Select an option

Save assertchris/5254105 to your computer and use it in GitHub Desktop.
<?php
class SplNotReallyFixedArray extends SplFixedArray
{
public function offsetSet($index, $value)
{
if ($index > $this->getSize() - 1)
{
$this->setSize($index + 1);
}
parent::offsetSet($index, $value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment