3v4l.org

run code in 300+ PHP versions simultaneously
<?php class hello { function foo(){ static $a = 0; echo $a; $a++; } } $bar = new hello(); $car = $bar->foo(); $tar = $bar->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ILZT1
function name:  (null)
number of ops:  10
compiled vars:  !0 = $bar, !1 = $car, !2 = $tar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'hello'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   15     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   16     6        INIT_METHOD_CALL                                         !0, 'foo'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
          9      > RETURN                                                   1

Class hello:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ILZT1
function name:  foo
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        ECHO                                                     !0
    9     2        PRE_INC                                                  !0
   10     3      > RETURN                                                   null

End of function foo

End of class hello.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.99 ms | 1393 KiB | 13 Q