3v4l.org

run code in 300+ 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}
number of ops:  15
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '+'
          3        INIT_FCALL                                               'array_reverse'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        FETCH_DIM_R                                      ~1      !0, 0
          7        SEND_VAL                                                 ~1
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13      > RETURN                                                   $4
    7    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.16 ms | 1014 KiB | 17 Q