Re: Why 5.2 should not be delayed for E_DEPRECATED
| From: | Hannes Magnusson | Date: | Tue, 24 Oct 2006 14:57:29 +0000 |
| Subject: | Re: Why 5.2 should not be delayed for E_DEPRECATED | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26230@lists.php.net to get a copy of this message | ||
On 10/24/06, Ilia Alshanetsky <ilia@prohost.org> wrote:
> Zeev,
>
> There are probably 5-6 new fatal errors in the engine since 5.1, some
> of which cannot be delegated to lower error reporting modes as they
> may cause engine instability or similar problems. Rasmus was going to
> make a list of all the newly added engine error changes, hopefully
> he'll have that list soon.
Attached is a list (php examples) over all the backwards incompatible
error throwing I could find...
-Hannes
>
>
> On 24-Oct-06, at 2:55 AM, Zeev Suraski wrote:
>
> > Ilia,
> >
> > I think Wez's suggestion is the most practical one. Let's make
> > sure we haven't introduced any fatal errors into 5.2 (and demote
> > them to E_STRICT for now), and handle the rest of the suggestions
> > afterwards.
> >
> > Zeev
> >
> > At 02:33 24/10/2006, Ilia Alshanetsky wrote:
> >> I've been reading people's replies to Marcus' RFC in regard to
> >> E_DEPRECATED and it seems that some people have expressed the want to
> >> delay 5.2 until mucking around with error handling is done one way or
> >> another. My simple answer to this is no.
> >>
> >> The long answer is as follows.
> >>
> >> PHP 5.2.0 is not the last 5.X release, there will be more patch level
> >> versions and at the very least at least one more major version, so we
> >> should not be trying to stuff every single feature under the sun
> >> into it as if it was the end of the 5 series. Furthermore, it makes
> >> little sense to make drastic error handling changes this late in the
> >> game, rushing the decision process and possibly excluding developers
> >> who do not read the list every day or are currently away. It should
> >> go through an extensive peer review and comment process, be tested,
> >> tried with real applications to see what breaks and so on, this is
> >> not a trivial change. Another words it is too major of a change to do
> >> at the last minute, rushing it will only lead to problems we'd end up
> >> cleaning up for many more releases to come. We also need to remember
> >> that 5.2 is already way behind schedule, which is important because
> >> it contains a fair number of security fixes, without which a good
> >> number of users are vulnerable to a variety of exploits. Delaying the
> >> release means not deploying those fixes and in my opinion is a
> >> disservice to all users of PHP.
> >>
> >> In my opinion we need to make a release, continue considering
> >> Marcus' RFC, develop a patch and push it to our real development tree
> >> PHP 6.0. If it proves to be solid and does not break (m)any
> >> applications it would be the first candidate to back-port to 5 series
> >> once 5.3 is under consideration.
> >>
> >>
> >> Ilia Alshanetsky
> >>
> >> --
> >> PHP Internals - PHP Runtime Development Mailing List
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> Ilia Alshanetsky
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
<?php /* PHP Warning: bzopen(): filename cannot be empty in /usr/src/php/examples/bzopen.no.filename.php on line 3 */ bzopen("", "w"); ?> <?php /* PHP Warning: bzopen(): 'a' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in /usr/src/php/examples/bzopen.wrong.stream.mode.php on line 3 */ bzopen("foo", "a"); $fp = fopen("foo", "a"); /* PHP Warning: bzopen(): cannot read from a stream opened in write only mode in /usr/src/php/examples/bzopen.wrong.stream.mode.php on line 7 */ bzopen($fp, "r"); ?> <?php /* PHP Warning: Invalid access mode -1 in /usr/src/php/examples/dbase.invalid.access.mode.php on line 3 */ dbase_open("foo", -1); ?> <?php /* PHP Fatal error: Class bar cannot implement previously implemented interface foo in /usr/src/php/examples/impliment.implemented.php on line 4 */ interface foo { } class bar implements foo, foo { } ?> <?php class foo { public $bar; function __get($var) { return $this->bar; } } $foo = new foo; /* PHP Notice: Indirect modification of overloaded property foo::$prop has no effect in /usr/src/php/examples/indirect.modification.of.overloaded.property.php on line 12 */ $bar =& $foo->prop; ?> <?php class foo implements iterator { public function current() { } public function next() { } public function key() { } public function valid() { } public function rewind() { } } $foo = new foo(); /* PHP Fatal error: An iterator cannot be used with foreach by reference in /usr/src/php/examples/iterator.foreach.by_ref.php on line 22 */ foreach($foo as &$ref) { } ?> <?php $key = "this is a secret key"; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); /* PHP Warning: An empty string was passed in /usr/src/php/examples/mcrypt.generic.empty.string.php on line 8 */ $encrypted_data = mcrypt_generic($td, ""); ?> <?php /* PHP Warning: Division by zero in /usr/src/php/examples/modulus.by.zero.php on line 3 */ print 10%0; ?> <?php /* PHP Warning: Invalid character set name: bogus_charset in /usr/src/php/examples/oci.bogus.charset.php on line 3 */ oci_connect("user", "pass", "db", "bogus_charset"); ?> <?php $oci = oci_connect("user", "pass", "db"); /* PHP Warning: username cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 4 */ oci_password_change($oci, "", "old", "new"); /* PHP Warning: old password cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 6 */ oci_password_change($oci, "user", "", "new"); /* PHP Warning: new password cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 8 */ oci_password_change($oci, "user", "old", ""); ?> <?php class foo { private function __construct() { } } class bar extends foo { public function __construct() { /* PHP Fatal error: Cannot call private foo::__construct() in /usr/src/php/examples/private.ctor.php on line 9 */ parent::__construct(); } } new bar; ?> <?php echo " "; /* PHP Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /usr/src/php/examples/session.cannot.regenerate.id.php on line 4 */ session_regenerate_id(); ?> <?php $obj = new SplFileObject(__FILE__); /* PHP Warning: SplFileObject::fgetcsv(): delimiter must be a character in /usr/src/php/examples/splfileobj.csv.must.be.char.php on line 4 */ $obj->fgetcsv("foo"); /* PHP Warning: SplFileObject::fgetcsv(): enclosure must be a character in /usr/src/php/examples/splfileobj.csv.must.be.char.php on line 6 */ $obj->fgetcsv(",", "foo"); ?> <?php /* PHP Strict Standards: Static function foo::bar() should not be abstract in /usr/src/php/examples/static.abstract.method.php on line 3 */ abstract class foo { abstract static function bar(); } ?> <?php /* PHP Warning: stream_filter_register(): Filter name cannot be empty in /usr/src/php/examples/stream.filter.cannot.be.empty.php on line 3 */ stream_filter_register("", "class"); /* PHP Warning: stream_filter_register(): Class name cannot be empty in /usr/src/php/examples/stream.filter.cannot.be.empty.php on line 5 */ stream_filter_register("filter", ""); ?> <?php /* PHP Warning: str_word_count(): Invalid format value 4 in /usr/src/php/examples/string.wordcount.invalid.format.value.php on line 3 */ str_word_count("string", 4); ?> <?php /* PHP Notice: strripos(): Offset is greater than the length of haystack string in /usr/src/php/examples/strripos.offset.greater.than.heystrack.php on line 3 */ strripos("foo", "f", 4); ?> <?php /* PHP Notice: strrpos(): Offset is greater than the length of haystack string in /usr/src/php/examples/strrpos.offset.greater.than.heystrack.php on line 3 */ strrpos("foo", "f", 4); ?> <?php class foo { public function __toString() { throw new Exception; } } try { /* PHP Fatal error: Method foo::__toString() must not throw an exception in /usr/src/php/examples/tostring.exception.php on line 9 */ print new foo; } catch(Exception $e) { } ?>
<?php /* PHP Warning: bzopen(): filename cannot be empty in /usr/src/php/examples/bzopen.no.filename.php on line 3 */ bzopen("", "w"); ?> <?php /* PHP Warning: bzopen(): 'a' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in /usr/src/php/examples/bzopen.wrong.stream.mode.php on line 3 */ bzopen("foo", "a"); $fp = fopen("foo", "a"); /* PHP Warning: bzopen(): cannot read from a stream opened in write only mode in /usr/src/php/examples/bzopen.wrong.stream.mode.php on line 7 */ bzopen($fp, "r"); ?> <?php /* PHP Warning: Invalid access mode -1 in /usr/src/php/examples/dbase.invalid.access.mode.php on line 3 */ dbase_open("foo", -1); ?> <?php /* PHP Fatal error: Class bar cannot implement previously implemented interface foo in /usr/src/php/examples/impliment.implemented.php on line 4 */ interface foo { } class bar implements foo, foo { } ?> <?php class foo { public $bar; function __get($var) { return $this->bar; } } $foo = new foo; /* PHP Notice: Indirect modification of overloaded property foo::$prop has no effect in /usr/src/php/examples/indirect.modification.of.overloaded.property.php on line 12 */ $bar =& $foo->prop; ?> <?php class foo implements iterator { public function current() { } public function next() { } public function key() { } public function valid() { } public function rewind() { } } $foo = new foo(); /* PHP Fatal error: An iterator cannot be used with foreach by reference in /usr/src/php/examples/iterator.foreach.by_ref.php on line 22 */ foreach($foo as &$ref) { } ?> <?php $key = "this is a secret key"; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); /* PHP Warning: An empty string was passed in /usr/src/php/examples/mcrypt.generic.empty.string.php on line 8 */ $encrypted_data = mcrypt_generic($td, ""); ?> <?php /* PHP Warning: Division by zero in /usr/src/php/examples/modulus.by.zero.php on line 3 */ print 10%0; ?> <?php /* PHP Warning: Invalid character set name: bogus_charset in /usr/src/php/examples/oci.bogus.charset.php on line 3 */ oci_connect("user", "pass", "db", "bogus_charset"); ?> <?php $oci = oci_connect("user", "pass", "db"); /* PHP Warning: username cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 4 */ oci_password_change($oci, "", "old", "new"); /* PHP Warning: old password cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 6 */ oci_password_change($oci, "user", "", "new"); /* PHP Warning: new password cannot be empty in /usr/src/php/examples/oci.no.empty.username.php on line 8 */ oci_password_change($oci, "user", "old", ""); ?> <?php class foo { private function __construct() { } } class bar extends foo { public function __construct() { /* PHP Fatal error: Cannot call private foo::__construct() in /usr/src/php/examples/private.ctor.php on line 9 */ parent::__construct(); } } new bar; ?> <?php echo " "; /* PHP Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /usr/src/php/examples/session.cannot.regenerate.id.php on line 4 */ session_regenerate_id(); ?> <?php $obj = new SplFileObject(__FILE__); /* PHP Warning: SplFileObject::fgetcsv(): delimiter must be a character in /usr/src/php/examples/splfileobj.csv.must.be.char.php on line 4 */ $obj->fgetcsv("foo"); /* PHP Warning: SplFileObject::fgetcsv(): enclosure must be a character in /usr/src/php/examples/splfileobj.csv.must.be.char.php on line 6 */ $obj->fgetcsv(",", "foo"); ?> <?php /* PHP Strict Standards: Static function foo::bar() should not be abstract in /usr/src/php/examples/static.abstract.method.php on line 3 */ abstract class foo { abstract static function bar(); } ?> <?php /* PHP Warning: stream_filter_register(): Filter name cannot be empty in /usr/src/php/examples/stream.filter.cannot.be.empty.php on line 3 */ stream_filter_register("", "class"); /* PHP Warning: stream_filter_register(): Class name cannot be empty in /usr/src/php/examples/stream.filter.cannot.be.empty.php on line 5 */ stream_filter_register("filter", ""); ?> <?php /* PHP Warning: str_word_count(): Invalid format value 4 in /usr/src/php/examples/string.wordcount.invalid.format.value.php on line 3 */ str_word_count("string", 4); ?> <?php /* PHP Notice: strripos(): Offset is greater than the length of haystack string in /usr/src/php/examples/strripos.offset.greater.than.heystrack.php on line 3 */ strripos("foo", "f", 4); ?> <?php /* PHP Notice: strrpos(): Offset is greater than the length of haystack string in /usr/src/php/examples/strrpos.offset.greater.than.heystrack.php on line 3 */ strrpos("foo", "f", 4); ?> <?php class foo { public function __toString() { throw new Exception; } } try { /* PHP Fatal error: Method foo::__toString() must not throw an exception in /usr/src/php/examples/tostring.exception.php on line 9 */ print new foo; } catch(Exception $e) { } ?>