3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { protected $my_var = 42; public function bar() { preg_replace_callback('/./', function($match) { var_dump($this->my_var); }, 'a'); } } $fizz = new foo(); $fizz->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S0jbP
function name:  (null)
number of ops:  6
compiled vars:  !0 = $fizz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FS0jbP%3A8%240

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.84 ms | 1395 KiB | 17 Q