3v4l.org

run code in 300+ PHP versions simultaneously
<?php function deslug_array_values($getvars) { $new_array = array(); foreach ($getvars as $key=>$value) { $new_value = str_replace("-", " ", $value); $new_value = str_replace("+", "-", $new_value); $new_key = str_replace("-", " ", $key); $new_key = str_replace("+", "-", $new_key); $new_array[$new_key] = $new_value; } return $new_array; } var_dump(deslug_array_values( [ 'testing this', 'testing-this++', 'testing+this-too okay' ] ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSjL5
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'deslug_array_values'
   18     2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   23     6      > RETURN                                                   1

Function deslug_array_values:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 32
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/rSjL5
function name:  deslug_array_values
number of ops:  35
compiled vars:  !0 = $getvars, !1 = $new_array, !2 = $value, !3 = $key, !4 = $new_value, !5 = $new_key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $7      !0, ->32
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->32
          4    >   ASSIGN                                                   !3, ~8
    6     5        INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 '-'
          7        SEND_VAL                                                 '+'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !4, $10
    7    11        INIT_FCALL                                               'str_replace'
         12        SEND_VAL                                                 '%2B'
         13        SEND_VAL                                                 '-'
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !4, $12
    8    17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 '-'
         19        SEND_VAL                                                 '+'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !5, $14
    9    23        INIT_FCALL                                               'str_replace'
         24        SEND_VAL                                                 '%2B'
         25        SEND_VAL                                                 '-'
         26        SEND_VAR                                                 !5
         27        DO_ICALL                                         $16     
         28        ASSIGN                                                   !5, $16
   10    29        ASSIGN_DIM                                               !1, !5
         30        OP_DATA                                                  !4
    5    31      > JMP                                                      ->3
         32    >   FE_FREE                                                  $7
   12    33      > RETURN                                                   !1
   13    34*     > RETURN                                                   null

End of function deslug_array_values

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.77 ms | 1394 KiB | 18 Q