FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » error message I don understand
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: error message I don understand [message #174901 is a reply to message #174898] Sun, 17 July 2011 13:01 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 7/17/2011 5:20 AM, The Natural Philosopher wrote:
> Thomas 'PointedEars' Lahn wrote:
>> liebling(dot)kreuzberg(at)gmail(dot)com wrote:
>>
>>> Denis McMahon wrote:
>>>> Consider:
>>>>
>>>> <?php
>>>>
>>>> function x()
>>>> {
>>>> return 5;
>>>> }
>>>>
>>>> x() = 1;
>>>>
>>>> ?>
>>>>
>>>> although x() gives the value 5, it is not a variable that can be
>>>> set, and
>>>> so you can not assign (or write) a value (such as 1) to it.
>>>>
>>>> The php error message is saying that you can't assign (or write) a
>>>> value
>>>> to a function call, or in other words, the return value of a function
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>> call is read_only data.
>> ^^^^^^^^^^^^^^^^^^^^^^^
>>> Thanks Dennis.
>>>
>>> Good addition to the explanation of Billy.
>>
>> In the end an oversimplified, wrong explanation. It is a syntactical
>> requirement, not a functional one:
>>
>> function x()
>> {
>> return array(23);
>> }
>>
>> $a = x();
>>
>> $a[0] = 42;
>>
>> /* * Array
>> * (
>> * [0] => 42 * )
>> */
>> print_r($a);
>>
>
> fair point, if pedantic.
>
>
>> You would be well-advised to post under your real name, as it is
>> customary in Usenet.
>>
>
> And have the Stuckle stalk you in real life?
>
> I think not.
>

LOL, are you hearing little voices in your head again?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ouion Movement, Roun Time (Floating Point Time)
Next Topic: [MEMCACHED] Is there a way to get the expiration of a key?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 06:19:25 GMT 2024

Total time taken to generate the page: 0.04929 seconds