text: 
  #ifdef HAVE_CONFIG_H
  #include "../../../ext_config.h"
  #endif
  
  #include <php.h>
  #include "../../../php_ext.h"
  #include "../../../ext.h"
  
  #include <Zend/zend_operators.h>
  #include <Zend/zend_exceptions.h>
  #include <Zend/zend_interfaces.h>
  
  #include "kernel/main.h"
  #include "kernel/fcall.h"
  #include "kernel/memory.h"
  #include "kernel/operators.h"
  #include "kernel/array.h"
  #include "ext/spl/spl_exceptions.h"
  #include "kernel/exception.h"
  
  
  /**
   * Phalcon\Validation\Validator\Alnum
   *
   * Check for alphanumeric character(s)
   *
   *<code>
   *use Phalcon\Validation\Validator\Alnum as AlnumValidator;
   *
   *$validator->add('username', new AlnumValidator(array(
   *   'message' => ':field must contain only alphanumeric characters'
   *)));
   *</code>
   */
  ZEPHIR_INIT_CLASS(Phalcon_Validation_Validator_Alnum) {
  
  	ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Validation\\Validator, Alnum, phalcon, validation_validator_alnum, phalcon_validation_validator_ce, phalcon_validation_validator_alnum_method_entry, 0);
  
  	return SUCCESS;
  
  }
  
  /**
   * Executes the validation
   */
  PHP_METHOD(Phalcon_Validation_Validator_Alnum, validate) {
  
  	zend_bool _2;
  	int ZEPHIR_LAST_CALL_STATUS;
  	zval *field = NULL;
  	zval *validation, *field_param = NULL, *value = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *_0 = NULL, *_1, *_3 = NULL, *_4$$4 = NULL, *_6$$4 = NULL, *_7$$4, *_5$$6;
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &validation, &field_param);
  
  	if (unlikely(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be a string") TSRMLS_CC);
  		RETURN_MM_NULL();
  	}
  	if (likely(Z_TYPE_P(field_param) == IS_STRING)) {
  		zephir_get_strval(field, field_param);
  	} else {
  		ZEPHIR_INIT_VAR(field);
  		ZVAL_EMPTY_STRING(field);
  	}
  
  
  	ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);
  	zephir_check_call_status();
  	ZEPHIR_INIT_VAR(_1);
  	ZVAL_STRING(_1, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY);
  	ZEPHIR_CALL_METHOD(&_0, this_ptr, "issetoption", NULL, 0, _1);
  	zephir_check_temp_parameter(_1);
  	zephir_check_call_status();
  	_2 = zephir_is_true(_0);
  	if (_2) {
  		_2 = ZEPHIR_IS_EMPTY(value);
  	}
  	if (_2) {
  		RETURN_MM_BOOL(1);
  	}
  	ZEPHIR_CALL_FUNCTION(&_3, "ctype_alnum", NULL, 436, value);
  	zephir_check_call_status();
  	if (!(zephir_is_true(_3))) {
  		ZEPHIR_INIT_VAR(_4$$4);
  		ZVAL_STRING(_4$$4, "label", ZEPHIR_TEMP_PARAM_COPY);
  		ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _4$$4);
  		zephir_check_temp_parameter(_4$$4);
  		zephir_check_call_status();
  		if (ZEPHIR_IS_EMPTY(label)) {
  			ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field);
  			zephir_check_call_status();
  		}
  		ZEPHIR_INIT_NVAR(_4$$4);
  		ZVAL_STRING(_4$$4, "message", ZEPHIR_TEMP_PARAM_COPY);
  		ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _4$$4);
  		zephir_check_temp_parameter(_4$$4);
  		zephir_check_call_status();
  		ZEPHIR_INIT_VAR(replacePairs);
  		zephir_create_array(replacePairs, 1, 0 TSRMLS_CC);
  		zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE);
  		if (ZEPHIR_IS_EMPTY(message)) {
  			ZEPHIR_INIT_VAR(_5$$6);
  			ZVAL_STRING(_5$$6, "Alnum", ZEPHIR_TEMP_PARAM_COPY);
  			ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _5$$6);
  			zephir_check_temp_parameter(_5$$6);
  			zephir_check_call_status();
  		}
  		ZEPHIR_INIT_NVAR(_4$$4);
  		object_init_ex(_4$$4, phalcon_validation_message_ce);
  		ZEPHIR_CALL_FUNCTION(&_6$$4, "strtr", NULL, 55, message, replacePairs);
  		zephir_check_call_status();
  		ZEPHIR_INIT_VAR(_7$$4);
  		ZVAL_STRING(_7$$4, "Alnum", ZEPHIR_TEMP_PARAM_COPY);
  		ZEPHIR_CALL_METHOD(NULL, _4$$4, "__construct", NULL, 435, _6$$4, field, _7$$4);
  		zephir_check_temp_parameter(_7$$4);
  		zephir_check_call_status();
  		ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _4$$4);
  		zephir_check_call_status();
  		RETURN_MM_BOOL(0);
  	}
  	RETURN_MM_BOOL(1);
  
  }
  
  