On Wed, Feb 25, 2015 at 4:30 AM, Dmitry Stogov dmi...@zend.com wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
var_dump(foo(5));
?
a.php
=
?php
declare(strict_types=0)
function
On Wed, 25 Feb 2015 16:55:57 +0400, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov inefe...@gmail.com
wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com
wrote:
anyone may tell, what this will print without running :)
main.php
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
var_dump(foo(5));
?
a.php
=
?php
declare(strict_types=0)
function foo(string $a): string {
bar($a);
return $a;
}
?
b.php
=
?php
On Wed, Feb 25, 2015 at 3:54 PM, Shashank Kumar shashankkumar...@gmail.com
wrote:
On Wed, Feb 25, 2015 at 4:30 AM, Dmitry Stogov dmi...@zend.com wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
On Wed, Feb 25, 2015 at 3:15 PM, Niktia Nefedov inefe...@gmail.com wrote:
On Wed, 25 Feb 2015 16:55:57 +0400, Dmitry Stogov dmi...@zend.com
wrote:
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov inefe...@gmail.com
wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com
Hi Anthony,
Few notes:
- first of all, it would be great to split the voting questions: 2/3 -
implement scalar type hinting + 1/2 - in addition add strict type hinting
as you propose. I think, the concept of run-time declare() switch is not
designed well. It just affects VM and JITed code in
Hi,
Le 25 févr. 2015 13:31, Dmitry Stogov dmi...@zend.com a écrit :
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
var_dump(foo(5));
?
a.php
=
?php
declare(strict_types=0)
function
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov inefe...@gmail.com wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
var_dump(foo(5));
?
a.php
=
?php
declare(strict_types=0)
function foo(string $a):
On Wed, 25 Feb 2015 15:42:11 +0400, Niktia Nefedov inefe...@gmail.com
wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com
wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
Dmitry
On Wed, Feb 25, 2015 at 10:20 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 6:06 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry:
On Wed, Feb 25, 2015 at 7:55 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov
Dmitry:
On Wed, Feb 25, 2015 at 7:55 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov inefe...@gmail.com wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov dmi...@zend.com wrote:
anyone may tell, what this will print without running :)
On Wed, Feb 25, 2015 at 6:06 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry:
On Wed, Feb 25, 2015 at 7:55 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 2:42 PM, Niktia Nefedov inefe...@gmail.com
wrote:
On Wed, 25 Feb 2015 16:30:32 +0400, Dmitry Stogov
On Wed, Feb 25, 2015 at 6:03 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
On Wed, Feb 25, 2015 at 7:19 AM, Dmitry Stogov dmi...@zend.com wrote:
Hi Anthony,
Few notes:
- first of all, it would be great to split the voting questions: 2/3 -
implement scalar type hinting +
On 25/02/15 12:58, Dmitry Stogov wrote:
Does that mean when reading or writing code, in addition to checking the
signature of a function,
I have to check the 'strict_types' setting at the top as well, to
understand how that signature behaves?
I think you should check it in the top line
Dmitry,
The object on the call-site should remain to be an object (if it's not
passed by reference), however the called function will receive a string.
It works in PHP-5 and PHP-7. Nothing should be changed.
$ sapi/cli/php -r 'class X {function __toString(){return abc;}} $x=new X;
Dmitry,
But checks are performed not in the caller but in RECV opcode at called
function.
And in this function we don't know id it's going to be called only in strict
mode or in weak as well.
Currently, yes. However, by the time we enter ZEND_DO_FCALL, we know
which function we're going to
Dmitry,
On Wed, Feb 25, 2015 at 7:19 AM, Dmitry Stogov dmi...@zend.com wrote:
Hi Anthony,
Few notes:
- first of all, it would be great to split the voting questions: 2/3 -
implement scalar type hinting + 1/2 - in addition add strict type hinting as
I've mentioned this a few times, but I
Dmitry,
On Wed, Feb 25, 2015 at 10:13 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 6:03 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
On Wed, Feb 25, 2015 at 7:19 AM, Dmitry Stogov dmi...@zend.com wrote:
Hi Anthony,
Few notes:
- first of all, it
On Wed, Feb 25, 2015 at 6:47 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
On Wed, Feb 25, 2015 at 10:13 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 6:03 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
On Wed, Feb 25, 2015 at 7:19 AM,
On Wed, Feb 25, 2015 at 6:09 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
The object on the call-site should remain to be an object (if it's not
passed by reference), however the called function will receive a string.
It works in PHP-5 and PHP-7. Nothing should be changed.
$
On Wed, Feb 25, 2015 at 6:24 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry
On Wed, Feb 25, 2015 at 10:20 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 6:06 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry:
On Wed, Feb 25, 2015 at 7:55 AM, Dmitry
On Wed, Feb 25, 2015 at 7:29 AM, Dmitry Stogov dmi...@zend.com wrote:
On Wed, Feb 25, 2015 at 6:09 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
The object on the call-site should remain to be an object (if it's not
passed by reference), however the called function will receive a
On 25/02/2015 12:30, Dmitry Stogov wrote:
anyone may tell, what this will print without running :)
main.php
?php
declare(strict_types=1)
include a.php;
include b.php;
var_dump(foo(5));
?
a.php
=
?php
declare(strict_types=0)
function foo(string $a): string {
bar($a);
On Wed, Feb 25, 2015 at 7:06 PM, Anthony Ferrara ircmax...@gmail.com
wrote:
Dmitry,
But checks are performed not in the caller but in RECV opcode at called
function.
And in this function we don't know id it's going to be called only in
strict
mode or in weak as well.
Currently, yes.
-Original Message-
From: Shashank Kumar [mailto:shashankkumar...@gmail.com]
Sent: Wednesday, February 25, 2015 2:54 PM
To: Dmitry Stogov
Cc: Anthony Ferrara; internals@lists.php.net
Subject: Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5
On Wed, Feb 25, 2015 at 4:30
De : Anthony Ferrara [mailto:ircmax...@gmail.com]
Additionally, it presents a problem when it comes to voting. What if a
person wants strict types. And it looks like it's overall going to
pass, but that weak types is winning. What's the best way for them to
vote? No. For the entire proposal.
I've been having a play around with the implementation, and it's been
behaving pretty solidly, nothing unexpected so far.
I've even gotten around my issue regarding no strict-by-default option
for those of us who want it.
Maybe this will sway a few voters. I'll put the source up if this
All,
I have updated the RFC to re-target 7.0.
I have also added a new behavior:
Currently, if you install an error handler that returns true, you can
bypass type checking in userland functions.
set_error_handler(function() { return true; });
function foo(int $abc) {
var_dump($abc);
}
All,
An interesting point was brought up related to block mode:
https://twitter.com/drrotmos/status/568540722586107904
Namely that generated file caches may need the ability to switch block
mode on-and-off.
I'm considering making the change to add that. If that happens,
declare must be
On 19/02/15 01:33, Christoph Becker wrote:
Lester Caine wrote:
On 18/02/15 23:09, Christoph Becker wrote:
It seems to me that this behavior is hard to deal with generally for
programmers as well as static analyzers. Andreas' bigint RFC[1] would
solve that issue, but it has been withdrawn,
All,
An interesting point was brought up related to block mode:
https://twitter.com/drrotmos/status/568540722586107904
Namely that generated file caches may need the ability to switch block
mode on-and-off.
I'm considering making the change to add that. If that happens,
declare must be the
On 19 February 2015 at 23:07, Anthony Ferrara ircmax...@gmail.com wrote:
All,
An interesting point was brought up related to block mode:
https://twitter.com/drrotmos/status/568540722586107904
Namely that generated file caches may need the ability to switch block
mode on-and-off.
I'm
On 2/18/2015 6:33 PM, Christoph Becker wrote:
It seems to me you're thinking too much (maybe only?) about database
types. IMHO PHP can be used more versatile, and there might be issues
which are exemplified in the RFC[1]:
Maybe PHP can be more versatile, but what percentage of PHP code sits
Anthony Ferrara wrote:
3. int typed variables can resolve a parameter type of float So
calling requiresAFloat(10) will work even in strict mode.
Have you considered the overflow behavior of ints resulting in a float?
For instance, the following code would produce E_RECOVERABLE_ERROR, AIUI:
Christoph,
On Wed, Feb 18, 2015 at 6:09 PM, Christoph Becker cmbecke...@gmx.de wrote:
Anthony Ferrara wrote:
3. int typed variables can resolve a parameter type of float So
calling requiresAFloat(10) will work even in strict mode.
Have you considered the overflow behavior of ints resulting
Anthony,
Anthony Ferrara wrote:
On Wed, Feb 18, 2015 at 6:09 PM, Christoph Becker cmbecke...@gmx.de wrote:
Have you considered the overflow behavior of ints resulting in a float?
For instance, the following code would produce E_RECOVERABLE_ERROR, AIUI:
?php
declare(strict_types=1);
Lester Caine wrote:
On 18/02/15 23:09, Christoph Becker wrote:
It seems to me that this behavior is hard to deal with generally for
programmers as well as static analyzers. Andreas' bigint RFC[1] would
solve that issue, but it has been withdrawn, and AFAIK nobody is working
on it. OTOH,
On 18/02/15 23:09, Christoph Becker wrote:
It seems to me that this behavior is hard to deal with generally for
programmers as well as static analyzers. Andreas' bigint RFC[1] would
solve that issue, but it has been withdrawn, and AFAIK nobody is working
on it. OTOH, bigint would make the
39 matches
Mail list logo