note 123953 added to language.oop5.iterations

From: Date: Wed, 19 Jun 2019 00:51:10 +0000
Subject: note 123953 added to language.oop5.iterations
Groups: php.notes 
Request: Send a blank email to php-notes+get-211306@lists.php.net to get a copy of this message
I've created a dinamic version of grzeniufication code to allow un-, serialize more than one property: <?php class Person implements \Serializable { public $id; public $name; public $birthDate; public $surname; public function serialize() { return serialize((array) $this); } public function unserialize($serialized): void { foreach (unserialize($serialized) as $p => $v) { $this->{$p} = $v; } } } ---- Server IP: 208.43.231.9 Probable Submitter: 177.234.144.170 (proxied: 186.205.49.50) ---- Manual Page -- http://php.net/manual/en/language.oop5.iterations.php Edit -- https://master.php.net/note/edit/123953 Del: integrated -- https://master.php.net/note/delete/123953/integrated Del: useless -- https://master.php.net/note/delete/123953/useless Del: bad code -- https://master.php.net/note/delete/123953/bad+code Del: spam -- https://master.php.net/note/delete/123953/spam Del: non-english -- https://master.php.net/note/delete/123953/non-english Del: in docs -- https://master.php.net/note/delete/123953/in+docs Del: other reasons-- https://master.php.net/note/delete/123953 Reject -- https://master.php.net/note/reject/123953 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#211306) next »