3v4l.org

run code in 300+ 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 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 126) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/QDMjS
function name:  (null)
number of ops:  27
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        INIT_FCALL                                               'str_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !3, $8
   56     9      > FE_RESET_RW                                      $10     !3, ->22
         10    > > FE_FETCH_RW                                              $10, !4, ->22
   57    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !4
         13        SEND_VAL                                                 0
         14        INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !4
         16        SEND_VAL                                                 '+'
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !4, $12
   56    21      > JMP                                                      ->10
         22    >   FE_FREE                                                  $10
   60    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.88 ms | 1001 KiB | 17 Q