3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo Module::work('hello world.'), "\n"; echo MyModule::work('hello world.'); abstract class Module { private static $mask = '[[[%s]]]'; public static function work($it) { return preg_replace_callback('~\w+~', 'static::replace', $it); } private static function replace($matches) { return sprintf(static::$mask, $matches[0]); } } abstract class MyModule extends Module { protected static $mask = '{{{%s}}}'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/074Ck
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
   21     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/074Ck
function name:  work
number of ops:  8
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     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
   11     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/074Ck
function name:  replace
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'sprintf'
          2        FETCH_STATIC_PROP_R          global lock         ~1      'mask'
          3        SEND_VAL                                                 ~1
          4        FETCH_DIM_R                                      ~2      !0, 0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   15     8*     > RETURN                                                   null

End of function replace

End of class Module.

Class MyModule:
Function work:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/074Ck
function name:  work
number of ops:  8
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     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
   11     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/074Ck
function name:  replace
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'sprintf'
          2        FETCH_STATIC_PROP_R          global lock         ~1      'mask'
          3        SEND_VAL                                                 ~1
          4        FETCH_DIM_R                                      ~2      !0, 0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   15     8*     > RETURN                                                   null

End of function replace

End of class MyModule.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.53 ms | 1392 KiB | 17 Q