3v4l.org

run code in 500+ PHP versions simultaneously
<?php $currencies = [ 'USD', 'BTC', 'DASH', 'LTC', 'SC', 'STEEM', 'WAVES', 'SNGLS', '1ST', 'BQX', 'ETH', 'PTOY', 'XAUR', 'DOGE' ]; $repl = [ 'USD ', 'BTC ', 'DASH ', 'LTC ', 'SC ', 'STEEM ', 'WAVES ', 'SNGLS ', '1ST ', 'BQX ', 'ETH ', 'PTOY ', 'XAUR ', 'DOGE ' ]; $input = [ "BTCUSD", "DASHBTC", "DOGEUSD", "LTCBTC", "LTCUSD", "SCBTC", "STEEMBTC", "WAVESBTC", "SNGLSBTC", "1STBTC", "DASHUSD", "BQXETH", "PTOYETH", "XAURETH", "BTCUSDT", ]; $new = str_replace($currencies, $repl, $input); Foreach($new as &$item){ $item = substr($item, 0, strpos($item, " ")); } Var_dump($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/QDMjS
function name:  (null)
number of ops:  18
compiled vars:  !0 = $currencies, !1 = $repl, !2 = $input, !3 = $new, !4 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   20     1        ASSIGN                                                       !1, <array>
   37     2        ASSIGN                                                       !2, <array>
   55     3        FRAMELESS_ICALL_3                str_replace         ~8      !0, !1
          4        OP_DATA                                                      !2
          5        ASSIGN                                                       !3, ~8
   56     6      > FE_RESET_RW                                          $10     !3, ->13
          7    > > FE_FETCH_RW                                                  $10, !4, ->13
   57     8    >   FRAMELESS_ICALL_2                strpos              ~11     !4, '+'
          9        FRAMELESS_ICALL_3                substr              ~12     !4, 0
         10        OP_DATA                                                      ~11
         11        ASSIGN                                                       !4, ~12
   56    12      > JMP                                                          ->7
         13    >   FE_FREE                                                      $10
   60    14        INIT_FCALL                                                   'var_dump'
         15        SEND_VAR                                                     !3
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.34 ms | 2209 KiB | 14 Q