Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2614

Re: error message I don understand

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.n-ix.net!news.belwue.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="ISO-8859-1"
Message-ID <2977017.SPkdTlGXAF@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Mon, 18 Jul 2011 17:19:33 +0200
User-Agent KNode/4.4.11
Content-Transfer-Encoding 7Bit
Subject Re: error message I don understand
Newsgroups comp.lang.php
References <4e2050e3$0$48996$dbd4f001@news.wanadoo.nl> <4e21e658$0$19265$a8266bb1@newsreader.readnews.com> <4e229b87$0$39844$dbd4d001@news.wanadoo.nl> <1661536.sHWYdyDnFx@PointedEars.de> <4e22f737$0$19237$a8266bb1@newsreader.readnews.com>
Followup-To comp.lang.php
MIME-Version 1.0
Lines 44
NNTP-Posting-Date 18 Jul 2011 17:19:33 CEST
NNTP-Posting-Host 0aa48f99.newsspool2.arcor-online.net
X-Trace DXC=mLa3;178l>Hk:C4l9A;OcOA9EHlD;3YcB4Fo<]lROoRA8kF<OcfhCOK9[GHo:1OE=IDZm8W4\YJNLUFDj8T]K0?CDmniOZG;K0KfW@^bdjG8JB
X-Complaints-To usenet-abuse@arcor.de
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:2614

Followups directed to: comp.lang.php

Show key headers only | View raw


Denis McMahon wrote:

> Thomas 'PointedEars' Lahn wrote:
>> In the end an oversimplified, wrong explanation.  It is a syntactical
>> requirement, not a functional one:
>> 
>>   $a = x();
> 
> Here you're assigning the return value of the function x() to the
> variable $a.
> 
>>   $a[0] = 42;
> 
> Here you're writing to the variable $a (or rather, in this case, to an
> element of the array that is variable $a).
> 
> Neither of these is trying to assign (write) a value to the return value
> of the function call.

Yes, it is.  The return value of the function is a one-element array, and 
with that assignment I am writing to the same memory area (or another memory 
area that holds a copy of the former's content) by changing the first 
element of the array.  IOW, the return value is _not_ read-only.

> Whether you call the issue syntactical or not is just irrelevant and
> messing about with semantics.

You are mistaken.  The issue is a syntactical one, not a functional one, 
because a function call (currently) cannot occur on the left-hand side of an 
assignment expression in PHP, *regardless* of the return value of function 
to be called.

IOW, it does not make sense to say that "the return value is read-only" as 
the function is *never* *called* and *no* return value is obtained in the 
first place then.  This is a rather important difference because syntax 
errors are detected by the parser upon (JIT-)compilation already.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 14:38 +0000
  Re: error message I don understand Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> - 2011-07-15 10:44 -0400
    Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 17:26 +0000
      Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 18:45 +0100
        Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 18:36 +0000
          Re: error message I don understand VanguardLH <V@nguard.LH> - 2011-07-15 14:25 -0500
            Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 21:36 +0100
              Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-16 09:17 +0000
                Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-16 13:52 +0100
              Re: error message I don understand Heinrich Käsner <heinkasner@gmail.com> - 2011-08-02 07:02 -0700
          Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 21:35 +0100
          Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-16 09:30 -0400
            Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-16 19:14 +0000
              Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-16 22:18 +0100
  Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 17:49 +0100
    Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 17:25 +0000
  Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-16 19:28 +0000
    Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-17 08:21 +0000
      Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-17 11:10 +0200
        Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 10:20 +0100
          Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:01 -0400
        Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:00 -0400
          Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-17 14:53 +0000
            Re: error message I don understand dougatmilmacdotcom@example.com (Doug Miller) - 2011-07-17 16:26 +0000
            Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 16:11 +0000
        Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-17 14:52 +0000
          Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 17:19 +0200
            Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-18 17:01 +0100
        Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 16:07 +0000
          Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 18:27 +0200
            Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 20:12 +0000
  Re: error message I don understand August Karlstrom <fusionfile@gmail.com> - 2011-07-17 14:55 +0200
    Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:03 -0400
      Re: error message I don understand August Karlstrom <fusionfile@gmail.com> - 2011-07-17 16:50 +0200
        Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 12:26 -0400
        Re: error message I don understand "Peter H. Coffin" <hellsop@ninehells.com> - 2011-07-17 11:31 -0500
          Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-17 19:47 +0200
            Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 14:12 -0400
            Re: Nasty language semantics (Was: error message I don understand) Robert Heller <heller@deepsoft.com> - 2011-07-17 13:26 -0500
            Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-17 20:23 +0100
              Re: Nasty language semantics (Was: error message I don understand) The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 20:50 +0100
                Re: Nasty language semantics (Was: error message I don understand) Robert Heller <heller@deepsoft.com> - 2011-07-17 15:17 -0500
                Re: Nasty language semantics (Was: error message I don understand) The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 21:21 +0100
                Re: Nasty language semantics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 18:17 +0200
                Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-17 23:06 +0100
                Re: Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 00:48 +0200
                Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 19:23 -0400
                Re: Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 01:51 +0200
                Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 21:18 -0400
                Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-18 09:22 +0100
                Re: Nasty language semantics (Was: error message I don understand) "Peter H. Coffin" <hellsop@ninehells.com> - 2011-07-18 10:57 -0500
        Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 17:55 +0200
          Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 20:31 +0200
            Re: Nasty language semantics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 21:29 +0200

csiph-web