Req #80068 [Opn->Dup]: Feature request magic methods

From: Date: Mon, 07 Sep 2020 04:41:28 +0000
Subject: Req #80068 [Opn->Dup]: Feature request magic methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228910@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80068&edit=1 ID: 80068 Updated by: requinix@php.net Reported by: peter dot quinn at optushome dot com dot au Summary: Feature request magic methods -Status: Open +Status: Duplicate Type: Feature/Change Request Package: Class/Object related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Duplicate of other requests, and the idea of casting objects to other types has been discussed multiple times on the mailing list. Previous Comments: ------------------------------------------------------------------------ [2020-09-07 04:38:25] peter dot quinn at optushome dot com dot au Description: ------------ A toNumeric(), toArray, toObject would be handy so can cast an object in different ways. Eg, If I had a object which had the queried result set from a database query within a private member, then could use toString() to display the current row as say a HTML version of it, use toArray to return the current row as an array, and use toObject to return the current row as an object. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80068&edit=1

« previous php.bugs (#228910) next »