Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
use strict

Posted by John_Moylan (John_Moylan), 17 July 2002
Well after using PHP for the past month my biggest gripe is the lack of 'use strict'.

This pragma has been a godsend in Perl, surely it's got to come soon to PHP.

Or am I the only one who thinks this?


Posted by admin (Graham Ellis), 18 July 2002
Both Perl and PHP have "grown up" from languages in which programmers wrote relativly short utility scripts into languages in which major applications are written. This forum is a good example - it happens to be written in Perl (yes, I know I'm posting on the PHP board!), but that's not the origins.  Recall that PHP was originally "Personal Home Pages", and Perl is the "Practical Extraction and reporting language".  Neither of these imply big applications.

When writing a shorter piece of code, having to declare variables adds code which isn't really necessary.  It takes time to type in all those "int" or "float", "my" or "our" words and ensure that they're all present, and for what real gain?  As your application gets longer, so variable declaration does have a point - it ensures that you don't have a "typo" somewhere in your code that is hard to find during testing and it helps in the "selfdocumentation" of something that's going to take more reading / understanding than a little utility.

PHP does not (as far as I know) have an equivalent of "use strict".  You can use the error_reporting function to help you catch variables that you have not initialised in your code; see the online manual at

Here's an example of it in use:

// Reporting E_NOTICE to report uninitialized
// variables or catch variable name misspellings ...
error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE);


This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

Comment: "I agree with John. The bulk of time is spent on design and ..."
Visitor Ranking 4.0 (5=excellent, 1=poor)

Comment by Rutishauser (published 2010-07-15)
I agree with John. The bulk of time is spent on design and debugging, rather than on pressing keys on the keyboard. So, no matter what you are writing, a big complicated program or a couple of simple lines, strict typification is certainly of great help. [#3629]

You can Add a comment or ranking or edit your own comments

Average page ranking - 4.0

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho