Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

__clone() method removal from Singleton#434

AliN11 started this conversation inGeneral
Discussion options

Hello. In the last commit the__clone() method was removed from the Singleton pattern. While defining this method as private guarantees that only one single instance will exist, can you explain the removal? Thanks.

<?php$obj = Singleton::getInstance();$obj2 =clone Singleton::getInstance();var_dump($obj ===$obj2);// false
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hi@AliN11, you are right, that method should not be removed. Seems like rector did remove it while running the refactorings towards PHP8 and I didn't notice. My bad, will re-add that.

You must be logged in to vote
1 reply
@AliN11
Comment options

Aha. I created a pull request#435

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@AliN11@domnikl

[8]ページ先頭

©2009-2025 Movatter.jp