{"repo":"symfony/var-exporter","free":true,"listed":false,"github":"https://github.com/symfony/var-exporter","clone":"git clone https://github.com/symfony/var-exporter.git","description":"Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects","language":"PHP","stars":2098,"topics":["php","symfony","component","symfony-component","clone","construct","export","hydrate","instantiate","lazy-loading"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"VarExporter Component ===================== The VarExporter component provides various tools to deal with the internal state of objects: - VarExporter::export() allows exporting any serializable PHP data structure to plain PHP code. While doing so, it preserves all the semantics associated with the serialization mechanism of PHP ( wakeup , sleep , Serializable , serialize , unserialize ); - DeepCloner deep-clones PHP values while preserving copy-on-write benefits for strings and arrays, making it faster and more memory efficient than unserialize(serialize()) ; - ProxyHelper::generateLazyProxy() generates lazy-loading decorators for abstract or internal classes and for interfaces (use native lazy objects for regular concrete classes). The component depends on the native ext-deepclone extension for maximum performance, or on its polyfill as a fallback. In addition to functions deepclone to array() and deepclone from array() which are leveraged by DeepCloner and VarExporter::export() , the extension provides a deepclone hydrate() function that lets you instantiate / hydrate objects without calling their constructor, including private, protected and readonly properties. VarExporter::export() --------------------- The reason to use VarExporter::export() vs serialize() or igbinary is performance: thanks to OPcache, the resulting code is significantly faster and more memory efficient than using unserialize() or igbinary unserialize() . Unlike var export() , this works on any seriali","default_branch":null,"files":null,"tree":[],"storefront":"/r/symfony","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/symfony/var-exporter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}