Opened 22 months ago

#365 new defect

__CLASS__ in trait return NULL

Reported by: drakmor Owned by: moo
Priority: major Milestone: undecided
Component: disassembler Version: 3.1.2
Keywords: Cc:
Application: PHP Version: 5.6
Other Exts: SAPI: Irrelevant
Probability: Blocked By:
Blocking:

Description

Bug of constant recognition.

Test code:

<?php

trait ta
{
    public function fn()
    {
        echo __CLASS__;
    }

}

xcache:

class ta
array(0) {
}
  function fn
      7   0 FETCH_CONSTANT           t@0  l#0                 NULL                0x10
      7   1 ECHO                     l#0  t@0                 l#0                 0x0
      8   2 RETURN                   l#0  NULL                l#0                 0x0
  4   0 NOP                      l#0  l#0                 l#0                 0x0
 11   1 RETURN                   l#0  1                   l#0                 0x4

vld:

Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /home/test/trait.php
function name:  (null)
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP
  11     1      > RETURN                                                   1

branch: #  0; line:     4-   11; sop:     0; eop:     1; out1:  -2
path #1: 0,
Class ta:
Function fn:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /home/test/trait.php
function name:  fn
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   FETCH_CONSTANT                                   ~0      <const:'__CLASS__'>
         1        ECHO                                                     ~0
   8     2      > RETURN                                                   null

branch: #  0; line:     7-    8; sop:     0; eop:     2; out1:  -2
path #1: 0,
End of function fn

End of class ta.

Change History (0)

Note: See TracTickets for help on using tickets.