{"id":16915819,"url":"https://github.com/tysonandre/shortvarexport","last_synced_at":"2025-10-09T02:46:17.950Z","repository":{"id":75022585,"uuid":"93819725","full_name":"TysonAndre/ShortVarExport","owner":"TysonAndre","description":"Builds a small representation of PHP values as PHP code, similar to `var_export`, but with square brackets and less whitespace","archived":false,"fork":false,"pushed_at":"2017-06-12T20:14:54.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T02:46:16.354Z","etag":null,"topics":["php","var-export"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TysonAndre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-09T04:45:40.000Z","updated_at":"2017-06-09T04:47:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"aeac6a68-4aae-4545-aff8-7940b8cfc3ce","html_url":"https://github.com/TysonAndre/ShortVarExport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TysonAndre/ShortVarExport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TysonAndre%2FShortVarExport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TysonAndre%2FShortVarExport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TysonAndre%2FShortVarExport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TysonAndre%2FShortVarExport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TysonAndre","download_url":"https://codeload.github.com/TysonAndre/ShortVarExport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TysonAndre%2FShortVarExport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000768,"owners_count":26082906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","var-export"],"created_at":"2024-10-13T19:22:53.665Z","updated_at":"2025-10-09T02:46:17.785Z","avatar_url":"https://github.com/TysonAndre.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ShortVarExport\n==============\n\nIntroduction\n------------\n\nBuilds a smaller representation of PHP values as PHP code, similar to `var_export`.\n\nThe representation is also valid, executable PHP code.\n\nThis is compatible with PHP 7.0+ (Will work in php5 if you remove scalar type hints and return types, and `declare`)\n- See https://github.com/TysonAndre/Transphpile to automatically convert code\n\n`ShortVarExport\\Builder::build($value)` returns arrays formatted with the php 5.4 square bracket syntax.\nThis isn't fully tested yet.\n\nSupported data types:\n\n- arrays\n- scalars (string/float/int/bool)\n- null\n\nUnsupported data types, which will trigger an `InvalidArgumentException` (Support can be added by subclassing the class)\n(A subclass may be added in the future, supporting objects)\n\n- resource\n- objects\n\nLicense: MIT\n\nExamples of things this could be used for:\n- https://blog.graphiq.com/500x-faster-caching-than-redis-memcache-apc-in-php-hhvm-dcd26e8447ad\n\n\nUsage\n-----\n\n```php\nrequire_once '/path/to/Builder.php';\nuse ShortVarExport\\Builder;\necho Builder::build(2, Builder::MULTI_LINE), \"\\n\\n\";\necho Builder::build([\"value\", 42, 4 =\u003e [[\"newvalue\"]], \"key\" =\u003e \"othervalue\"], Builder::MULTI_LINE), \"\\n\";\n```\n\nOutput\n\n```\n2\n\n[\n\"value\",\n4 =\u003e [[\"newvalue\"]],\n\"key\" =\u003e \"othervalue\",\n]\n```\n\nTesting\n-------\n\n`php BuilderTest.php`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftysonandre%2Fshortvarexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftysonandre%2Fshortvarexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftysonandre%2Fshortvarexport/lists"}