{"id":17370125,"url":"https://github.com/gianarb/priority-array-merge","last_synced_at":"2025-10-11T03:37:05.302Z","repository":{"id":25661126,"uuid":"29096744","full_name":"gianarb/priority-array-merge","owner":"gianarb","description":"Merge array with priority","archived":false,"fork":false,"pushed_at":"2015-01-12T20:47:06.000Z","size":145,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T21:43:42.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gianarb.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}},"created_at":"2015-01-11T15:54:27.000Z","updated_at":"2019-02-22T21:58:54.000Z","dependencies_parsed_at":"2022-07-12T09:22:41.921Z","dependency_job_id":null,"html_url":"https://github.com/gianarb/priority-array-merge","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fpriority-array-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fpriority-array-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fpriority-array-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gianarb%2Fpriority-array-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gianarb","download_url":"https://codeload.github.com/gianarb/priority-array-merge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245905249,"owners_count":20691753,"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","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":[],"created_at":"2024-10-16T00:23:38.328Z","updated_at":"2025-10-11T03:37:00.285Z","avatar_url":"https://github.com/gianarb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Priority merge array\n[![Build Status](https://travis-ci.org/gianarb/priority-array-merge.svg)](https://travis-ci.org/gianarb/priority-array-merge)\nThis lib help you to merge two array with key priority\n\n```php\n\u003c?php\n$mergeManager = new PriorityArray();\n$first = [\n    'companyId' =\u003e 0,\n    'companyCode' =\u003e 1,\n    'companyName' =\u003e 1,\n];\n$second = [\n    'companyId' =\u003e 1,\n    'companyCode' =\u003e 0,\n    'companyName' =\u003e 0,\n];\n$mergeManager-\u003esetMapPriority($first, $second);\n$arr1 = [\n    'companyId' =\u003e '012',\n    'companyCode' =\u003e 'B353sf',\n    'companyName' =\u003e 'Fox',\n];\n$arr2 = [\n    'companyId' =\u003e '024',\n    'companyCode' =\u003e 'A352gh',\n    'companyName' =\u003e 'BBC',\n];\nvar_dump($mergeManager-\u003emerge($arr1, $arr2));\n// output [\"companyId\"=\u003e\"024\", \"companyCode\": \"B353sf\", \"companyName\": \"Fox\"]\n```\n\n## Benchamarks\n```\nGianArb\\Benchmarks\\Util\\ArrayMergeEvent\n    Method Name                       Iterations    Average Time      Ops/second\n    -------------------------------  ------------  --------------    -------------\n    mergeTwoArrayWithNativeFunction: [1,000     ] [0.0000039789677] [251,321.46923]\n    mergeTwoArrayWithPriority      : [1,000     ] [0.0000096676350] [103,437.91462]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianarb%2Fpriority-array-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianarb%2Fpriority-array-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianarb%2Fpriority-array-merge/lists"}