note 102882 added to language.oop5.decon

From: Date: Sat, 12 Mar 2011 00:26:36 +0000
Subject: note 102882 added to language.oop5.decon
Groups: php.notes 
Request: Send a blank email to php-notes+get-177811@lists.php.net to get a copy of this message
multiple constructors with type signetures (almost overloading): public function __construct() { $args = func_get_args(); $argsStr = ''; foreach ($args as $arg) { $argsStr .= '_' . gettype($arg); } if (method_exists($this, $constructor = '__construct' . $argsStr)) call_user_func_array(array($this, $constructor), $args); else throw new Exception('NO CONSTRUCTOR: ' . get_class() . $constructor, NULL, NULL); } public function __construct_integer($a) {} public function __construct_string($a) {} public function __construct_integer_string($a, $b) {} public function __construct_string_integer($a, $b) {} ---- Server IP: 69.147.83.197 Probable Submitter: 79.176.185.236 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.decon.php Edit -- https://master.php.net/note/edit/102882 Del: integrated -- https://master.php.net/note/delete/102882/integrated Del: useless -- https://master.php.net/note/delete/102882/useless Del: bad code -- https://master.php.net/note/delete/102882/bad+code Del: spam -- https://master.php.net/note/delete/102882/spam Del: non-english -- https://master.php.net/note/delete/102882/non-english Del: in docs -- https://master.php.net/note/delete/102882/in+docs Del: other reasons-- https://master.php.net/note/delete/102882 Reject -- https://master.php.net/note/reject/102882 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177811) next »