Skip to content

Instantly share code, notes, and snippets.

View bshaffer's full-sized avatar

Brent Shaffer bshaffer

View GitHub Profile
@bshaffer
bshaffer / gist:413344
Created May 25, 2010 16:19 — forked from anonymous/gist:234678
PHP Object Oriented Array class
<?php
class A implements ArrayAccess, Iterator, Countable
{
public function __construct($arr) {
$this->arr = is_array($arr) ? $arr : func_get_args();
}
public function __toString() {
return print_r($this->arr, true);
}
@bshaffer
bshaffer / sfValidatorCCExpirationDate.php
Created April 29, 2010 18:25 — forked from anonymous/gist:179274
sfValidatorCCExpirationDate.php
<?php
/**
* sfValidatorCCExpirationDate validates the expiration date for a credit card.
*
* @author Brent Shaffer <bshafs@gmail.com>
*/
class sfValidatorCCExpirationDate extends sfValidatorDate
{