3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is a " . str_repeat("test", 2) . "!\n" . str_repeat("hello", 3) . " and Bye!\n" . "When I sleep, the thought bubble says " . str_repeat("zz", 3) . "."; echo preg_replace_callback( '~\b(\w+?)\1+\b~', function($m) { return "[{$m[1]}](" . (strlen($m[0]) / strlen($m[1])) . ")"; }, $string );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VbL3
function name:  (null)
number of ops:  28
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 'test'
          2        SEND_VAL                                                 2
          3        DO_ICALL                                         $1      
          4        CONCAT                                           ~2      'This+is+a+', $1
    4     5        CONCAT                                           ~3      ~2, '%21%0A'
          6        INIT_FCALL                                               'str_repeat'
          7        SEND_VAL                                                 'hello'
          8        SEND_VAL                                                 3
          9        DO_ICALL                                         $4      
         10        CONCAT                                           ~5      ~3, $4
         11        CONCAT                                           ~6      ~5, '+and+Bye%21%0A'
    5    12        CONCAT                                           ~7      ~6, 'When+I+sleep%2C+the+thought+bubble+says+'
         13        INIT_FCALL                                               'str_repeat'
         14        SEND_VAL                                                 'zz'
         15        SEND_VAL                                                 3
         16        DO_ICALL                                         $8      
         17        CONCAT                                           ~9      ~7, $8
         18        CONCAT                                           ~10     ~9, '.'
    3    19        ASSIGN                                                   !0, ~10
    7    20        INIT_FCALL                                               'preg_replace_callback'
    8    21        SEND_VAL                                                 '%7E%5Cb%28%5Cw%2B%3F%29%5C1%2B%5Cb%7E'
    9    22        DECLARE_LAMBDA_FUNCTION                          ~12     [0]
   11    23        SEND_VAL                                                 ~12
   12    24        SEND_VAR                                                 !0
    7    25        DO_ICALL                                         $13     
   12    26        ECHO                                                     $13
   13    27      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VbL3
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ROPE_INIT                                     3  ~3      '%5B'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        ROPE_ADD                                      1  ~3      ~3, ~1
          4        ROPE_END                                      2  ~2      ~3, '%5D%28'
          5        FETCH_DIM_R                                      ~5      !0, 0
          6        STRLEN                                           ~6      ~5
          7        FETCH_DIM_R                                      ~7      !0, 1
          8        STRLEN                                           ~8      ~7
          9        DIV                                              ~9      ~6, ~8
         10        CONCAT                                           ~10     ~2, ~9
         11        CONCAT                                           ~11     ~10, '%29'
         12      > RETURN                                                   ~11
   11    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.42 ms | 1006 KiB | 15 Q