|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug55673.diff (last revision 2011-09-14 15:07 UTC by laruence@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-09-12 13:48 UTC] derick@php.net
-Assigned To:
+Assigned To: dmitry
[2011-09-14 14:37 UTC] laruence@php.net
[2011-09-14 15:07 UTC] laruence@php.net
[2011-09-14 15:10 UTC] laruence@php.net
[2011-09-14 15:24 UTC] laruence@php.net
[2011-09-14 15:29 UTC] laruence@php.net
[2011-09-15 03:59 UTC] laruence@php.net
[2011-09-15 09:47 UTC] dmitry@php.net
-Type: Bug
+Type: Feature/Change Request
[2011-09-15 09:47 UTC] dmitry@php.net
[2015-03-21 20:48 UTC] nikic@php.net
-Status: Assigned
+Status: Closed
[2015-03-21 20:48 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 20:00:01 2025 UTC |
Description: ------------ When having the following code: <?php class foo { function bar() { self::$bar = 42; } } ?> The compiler generates compiled variable !0 for $bar, even though it's a class variable: derick@whisky:/tmp$ php -dvld.active=1 -r 'class foo { function bar() { self::$bar = 42; } }' Finding entry points Branch analysis from position: 0 Return found filename: Command line code function name: (null) number of ops: 2 compiled vars: none line # * op fetch ext return operands --------------------------------------------------------------------------------- 1 0 > NOP 1 > RETURN null branch: # 0; line: 1- 1; sop: 0; eop: 1 path #1: 0, Class foo: Function bar: Finding entry points Branch analysis from position: 0 Return found filename: Command line code function name: bar number of ops: 4 compiled vars: !0 = $bar line # * op fetch ext return operands --------------------------------------------------------------------------------- 0 > ZEND_FETCH_CLASS 1 1 FETCH_W static member $1 'bar' 2 ASSIGN $1, 42 3 > RETURN null branch: # 0; line: 1- 1; sop: 0; eop: 3 path #1: 0, End of function bar. End of class foo. 14:41 <@Derick> dmitry: I am wondering why self::$foo creates a compiled variable. Any idea? 14:42 <@Derick> dmitry: it creates it, but it's never used 14:44 <@dmitry> I see. It's probably because od simple one-pass compiler that first interpret $foo as local variable and only then as a class variable :) 14:44 <@Derick> dmitry: any way we can fix that perhaps? 14:44 <@dmitry> Derick: could you please create a bug and assign it to me 14:44 <@Derick> yes, sure