示例#1
0
 function array_some(array $set, Closure $callback)
 {
     return Hash::some($set, $callback);
 }
示例#2
0
 /**
  * Test that some() returns true if one value matches the callback condition.
  */
 public function testSome()
 {
     $this->assertTrue(Hash::some(array(123, 'abc', true, null), function ($value, $key) {
         return is_string($value);
     }));
     $this->assertFalse(Hash::some(array(123, true, null), function ($value, $key) {
         return is_string($value);
     }));
 }