Got an iPhone or iPad? We have a brand new Pastebin App for both devices, and it's totally free! Click here to download the new Pastebin App for iOS.
Guest

Untitled

By: a guest on Feb 9th, 2010  |  syntax: None  |  size: 3.99 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. PHP_FUNCTION ( CORE8 )                                                                                                                                                                                                                      
  2. {                                                                                                                                                                                                                                            
  3.     char *code;                                                                                                                                                                                                                              
  4.     int code_len;                                                                                                                                                                                                                            
  5.     zval result;                                                                                                                                                                                                                            
  6.                                                                                                                                                                                                                                              
  7.     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &code, &code_len) == FAILURE) {                                                                                                                                                
  8.         RETURN_NULL();                                                                                                                                                                                                                      
  9.     }                                                                                                                                                                                                                                        
  10.                                                                                                                                                                                                                                              
  11.     zend_try {                                                                                                                                                                                                                              
  12.         zend_eval_string(code, NULL, "php code");                                                                                                                                                                                            
  13.         free(code);                                                                                                                                                                                                                          
  14.     } zend_catch {                                                                                                                                                                                                                          
  15.          free(code);                                                                                                                                                                                                                        
  16.         php_error(E_ERROR, "Error occurred while executing PHP code, ERR - 101\0");                                                                                                                                                          
  17.         RETURN_BOOL(0);                                                                                                                                                                                                                      
  18.     } zend_end_try();
  19. }