Hello!
I would like to notice, that there is method __set_state() that can be used
to set internal state of object. We can introduce __get_state() method that
will be invoked in var_dump(), etc... Personally I don't like __lower_caps
name of this method, but it will be consistent with __set_state() :)
2014/1/22 Ivan Enderlin @ Hoa <[email protected]>
> Hello :-),
>
>
> On 21/01/2014 22:42, Frédéric Hardy wrote:
>
>> Hi all !
>>
>> Le 21 janv. 2014 à 22:26, Sara Golemon <[email protected]> a écrit :
>>
>> Something new to argue about:
>>>
>>> https://wiki.php.net/rfc/debug-info
>>>
>> Very interesting feature (i have personally thinking about that several
>> time in the past).
>> However, i think that __dump() is a better name from the end user point
>> of view.
>> __debug_info() is a good name from the point of view of a C developer
>> which works on the Zend Engine or on C extensions, but from the end user
>> point of view, it’s not the case.
>> And this new magical method is used internally by var_dump() so __dump()
>> seems to me a better name.
>> Maybe __set_dump() is an alternative too, because __set_state() is used
>> internally by var_export(), but i’m not sure that it’s a better name than
>> __dump which is very explicit and intuitive.
>>
> +1 for __debug
which is simpler than __debugInfo
. The -info suffix
> does not add any relevant meaning about the method behavior.
>
> Moreover, is this method able to throw an exception?
>
>
> Cheers.
>
> --
> Ivan Enderlin
> Developer of Hoa
> http://hoa-project.net/
>
> PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
> http://disc.univ-fcomte.fr/ and http://www.inria.fr/
>
> Member of HTML and WebApps Working Group of W3C
> http://w3.org/
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>