Skip to content

Commit 0acfc73

Browse files
committed
Add note to clone() / ZEND_CLONE that implementations need to be kept in sync
1 parent 8b25a9b commit 0acfc73

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Zend/zend_builtin_functions.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ ZEND_FUNCTION(clone)
7777
Z_PARAM_OBJ(zobj)
7878
ZEND_PARSE_PARAMETERS_END();
7979

80+
/* clone() also exists as the ZEND_CLONE OPcode and both implementations must be kept in sync. */
81+
8082
zend_class_entry *scope = zend_get_executed_scope();
8183

8284
zend_class_entry *ce = zobj->ce;

Zend/zend_vm_def.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6006,6 +6006,8 @@ ZEND_VM_COLD_CONST_HANDLER(110, ZEND_CLONE, CONST|TMPVAR|UNUSED|THIS|CV, ANY)
60066006
SAVE_OPLINE();
60076007
obj = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R);
60086008

6009+
/* ZEND_CLONE also exists as the clone() function and both implementations must be kept in sync. */
6010+
60096011
do {
60106012
if (OP1_TYPE == IS_CONST ||
60116013
(OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {

Zend/zend_vm_execute.h

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)