ID:               27150
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sven at leon dot uia dot mx
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: All (redhat 90)
 PHP Version:      5.0.0b3 (beta3)
 New Comment:

For the first part:
see bug #23920.
As for the second:
the answer is no.



Previous Comments:
------------------------------------------------------------------------

[2004-02-04 13:45:39] sven at leon dot uia dot mx

oops: forgot to write correct summarym, done

------------------------------------------------------------------------

[2004-02-04 13:43:39] sven at leon dot uia dot mx

Description:
------------
I have a number of feature requests:

1) Could it be possible to immediately access an array that was
returned from a function, just like its possible to access object
functions immediately? This way its easy to safely access arrays that
are privately stored inside an object (so that another person can not
(accidentally) change information inside that array.

i.e. $temp=$object->return_object($parameter)->data($key);
for an array (that is privately kept inside an object):
     $temp=$object->return_array($parameter)[$key];

where $object->return_array would be like:

function return_array(){
    return $copied_array=$private_array;
}

This same (feature request) has been asked in report 25898, but the
given "possible solution" did not seem to match my question. 

2) Could it be possible for functions that accept parameters by
reference, and return values by reference, to also accept static
value's like strings or booleans?

This would be very nice in situations where I would have to accept a
large string PLUS a small piece of text like "hey", and it would be
very usefull too in situations where I would  have to return either an
array or FALSE.

like this:

$data="hey";
test(TRUE, $data."<br>");
function test($param1, &$param2){
  $data=array($param2, "bye");
  If($param1)
  {
    return $data;
  }
  else
  {
    return FALSE;
  }
}

The above script will fail with beta 3 on both the parameters (since a
static string was part of $param2) and the return value (Becouse FALSE
is also not a variable)

This is a functionality I have used alot in other programming
languages, without problems. Sending strings by reference will (in my
opinion) make it possible to optimize your scripts a little more.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27150&edit=1

Reply via email to