All Projects → symfony → Var Exporter

symfony / Var Exporter

Licence: mit
The VarExporter component 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).

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Var Exporter

Polyfill Php56
This component provides functions unavailable in releases prior to PHP 5.6.
Stars: ✭ 1,470 (-9.03%)
Mutual labels:  symfony, symfony-component, component
Console
The Console component eases the creation of beautiful and testable command line interfaces.
Stars: ✭ 8,988 (+456.19%)
Mutual labels:  symfony, symfony-component, component
Security Http
Security provides an infrastructure for sophisticated authorization systems, which makes it possible to easily separate the actual authorization logic from so called user providers that hold the users credentials. It is inspired by the Java Spring framework.
Stars: ✭ 1,146 (-29.08%)
Mutual labels:  symfony, symfony-component, component
Http Foundation
The HttpFoundation component defines an object-oriented layer for the HTTP specification.
Stars: ✭ 8,068 (+399.26%)
Mutual labels:  symfony, symfony-component, component
Polyfill Php55
This component provides functions unavailable in releases prior to PHP 5.5.
Stars: ✭ 105 (-93.5%)
Mutual labels:  symfony, symfony-component, component
Web Link
The WebLink component manages links between resources. It is particularly useful to advise clients to preload and prefetch documents through HTTP and HTTP/2 pushes.
Stars: ✭ 1,060 (-34.41%)
Mutual labels:  symfony, symfony-component, component
Http Client
The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.
Stars: ✭ 1,186 (-26.61%)
Mutual labels:  symfony, symfony-component, component
Routing
The Routing component maps an HTTP request to a set of configuration variables.
Stars: ✭ 7,080 (+338.12%)
Mutual labels:  symfony, symfony-component, component
Security Core
Security provides an infrastructure for sophisticated authorization systems, which makes it possible to easily separate the actual authorization logic from so called user providers that hold the users credentials. It is inspired by the Java Spring framework.
Stars: ✭ 1,264 (-21.78%)
Mutual labels:  symfony, symfony-component, component
Security Csrf
The Security CSRF (cross-site request forgery) component provides a class CsrfTokenManager for generating and validating CSRF tokens.
Stars: ✭ 1,220 (-24.5%)
Mutual labels:  symfony, symfony-component, component
Event Dispatcher
The EventDispatcher component provides tools that allow your application components to communicate with each other by dispatching events and listening to them.
Stars: ✭ 7,946 (+391.71%)
Mutual labels:  symfony, symfony-component, component
Polyfill
PHP polyfills
Stars: ✭ 1,333 (-17.51%)
Mutual labels:  symfony, symfony-component, component
Finder
The Finder component finds files and directories via an intuitive fluent interface.
Stars: ✭ 7,840 (+385.15%)
Mutual labels:  symfony, symfony-component, component
Class Loader
[DEPRECATED] The ClassLoader component provides tools to autoload your classes and cache their locations for performance.
Stars: ✭ 1,131 (-30.01%)
Mutual labels:  symfony, symfony-component, component
Telegram Notifier
Provides Telegram integration for Symfony Notifier.
Stars: ✭ 30 (-98.14%)
Mutual labels:  symfony, symfony-component, component
Security Guard
The Guard component brings many layers of authentication together, making it much easier to create complex authentication systems where you have total control.
Stars: ✭ 1,157 (-28.4%)
Mutual labels:  symfony, symfony-component, component
Process
The Process component executes commands in sub-processes.
Stars: ✭ 6,942 (+329.58%)
Mutual labels:  symfony, symfony-component, component
Polyfill Xml
This polyfill is deprecated. Use the symfony/polyfill-php72 package instead.
Stars: ✭ 11 (-99.32%)
Mutual labels:  symfony, symfony-component, component
Security
The Security component provides a complete security system for your web application.
Stars: ✭ 1,195 (-26.05%)
Mutual labels:  symfony, symfony-component, component
Polyfill Php54
This component provides functions unavailable in releases prior to PHP 5.4.
Stars: ✭ 93 (-94.25%)
Mutual labels:  symfony, symfony-component, component

VarExporter Component

The VarExporter component 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).

It also provides an instantiator that allows creating and populating objects without calling their constructor nor any other methods.

The reason to use this component 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 serializable PHP value.

It also provides a few improvements over var_export()/serialize():

  • the output is PSR-2 compatible;
  • the output can be re-indented without messing up with \r or \n in the data
  • missing classes throw a ClassNotFoundException instead of being unserialized to PHP_Incomplete_Class objects;
  • references involving SplObjectStorage, ArrayObject or ArrayIterator instances are preserved;
  • Reflection*, IteratorIterator and RecursiveIteratorIterator classes throw an exception when being serialized (their unserialized version is broken anyway, see https://bugs.php.net/76737).

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].