3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2Fk2pcK%3A11%240

Class Test:
Function fun1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k2pcK
function name:  fun1
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   POST_INC_OBJ                                     ~0      'var'
          1      > RETURN                                                   ~0
    8     2*     > 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/k2pcK
function name:  fun2
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'preg_replace_callback'
          1        SEND_VAL                                                 '%2F.%2A%2F'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fk2pcK%3A11%240'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 't'
          5        DO_ICALL                                         $1      
          6        ECHO                                                     $1
   12     7      > RETURN                                                   null

End of function fun2

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.95 ms | 1396 KiB | 17 Q