Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89369 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86267 invoked from network); 24 Nov 2015 12:14:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2015 12:14:36 -0000 Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:32986] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/C3-57156-AA454565 for ; Tue, 24 Nov 2015 07:14:35 -0500 Received: by wmec201 with SMTP id c201so205761640wme.0 for ; Tue, 24 Nov 2015 04:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=mlzpfldb/f6MNMxNRDf2KzhhNs7h/mfWuRq/3MVA92M=; b=nYyGFljoUgrZtR7Jb/w8q/c7HmkFBpM1v1hoyvjIc6z5KO1vdcIijS7zIBA2kfsuSn tEu2xauoSKXiNzvAt0AKs7P5fP+lY+UuV7cYhWGugGyfvQasc+Cdpim1zvbKuAQQeW43 eOy1Tjtv7xqKIxx3exSK+wAUIgzRdM7QyXN77Vp016LZS55pxzUp70hV+9/5pMWfzaIJ yNwtEzP98pl9LaGbnow61QC9TpIoABbQb8pbXP8Jr9z3rIZUyWrT//MHsAWG3GSzn/7g Gbk7bupYai3GbIga7AbbJrAUK/2zgHSvY08wRwQ4zOiQEmYcvycMI52/786t7nkyMIBr A/4g== MIME-Version: 1.0 X-Received: by 10.194.173.5 with SMTP id bg5mr36992779wjc.142.1448367272351; Tue, 24 Nov 2015 04:14:32 -0800 (PST) Received: by 10.27.33.18 with HTTP; Tue, 24 Nov 2015 04:14:32 -0800 (PST) Received: by 10.27.33.18 with HTTP; Tue, 24 Nov 2015 04:14:32 -0800 (PST) Date: Tue, 24 Nov 2015 12:14:32 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=089e013c68e8c5ddc705254848b6 Subject: Internal methods proposal From: codekestrel@googlemail.com (Dominic Grostate) --089e013c68e8c5ddc705254848b6 Content-Type: text/plain; charset=UTF-8 Hi, I think this proposal has been made before maybe here or discussed elsewhere. Still, I'd like to give my input on the idea. The basic concept is when a method has the internal access modifier, it can only be called from within the same namespace. The case for this is to protect classes from being used in ways unintended, while still allowing classes within the same namespace to interact with each other non-api methods. I've created a commit: https://github.com/orolyn/php-src/commit/2ddec7149c308a80b33653da31b5ba214f679bb8 Please forgive any mistakes, it is a proof of concept and just complete enough to fulfil the feature. Currently, a limitation is internal methods can only be called from within another scope in the same namespace, as opposed to outside a class. For this implementation I needed to store the namespace of the class during the declaration, so to test that I added the function get_class_namespace to help me iron out some bugs. I have left the function there. Thank you, Dominic --089e013c68e8c5ddc705254848b6--