<?php namespace Rubicon\Collection; require dirname(__DIR__) . '/vendor/autoload.php'; $objects = new MutableCollection(); $objects->add('1'); $objects->add(1); $objects->replace(1, 2, false); print_r($objects->get());
<?php namespace Rubicon\Collection; require dirname(__DIR__) . '/vendor/autoload.php'; $collection = new MutableCollection(['string', 123, new \stdClass()]); $callable = new Constraint\IsTypeOf('object'); print_r($result = $collection->filter($callable));