3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $name; public function bar() { static $a = 1; if ($a === 5) { echo PHP_EOL.$this->name.PHP_EOL; var_dump($a); return; } echo 'incriment a'.PHP_EOL; $a++; } } $foo1 = new Foo(); $foo1->name = 'foo1'; $foo1->bar(); $foo1->bar(); $foo1->bar(); $foo1->bar(); $foo1->bar(); echo PHP_EOL; $foo2 = new Foo(); $foo2->name = 'foo2'; $foo2->bar(); $foo2->bar(); $foo2->bar(); $foo2->bar(); $foo2->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIjgi
function name:  (null)
number of ops:  32
compiled vars:  !0 = $foo1, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'foo1'
   27     5        INIT_METHOD_CALL                                         !0, 'bar'
          6        DO_FCALL                                      0          
   28     7        INIT_METHOD_CALL                                         !0, 'bar'
          8        DO_FCALL                                      0          
   29     9        INIT_METHOD_CALL                                         !0, 'bar'
         10        DO_FCALL                                      0          
   30    11        INIT_METHOD_CALL                                         !0, 'bar'
         12        DO_FCALL                                      0          
   31    13        INIT_METHOD_CALL                                         !0, 'bar'
         14        DO_FCALL                                      0          
   33    15        ECHO                                                     '%0A'
   35    16        NEW                                              $11     'Foo'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !1, $11
   37    19        ASSIGN_OBJ                                               !1, 'name'
         20        OP_DATA                                                  'foo2'
   39    21        INIT_METHOD_CALL                                         !1, 'bar'
         22        DO_FCALL                                      0          
   40    23        INIT_METHOD_CALL                                         !1, 'bar'
         24        DO_FCALL                                      0          
   41    25        INIT_METHOD_CALL                                         !1, 'bar'
         26        DO_FCALL                                      0          
   42    27        INIT_METHOD_CALL                                         !1, 'bar'
         28        DO_FCALL                                      0          
   43    29        INIT_METHOD_CALL                                         !1, 'bar'
         30        DO_FCALL                                      0          
         31      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIjgi
function name:  bar
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   11     1        IS_IDENTICAL                                             !0, 5
          2      > JMPZ                                                     ~1, ->11
   12     3    >   FETCH_OBJ_R                                      ~2      'name'
          4        CONCAT                                           ~3      '%0A', ~2
          5        CONCAT                                           ~4      ~3, '%0A'
          6        ECHO                                                     ~4
   13     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   15    10      > RETURN                                                   null
   18    11    >   ECHO                                                     'incriment+a%0A'
   19    12        PRE_INC                                                  !0
   20    13      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.44 ms | 1400 KiB | 15 Q