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


Groups > comp.lang.php > #16754

Re: not "autovivification", but ...?

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript, comp.lang.php
Subject Re: not "autovivification", but ...?
Followup-To comp.lang.php
Date 2016-06-02 02:16 +0200
Organization PointedEars Software (PES)
Message-ID <6429329.X1ROTxqqWj@PointedEars.de> (permalink)
References (1 earlier) <nik0k5$8mu$1@news.albasani.net> <1dc7bd11-343d-4cbb-b75d-1db8516666a0@googlegroups.com> <nin783$9qu$1@news.albasani.net> <d7cf47ca-3871-46e0-8434-b17ec1fe1440@googlegroups.com> <ninr5k$gee$1@news.albasani.net>

Cross-posted to 2 groups.

Followups directed to: comp.lang.php

Show all headers | View raw


Stefan Weiss wrote:

> PS, a little off-topic: PHP is probably the worst language to work with in
> this regard. It will happily allow implicit multi-level creation in arrays
> -
> 
>    // ($foo is unused up to this point)
>    $foo["bar"][13]["baz"] = "qux";

This is so very useful. (No sarcasm.)
 
> - but will emit E_NOTICE (a type of error)

A common misonception.  It is a kind of debug message instead and can be 
suppressed in various ways.

> if we try to read a nonexistent index ($foo["x"]).
                                  ^^^^^
The proper term is _key_, and if you write

  @$foo["x"]

the notice will go away without any extra configuration.

F'up2 comp.lang.php

-- 
PointedEars (ZCE PHP)
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

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


Thread

Re: not "autovivification", but ...? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-02 02:16 +0200
  Re: not "autovivification", but ...? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-02 11:47 +0200
    Re: not "autovivification", but ...? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-03 22:20 +0200
      Re: not "autovivification", but ...? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-04 16:24 +0200

csiph-web