Repository navigation
Zend: add new zend_object_init{_with_constructor}() API #24135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Girgias
wants to merge
17
commits into
php:master
Choose a base branch
from
Girgias:2026-09-zend_object_init_api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+257
−253
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
93db860
Zend: assert that the object is a Throwable in zend_throw_exception_i…
Girgias 7238c45
Zend: refactor _object_and_properties_init() to return zend_object*
Girgias c51ba83
Zend: add const qualifier to object API
Girgias 04b5b01
Zend: add new zend_object_init() API
Girgias 62b1370
Zend: migrate to new zend_object_init() API
Girgias e776a13
Zend: add zend_object_init_with_constructor() API
Girgias 452f637
Zend: refactor zend_get_attribute_object() to return zend_object*
Girgias 6ad8d6b
ftp: migrate to new zend_object_init() API
Girgias 716e019
hash: migrate to new zend_object_init() API
Girgias 98bf16f
pdo: migrate to new zend_object_init() API
Girgias 7f4ef66
socket: migrate to new zend_object_init() API
Girgias 0e40afd
shmop: migrate to new zend_object_init() API
Girgias d6f44c8
mysqli: migrate to new zend_object_init() API
Girgias 02ead33
streams: migrate to new zend_object_init() API
Girgias 2bdea0f
libxml: migrate to new zend_object_init() API
Girgias afd805f
phar: migrate to zend_object_init_with_constructor() API
Girgias 203213a
spl: migrate to zend_object_init_with_constructor() API
Girgias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change fixing a pre-existing bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it does, as that branch is tested via the
ext/zend_test/tests/zend_object_init_with_constructor.phptand the destructor doesn't seem to be called already. So I'm slightly confused. But this whole logic will go away when I get back round to remove the annoying get_constructor object handler.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this looks like a sus behaviour change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be testable with a non-final class that throws with a destructor. I don't think we have a class already that can show this difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that case already covered by the
ThrowingUserclass inext/zend_test/tests/zend_object_init_with_constructor.phpt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're looking for a class that throws in get_constructor without implicitly already calling zend_object_store_ctor_failed, and then subclass that with a destructor