Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14552
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: OO PHP result of new if a constructor fails |
| Date | 2014-11-13 00:46 +0100 |
| Organization | solani.org |
| Message-ID | <m40rg2$jic$1@solani.org> (permalink) |
| References | (3 earlier) <871tp9w15b.fsf@ahungry.com> <m3ukj6$5e8$1@dont-email.me> <87wq71ue02.fsf@ahungry.com> <m3vjto$p1$1@solani.org> <m3von1$pm6$1@dont-email.me> |
Denis McMahon wrote:
> On Wed, 12 Nov 2014 13:30:51 +0100, Christoph M. Becker wrote:
>
>> ... the documentation states that you should not
>> return anything from a __constructor() function. If you nonetheless do
>> so, you are violating the contract.
>
> Then at least a notice or warning should be raised.
That might be a good idea, but for the sake of consistency this would
have to be done in other places as well. Consider, for instance:
$a = [1, 2, 3];
array_walk($a, function ($el) {return 42;});
The returned value is silently discarded.
--
Christoph M. Becker
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
OO PHP result of new if a constructor fails "James Harris" <james.harris.1@gmail.com> - 2014-11-11 15:13 +0000
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-11 10:20 -0500
Re: OO PHP result of new if a constructor fails "James Harris" <james.harris.1@gmail.com> - 2014-11-11 15:56 +0000
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-11 11:03 -0500
Re: OO PHP result of new if a constructor fails "James Harris" <james.harris.1@gmail.com> - 2014-11-11 16:27 +0000
Re: OO PHP result of new if a constructor fails Matthew Carter <m@ahungry.com> - 2014-11-11 12:01 -0500
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-11 12:56 -0500
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-11 12:52 -0500
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-11 18:12 +0100
Re: OO PHP result of new if a constructor fails Richard Damon <Richard@Damon-Family.org> - 2014-11-11 13:03 -0500
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-11 23:54 +0100
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-12 03:00 +0100
Re: OO PHP result of new if a constructor fails Matthew Carter <m@ahungry.com> - 2014-11-11 22:25 -0500
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-11 22:36 -0500
Re: OO PHP result of new if a constructor fails Matthew Carter <m@ahungry.com> - 2014-11-12 01:30 -0500
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-12 07:08 -0500
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-12 13:30 +0100
Re: OO PHP result of new if a constructor fails Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-12 13:52 +0000
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-13 00:46 +0100
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-12 22:28 -0500
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-12 21:30 +0100
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-13 01:15 +0100
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-13 04:09 +0100
Re: OO PHP result of new if a constructor fails Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2014-11-13 07:42 +0000
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-13 14:11 +0100
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-13 21:40 +0100
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-14 13:49 +0100
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-14 23:25 +0100
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-12 22:29 -0500
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-13 21:45 +0100
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-13 15:56 -0500
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-13 22:09 +0100
Re: OO PHP result of new if a constructor fails Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-13 21:03 -0500
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-13 22:47 +0100
Re: OO PHP result of new if a constructor fails Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-13 22:59 +0100
Re: OO PHP result of new if a constructor fails "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-18 19:02 +0100
csiph-web