3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private function callback() { return "Test"; } public function doSomething() { return preg_replace_callback('/./', array($this, 'callback'), 'foo'); } } $e = new Example; echo $e->doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5se86
function name:  (null)
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'doSomething'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class Example:
Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5se86
function name:  callback
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Test'
    6     1*     > RETURN                                                   null

End of function callback

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5se86
function name:  doSomething
number of ops:  10
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        FETCH_THIS                                       ~0      
          3        INIT_ARRAY                                       ~1      ~0
          4        ADD_ARRAY_ELEMENT                                ~1      'callback'
          5        SEND_VAL                                                 ~1
          6        SEND_VAL                                                 'foo'
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
    9     9*     > RETURN                                                   null

End of function dosomething

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.97 ms | 1395 KiB | 15 Q