is() 공개 메소드

Compare value by key with somethig
public is ( string $key, mixed $compareWith = true, boolean $strictMode = false ) : boolean
$key string
$compareWith mixed
$strictMode boolean
리턴 boolean
예제 #1
0
파일: dataTest.php 프로젝트: jbzoo/data
 public function testIs()
 {
     $data = new Data(array('key' => 1, 'nested' => array('key' => null)));
     isTrue($data->is('key'));
     isTrue($data->is('key', '1'));
     isTrue($data->is('key', 1));
     isTrue($data->is('key', true));
     isTrue($data->is('key', 1, true));
     isTrue($data->is('nested.key', null, true));
     isTrue($data->is('nested.key', false));
     isFalse($data->is('key', '1', true));
     isFalse($data->is('key', 1.0, true));
     isFalse($data->is('nested.key', '1', true));
     isFalse($data->is('nested.key', false, true));
 }