3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'The quick brown fox jumps over the lazy dog'; echo preg_replace_callback('/fox|dog/', function($matches){ $a = $matches[0]; return '=>'.$a[0].'...'.$a[strlen($a)-1].'<='; }, $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbq3W
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'The+quick+brown+fox+jumps+over+the+lazy+dog'
    3     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2Ffox%7Cdog%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ffbq3W%3A3%240'
    6     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ffbq3W%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbq3W
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $matches, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~2      !0, 0
          2        ASSIGN                                                   !1, ~2
    5     3        FETCH_DIM_R                                      ~4      !1, 0
          4        CONCAT                                           ~5      '%3D%3E', ~4
          5        CONCAT                                           ~6      ~5, '...'
          6        STRLEN                                           ~7      !1
          7        SUB                                              ~8      ~7, 1
          8        FETCH_DIM_R                                      ~9      !1, ~8
          9        CONCAT                                           ~10     ~6, ~9
         10        CONCAT                                           ~11     ~10, '%3C%3D'
         11      > RETURN                                                   ~11
    6    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ffbq3W%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.02 ms | 1399 KiB | 15 Q