Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avoid clashes in the global scope by using filename in class name
  • Loading branch information
krakjoe committed Sep 29, 2013
1 parent f880310 commit 903bff5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Zend/zend_compile.c
Expand Up @@ -2252,7 +2252,15 @@ void zend_do_create_anon_class(znode *result TSRMLS_DC) { /* {{{ */
prefix_name += Z_STRLEN_P(
CG(current_namespace)) + sizeof("\\")-1;
}
} else prefix_name = "Class";
} else {
/* use filename as prefix for class */
prefix_name = CG(active_op_array)->filename;
}
}

if (!prefix_name) {
/* this shouldn't happen, possibly emit a warning ? */
prefix_name = "Class";
}

/* populate znode constant with generated anonymous class name */
Expand Down

0 comments on commit 903bff5

Please sign in to comment.