Diffs
PHP_Object/trunk/PHP/Object/Array.php
@@ -59,6 +59,7 @@
'implode' => 1,
'in_array' => 1,
'join' => 1,
+ 'key_exists' => 1,
'key' => 0,
'krsort' => 0,
'ksort' => 0,
@@ -102,12 +103,13 @@
public function offsetGet($offset)
{
- return self::factory($this->data[$this->revert($offset)]);
+ return self::factory(&$this->data[$this->revert($offset)]);
}
public function offsetSet($offset, $value)
{
$offset = $this->revert($offset);
+ $value = $this->revert($value);
if (is_null($offset)) {
$this->data[] = $value;
} else {
PHP_Object/trunk/PHP/Object/String.php
@@ -12,6 +12,7 @@
'addcslashes' => 0,
'addslashes' => 0,
'array_filter' => 1,
+ 'array_key_exists' => 0,
'array_reduce' => 1,
'array_map' => 0,
'array_reduce' => 1,
@@ -43,6 +44,7 @@
'is_a' => 1,
'is_subclass_of' => 1,
'join' => 0,
+ 'key_exists' => 0,
'lcfirst' => 0,
'ltrim' => 0,
'method_exists' => 1,
PHP_Object/trunk/PHP/Object.php
@@ -16,24 +16,61 @@
protected $aliasMethods = array();
protected $methodsReturningSelf = array(
+ 'clearstatcache',
+ 'closedir',
+ 'date_date_set',
+ 'date_isodate_set',
+ 'date_modify',
+ 'date_time_set',
+ 'date_timezone_set',
+ 'dba_close',
'debug_print_backtrace',
+ 'debug_zval_dump',
+ 'define_syslog_variables',
'flush',
+ 'header',
'ini_restore',
+ 'libxml_clear_errors',
+ 'libxml_set_streams_context',
+ 'mt_srand',
+ 'ncurses_bkgdset',
+ 'ncurses_filter',
+ 'ncurses_getmaxyx',
+ 'ncurses_getyx',
+ 'ncurses_init',
+ 'ncurses_noqiflush',
+ 'ncurses_qiflush',
+ 'ncurses_timeout',
+ 'ncurses_update_panels',
+ 'ncurses_use_env',
'ob_clean',
'ob_flush',
'ob_implicit_flush',
- 'date_add',
- 'date_date_set',
- 'date_isodate_set',
- 'date_modify',
+ 'openssl_free_key',
+ 'openssl_pkey_free',
+ 'openssl_x509_free',
+ 'parse_str',
+ 'passthru',
+ 'pcntl_exec',
'register_shutdown_function',
'restore_include_path',
+ 'rewinddir',
'session_set_cookie_params',
'session_unset',
'session_write_close',
'set_time_limit',
+ 'shmop_close',
+ 'socket_clear_error',
+ 'socket_close',
+ 'spl_autoload',
+ 'spl_autoload_call',
+ 'srand',
+ 'stream_bucket_append',
+ 'stream_bucket_prepend',
+ 'unregister_tick_function',
'usleep',
'var_dump',
+ 'zip_close',
);
public $argOffsets = array(
@@ -113,6 +150,7 @@
'ini_alter' => 1,
'ini_get_all' => NULL,
'ini_set' => 1,
+ 'key_exists' => 0,
'lcg_value' => NULL,
'localeconv' => NULL,
'localtime' => NULL,
@@ -244,7 +282,7 @@
public function __construct($data = NULL)
{
- $this->data = $data;
+ $this->data = &$data;
$parent = get_parent_class($this);
while ($parent !== false) {
@@ -298,29 +336,27 @@
public static function factory($data = NULL)
{
if (is_string($data)) {
- return new PHP_Object_String($data);
+ return new PHP_Object_String(&$data);
} else if (is_numeric($data)) {
if (is_int($data)) {
- return new PHP_Object_Numeric_Integer($data);
+ return new PHP_Object_Numeric_Integer(&$data);
} else {
- return new PHP_Object_Numeric($data);
+ return new PHP_Object_Numeric(&$data);
}
} else if (is_array($data)) {
- return new PHP_Object_Array($data);
+ return new PHP_Object_Array(&$data);
} else if (is_bool($data)) {
- return new PHP_Object_Boolean($data);
+ return new PHP_Object_Boolean(&$data);
} else if (is_null($data)) {
- return new PHP_Object_Null($data);
+ return new PHP_Object_Null(&$data);
} else if (is_object($data)) {
if ($data instanceof self) {
return $data;
} else {
- return new PHP_Object_Object($data);
+ return new PHP_Object_Object(&$data);
}
} else if (is_resource($data)) {
- return new PHP_Object_Resource($data);
- } else {
- return new PHP_Object($data);
+ return new PHP_Object_Resource(&$data);
}
}