3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "i like to eat apple", "orange", "Surprise!" ]; foreach ($strings as $string) { echo preg_replace_callback( '~[a-z]+(?=[^a-z]*$)~i', fn($m) => strrev($m[0]), $string ); echo "\n---\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/ApDXE
function name:  (null)
number of ops:  14
compiled vars:  !0 = $strings, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                               $3, !1, ->12
   10     3    >   INIT_FCALL                                               'preg_replace_callback'
   11     4        SEND_VAL                                                 '%7E%5Ba-z%5D%2B%28%3F%3D%5B%5Ea-z%5D%2A%24%29%7Ei'
   12     5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        SEND_VAL                                                 ~4
   13     7        SEND_VAR                                                 !1
   10     8        DO_ICALL                                         $5      
   13     9        ECHO                                                     $5
   15    10        ECHO                                                     '%0A---%0A'
    9    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   16    13      > 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/ApDXE
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strrev'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.19 ms | 999 KiB | 15 Q