3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function fun1(){ static $var = 1; echo $var++; } public function fun2(){ echo preg_replace_callback('/.+/', function($find){return $this->fun1().$find[0];}, 't'); } } $t = new Test; $t->fun2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2493
function name:  (null)
number of ops:  6
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'fun2'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FP2493%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2493
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        FETCH_THIS                                       $1      
          2        INIT_METHOD_CALL                                         $1, 'fun1'
          3        DO_FCALL                                      0  $2      
          4        FETCH_DIM_R                                      ~3      !0, 0
          5        CONCAT                                           ~4      $2, ~3
          6      > RETURN                                                   ~4
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FP2493%3A10%240

Class Test:
Function fun1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2493
function name:  fun1
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        POST_INC                                         ~1      !0
          2        ECHO                                                     ~1
    7     3      > RETURN                                                   null

End of function fun1

Function fun2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2493
function name:  fun2
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'preg_replace_callback'
          1        SEND_VAL                                                 '%2F.%2B%2F'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FP2493%3A10%240'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 't'
          5        DO_ICALL                                         $1      
          6        ECHO                                                     $1
   11     7      > RETURN                                                   null

End of function fun2

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.8 ms | 1396 KiB | 15 Q