On Mon, Jan 19, 2015 at 6:04 PM, Michael Wallner wrote:
>
> On 19 Jan 2015 12:30, "Ferenc Kovacs" wrote:
> >
> > On Mon, Jan 19, 2015 at 6:41 AM, Stanislav Malyshev >
> > wrote:
> >
> > > Hi!
> > >
> > > > This is pretty horrible and should be fixed by making sure that
> > >
> > > I don't see w
On 19 Jan 2015 12:30, "Ferenc Kovacs" wrote:
>
> On Mon, Jan 19, 2015 at 6:41 AM, Stanislav Malyshev
> wrote:
>
> > Hi!
> >
> > > This is pretty horrible and should be fixed by making sure that
> >
> > I don't see why it's so horrible. In fact, handling null is easier than
> > handling exception
Tony Marston wrote on 19/01/2015 09:54:
You are forgetting one minor thing - an object may be instantiated
from a
piece of procedural code. In fact the very first object can only be
instantiated from procedural code.
I'm not sure what you mean by the second sentence here; which is the
"ver
On Mon, Jan 19, 2015 at 6:41 AM, Stanislav Malyshev
wrote:
> Hi!
>
> > This is pretty horrible and should be fixed by making sure that
>
> I don't see why it's so horrible. In fact, handling null is easier than
> handling exception (and faster too, probably). Many functions that try
> to create o
"Rowan Collins" wrote in message
news:CALKiJKqpk7X0yn0d_PWOKU1S7m156dF7865aLCP5dLF=q39...@mail.gmail.com...
On 18 January 2015 at 11:28, Tony Marston wrote:
"Andrea Faulds" wrote in message news:23490588-0131-4B0F-A7AA-
c9c8c7666...@ajf.me...
<>
You are forgetting one minor thing - an
On 19 January 2015 at 05:48, Stanislav Malyshev wrote:
> Hi!
>
> > A constructor that fails is a hard failure (factory method failed to
> > produce the expected value), and is an exceptional case that can or
> cannot
> > be handled (via catch).
> > It's not just a failed operation (expected to ev
Hi!
> A constructor that fails is a hard failure (factory method failed to
> produce the expected value), and is an exceptional case that can or cannot
> be handled (via catch).
> It's not just a failed operation (expected to eventually fail), but
> something really went wrong, badly.
Why it is d
Hi!
> This is pretty horrible and should be fixed by making sure that
I don't see why it's so horrible. In fact, handling null is easier than
handling exception (and faster too, probably). Many functions that try
to create objects return null or false when unable to. Of course, we
could change it
On 18 January 2015 at 11:28, Tony Marston wrote:
> "Andrea Faulds" wrote in message news:23490588-0131-4B0F-A7AA-
> c9c8c7666...@ajf.me...
>
>>
>> Hi François,
>>
>> On 17 Jan 2015, at 15:37, François Laupretre
>>> wrote:
>>>
>>> I would prefer deciding that returning null is the standard way
"Andrea Faulds" wrote in message
news:23490588-0131-4b0f-a7aa-c9c8c7666...@ajf.me...
Hi François,
On 17 Jan 2015, at 15:37, François Laupretre
wrote:
I would prefer deciding that returning null is the standard way for a
constructor to inform the PHP core that the object creation failed (f
Hi,
On 18/01/2015 09:31, Sebastian Bergmann wrote:
Several classes in PHP return null when there is a problem in the
parameters passed to their constructor e.g.
[...]
Several constructors check the parameters that they are given.and
then just give a warning when they are not acceptable. e.
Am 17.01.2015 um 15:02 schrieb Dan Ackroyd:
> class constructors
PHP does not have class constructors (static method automatically
invoked when a class is initialized). It only supports object
constructors (method automatically invoked when an object is
created).
> Several classes in PHP
> De : Andrea Faulds [mailto:a...@ajf.me]
>
> I don’t really agree here. For some reason we have this tradition of not using
> exceptions for “procedural” stuff. That sort of makes sense for functions, but
> classes are “OOP” and therefore I don’t see a good reason why they
> shouldn’t throw except
On 17 January 2015 at 16:37, François Laupretre
wrote:
> > De : Dan Ackroyd [mailto:dan...@basereality.com]
> >
> > This is pretty horrible and should be fixed by making sure that
> > constructors either return an object or throw an exception.
> > Additionally the exception policy for core (that
On 17 January 2015 at 16:04, Rowan Collins wrote:
> The difference is that AFAIK all the exceptions returned by OOP extensions
> right now are of classes specific to that extension, whereas this would be a
> global engine-thrown exception.
Sorry - I wasn't clear. I didn't mean they should throw
On 17 January 2015 at 15:43, Andrea Faulds wrote:
> Hi François,
>
> > On 17 Jan 2015, at 15:37, François Laupretre
> wrote:
> >
> > I would prefer deciding that returning null is the standard way for a
> constructor to inform the PHP core that the object creation failed (for any
> reason). This
Hi François,
> On 17 Jan 2015, at 15:37, François Laupretre wrote:
>
> I would prefer deciding that returning null is the standard way for a
> constructor to inform the PHP core that the object creation failed (for any
> reason). This would be trapped by the core and cause a catchable fatal er
> De : Dan Ackroyd [mailto:dan...@basereality.com]
>
> This is pretty horrible and should be fixed by making sure that
> constructors either return an object or throw an exception.
> Additionally the exception policy for core (that was previously
> discussed here: http://marc.info/?t=1192637480
Hi,
I've been going through some bug reports, and have found there are
several bad behaviours related to class constructors that ought to be
corrected, but could only be done at a major version. The bad
behaviours are:
Constructors returning null
---
Several classes in PH
19 matches
Mail list logo