3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function getStVar() { static $_stVar = false; if (false === $_stVar) { $_stVar = true; } return $_stVar; } } $t = new Test(); echo $t->getStVar(); echo $t->getStVar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJfqY
function name:  (null)
number of ops:  10
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'getStVar'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   21     6        INIT_METHOD_CALL                                         !0, 'getStVar'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Class Test:
Function getstvar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/gJfqY
function name:  getStVar
number of ops:  6
compiled vars:  !0 = $_stVar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    4          !0
          2      > JMPZ                                                     ~1, ->4
   10     3    >   ASSIGN                                                   !0, <true>
   13     4    > > RETURN                                                   !0
   14     5*     > RETURN                                                   null

End of function getstvar

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.38 ms | 1393 KiB | 13 Q