3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phrase = "You should eat fruuits, vegetaaables, and fiiibeeer every day."; $healthy = array("fruits", "vegetables", "fiber"); $patterns = array_map(function($term){ $newterm = ""; for($x=0; $x<strlen($term); $x++) $newterm.= preg_escape($term[$x], "~")."+"; return "~(".$newterm.")~"; }, $healthy); print_r($patterns); $yummy = array("pizza", "beer", "ice cream"); $newphrase = str_replace($healthy, $yummy, $phrase);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cuiJ7
function name:  (null)
number of ops:  19
compiled vars:  !0 = $phrase, !1 = $healthy, !2 = $patterns, !3 = $yummy, !4 = $newphrase
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'You+should+eat+fruuits%2C+vegetaaables%2C+and+fiiibeeer+every+day.'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcuiJ7%3A5%240'
    9     4        SEND_VAL                                                 ~7
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
    5     7        ASSIGN                                                   !2, $8
   10     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   11    11        ASSIGN                                                   !3, <array>
   12    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !4, $12
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcuiJ7%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/cuiJ7
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $term, !1 = $newterm, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, ''
    7     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->13
          4    >   INIT_FCALL_BY_NAME                                       'preg_escape'
          5        CHECK_FUNC_ARG                                           
          6        FETCH_DIM_FUNC_ARG                               $5      !0, !2
          7        SEND_FUNC_ARG                                            $5
          8        SEND_VAL_EX                                              '%7E'
          9        DO_FCALL                                      0  $6      
         10        CONCAT                                           ~7      $6, '%2B'
         11        ASSIGN_OP                                     8          !1, ~7
         12        PRE_INC                                                  !2
         13    >   STRLEN                                           ~10     !0
         14        IS_SMALLER                                               !2, ~10
         15      > JMPNZ                                                    ~11, ->4
    8    16    >   CONCAT                                           ~12     '%7E%28', !1
         17        CONCAT                                           ~13     ~12, '%29%7E'
         18      > RETURN                                                   ~13
    9    19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcuiJ7%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.8 ms | 1400 KiB | 19 Q