hwo to read out variables ?
| From: | Thomas Fromm | Date: | Fri, 08 Sep 2000 18:14:34 +0000 |
| Subject: | hwo to read out variables ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32708@lists.php.net to get a copy of this message | ||
Hi,
I want to read out values with a extension function from the running PHP
skript.
i wrote something like that:
pval **print_trace; // i also tried (zval)
if(zend_hash_find(&EG(symbol_table),"print_trace",12,(void **)
&print_trace)!=FAILURE){
PHPWRITE((*print_trace)->value.str.val, (*print_trace)->value.str.len);
}
print_trace is the global variable in the php skript.
start this programm produce a core dump, if i use (*print_trace)->value.str.val
in any way.
here the backtrace:
#0 0x40140bd1 in _IO_new_file_xsputn (f=0x401dc7c0, data=0x1, n=11)
at fileops.c:765
#1 0x4013ce6e in _IO_fwrite (buf=0x1, size=1, count=11, fp=0x401dc7c0)
at iofwrite.c:44
#2 0x805c08b in sapi_cgibin_ub_write (str=0x1 <Address 0x1 out of bounds>,
str_length=11) at cgi_main.c:93
#3 0x80b3403 in php_ub_body_write_no_header (
str=0x1 <Address 0x1 out of bounds>, str_length=11) at output.c:312
#4 0x80b3494 in php_ub_body_write (str=0x1 <Address 0x1 out of bounds>,
str_length=11) at output.c:349
#5 0x80b3092 in php_body_write (str=0x1 <Address 0x1 out of bounds>,
str_length=11) at output.c:81
#6 0x8067216 in zend_if_trace (ht=4, return_value=0x816b1ec, this_ptr=0x0,
return_value_used=0) at inubit.c:196
#7 0x80f42b5 in execute (op_array=0x816b104) at ./zend_execute.c:1519
#8 0x80c9aa8 in zend_execute_scripts (type=8, file_count=3) at zend.c:712
#9 0x805e5d1 in php_execute_script (primary_file=0xbffff594) at main.c:1173
#10 0x805cc29 in main (argc=2, argv=0xbffff5f4) at cgi_main.c:711
iam on the wrong way ? how else can i read out variables ?
thanks for help,
thomas
--
-----------------------------------------------------------------
InUBIT - your e-business partner! http://www.inubit.com
http://tfromm.com mailto:tf@inubit.com
"go away or I will replace you with a small php script."