PHPSA\Compiler\Types::getTypeByValue PHP Method

getTypeByValue() public static method

Get type by $value
public static getTypeByValue ( $value ) : integer
$value
return integer
    public static function getTypeByValue($value)
    {
        return self::getType(gettype($value));
    }

Usage Example

Example #1
0
 /**
  * If we don't know $type but know $value
  *
  * @param $value
  * @throws RuntimeException
  * @return CompiledExpression
  */
 public static function fromZvalValue($value)
 {
     return new CompiledExpression(CompilerTypes::getTypeByValue($value), $value);
 }