Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100360 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86235 invoked from network); 4 Sep 2017 00:49:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2017 00:49:13 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.52 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.214.52 mail-it0-f52.google.com Received: from [209.85.214.52] ([209.85.214.52:35607] helo=mail-it0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/E7-04538-703ACA95 for ; Sun, 03 Sep 2017 20:49:11 -0400 Received: by mail-it0-f52.google.com with SMTP id c13so11496510itb.0 for ; Sun, 03 Sep 2017 17:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=awOv9v8y5u/fnEK1qC+jwjcjkYmAKpeytQt4mcyqH/o=; b=ND8jfAt7UYaLOytqhWZG0qqvhIGgrqxme8jHaMYm1P2/D9zqdnpHEDOF97lbArL76w 9zj+UYqfTWSVvy/O5AeUNbGvUKghd8HLWqLXkcRtvLA7CHBBQoHRQ3jgJharWWo8C2Ox 2M78hvBXrsq0g+ieAwiyqAR55d11Su5/3TsG2ny6ljfyYKnVT899XI2AgJNm47uVceXL XeUxxX6VnUuK1AGBLS1csPkYc+kueNTpvM4XCwt/gmmI84y8II3Wt+iUJizzYk7kOjOO rCMpemOJ3KCZWenE1uwdOPTCIz/RXs1v9mJrdY4hftCIu5Qu6T54QnWXKuD8qQORxuaN b2vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=awOv9v8y5u/fnEK1qC+jwjcjkYmAKpeytQt4mcyqH/o=; b=GESdmjdJ5MdwBQpzz17Ge79WZ/qfU5aJePmhD7/NykYBEJiBZnopUCPQP+xosgytVI Lp2Vr4mlRIYlf+fZ14bU9A76nM1AWBUpndvNxrUtvp/zjUt6DZaDFMsoqpU0NnWkwwDL bqNwGraNCD6t2xa7lNfe4An9KF1ZTl8hwB0xtYKw1a1gdfPwu55oBNVMF3KBhGkMPmc5 gbH3AUGiyxlc4YCCq2OsHcHubQqZEQuxSYvoofiVh0XskLddAFPy1uCfjiM2FUkBkajk dc4Quoz0R0lO/6ZxysFhdzLJ+dWSCHVsL1BzzyDFUW8Ct2uUUGzzUc0bKsPiDYN8dFsr u9MQ== X-Gm-Message-State: AHPjjUhQ6W2ykx1crmspd9klIpWrfsuhakbLe7gMPHHCO4+D8qz5y/9F oA8X81A+T1KTQBObRRUWHPD35sI3ww== X-Google-Smtp-Source: ADKCNb51jRInaZuLdxRfdNdeB497fRNCEnvFriU4zyHBITO1onrSE6Wxor6XrmsVYVs+FM5wLkc17xpwXdEHOk54d3M= X-Received: by 10.36.133.137 with SMTP id r131mr5612425itd.11.1504486148949; Sun, 03 Sep 2017 17:49:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.36.4 with HTTP; Sun, 3 Sep 2017 17:48:48 -0700 (PDT) In-Reply-To: <27.87.04538.90E9CA95@pb1.pair.com> References: <27.87.04538.90E9CA95@pb1.pair.com> Date: Sun, 3 Sep 2017 21:48:48 -0300 Message-ID: To: Jefferson Gonzalez Cc: PHP Internals Content-Type: multipart/alternative; boundary="94eb2c05b0227a4a790558527a7e" Subject: Re: [PHP-DEV] I this a bug in PHP 7.1.9? From: david.proweb@gmail.com (David Rodrigues) --94eb2c05b0227a4a790558527a7e Content-Type: text/plain; charset="UTF-8" From doc: http://php.net/manual/en/language.variables.scope.php > Note: Static variables may be declared as seen in the examples above. From PHP 5.6 you can assign values to these variables which are the result of expressions, but you can't use any function here, what will cause a parse error. 2017-09-03 21:27 GMT-03:00 Jefferson Gonzalez : > 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: > ------------------------------------------ > > function test() > { > static $staticValue = test2(); > > return $staticValue; > } > > function test2() > { > return array(); > } > > print_r(test()); > > ------------------------------------------ > > Output: > > PHP Fatal error: Constant expression contains invalid operations in > test.php on line 5 > > Fatal error: Constant expression contains invalid operations in test.php > on line 5 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- David Rodrigues --94eb2c05b0227a4a790558527a7e--