Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19611 invoked from network); 11 Nov 2015 02:29:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2015 02:29:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@dasprids.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mail@dasprids.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dasprids.de from 46.4.80.198 cause and error) X-PHP-List-Original-Sender: mail@dasprids.de X-Host-Fingerprint: 46.4.80.198 server1.dasprids.de Received: from [46.4.80.198] ([46.4.80.198:52574] helo=mail.dasprids.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/5D-21426-608A2465 for ; Tue, 10 Nov 2015 21:29:26 -0500 Received: from [192.168.0.86] (unknown [5.158.132.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mail@dasprids.de) by mail.dasprids.de (Postfix) with ESMTPSA id 8927F3440474 for ; Wed, 11 Nov 2015 03:29:23 +0100 (CET) To: internals@lists.php.net References: <56429DAB.6010005@dasprids.de> Message-ID: <5642A801.3050909@dasprids.de> Date: Wed, 11 Nov 2015 03:29:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Resource typehint and return type From: mail@dasprids.de (Ben Scholzen 'DASPRiD') On 11.11.2015 03:21, Andrea Faulds wrote: > The reason for this is that the resource type is an anachronism from an > age in which PHP did not have objects, yet still needed to make certain > types of data opaque. The resource type is a type that exists only to > shuffle around C pointers between internal functions. It has no semantic > value. Because resources are now redundant, given the existence of > objects, their time is running out, and they will be replaced at some > point. Adding a type declaration for resource would mean that code using > it would break if we replace any existing usage of resources with > objects, preventing migration away from resource. I see, I didn't really know about this. Although right now, we still use resources to pass around the fopen() pointers. Do you mean that it is planned to have a read/write object like we have in e.g. Python (supplied by the open() function)? -- Ben Scholzen 'DASPRiD' Community Review Team Member | mail@dasprids.de Zend Framework | http://www.dasprids.de