3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private static function callback() { return "Test"; } public function doSomething() { return preg_replace_callback('/./', 'Example::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/GQLZF
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/GQLZF
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/GQLZF
function name:  doSomething
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        SEND_VAL                                                 'Example%3A%3Acallback'
          3        SEND_VAL                                                 'foo'
          4        DO_ICALL                                         $0      
          5      > RETURN                                                   $0
    9     6*     > RETURN                                                   null

End of function dosomething

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.07 ms | 1395 KiB | 15 Q