php / php/php-src

SimpleXMLElement Serialization

Open
#14,742 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: simplexml Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

From what i can tell the SimpleXMLElement class can be very easily serialised/unserialised which would be very useful for use with var_exports and keeping state between requests without the need for the stored source for the xml, would it be possible to have __serialise() which outputs the string representation of the xml, and __unserialise() which just calls simplexml_load_string() and returns the new instance?

the __set_state() method would also be useful but serialise would be beneficial to a larger audience

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the SimpleXMLElement implementation and existing PHP serialization hooks, then compare the requested serialization, unserialization, and __set_state behavior with current extension conventions. Done means the agreed API behavior is implemented and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.