Bug #66199 [Opn->Nab]: Access to undeclared static property: static::$this

From: Date: Fri, 29 Nov 2013 09:20:32 +0000
Subject: Bug #66199 [Opn->Nab]: Access to undeclared static property: static::$this
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183004@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66199&edit=1 ID: 66199 Updated by: nikic@php.net Reported by: gulturyan at gmail dot com Summary: Access to undeclared static property: static::$this -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Ubuntu 12.04 PHP Version: 5.4.22 Block user comment: N Private report: N New Comment: You are accessing the static property $this, which does not exist in your code sample. So you get an error. What's incorrect about this? Previous Comments: ------------------------------------------------------------------------ [2013-11-29 09:18:33] gulturyan at gmail dot com Description: ------------ in version 5.4.22 not working static::$this in version 5.4.21 still work. Test script: --------------- class A { public function aa() { return get_class(static::$this); } } class A2 extends A { } $a = new A2(); die(var_dump($a->aa())); Expected result: ---------------- A2 Actual result: -------------- Fatal error: Access to undeclared static property: A2::$this ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66199&edit=1

« previous php.bugs (#183004) next »