Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93080 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94402 invoked from network); 5 May 2016 06:47:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2016 06:47:58 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.127 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.127 mail-by2on0127.outbound.protection.outlook.com Received: from [207.46.100.127] ([207.46.100.127:35104] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/08-16256-B9CEA275 for ; Thu, 05 May 2016 02:47:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YmPwX2YholBKPaoF2D9eXFW2tHFUtcoNYyNwXPjr1nU=; b=hMyUf14jWoUhehHtmUhVVfJ62+tyOWDol7ZIrzmkLb2cHorec7Sm7/h9ZThx5HuU3+HEvOiRLgnk5uUal7GTLYrdrjMbl+KzxtbfJ5Ok3AjTofkf5IreAhOgLqcQIrVLJO9yJ7D0QOzsbz/3Ybim7TJREUOhes/vxIvSx0+LCUk= Authentication-Results: lists.php.net; dkim=none (message not signed) header.d=none;lists.php.net; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by BY2PR0201MB1783.namprd02.prod.outlook.com (10.163.72.25) with Microsoft SMTP Server (TLS) id 15.1.485.9; Thu, 5 May 2016 06:47:51 +0000 To: Larry Garfield , References: <5723F2AE.2020806@garfieldtech.com> <572529F2.9070606@garfieldtech.com> <8e4ed849-f504-fe80-3c5f-e4ea114e99fa@gmail.com> <6e3f41ce-4dd5-cd29-a063-fdc9c9c920b8@gmail.com> <830b1059-9a9e-b7e1-e338-29d562588e2f@gmail.com> <57265D57.1040301@garfieldtech.com> Message-ID: <7589bb52-8f78-576d-2a79-e8655f14865e@zend.com> Date: Thu, 5 May 2016 09:47:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <57265D57.1040301@garfieldtech.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: AM3PR01CA059.eurprd01.prod.exchangelabs.com (10.141.191.49) To BY2PR0201MB1783.namprd02.prod.outlook.com (10.163.72.25) X-MS-Office365-Filtering-Correlation-Id: bdc1501f-c53f-4e67-d95e-08d374b12e4f X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB1783;2:X9XRsUZhk7/waH/lJuvSfgarPaN0bOPG788Yf39nOjH089+g/yGSaYo5g0imQgSp09dIJ1hg3f6AaAnfmIDZIanQC6vrhFfoo9zkB6fvXub1iH40w8YLt/91tFJgI4GB/nnMSVqfYSXqHq990D8M0lQppQ3QeMGjjrzWQ3TWrg3/0/DMIrMRvecXUtc8ioF1;3:S38B9qhexGZPMgzneWdhPJFNeiy5mMM4m5GWMpJGfg2uNtXZXXom/PvbTozhBa/hvu3B/UG9LtzbuZoLjxanJ4vbAfZczybnnKaZRmoZkH3hJ7sr+aDkzRqJObajBJa/;25:DswZ+0j6q+hmIHqx2AReEse7rSsHRyRIZQO1pIU2BsEJLtVqwjHO8n/2uH8v0JyTqbHPImar2Whph0yzfE17rEfR+RG04yxey0ypaGFISY+Zx8TLkt5bX3s97NVnawx4Ni9/Y6GL1LBKgyCMvnJxF58vkX0aRCzjTYKw1fKAswwg0janmWtixpoZwUZoYGTKeUnSGWjb7fX78TS7M0rJ7UOq8Bif+vR3qhjg78HQ/yiWapUwb4bBAXSw76nLfBTGs6MC0Um7D+xyJ8n99jZ+QtnJY8WRTxTAvITa6KOcaLCUXW/XcKiYTqYbc2191bOtTM+BVjSNc5A/8YFfJUHR+n/rYuiDm1Kj+vOKEWxsrXQTCJNjNgSqHCWyTgaggyDKQbgcWf/JDEvH+92M5d5lq3G8mRurQ3fAhoLN8U/hLGiW0HmBGtNaMpddwZSlXnny X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB1783;20:auampzh0p8hs8hYmolGpUM93hpgs/y2N1WVsE+kdmk7gs9ad+BL21NbE3w2AXjrWRsdCuZZfIkcKCH/o589txrJf+Qa/AP2QxpAxG2b2ydHQRHL1QWmWUwRpR7eLdWfbR0crXXa7l6X9vc8eoAwAy92HryIkQJPsErZk+G6sruedLYh1hRaJmEa6ZMCBxdFiwLG8BQUbROzFc6chsbLLYN0NYM9bdBr3aBE47h62Kg/+qLsWI6a+Sq2JE1HrAbkjUlnF26ecOSblPrnML7OtBCHAiWeoeYdMznoY1YOexSm6TSBic+zuGexjw1IiU+yACrvZwLtj52pj05PhD4/9lDcIKzWu0oWittOctj5Ign1VDoNuvh3KNMT1iakxVjSh6H5he8plLjFMoxJTSK8amF+b09J0OSSePumOWhsADN/VfajGANMgh+cMyMP69MpbRYovz9fOSIawAkbZ8rTex+78+nGN57AxY5O4tLMNk/yFoU5gHryM5ymz5B6E3BU7;4:DojlTdXAPKIgMSUDy02A65KywZAomtmSsemqn62hsTVOMdl/rt0FtM2qeu0ERVNR/R6CSuL0+7LTT7vRXWOxmqkOGDYcvTG5fu35MX6dxcHHFmtnqb/YHHZArbjQUyVKixd8HUf14TBkgMAABlMYIibJiLwY1Mw93EqsaY+LRD0Uoeb4WVMc/EBogQSgU4NHV+oD/rqiYU4UpadcN/ijOVleuLtg2qLRhn+S0vQG+NfZVYRZZX32bzO9k0Ko07KaPuHimkdm/NTqDQCeqrF3FZUt+BNuayl+jCgHATgfA4plQvaEBSF6ghhkA3vr0E04HMDb8c5h14hlf7+oNP8Aj1JsCUEK6v0zyn+RnRVUIlUgUYHSkuz5wtOYbJMubtfiiMEhTLKPTbSUEHcHsWlXRw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521098)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BY2PR0201MB1783;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; X-Forefront-PRVS: 0933E9FD8D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(377454003)(24454002)(5008740100001)(2950100001)(93886004)(77096005)(65956001)(65806001)(66066001)(47776003)(6116002)(230700001)(81166005)(2906002)(3846002)(50986999)(36756003)(76176999)(33646002)(54356999)(586003)(92566002)(5004730100002)(31686004)(23676002)(86362001)(4001350100001)(42186005)(31696002)(50466002)(83506001)(64126003)(107886002)(5001770100001)(189998001)(65826006);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1783;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyMDFNQjE3ODM7MjM6OXlKZUlFY0ZxSXFLY2V3eEx1MDd5a1Uw?= =?utf-8?B?ZGJVc21nZTlNNzBPK01FV0xJSFlVWGV6T01OMmVoaDlaM1VlcjNlUUg1cHFX?= =?utf-8?B?elE2d1BRbGhMVlVIRUVPb09ZTVJtTzhhMUR1RmM0Unc0UHMvcmZBMnNSR1F3?= =?utf-8?B?LzY4eGZySzF4TFJVbGpHOVV1aCtyVlJFMDVxTWlQb2Npdk1xU0llUGVNeis5?= =?utf-8?B?a0ExbW9ldGNsekNKUnBBSS9Va2ZoVHFWdkVjdWZKaDFjZElUUlFYL29RU3pN?= =?utf-8?B?QnRp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-8?B?YzNXNGtWbEQ2ck5HeHVQNWY1RDVFTTM2L1JsejRCTmh3a29uUXdRNDlBR1Z6?= =?utf-8?B?ckdRZE1tcTZmc1F0c21zdHp5WjBnN1RMb1lqeWkxUmQ4d2kvZytnbmFpbnJx?= =?utf-8?B?M0Z1ejhoS2VVek5xcnIwVm8rSC9PN1lGQ09ZQjFrZEFwR3pnTHQ3djZZM3lD?= =?utf-8?B?b2Z5UjhwcVpleFZ1NFpLZEk1eXcwU2VyTjF2QklpRlE9PQ==?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB1783;5:ay6Pvk7nnfq4dT2QUU87UoOJl+Qd/14MgMOBNCUHNS7oGs+/3ZC9YIZjM0IfHYXWyBWy5YIvYyBUa7ATRdMTNyOaz6JDaNOT+pDgulrga46RD+RCwEKkKnkInve5KtNs0NqVtfcsbuH8dvVbXdna0w==;24:9LvtYKEUz3bOqtP5KQ4YQv4aBYrzJRX/jZMcBO0M4nUOT8Jwc2MfXsRFp1BkvYyP9/jc3tTK8b0YTmpWU2pcWx1ZTNWz6rn28JbGnyndaNg=;7:gWmVreIV0juC+RoTlxnnKoQF/UKGM3dNJiY3WmC97JsVEnraKGRUsYDCXODuvKUyjxBZLmctte+ModpBcKIEWbJjG9uA/p90qY+Lv9NvCUzR4ZLo4RX7vByLjGLqH4bVi9mOEb2DxS8WS/7xHRq3Z8TwHPnm3MIw4nqCa/YylsLLnidRgugM5FOHtCTYPswJ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2016 06:47:51.6264 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1783 Subject: Re: [PHP-DEV] Attributes/Annotations Case Study: Drupal From: dmitry@zend.com (Dmitry Stogov) On 05/01/2016 10:47 PM, Larry Garfield wrote: > On 04/30/2016 06:21 PM, Rowan Collins wrote: >> On 30/04/2016 23:45, Stanislav Malyshev wrote: >>> Oh, of course you can have methods, but then it is strange conceptually >>> - you have a normal class, which some other part of the language just >>> uses for something else that classes are not routinely used for. I.e., >>> does it call a constructor? When? With which arguments? What if it >>> fails? What if I just create an object of this class - would it be the >>> same as annotation object? >> >> Hm... I was going to say "well, PDO does this if you use >> PDOStatement::fetchObject"; but then I remembered that the >> integration with the object there IS a bit weird - it injects raw >> properties, and *then* calls the constructor. >> >> So, I'm not sure there's a limitation in terms of the object being >> data-only per se, but there are certainly oddities to be dealt with >> in terms of construction. And as you mentioned, mutability leads to >> another set of oddities - are the mutations stored for next time you >> request that annotation, or is the object recreated on each access? >> >> Regards, > > It would never occur to me to not have it regenerated on each access. > If I want to cache it I will do so myself, thanks. :-) > > However, that is not an issue created by using a defined structure for > the annotation result. The RFC currently says it returns an > associative array, aka anonymous struct. Those are always highly mutable. The RFC proposes only Reflection*::getAttributres() that returns by value. You may modify the returned copy, but the original attributes are immutable. Thanks. Dmitry. > A classed object is as mutable as its design allows it to be. To wit: > > <<__Annotation>> > class Definition { > protected $foo; > protected $bar; > public function getFoo() {} > public function getBar() {} > } > > < 1, bar => 2)>> > class Meep {} > > The resulting annotation object would be an instance of Definition, > which is for practical purposes immutable. If it were returned as an > array ['foo' => 1, 'bar' => 2], that would obviously be mutable. > > Whether Definition should have mutator methods on it then becomes the > implementer's decision, which is probably for the best. > > --Larry Garfield >