Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71387 invoked from network); 12 May 2014 19:15:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2014 19:15:04 -0000 Received: from [127.0.0.1] ([127.0.0.1:26820]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 45/5A-10689-7BD11735 for ; Mon, 12 May 2014 15:15:04 -0400 Authentication-Results: pb1.pair.com header.from=jwatzman@fb.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=prvs=02097f6e36=jwatzman@fb.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain fb.com designates 67.231.145.42 as permitted sender) X-PHP-List-Original-Sender: prvs=02097f6e36=jwatzman@fb.com X-Host-Fingerprint: 67.231.145.42 mx0a-00082601.pphosted.com Linux 2.5 (sometimes 2.4) (4) Received: from [67.231.145.42] ([67.231.145.42:53347] helo=mx0a-00082601.pphosted.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/79-10689-42F01735 for ; Mon, 12 May 2014 14:12:53 -0400 Received: from pps.filterd (m0044012 [127.0.0.1]) by mx0a-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id s4CI7B9k017486; Mon, 12 May 2014 11:12:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=lIHPDLEatnSBnu3E7bj8cIMOU+QFwVigo/6ELJlJhWs=; b=KGDaa9uNpAHnFVQ2ex40vdyskz7o7QKSB8UmOceLNXmQdIhhdcgOL6A1lopX/AaZBL7P ezIsBGFZW6XX2wVEmcqHefwUvN3YEIYpw/L/xkMGwWqVCye2ioeB96aHedAd53umjope wBv8lFeRBCLMOoCbulj0ecDOBHSBNOukr/U= Received: from mail.thefacebook.com (mailwest.thefacebook.com [173.252.71.148]) by mx0a-00082601.pphosted.com with ESMTP id 1ktu441fqh-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Mon, 12 May 2014 11:12:46 -0700 Received: from PRN-MBX02-2.TheFacebook.com ([169.254.5.125]) by PRN-CHUB08.TheFacebook.com ([fe80::c9c7:30fd:ad3:b94%12]) with mapi id 14.03.0174.001; Mon, 12 May 2014 11:12:44 -0700 To: Stas Malyshev CC: Lazare Inepologlou , Larry Garfield , "internals@lists.php.net" Thread-Topic: [PHP-DEV] [RFC] Return Type Declarations pre-vote follow-up Thread-Index: AQHPa5iwbRN8uH8IdkWOuZ8Vefj2F5s5InuAgAAU3YCAAAMQgIAACMIAgANUToCAAG3IAIAAAisAgACyPIA= Date: Mon, 12 May 2014 18:12:43 +0000 Message-ID: References: <90B71511-4FB4-4916-9AC0-E3DD0D328C37@fb.com> <536D46C5.7040302@sugarcrm.com> <536D50B0.408@sugarcrm.com> <53701BA7.2040809@garfieldtech.com> <53707990.2010507@sugarcrm.com> In-Reply-To: <53707990.2010507@sugarcrm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.16.4] Content-Type: text/plain; charset="us-ascii" Content-ID: <962360FC8D9F374283200B6D7AC25D8E@fb.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-05-12_03:2014-05-12,2014-05-12,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.322287768733618 urlsuspect_oldscore=0.322287768733618 suspectscore=0 recipient_domain_to_sender_totalscore=20 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=2524143 rbsscore=0.322287768733618 spamscore=0 recipient_to_sender_domain_totalscore=9 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1405120230 X-FB-Internal: deliver Subject: Re: [PHP-DEV] [RFC] Return Type Declarations pre-vote follow-up From: jwatzman@fb.com (Josh Watzman) On May 12, 2014, at 12:34 AM, Stas Malyshev wrote: > Hi! >=20 >> Docblocks is not the solution. If you want to take profit of static >> analysis without the penalty of runtime type checking, Hack has shown th= e >> way with its "soft type hints". >=20 > What prevents you from doing static analysis using types specified in > docblocks? For context/background. Hack has deliberately resisted doing this since we = consider the types to be an integral part of the language. Runtime enforcem= ent is very important for this. You need something to make sure the static = analysis of the type system is not just self-consistent but consistent with= reality. Until pretty close to the open source release of Hack, HHVM didn'= t actually enforce return types. Facebook had to do quite a bit of cleanup = here, since the return type enforcement uncovered a bunch of places where t= he types were self-consistent but not grounded in reality. So in our opinion putting things in docblocks just compounds this problem a= nd can be pretty dangerous if nothing is enforcing them at runtime. So this may or may not be a good idea for your use case (I've honestly kind= of lost where this branch of the email thread was going), but that's why w= e haven't done it for Hack. Josh Watzman