3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Carolina -6,5 - Indianapolis '; if (mb_ereg('^(.+)[[:space:]]+(([-]?[0-9]+[,.]?[0-9]*) /)?([-]?[0-9]+[,.]?[0-9]*)? -(.+)$', $text, $ar)) $team = 1; if (mb_ereg('^(.+) -(.+)[[:space:]]+(([-]?[0-9]+[,.]?[0-9]*) /)?([-]?[0-9]+[,.]?[0-9]*)?$', $text, $ar)) $team = 2; var_dump($ar, $team); foreach ($ar as $key => &$a) $a = str_replace(array(",", "+"), array(".", ""), $a); var_dump($ar); $home = 23; $away = 23; if ($team == 1) $home = $home + $ar[4]; elseif ($team == 2) $away = $away + $ar[5]; var_dump($home, $away);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 125) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
2 jumps found. (Code = 126) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 29
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/aYCjV
function name:  (null)
number of ops:  51
compiled vars:  !0 = $text, !1 = $ar, !2 = $team, !3 = $a, !4 = $key, !5 = $home, !6 = $away
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Carolina+-6%2C5+-+Indianapolis+'
    3     1        INIT_FCALL                                               'mb_ereg'
          2        SEND_VAL                                                 '%5E%28.%2B%29%5B%5B%3Aspace%3A%5D%5D%2B%28%28%5B-%5D%3F%5B0-9%5D%2B%5B%2C.%5D%3F%5B0-9%5D%2A%29+%2F%29%3F%28%5B-%5D%3F%5B0-9%5D%2B%5B%2C.%5D%3F%5B0-9%5D%2A%29%3F+-%28.%2B%29%24'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $8      
          6      > JMPZ                                                     $8, ->8
    4     7    >   ASSIGN                                                   !2, 1
    6     8    >   INIT_FCALL                                               'mb_ereg'
          9        SEND_VAL                                                 '%5E%28.%2B%29+-%28.%2B%29%5B%5B%3Aspace%3A%5D%5D%2B%28%28%5B-%5D%3F%5B0-9%5D%2B%5B%2C.%5D%3F%5B0-9%5D%2A%29+%2F%29%3F%28%5B-%5D%3F%5B0-9%5D%2B%5B%2C.%5D%3F%5B0-9%5D%2A%29%3F%24'
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !1
         12        DO_ICALL                                         $10     
         13      > JMPZ                                                     $10, ->15
    7    14    >   ASSIGN                                                   !2, 2
    8    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
    9    19      > FE_RESET_RW                                      $13     !1, ->29
         20    > > FE_FETCH_RW                                      ~14     $13, !3, ->29
         21    >   ASSIGN                                                   !4, ~14
   10    22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 <array>
         24        SEND_VAL                                                 <array>
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                         $16     
         27        ASSIGN                                                   !3, $16
    9    28      > JMP                                                      ->20
         29    >   FE_FREE                                                  $13
   12    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                                 
   13    33        ASSIGN                                                   !5, 23
   14    34        ASSIGN                                                   !6, 23
   16    35        IS_EQUAL                                                 !2, 1
         36      > JMPZ                                                     ~21, ->41
   17    37    >   FETCH_DIM_R                                      ~22     !1, 4
         38        ADD                                              ~23     !5, ~22
         39        ASSIGN                                                   !5, ~23
         40      > JMP                                                      ->46
   18    41    >   IS_EQUAL                                                 !2, 2
         42      > JMPZ                                                     ~25, ->46
   19    43    >   FETCH_DIM_R                                      ~26     !1, 5
         44        ADD                                              ~27     !6, ~26
         45        ASSIGN                                                   !6, ~27
   20    46    >   INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !5
         48        SEND_VAR                                                 !6
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.93 ms | 1400 KiB | 19 Q