3v4l.org

run code in 300+ PHP versions simultaneously
<?php $roots = array('/www/dev/sites/www.fred-4.com', '/www/dev/sites/www.fred-4.com-master'); foreach ($roots as $root) { $key = substr($root, strpos($root, '.com'), 0); echo $root . " -> " . $key . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/Hn5Ci
function name:  (null)
number of ops:  20
compiled vars:  !0 = $roots, !1 = $root, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1      > FE_RESET_R                                       $4      !0, ->18
          2    > > FE_FETCH_R                                               $4, !1, ->18
    8     3    >   INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 '.com'
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        SEND_VAL                                                 0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !2, $6
    9    13        CONCAT                                           ~8      !1, '+-%3E+'
         14        CONCAT                                           ~9      ~8, !2
         15        CONCAT                                           ~10     ~9, '%0A'
         16        ECHO                                                     ~10
    6    17      > JMP                                                      ->2
         18    >   FE_FREE                                                  $4
   11    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.41 ms | 1395 KiB | 17 Q