Skip to content

Commit 865f221

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
2 parents aa76f77 + 4c0bb6d commit 865f221

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2013, PHP 5.5.6
44

5+
- Core:
6+
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
7+
(Bob Weinand)
8+
59
17 Oct 2013, PHP 5.5.5
610

711
- Core:

Zend/tests/bug65911.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #65911 (scope resolution operator - strange behavior with $this)
3+
--FILE--
4+
<?php
5+
class A {}
6+
7+
class B
8+
{
9+
public function go()
10+
{
11+
$this->foo = 'bar';
12+
echo A::$this->foo; // should not output 'bar'
13+
}
14+
}
15+
16+
$obj = new B();
17+
$obj->go();
18+
?>
19+
--EXPECTF--
20+
Fatal error: Access to undeclared static property: A::$this in %s on line %d

Zend/zend_compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
908908
{
909909
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST)
910910
&& (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING)
911+
&& ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER)
911912
&& (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL)
912913
&& (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
913914
&& !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {

0 commit comments

Comments
 (0)