Marcus Boerger wrote:
  Liskov applies to static methods as soon as calls via objects are common
which is true for PHP.

This is common in PHP and you consider this good practice? Interesting, wasn't what I would have expected...

I didn't say it is good practice, god behave :-)

So you're adding a warning to something useful (factory methods) to help people doing something dubious? ;-)

Language developers copy from each other. Copy in the sense of looking
at the ideas and experience from others and taking them over, in a
fashion that suites their own language. As PHP has a C like syntax and

Just make sure you don't fall into the trap of not seeing the great potential PHP has *because* it is different from the other languages.

PLEASE NOTE: I don't expect you to reply to the above points as my email is just meant as food for thought and we're discussing language design *philosophy* here which would take too much space with little hope of getting to an agreement. But that's ok, I accept your opinion and you're much more in charge of PHP than I am.

What help is needed, compiling the list of E_NOTICE/E_STRICT to be convert to E_DEPRECATED? Or giving input on how to convert the individual messages? I'm willing to help.

Yes such a list would be very helpfull. If you think individual messages
need to be altered other then changing the severity than we might need to
discuss that as well. Having the list of such messages would help anyway.

I don't consider the text of the messages itself as that crucial.

I attached a little script which greps for error types and outputs a file to quickly visit those places in the source files.

Hope this helps,
- Chris
<?php

$errortypes = "E_NOTICE|E_STRICT";
$editor = "vi";

exec('find . -name \*.[chl]', $files);
$files = preg_replace('|^./|', '', $files);
foreach ($files as $file)
{
        $function = "<unknown>";
        $lines = array();
        exec("egrep -n 
'^PHP_FUNCTION|((php_error_docref|zend_error).*($errortypes))' $file", $lines);

        foreach ($lines as $line)
        {
                list($linenumber, $message) = explode(":", $line, 3);
                $message = trim($message);

                if (preg_match('/^PHP_FUNCTION\(\s*(\w+)\s*\)/', $message, 
$regs))
                        $function = $regs[1];
                else
                        echo "$editor +$linenumber $file\t# $function: 
$message\n";
        }
}

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to