|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-14 03:10 UTC] david71rj at gmail dot com
[2010-04-14 10:55 UTC] giorgio dot liscio at email dot it
[2014-08-27 12:57 UTC] rausch dot nico at gmail dot com
[2015-09-08 00:24 UTC] cmb@php.net
[2021-03-02 11:00 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-03-02 11:00 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 11:00:01 2025 UTC |
Description: ------------ hi, some object oriented architectures requires inner classes i'm not good with english language so i write some examples: in a library like PDO, now we can do some like this: class Database { public function prepareSql($sql){ return new Sql($sql)} } class Sql { public function setValue($search, $replace){} public function executeQuery(){return new ExecutedQuery();} } class ExecutedQuery { function fetch() function numRows() // etc } this api allows the developer to instantiate an ExecutedQuery with no Sql parameters escaping (class Sql) so inner classes are useful to make visible classes in some trusted environment: class Database { public function prepareSql($sql){ return new Sql($sql)} class Sql { public function setValue($search, $replace){} public function executeQuery(){return new ExecutedQuery();} class ExecutedQuery { function fetch() function numRows() // etc } } } i've read a lot of rfc on php's wiki but no one talks about inner classes (useful like traits and others new work in progress features) what do you think about this?