RepositoryPHP
MY

myclabs/DeepCopy

Create deep copies (clones) of your objects

8.9ksao
108fork
15issue
2lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: clone-deep

#1 Repository của tuần

8
TINIX TRENDING·Chủ đề: clone

#8 Repository của tuần

📦 DeepCopy: Sao chép đối tượng PHP một cách thông minh

DeepCopy giúp tạo bản sao sâu (clones) của các đối tượng PHP, đặc biệt xử lý tốt các chu trình tham chiếu (cycles).

DeepCopy là thư viện PHP giúp tạo bản sao sâu của đối tượng — sao chép cả các thuộc tính tham chiếu đến đối tượng khác. Không chỉ vậy, nó còn xử lý hiệu quả các chu trình (cycles) trong đồ thị tham chiếu, trường hợp thường gây lỗi với clone thông thường.

✨ Điểm nổi bật

  • Sao chép sâu toàn bộ: Duyệt đệ quy tất cả thuộc tính và sao chép cả đối tượng tham chiếu.
  • Xử lý chu trình tham chiếu: Dùng bảng băm (hash map) để tránh sao chép trùng lặp và giữ nguyên cấu trúc đồ thị.
  • Hỗ trợ bộ lọc (filters): Tùy chỉnh hành vi sao chép bằng cách thêm filter và matcher.
  • Hàm tiện ích deep_copy(): Cung cấp hàm nhanh để sao chép bất kỳ biến nào.
  • Tùy biến đối tượng DeepCopy: Cho phép cấu hình riêng thông qua lớp DeepCopy.
  • Hỗ trợ Doctrine: Các bộ lọc như DoctrineCollectionFilter, DoctrineEmptyCollectionFilter hỗ trợ thực thể Doctrine.

💡 Vì sao đáng chú ý

DeepCopy khác với clone thông thường ở khả năng xử lý chu trình tham chiếu — trường hợp thường dẫn đến vòng lặp vô hạn hoặc lỗi bộ nhớ. Ngoài ra, hệ thống filter và matcher linh hoạt giúp người dùng kiểm soát chi tiết quá trình sao chép, phù hợp cho các ứng dụng phức tạp như quản lý thực thể Doctrine hoặc xử lý dữ liệu có cấu trúc đối tượng phức tạp.


#PHP #Clone #DeepCopy #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryPHP
symfony/var-exporter

Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects

2.1k
Nov 4, 2026
RepositoryPHP
solcloud/Counter-Strike

Multiplayer FPS game - Counter-Strike: Football 🏉

988
Sep 9, 2025
RepositoryPHP
XGProyect/XG-Proyect-v3.x.x

XG Proyect is an OGame clone open-source web application framework designed for creating game clones, particularly those inspired by the popular game OGame, set in a vast and captivating space-themed universe.

167
May 30, 2026
RepositoryTypeScript
LibreChat-AI/LibreChat

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

47.6k
Nov 29, 2026
RepositoryTypeScript
JCodesMore/ai-website-cloner-template

Clone any website with one command using AI coding agents

40.3k
Dec 2, 2026
RepositoryC
RfidResearchGroup/proxmark3

Iceman Fork - Proxmark3

6.3k
Nov 30, 2026
RepositoryPython
anasty17/mirror-leech-telegram-bot

Official Repository: Telegram bot which can download direct links, torrents, nzb, google drive, telegram document, any file/folder from rclone supported clouds, all yt-dlp supported sites and jdownloader supported sites, then upload them to google drive, telegram cloud or to one of rclone supported clouds

4.4k
Nov 24, 2026
RepositoryC
bvschaik/julius

An open source re-implementation of Caesar III

3.5k
Nov 29, 2026
RepositoryGo
gabrie30/ghorg

Quickly clone or backup massive amounts of org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more 🐇🥚

2.2k
Dec 1, 2026