Hallo Tom,
Aber $_SESSION und $HTTP_SESSION_VARS sind nicht dasselbe Objekt.
Doch, sind sie (naja, außer, dass sie ein Array und kein Objekt sind ;-)):
-------------------------------------- schnipp -----------------------------
christian@cobalt ~/dev/php5.2 $ gdb sapi/cli/php
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break ZEND_ECHO_SPEC_CV_HANDLER
Breakpoint 1 at 0x837b871: file /home/christian/dev/php5.2/Zend/zend_vm_execute.h, line 19340.
(gdb) break ZEND_ECHO_SPEC_VAR_HANDLER
Breakpoint 2 at 0x8355b4e: file /home/christian/dev/php5.2/Zend/zend_vm_execute.h, line 7050.
(gdb) run
Starting program: /home/christian/dev/php5.2/sapi/cli/php
[Thread debugging using libthread_db enabled]
[New Thread 0xb769b6e0 (LWP 1604)]
<?php
session_start ();
echo $_SESSION;
echo $HTTP_SESSION_VARS;
?>
[Switching to Thread 0xb769b6e0 (LWP 1604)]
Breakpoint 2, ZEND_ECHO_SPEC_VAR_HANDLER (execute_data=0xbf969a54)
at /home/christian/dev/php5.2/Zend/zend_vm_execute.h:7050
7050 zend_op *opline = EX(opline);
(gdb) n
7053 zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
(gdb) n
7055 if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
(gdb) print z
$1 = (zval *) 0xa37cfe4
(gdb) c
Continuing.
Array
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER (execute_data=0xbf969a54)
at /home/christian/dev/php5.2/Zend/zend_vm_execute.h:19340
19340 zend_op *opline = EX(opline);
(gdb) n
19343 zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
(gdb) n
19345 if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
(gdb) print z
$2 = (zval *) 0xa37cfe4
-------------------------------------- schnapp -----------------------------
Wie man sehen kann, zeigen die Operhands der beiden echo-Opcodes beide auf die gleiche Variable, hier zufälligerweise an Speicherposition 0xa37cfe4.
Und wie es mit $_POST und $HTTP_POST_VARS und mit $_GET und $HTTP_GET_VARS?
Das gleiche wie mit $_SERVER, $_SESSION, etc.
Viele Grüße,
Christian