|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-16 07:09 UTC] aharvey@php.net
-Status: Open
+Status: Wont fix
[2010-07-16 07:09 UTC] aharvey@php.net
[2010-07-16 14:03 UTC] giorgio dot liscio at email dot it
[2011-03-30 11:59 UTC] florent dot biville at insa-rouen dot fr
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 07:00:01 2025 UTC |
Description: ------------ hi, in php is missing a visibility identifier to protect methods and properties inside the namespace example: namespace Oracle; // abstraction layer for Oracle class Connection { // ociresource should be visible only in the namespace // in php 5.3 the property is public to world namespace-protected $ociresource; public function __construct() { $this->ociresource = oci_connect(); } public function query($sql) { return new Query($this, $sql); } } class Query { public function __construct(Connection $con, $sql) { $x = oci_parse($con->ociresource, $sql); // $ociresource is accessible only in this namespace oci_execute($x); } } ---- suggested visibility identifier: namespace-private (if namespace is \Test\Abc\ the method/property is only accessible within \Test\Abc\) namespace-protected (if namespace is \Test\Abc\ the method/property can be accessible within \Test\Abc\ and, for example \Test\Abc\Foo\ )