3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "این متن فارسی است and this is !!! in English این خط بعدی است و this is going to be continued..."; $newStr = preg_replace_callback('/\w.*(?=\w|\b)/', function (array $m) { return implode(" ", array_reverse(explode(" ", $m[0]))); }, $string); echo $newStr;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ih7Ec
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string, !1 = $newStr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%D8%A7%DB%8C%D9%86+%D9%85%D8%AA%D9%86+%D9%81%D8%A7%D8%B1%D8%B3%DB%8C+%D8%A7%D8%B3%D8%AA+and+this+is+%21%21%21+in+English%0A%D8%A7%DB%8C%D9%86+%D8%AE%D8%B7+%D8%A8%D8%B9%D8%AF%DB%8C+%D8%A7%D8%B3%D8%AA+%D9%88+this+is+going+to+be+continued...'
    5     1        INIT_FCALL                                                   'preg_replace_callback'
          2        SEND_VAL                                                     '%2F%5Cw.%2A%28%3F%3D%5Cw%7C%5Cb%29%2F'
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
    7     4        SEND_VAL                                                     ~3
          5        SEND_VAR                                                     !0
    5     6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
    9     8        ECHO                                                         !1
   10     9      > 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/Ih7Ec
function name:  {closure:/in/Ih7Ec:5}
number of ops:  12
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_FCALL                                                   'array_reverse'
          2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '+'
          4        FETCH_DIM_R                                          ~1      !0, 0
          5        SEND_VAL                                                     ~1
          6        DO_ICALL                                             $2      
          7        SEND_VAR                                                     $2
          8        DO_ICALL                                             $3      
          9        FRAMELESS_ICALL_2                implode             ~4      '+', $3
         10      > RETURN                                                       ~4
    7    11*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162 ms | 2248 KiB | 16 Q