note 116886 added to pdostatement.fetchobject

From: Date: Sun, 15 Mar 2015 23:34:39 +0000
Subject: note 116886 added to pdostatement.fetchobject
Groups: php.notes 
Request: Send a blank email to php-notes+get-201951@lists.php.net to get a copy of this message
I think so could us use this variant to implement the constructor, this is my example: <?php class User{ public $user; public $password; public $name; public $email; public function __construct(){ $args = func_get_args(); $nargs = func_num_args(); $attribs = get_class_vars(get_class($this)); if(isset($args)){ foreach($args as $value){ $attrib = key($attribs); $this->$attrib = $value; next($attribs); } } } } ---- Server IP: 72.52.91.14 Probable Submitter: 87.222.151.152 ---- Manual Page -- http://php.net/manual/en/pdostatement.fetchobject.php Edit -- https://master.php.net/note/edit/116886 Del: integrated -- https://master.php.net/note/delete/116886/integrated Del: useless -- https://master.php.net/note/delete/116886/useless Del: bad code -- https://master.php.net/note/delete/116886/bad+code Del: spam -- https://master.php.net/note/delete/116886/spam Del: non-english -- https://master.php.net/note/delete/116886/non-english Del: in docs -- https://master.php.net/note/delete/116886/in+docs Del: other reasons-- https://master.php.net/note/delete/116886 Reject -- https://master.php.net/note/reject/116886 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201951) next »