コード例 #1
0
function convert_to_null($input)
{
    if (convert_to_bool($input) === false || $input === 'null') {
        return null;
    }
    return $input;
}
コード例 #2
0
function convert_to_null($input)
{
    //ensure the string 'null' is converted to null
    if ($input === 'null') {
        $input = null;
    }
    return convert_to_bool($input) ? $input : null;
}
コード例 #3
0
 /**
  * @dataProvider boolTestData
  */
 public function testConvertToBool($value, $expected)
 {
     $this->assertSame($expected, convert_to_bool($value));
 }