Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23068 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17500 invoked by uid 1010); 1 May 2006 21:19:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 17485 invoked from network); 1 May 2006 21:19:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2006 21:19:00 -0000 X-PHP-List-Original-Sender: andrey@mysql.com X-Host-Fingerprint: 213.136.52.68 mailgate-out2.mysql.com Linux 2.5 (sometimes 2.4) (4) Received: from ([213.136.52.68:33378] helo=mailgate.mysql.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 4A/C1-18514-24B76544 for ; Mon, 01 May 2006 17:18:59 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.mysql.com (8.13.4/8.13.4) with ESMTP id k41LIpl7007277; Mon, 1 May 2006 23:18:51 +0200 Received: from mail.mysql.com ([10.222.1.99]) by localhost (mailgate.mysql.com [10.222.1.98]) (amavisd-new, port 10026) with LMTP id 00445-02; Mon, 1 May 2006 23:18:51 +0200 (CEST) Received: from [10.100.84.9] (10-100-84-9.mysql.internal [10.100.84.9]) (authenticated bits=0) by mail.mysql.com (8.13.3/8.13.3) with ESMTP id k41LIYIu016727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 May 2006 23:18:42 +0200 Message-ID: <44567B27.5030808@mysql.com> Date: Mon, 01 May 2006 23:18:31 +0200 Organization: MySQL AB User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050219 MIME-Version: 1.0 To: Brandon Fosdick CC: internals@lists.php.net References: <4454491A.3090303@bfoz.net> In-Reply-To: <4454491A.3090303@bfoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailgate.mysql.com Subject: Re: [PHP-DEV] resources vs objects? From: andrey@mysql.com (Andrey Hristov) Hi, Brandon Fosdick wrote: >> From the point of view of an extension, what's the difference between >> a resource and an object? Is there any reason to favor one over the >> other? > > > sqlite seems to use resources for the procedural interface and objects > otherwise. Whereas mysqli uses objects all around in user space, but > then maps them to resources in the background. Why use objects only to > map them to resources? Are resources somehow special? > mysqli does not use resources at all. Even in the procedural interface, the "resources" are just objects. Thus, procedural and OO code can be mixed, for those wanting to write spaghetti code or for legacy and non-legacy code. $c = mysqli_connect(....); $r= $c->query(); ... Cheers, Andrey