On Mon, Jul 14, 2014 at 02:19:15PM +0200, Ferenc Kovacs wrote:

> >     function foo(int $a)
> >     {
> >         var $b;        // $b has no type hinting
> >         var float $c;  // $c is a float
> >         string $d;     // alternative to the syntax used for $c (see below)
> >     }

> I think it would be better to reuse declare() instead of reusing var.

As a matter of curiosity, why ?

The nice thing about 'var' is that it is the syntax used by other languages, eg
Javascript.

> What error level would it emit though?
> I anything below E_RECOVERABLE_ERROR, then it doesn't do anything, but
> prints a line to the error log(and or displays it), which we already do,
> because using an undefined variable will emit an E_NOTICE
> I think it is a good thing if we make it easier to spot programming errors
> and bail out early instead of trying to guess the developer's intention,
> but I don't think that adding more fatal errors or
> E_RECOVERABLE_ERRORs(which will be fatal if there is no userland error
> handler defined which explicitly allows to continue the execution).

This sort of error should be picked up the first time that the script is
compiled, it does not need to be executed (other than conditional includes).
This means that these errors will be picked up very quickly.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>

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

Reply via email to