FAQ
Hi Yasuo,
On 26 March 2016 at 00:08, Yasuo Ohgaki wrote:

Not suggesting allowing "\0" for property names: the example just shows
creating a public, private and protected property with an empty name.
Could you show some real world example use cases?
I've been using the "\0<scope>\0" approach in a few codegen-related
projects, specifically in ProxyManager (
https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-ghost-object.md#lazy-initialization-properties-explained
) and GeneratedHydrator ( https://github.com/Ocramius/GeneratedHydrator ).

No user input values involved, though.

See
https://github.com/php/php-src/blob/d3ed75b9ebc998b8cf325e0e3ab954bd10989918/tests/classes/array_conversion_keys.phpt
for the tests inside php-src: the inverse cast is not covered by tests,
though, as there is really little to no use-case for an `stdClass` with
private or protected properties, unless the only purpose is casting it back
into an array.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 12 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedMar 25, '16 at 5:45p
activeMay 29, '16 at 7:23p
posts12
users5
websitephp.net

People

Translate

site design / logo © 2019 Grokbase