PHPSA\CompiledExpression::fromZvalValue PHP Method

fromZvalValue() public static method

If we don't know $type but know $value
public static fromZvalValue ( $value ) : CompiledExpression
$value
return CompiledExpression
    public static function fromZvalValue($value)
    {
        return new CompiledExpression(CompilerTypes::getTypeByValue($value), $value);
    }

Usage Example

Example #1
0
 public function testFromZvalNull()
 {
     $result = CompiledExpression::fromZvalValue(null);
     $this->assertInstanceOfCompiledExpression($result);
     $this->assertSame(CompiledExpression::NULL, $result->getType());
     $this->assertSame(null, $result->getValue());
 }
All Usage Examples Of PHPSA\CompiledExpression::fromZvalValue