@@ -411,78 +411,6 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
411411 zend_string_release_ex (class_name , 0 );
412412 zend_string_efree (constant_name );
413413 return ret_constant ;
414- /*
415- zend_class_entry *ce = NULL;
416- zend_class_constant *c = NULL;
417- zval *ret_constant = NULL;
418-
419- if (zend_string_equals_literal_ci(class_name, "self")) {
420- if (UNEXPECTED(!scope)) {
421- zend_throw_error(NULL, "Cannot access \"self\" when no class scope is active");
422- goto failure;
423- }
424- ce = scope;
425- } else if (zend_string_equals_literal_ci(class_name, "parent")) {
426- if (UNEXPECTED(!scope)) {
427- zend_throw_error(NULL, "Cannot access \"parent\" when no class scope is active");
428- goto failure;
429- } else if (UNEXPECTED(!scope->parent)) {
430- zend_throw_error(NULL, "Cannot access \"parent\" when current class scope has no parent");
431- goto failure;
432- } else {
433- ce = scope->parent;
434- }
435- } else if (zend_string_equals_ci(class_name, ZSTR_KNOWN(ZEND_STR_STATIC))) {
436- ce = zend_get_called_scope(EG(current_execute_data));
437- if (UNEXPECTED(!ce)) {
438- zend_throw_error(NULL, "Cannot access \"static\" when no class scope is active");
439- goto failure;
440- }
441- } else {
442- ce = zend_fetch_class(class_name, flags);
443- }
444- if (ce) {
445- c = zend_hash_find_ptr(CE_CONSTANTS_TABLE(ce), constant_name);
446- if (c == NULL) {
447- if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
448- zend_throw_error(NULL, "Undefined constant %s::%s", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
449- goto failure;
450- }
451- ret_constant = NULL;
452- } else {
453- if (!zend_verify_const_access(c, scope)) {
454- if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
455- zend_throw_error(NULL, "Cannot access %s constant %s::%s", zend_visibility_string(ZEND_CLASS_CONST_FLAGS(c)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
456- }
457- goto failure;
458- }
459- ret_constant = &c->value;
460- }
461- }
462-
463- if (ret_constant && Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) {
464- zend_result ret;
465-
466- if (IS_CONSTANT_VISITED(ret_constant)) {
467- zend_throw_error(NULL, "Cannot declare self-referencing constant %s::%s", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
468- ret_constant = NULL;
469- goto failure;
470- }
471-
472- MARK_CONSTANT_VISITED(ret_constant);
473- ret = zval_update_constant_ex(ret_constant, c->ce);
474- RESET_CONSTANT_VISITED(ret_constant);
475-
476- if (UNEXPECTED(ret != SUCCESS)) {
477- ret_constant = NULL;
478- goto failure;
479- }
480- }
481- failure:
482- zend_string_release_ex(class_name, 0);
483- zend_string_efree(constant_name);
484- return ret_constant;
485- */
486414 }
487415
488416 /* non-class constant */
0 commit comments