Library/Backends/ZendEngine2/Backend.php
public function getTypeofCondition(Variable $variableVariable, $operator, $value, CompilationContext $context)
    {
        $variableName = $this->getVariableCode($variableVariable);
        switch ($value) {
            case 'array':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_ARRAY';
                break;

            case 'object':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_OBJECT';
                break;

            case 'null':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_NULL';
                break;

            case 'string':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_STRING';
                break;

            case 'int':
            case 'long':
            case 'integer':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_LONG';
                break;

            case 'double':
            case 'float':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_DOUBLE';
                break;

            case 'boolean':
            case 'bool':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_BOOL';
                break;

            case 'resource':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_RESOURCE';
                break;

            case 'callable':
                $condition = 'zephir_is_callable('.$variableName.' TSRMLS_CC) '.$operator.' 1';
                break;

            default:
                throw new CompilerException(sprintf('Unknown type: "%s" in typeof comparison', $value));
        }

        return $condition;
    }
public function getTypeofCondition(Variable $variableVariable, $operator, $value, CompilationContext $context)
    {
        $variableName = $this->getVariableCode($variableVariable);
        switch ($value) {
            case 'array':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_ARRAY';
                break;

            case 'object':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_OBJECT';
                break;

            case 'null':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_NULL';
                break;

            case 'string':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_STRING';
                break;

            case 'int':
            case 'long':
            case 'integer':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_LONG';
                break;

            case 'double':
            case 'float':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_DOUBLE';
                break;

            case 'boolean':
            case 'bool':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_BOOL';
                break;

            case 'resource':
                $condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_RESOURCE';
                break;

            case 'callable':
                $condition = 'zephir_is_callable('.$variableName.' TSRMLS_CC) '.$operator.' 1';
                break;

            default:
                throw new CompilerException(sprintf('Unknown type: "%s" in typeof comparison', $value));
        }

        return $condition;
    }
public function getTypeofCondition ( Variable $ variableVariable , $ operator , $ value , CompilationContext $ context ) { $ variableName = $ this -> getVariableCode ( $ variableVariable ) ; switch ( $ value ) { case 'array' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_ARRAY' ; break ; case 'object' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_OBJECT' ; break ; case 'null' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_NULL' ; break ; case 'string' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_STRING' ; break ; case 'int' : case 'long' : case 'integer' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_LONG' ; break ; case 'double' : case 'float' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_DOUBLE' ; break ; case 'boolean' : case 'bool' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_BOOL' ; break ; case 'resource' : $ condition = 'Z_TYPE_P(' . $ variableName . ') ' . $ operator . ' IS_RESOURCE' ; break ; case 'callable' : $ condition = 'zephir_is_callable(' . $ variableName . ' TSRMLS_CC) ' . $ operator . ' 1' ; break ; default : throw new CompilerException ( sprintf ( 'Unknown type: "%s" in typeof comparison' , $ value ) ) ; } return $ condition ; }
Checks the type of a variable using the ZendEngine constants.

@param Variable           $variableVariable
@param string             $operator
@param string             $value
@param CompilationContext $context

@throws CompilerException

@return string
Checks the type of a variable using the ZendEngine constants .