3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo Module::work('hello world.'), "\n"; echo MyModule::work('hello world.'); abstract class Module { public static function work($it) { return preg_replace_callback('~\w+~', 'static::replace', $it); } protected static function replace($matches) { return sprintf('[[[%s]]]', $matches[0]); } } abstract class MyModule extends Module { protected static function replace($matches) { return sprintf('{{{%s}}}', $matches[0]); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eD0Nd
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_STATIC_METHOD_CALL                                  'Module', 'work'
          1        SEND_VAL_EX                                              'hello+world.'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4        ECHO                                                     '%0A'
    3     5        INIT_STATIC_METHOD_CALL                                  'MyModule', 'work'
          6        SEND_VAL_EX                                              'hello+world.'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
   22     9      > RETURN                                                   1

Class Module:
Function work:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eD0Nd
function name:  work
number of ops:  8
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%7E%5Cw%2B%7E'
          3        SEND_VAL                                                 'static%3A%3Areplace'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    9     7*     > RETURN                                                   null

End of function work

Function replace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eD0Nd
function name:  replace
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%5B%5B%5B%25s%5D%5D%5D'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   13     7*     > RETURN                                                   null

End of function replace

End of class Module.

Class MyModule:
Function replace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eD0Nd
function name:  replace
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%7B%7B%7B%25s%7D%7D%7D'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   20     7*     > RETURN                                                   null

End of function replace

Function work:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eD0Nd
function name:  work
number of ops:  8
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%7E%5Cw%2B%7E'
          3        SEND_VAL                                                 'static%3A%3Areplace'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    9     7*     > RETURN                                                   null

End of function work

End of class MyModule.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1400 KiB | 17 Q