The Artima Developer Community
Sponsored Link

PHP Buzz Forum
removing that stupid is_a warning.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Knowles

Posts: 390
Nickname: alank
Registered: Sep, 2004

Alan Knowles is Freelance Developer, works on PHP extensions and PEAR.
removing that stupid is_a warning. Posted: Mar 17, 2005 2:04 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Alan Knowles.
Original Post: removing that stupid is_a warning.
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Alan Knowles
Latest Posts From Smoking toooo much PHP

Advertisement
My new pet hate about PHP5 is currently the rather stupid warning:

"Strict Standards
: is_a(): Deprecated. Please use the instanceof operator in"

Why on earth is that in there? instance of requires that the class or interface you are testing against exists. That means loading code that may not actually be used if you are using negative testing.


That shouts out ineffeciency, and doesnt really give you and readibility or particularly major gains in terms of code doing the testing for you.

It's about the only warning that PHP4 code emits when running under E_STRICT if you disable it when loading the code.

here is the simple patch to get rid of this crazyness..
 

--- zend_builtin_functions.c 1 Feb 2005 19:05:56 -0000 1.256
+++ zend_builtin_functions.c 17 Mar 2005 08:20:42 -0000
@@ -672,7 +672,6 @@
Returns true if the object is of this class or has this class as one of its parents */
ZEND_FUNCTION(is_a)
{
- zend_error(E_STRICT, "is_a(): Deprecated. Please use the instanceof operator");
is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */


Read: removing that stupid is_a warning.

Topic: The Hypertext d20 SRD Previous Topic   Next Topic Topic: PHP Magazin 3.2005

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use