# E_STRICT

- Thread: https://externals.io/message/5526
- Original archive: https://news-web.php.net/php.internals/5526
- Started by Andi Gutmans on 2003-11-18T22:00:30+00:00
- Messages: 13
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5526 — Andi Gutmans — 2003-11-18T22:00:30+00:00

URL: https://externals.io/message/5526#5526

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

---

## #5528 — Wojtek Meler — 2003-11-18T22:11:25+00:00

URL: https://externals.io/message/5526#5528 · In reply to: #5526

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

---

## #5530 — Jani Taskinen — 2003-11-18T23:26:43+00:00

URL: https://externals.io/message/5526#5530 · In reply to: #5526

>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

---

## #5531 — Ilia Alshanetsky — 2003-11-18T23:57:25+00:00

URL: https://externals.io/message/5526#5531 · In reply to: #5526

> 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

---

## #5554 — magnus@php.net — 2003-11-19T01:51:27+00:00

URL: https://externals.io/message/5526#5554 · In reply to: #5526

-----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

---

## #5540 — Sara Golemon — 2003-11-19T05:20:06+00:00

URL: https://externals.io/message/5526#5540 · In reply to: #5526

> 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;

---

## #5541 — Andi Gutmans — 2003-11-19T06:12:02+00:00

URL: https://externals.io/message/5526#5541 · In reply to: #5526

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:
> > […]
>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;

---

## #5557 — Ferdinand Beyer — 2003-11-19T15:20:25+00:00

URL: https://externals.io/message/5526#5557 · In reply to: #5526

> 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

---

## #5558 — Zeev Suraski — 2003-11-19T15:33:12+00:00

URL: https://externals.io/message/5526#5558 · In reply to: #5526

At 17:20 19/11/2003, Ferdinand Beyer wrote:
>
>
> > […]
>make sure
> > […]
>method of
> > […]
>this
> > […]
>
>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...

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

---

## #5656 — Sara Golemon — 2003-11-21T23:10:16+00:00

URL: https://externals.io/message/5526#5656 · In reply to: #5526

> 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

---

## #5821 — mfischer@gjat.josefine@Markus Fischer — 2003-11-30T11:01:19+00:00

URL: https://externals.io/message/5526#5821 · In reply to: #5526

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

---

## #5825 — Derick Rethans — 2003-11-30T12:39:13+00:00

URL: https://externals.io/message/5526#5825 · In reply to: #5821

> On Wed, Nov 19, 2003 at 12:00:30AM +0200, Andi Gutmans wrote :
> > […]
>
> 	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

---

## #5829 — mfischer@gjat.josefine@Markus Fischer — 2003-11-30T15:43:19+00:00

URL: https://externals.io/message/5526#5829 · In reply to: #5825

On Sun, Nov 30, 2003 at 01:39:13PM +0100, Derick Rethans wrote : 
> 
> > […]
> 
> Please file a documentation bug for this.

    Thanks, done.

	- Markus
