3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Carolina -6,5 - Indianapolis '; var_dump($text); $text = trim($text); var_dump($text); if (mb_ereg('^(.+)[[:space:]]+(([-]?[0-9]+[,.]?[0-9]*) /)?([-]?[0-9]+[,.]?[0-9]*)? -(.+)$', $text, $ar)) $team = 1; var_dump($ar, $team); 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 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
2 jumps found. (Code = 125) Position 1 = 34, Position 2 = 43
Branch analysis from position: 34
2 jumps found. (Code = 126) Position 1 = 35, Position 2 = 43
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 55
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
Branch analysis from position: 43
Branch analysis from position: 29
Branch analysis from position: 18
filename:       /in/JM5fo
function name:  (null)
number of ops:  65
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                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'trim'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !0, $9
    5     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    7    11        INIT_FCALL                                               'mb_ereg'
         12        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'
         13        SEND_VAR                                                 !0
         14        SEND_REF                                                 !1
         15        DO_ICALL                                         $12     
         16      > JMPZ                                                     $12, ->18
    8    17    >   ASSIGN                                                   !2, 1
   10    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
   11    22        INIT_FCALL                                               'mb_ereg'
         23        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'
         24        SEND_VAR                                                 !0
         25        SEND_REF                                                 !1
         26        DO_ICALL                                         $15     
         27      > JMPZ                                                     $15, ->29
   12    28    >   ASSIGN                                                   !2, 2
   13    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                                 
   14    33      > FE_RESET_RW                                      $18     !1, ->43
         34    > > FE_FETCH_RW                                      ~19     $18, !3, ->43
         35    >   ASSIGN                                                   !4, ~19
   15    36        INIT_FCALL                                               'str_replace'
         37        SEND_VAL                                                 <array>
         38        SEND_VAL                                                 <array>
         39        SEND_VAR                                                 !3
         40        DO_ICALL                                         $21     
         41        ASSIGN                                                   !3, $21
   14    42      > JMP                                                      ->34
         43    >   FE_FREE                                                  $18
   17    44        INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !1
         46        DO_ICALL                                                 
   18    47        ASSIGN                                                   !5, 23
   19    48        ASSIGN                                                   !6, 23
   21    49        IS_EQUAL                                                 !2, 1
         50      > JMPZ                                                     ~26, ->55
   22    51    >   FETCH_DIM_R                                      ~27     !1, 4
         52        ADD                                              ~28     !5, ~27
         53        ASSIGN                                                   !5, ~28
         54      > JMP                                                      ->60
   23    55    >   IS_EQUAL                                                 !2, 2
         56      > JMPZ                                                     ~30, ->60
   24    57    >   FETCH_DIM_R                                      ~31     !1, 5
         58        ADD                                              ~32     !6, ~31
         59        ASSIGN                                                   !6, ~32
   25    60    >   INIT_FCALL                                               'var_dump'
         61        SEND_VAR                                                 !5
         62        SEND_VAR                                                 !6
         63        DO_ICALL                                                 
         64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.54 ms | 1400 KiB | 21 Q