public static function explain(PDO $pdo, $sql, $bindings = [])
    {
        $explains = [];
        if (preg_match('#\s*\(?\s*SELECT\s#iA', $sql)) {
            $statement = $pdo->prepare('EXPLAIN '.$sql);
            $statement->execute($bindings);
            $explains = $statement->fetchAll(PDO::FETCH_CLASS);
        }

        return $explains;
    }
public static function explain(PDO $pdo, $sql, $bindings = [])
    {
        $explains = [];
        if (preg_match('#\s*\(?\s*SELECT\s#iA', $sql)) {
            $statement = $pdo->prepare('EXPLAIN '.$sql);
            $statement->execute($bindings);
            $explains = $statement->fetchAll(PDO::FETCH_CLASS);
        }

        return $explains;
    }
public static function explain ( PDO $ pdo , $ sql , $ bindings = [ ] ) { $ explains = [ ] ; if ( preg_match ( '#\s*\(?\s*SELECT\s#iA' , $ sql ) ) { $ statement = $ pdo -> prepare ( 'EXPLAIN ' . $ sql ) ; $ statement -> execute ( $ bindings ) ; $ explains = $ statement -> fetchAll ( PDO :: FETCH_CLASS ) ; } return $ explains ; }
explain sql.

@param PDO $pdo
@param string $sql
@param array $bindings
@return array
explain sql .