3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'תירס גדול A-10 (פרי גליל)'; echo preg_replace_callback( "/\p{Hebrew}+(?: \p{Hebrew}+)*/u", fn($m) => implode( array_reverse( preg_split('~~u', $m[0], 0, PREG_SPLIT_NO_EMPTY) ) ), $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/usfi2
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D7%AA%D7%99%D7%A8%D7%A1+%D7%92%D7%93%D7%95%D7%9C+A-10+%28%D7%A4%D7%A8%D7%99+%D7%92%D7%9C%D7%99%D7%9C%29'
    4     1        INIT_FCALL                                               'preg_replace_callback'
    5     2        SEND_VAL                                                 '%2F%5Cp%7BHebrew%7D%2B%28%3F%3A+%5Cp%7BHebrew%7D%2B%29%2A%2Fu'
    6     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   10     4        SEND_VAL                                                 ~2
   11     5        SEND_VAR                                                 !0
    4     6        DO_ICALL                                         $3      
   11     7        ECHO                                                     $3
   12     8      > 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/usfi2
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'implode'
    7     2        INIT_FCALL                                               'array_reverse'
    8     3        INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%7E%7Eu'
          5        FETCH_DIM_R                                      ~1      !0, 0
          6        SEND_VAL                                                 ~1
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
    7    11        DO_ICALL                                         $3      
    8    12        SEND_VAR                                                 $3
    6    13        DO_ICALL                                         $4      
    8    14      > RETURN                                                   $4
   10    15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.6 ms | 1005 KiB | 17 Q