3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function getStVar() { static $_stVar; $output = ''; if (!isset($_stVar)) { $_stVar = true; $output = '!'; } else { $output = '.'; } return $output; } } class TestExt_1 extends Test { function geStVar() { return parent::getStVar(); } } class TestExt_2 extends Test { function geStVar() { return parent::getStVar(); } } $t1 = new TestExt_1(); $t2 = new TestExt_2(); echo $t1->getStVar(); echo $t1->getStVar(); echo $t2->getStVar(); echo $t2->getStVar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  (null)
number of ops:  19
compiled vars:  !0 = $t1, !1 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   NEW                                              $2      'TestExt_1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   40     3        NEW                                              $5      'TestExt_2'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   42     6        INIT_METHOD_CALL                                         !0, 'getStVar'
          7        DO_FCALL                                      0  $8      
          8        ECHO                                                     $8
   43     9        INIT_METHOD_CALL                                         !0, 'getStVar'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
   44    12        INIT_METHOD_CALL                                         !1, 'getStVar'
         13        DO_FCALL                                      0  $10     
         14        ECHO                                                     $10
   45    15        INIT_METHOD_CALL                                         !1, 'getStVar'
         16        DO_FCALL                                      0  $11     
         17        ECHO                                                     $11
         18      > RETURN                                                   1

Class Test:
Function getstvar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  getStVar
number of ops:  11
compiled vars:  !0 = $_stVar, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        ASSIGN                                                   !1, ''
   11     2        ISSET_ISEMPTY_CV                                 ~3      !0
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->8
   12     5    >   ASSIGN                                                   !0, <true>
   13     6        ASSIGN                                                   !1, '%21'
          7      > JMP                                                      ->9
   16     8    >   ASSIGN                                                   !1, '.'
   19     9    > > RETURN                                                   !1
   20    10*     > RETURN                                                   null

End of function getstvar

End of class Test.

Class TestExt_1:
Function gestvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  geStVar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                  'getStVar'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   27     3*     > RETURN                                                   null

End of function gestvar

Function getstvar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  getStVar
number of ops:  11
compiled vars:  !0 = $_stVar, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        ASSIGN                                                   !1, ''
   11     2        ISSET_ISEMPTY_CV                                 ~3      !0
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->8
   12     5    >   ASSIGN                                                   !0, <true>
   13     6        ASSIGN                                                   !1, '%21'
          7      > JMP                                                      ->9
   16     8    >   ASSIGN                                                   !1, '.'
   19     9    > > RETURN                                                   !1
   20    10*     > RETURN                                                   null

End of function getstvar

End of class TestExt_1.

Class TestExt_2:
Function gestvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  geStVar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_STATIC_METHOD_CALL                                  'getStVar'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   34     3*     > RETURN                                                   null

End of function gestvar

Function getstvar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LdsNR
function name:  getStVar
number of ops:  11
compiled vars:  !0 = $_stVar, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        ASSIGN                                                   !1, ''
   11     2        ISSET_ISEMPTY_CV                                 ~3      !0
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->8
   12     5    >   ASSIGN                                                   !0, <true>
   13     6        ASSIGN                                                   !1, '%21'
          7      > JMP                                                      ->9
   16     8    >   ASSIGN                                                   !1, '.'
   19     9    > > RETURN                                                   !1
   20    10*     > RETURN                                                   null

End of function getstvar

End of class TestExt_2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 948 KiB | 14 Q