3v4l.org

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

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

End of function replace

End of class Module.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.23 ms | 1395 KiB | 17 Q