Re: I this a bug in PHP 7.1.9?
| From: | Rowan Collins | Date: | Mon, 04 Sep 2017 12:59:53 +0000 |
| Subject: | Re: I this a bug in PHP 7.1.9? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100369@lists.php.net to get a copy of this message | ||
On 4 September 2017 01:27:49 BST, Jefferson Gonzalez <jgmdev@gmail.com> wrote:
>I upgraded my PHP version on a server from 7.0 to latest 7.1.9 and got
>this strange behaviour, did something changed on the core language or
>is
>this a bug?
>
>PHP sample code:
>------------------------------------------
><?php
>
>function test()
>{
> static $staticValue = test2();
>
> return $staticValue;
>}
>
>function test2()
>{
> return array();
>}
>
>print_r(test());
>
According to 3v4l.org this has never been valid: https://3v4l.org/vRaNK The error message changed between 5.x and
7.x, but if you're already on 7.0 you shouldn't have seen any change.
Are you sure this test case correctly represents the code you're having problems with?
Regards,
--
Rowan Collins
[IMSoP]