Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99929 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35272 invoked from network); 19 Jul 2017 07:54:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2017 07:54:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=krukowski.bartlomiej@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krukowski.bartlomiej@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.178 as permitted sender) X-PHP-List-Original-Sender: krukowski.bartlomiej@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-qt0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:33788] helo=mail-qt0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/E4-02884-C101F695 for ; Wed, 19 Jul 2017 03:54:04 -0400 Received: by mail-qt0-f178.google.com with SMTP id n42so34694413qtn.0 for ; Wed, 19 Jul 2017 00:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zsexo/pxj6Jpe9U+E3AEhifKJ9kooZNn2e5fiqw09iw=; b=Ii8bhKCkA5m8xX6UHu/tabgFtCkC0BUKQXxNHRg8zzxWzbPmLQM53p+HzJI3S3r/bO q08RVmi8nirv2W9UfdBl528pbPGAti8yNU2hVRRdI1GPDKVB2Cnobdv5mWaBSy8QmX/N hn6qnqceuu/JM1jd05hJ7tgg1FLsH1ipG5JzIHVR0cmMmV953h/mobRZX6hgj0PrrHFK 9rI6m73I9rFNgS+b6WgrPC0OW6xYPlr8jndyxb2a0/a31WIQZXVckJJ7qccgFS/zqxei SaqBQ7P2kUCesZF+K5UJEZd9uKY/ZuE/nC95YoP9kt01mjxvYH/lvAwtc90PtwPHO0R5 2HKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zsexo/pxj6Jpe9U+E3AEhifKJ9kooZNn2e5fiqw09iw=; b=ixsMdHaYswODg6xBsoXdwEkRU5PHQFZc2nWjvwoXmci1CfaXOw9o0/fQ1eDWDcDlZI MKQAr2zhWrygu6A2bjJJXyppKUdhIPBd0YRu/4lwvMqsRJ+qK77bwD0zDblCOXN6zWCD wJ1DPgA7ViauackGU9RjF7ZIAbwNWS259ZcROSeYni9mm6ORtbVQpb21CGNS9HtTYrVt fRZqu2rUWV0YMVhJdyZpBhSLLjXYdVVt8aiAAI7BsI5Qjven+6fFRS1IF/Q6DVNQ7vPb 2i2mtoHUgS3kvMRjKc57zqnOBoEsskF9WVCd7aIb/urznCS41MjEdKE3PTmiROPi1+H9 bD3Q== X-Gm-Message-State: AIVw111Kz2qPk0xlfx2m5RVw/41EcfMsVqMZzAnICyygsqkBzCASE8tP 9TnBql0/3HIdUWHTpYPzBmrFAaglqn1I X-Received: by 10.237.63.245 with SMTP id w50mr1853605qth.135.1500450841957; Wed, 19 Jul 2017 00:54:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.170.221 with HTTP; Wed, 19 Jul 2017 00:53:41 -0700 (PDT) Date: Wed, 19 Jul 2017 09:53:41 +0200 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="001a1144e7787019b30554a6ef33" Subject: RFC - ReflectionProperty calls __get methods From: krukowski.bartlomiej@gmail.com (=?UTF-8?Q?Bart=C5=82omiej_Krukowski?=) --001a1144e7787019b30554a6ef33 Content-Type: text/plain; charset="UTF-8" Hello, Class *ReflectionProperty* allows to get access to private properties in library. Unfortunately there is one unexpected (or at least undocumented) case - *ReflectionProperty* tries execute *__call* method. In my opinion this approach is bad, because method *__call* can change state of application (I'd like to read value, not execute code). I'd like to suggest different approach: - Method *ReflectionProperty->getValue* will throw exception when property is removed. - Class *ReflectionProperty* will receive new method - *exists*. Code - http://ideone.com/A23YKF Best regards --001a1144e7787019b30554a6ef33--