Hey,
I added an E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.
If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.
Andi
Andi Gutmans wrote:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.
c) references usage - things like:
<?
function f() {...}
function &r() {...}
$a = f(); //OK
$b =&r(); //OK
$a =&f(); //warning - function returns value but reference assigned
$b = r(); //warning - function returns reference but value assigned
?>
regards,
Wojtek
Hey,
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.
When different case used for calling defined functions/methods? :)
--Jani
If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.
When objects are passed to functions intended for arrays.
Ilia
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I did a quick search in the manual and found a bunch of deprecated functions..
Here are some of them:
mysql_db_query
mysql_listtables
mysql_createdb
mysql_dropdb
mysql_selectdb
mysql_listfields
... and a bunch of other aliases.
call_user_method
call_user_method_array
session_register
pdf_add_annotation -- Deprecated: Adds annotation
pdf_add_outline -- Deprecated: Adds bookmark for current page
pdf_endpath -- Deprecated: Ends current path
pdf_get_font -- Deprecated: font handling
pdf_get_fontname -- Deprecated: font handling
pdf_get_fontsize -- Deprecated: font handling
pdf_get_image_height -- Deprecated: returns height of an image
pdf_get_image_width -- Deprecated: Returns width of an image
pdf_open_gif -- Deprecated: Opens a GIF image
pdf_open_jpeg -- Deprecated: Opens a JPEG image
pdf_open_png -- Deprecated: Opens a PNG image
pdf_open_tiff -- Deprecated: Opens a TIFF image
pdf_open -- Deprecated: Open a new pdf object
pdf_set_char_spacing -- Deprecated: Sets character spacing
pdf_set_duration -- Deprecated: Sets duration between pages
pdf_set_font -- Deprecated: Selects a font face and size
pdf_set_info_author -- Deprecated: Fills the author field of the document
pdf_set_info_creator -- Deprecated: Fills the creator field of the document
pdf_set_info_keywords -- Deprecated: Fills the keywords field of the document
pdf_set_info_subject -- Deprecated: Fills the subject field of the document
pdf_set_info_title -- Deprecated: Fills the title field of the document
pdf_set_leading -- Deprecated: Sets distance between text lines
pdf_set_text_matrix -- Deprecated: Sets the text matrix
pdf_set_text_rendering -- Deprecated: Determines how text is rendered
pdf_set_text_rise -- Deprecated: Sets the text rise
pdf_set_word_spacing -- Deprecated: Sets spacing between words
pdf_setpolydash -- Deprecated: Sets complicated dash pattern
"The previous syntax of: $conn = pg_connect ("host", "port", "options",
"tty", "dbname") has been deprecated."
And don't forget that $HTTP_*_VARS are deprecated too.
I was lazy and didn't care to remove the descriptions..
/Magnus
Hey,
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.Andi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/usyk8JJ96JyIrNYRAmvnAJ44ltdG640B4vKlypE5TbRysT7mYgCdG5pq
tXRBrVHsFhV7oh/pHmNnDm4=
=IHOJ
-----END PGP SIGNATURE
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Should E_STRICT
halt execution (as with E_ERROR) or simply state a warning
(as with E_NOTICE
/ E_WARNING)?
Either way main/main.c : php_error_cb() needs something like the following
(Looking for thoughts on exact verbage)
Index: main/main.c
RCS file: /repository/php-src/main/main.c,v
retrieving revision 1.579
diff -u -r1.579 main.c
--- main/main.c 9 Oct 2003 02:58:34 -0000 1.579
+++ main/main.c 19 Nov 2003 05:18:15 -0000
@@ -723,6 +723,9 @@
case E_USER_NOTICE:
error_type_str = "Notice";
break;
-
case E_STRICT:
-
error_type_str = "Strict Standards";
-
break; default: error_type_str = "Unknown error"; break;
Just a warning.
I commited your patch. Not sure about the naming but it's the status quo
for now :)
Andi
At 09:20 PM 11/18/2003 -0800, Sara Golemon wrote:
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).Should
E_STRICT
halt execution (as with E_ERROR) or simply state a warning
(as withE_NOTICE
/ E_WARNING)?Either way main/main.c : php_error_cb() needs something like the following
(Looking for thoughts on exact verbage)Index: main/main.c
RCS file: /repository/php-src/main/main.c,v
retrieving revision 1.579
diff -u -r1.579 main.c
--- main/main.c 9 Oct 2003 02:58:34 -0000 1.579
+++ main/main.c 19 Nov 2003 05:18:15 -0000
@@ -723,6 +723,9 @@
case E_USER_NOTICE:
error_type_str = "Notice";
break;
case E_STRICT:
error_type_str = "Strict Standards";
break; default: error_type_str = "Unknown error"; break;
Hey,
I added an
E_STRICT
error level today which purists can use to
make sure
that there scripts are using the latest and greatest suggested
method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to
this
option let me know. For obvious reasons this will be off by default.Andi
What's the difference between E_NOTICE
and E_STRICT
then?
It would be as easy to trigger errors like
"Notice: Use of deprecated function is_a
; use instanceof
instead"
Purists who want to be sure to be coding >The PHP Way< will use
error_level = E_ALL
anyway...
--
Ferdinand Beyer
<fb@fbeyer.com
At 17:20 19/11/2003, Ferdinand Beyer wrote:
Hey,
I added an
E_STRICT
error level today which purists can use to
make sure
that there scripts are using the latest and greatest suggested
method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to
this
option let me know. For obvious reasons this will be off by default.Andi
What's the difference between
E_NOTICE
andE_STRICT
then?It would be as easy to trigger errors like
"Notice: Use of deprecated functionis_a
; useinstanceof
instead"Purists who want to be sure to be coding >The PHP Way< will use
error_level =E_ALL
anyway...
I think we discussed this in the past, but the one (or rather, two) line
summary - E_NOTICE
is usable for many practical non-purist situations, such
as detection of broken variable names, etc. We don't want to force people
that want their code to be E_NOTICE
clean to also be fully compliant with
the latest PHP compatibility guidelines...
Zeev
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.
Here's another:
$foo = "I am a string";
$firstchar = $foo[0]; /* As opposed to $foo{0} */
-Sara
On Wed, Nov 19, 2003 at 12:00:30AM +0200, Andi Gutmans wrote :
Hey,
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.
Maybe it should be noted somewhere that `E_ALL` no longer is 2047 but
4095 in its value (maybe important for Apache php_value directives).
- Markus
On Wed, Nov 19, 2003 at 12:00:30AM +0200, Andi Gutmans wrote :
Hey,
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).
Ideas are things like:
a) Not using var for member variables but moving to PPP.
b) Not using is_a but using instanceof.If you have any further ideas of stuff which makes sense to add to this
option let me know. For obvious reasons this will be off by default.Maybe it should be noted somewhere that
E_ALL
no longer is 2047 but
4095 in its value (maybe important for Apache php_value directives).
Please file a documentation bug for this.
Derick
On Sun, Nov 30, 2003 at 01:39:13PM +0100, Derick Rethans wrote :
On Wed, Nov 19, 2003 at 12:00:30AM +0200, Andi Gutmans wrote :
I added an
E_STRICT
error level today which purists can use to make sure
that there scripts are using the latest and greatest suggested method of
coding (according to what we decide).Maybe it should be noted somewhere that `E_ALL` no longer is 2047 but 4095 in its value (maybe important for Apache php_value directives).
Please file a documentation bug for this.
Thanks, done.
- Markus