Bug #70514 [Fbk]: isset(aClass::ARRAY[$a]) is mistaken for an expression

From: Date: Tue, 22 Sep 2015 15:16:40 +0000
Subject: Bug #70514 [Fbk]: isset(aClass::ARRAY[$a]) is mistaken for an expression
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196160@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70514&edit=1 ID: 70514 Updated by: dams@php.net Reported by: dams@php.net Summary: isset(aClass::ARRAY[$a]) is mistaken for an expression Status: Feedback Type: Bug Package: Class/Object related Operating System: OSX, Debian PHP Version: 7.0.0RC2 Block user comment: N Private report: N New Comment: I tried with bison 2.7 and 3.0.4, with the same result. I use this compilation sequence : make clean ./buildconf --force env YACC=brew --prefix bison27/bin/bison ./configure \ --prefix="/usr/local/opt/phpng" \ --with-config-file-path="/usr/local/etc/phpng" \ --with-config-file-scan-dir=/usr/local/etc/phpng/conf.d --enable-mbstring \ --enable-tokenizer \ --disable-all make -jsysctl -n hw.logicalcpu_max on #master from php-src. It is working fine on Debian. Previous Comments: ------------------------------------------------------------------------ [2015-09-19 01:24:35] bwoebi@php.net Works for me on OS X with PHP 7... Just on PHP 5.6, isset() did not support constant arrays at all. I just had forgotten to take care of that special case back then. isset(aClass::X) still does not work with PHP 7, but aClass::X[$a] (or static::X[$a]) definitely should work there. ------------------------------------------------------------------------ [2015-09-18 17:47:44] iletisim at ilkerozcan dot com dot tr Works on ubuntu but does not work on OsX. It may be due to the bison version. ------------------------------------------------------------------------ [2015-09-18 04:08:06] laruence@php.net did I misunderstand something here? https://3v4l.org/upQIg it seems works fine with php7 ------------------------------------------------------------------------ [2015-09-17 09:15:39] dams@php.net OK, I made it to work on Debian with 7.1.0-dev. Recompiled on osx too, but still doesn't work. ------------------------------------------------------------------------ [2015-09-17 01:18:01] feilengcui at gmail dot com hello,I just test your code for 7.0RC1 and 7.0RC2, and I find that if(isset(aClass::X[$a])) if(isset(X[$a])) are both OK and output "5 doesn't exists" but for if(isset(aClass::$X[$a])) it reports an error "Fatal error: Uncaught EngineException: Access to undeclared static property: W::$X" ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70514 -- Edit this bug report at https://bugs.php.net/bug.php?id=70514&edit=1

« previous php.bugs (#196160) next »