Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]

From: Date: Thu, 03 Apr 2003 00:08:27 +0000
Subject: Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Type hints revisited [IllegalArgumentException instead of E_ERROR]
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-643@lists.php.net to get a copy of this message
On Fri, 2003-03-28 at 16:36, Brian Moon wrote: > | The point is that the SOAP (or whatever) library will be interfacing > | with code written by others. If those other people use type hints and > | it blows up with an E_ERROR, we don't have a nice way to handle this > | error and continue serving. > | > | This *is* a disaster, because we are introducing a feature that appears > | to be quite nice at first glance, but causes portability issues with > | peoples scripts; for instance; PEAR scripts that use type hints will > | immediately be incompatible with a larger application framework. > | Therefore, PEAR should not use type hints if it wants to remain > | portable. > > I am no "novice" programmer, but I don't get where you are going here. How > is there a portability problem? You are either calling the method with the > right paramaters or you aren't. What am I missing? You may be passing an object to a function that again calls a piece of library code using type hints (but you don't have to know that). If your object is of the wrong type, PHP dies. PEAR packages follow a strict "stay alive" policy, so this would not be acceptable for a PEAR package. In other words, PEAR can not use type hints if they may cause PHP to exit. - Stig

« previous php.internals (#643) next »