3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Players are (4): nana, nini, nunu, nono'; $str1 = 'nunu: (JH)'; $str2 = 'Bot draws - nana: (JH) Bot draws - nini: (JH) Bot draws - nunu: (JH) Bot draws - nono: (JH)'; $pplayer = preg_match("#^Players are ?(\((.*)\):)? (.*)$#i", $str, $pp); $player = array_map('trim', explode(',', $pp[3])); foreach($player as $playerval){ list($player1, $player2, $player3, $player4, $player5, $player6) = each($player); } $endplayer = end($player); $sisaplayer = $pp[2]; $ppkartu = preg_match("#^([a-z0-9\-\._:]+) ?(\((.*)\))?$#i", $str1, $pk); $pkartu = $pk[2]; $pbdraw = preg_match('#^Bot draws - '.$pk[2].': ?(\((.*)\))?$#i', $str2, $pb); $pbplayer = $pb; $pbkartu = $pb[2]; print_r($playerval);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 38
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 38
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/P60QC
function name:  (null)
number of ops:  69
compiled vars:  !0 = $str, !1 = $str1, !2 = $str2, !3 = $pplayer, !4 = $pp, !5 = $player, !6 = $playerval, !7 = $player1, !8 = $player2, !9 = $player3, !10 = $player4, !11 = $player5, !12 = $player6, !13 = $endplayer, !14 = $sisaplayer, !15 = $ppkartu, !16 = $pk, !17 = $pkartu, !18 = $pbdraw, !19 = $pb, !20 = $pbplayer, !21 = $pbkartu
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Players+are+%284%29%3A+nana%2C+nini%2C+nunu%2C+nono'
    3     1        ASSIGN                                                   !1, 'nunu%3A+%28JH%29'
    4     2        ASSIGN                                                   !2, 'Bot+draws+-+nana%3A+%28JH%29+Bot+draws+-+nini%3A+%28JH%29+Bot+draws+-+nunu%3A+%28JH%29+Bot+draws+-+nono%3A+%28JH%29'
    5     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%23%5EPlayers+are+%3F%28%5C%28%28.%2A%29%5C%29%3A%29%3F+%28.%2A%29%24%23i'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !4
          7        DO_ICALL                                         $25     
          8        ASSIGN                                                   !3, $25
    6     9        INIT_FCALL                                               'array_map'
         10        SEND_VAL                                                 'trim'
         11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%2C'
         13        FETCH_DIM_R                                      ~27     !4, 3
         14        SEND_VAL                                                 ~27
         15        DO_ICALL                                         $28     
         16        SEND_VAR                                                 $28
         17        DO_ICALL                                         $29     
         18        ASSIGN                                                   !5, $29
    7    19      > FE_RESET_R                                       $31     !5, ->38
         20    > > FE_FETCH_R                                               $31, !6, ->38
    8    21    >   INIT_FCALL_BY_NAME                                       'each'
         22        SEND_VAR_EX                                              !5
         23        DO_FCALL                                      0  $32     
         24        FETCH_LIST_R                                     $33     $32, 0
         25        ASSIGN                                                   !7, $33
         26        FETCH_LIST_R                                     $35     $32, 1
         27        ASSIGN                                                   !8, $35
         28        FETCH_LIST_R                                     $37     $32, 2
         29        ASSIGN                                                   !9, $37
         30        FETCH_LIST_R                                     $39     $32, 3
         31        ASSIGN                                                   !10, $39
         32        FETCH_LIST_R                                     $41     $32, 4
         33        ASSIGN                                                   !11, $41
         34        FETCH_LIST_R                                     $43     $32, 5
         35        ASSIGN                                                   !12, $43
         36        FREE                                                     $32
    7    37      > JMP                                                      ->20
         38    >   FE_FREE                                                  $31
   10    39        INIT_FCALL                                               'end'
         40        SEND_REF                                                 !5
         41        DO_ICALL                                         $45     
         42        ASSIGN                                                   !13, $45
   11    43        FETCH_DIM_R                                      ~47     !4, 2
         44        ASSIGN                                                   !14, ~47
   12    45        INIT_FCALL                                               'preg_match'
         46        SEND_VAL                                                 '%23%5E%28%5Ba-z0-9%5C-%5C._%3A%5D%2B%29+%3F%28%5C%28%28.%2A%29%5C%29%29%3F%24%23i'
         47        SEND_VAR                                                 !1
         48        SEND_REF                                                 !16
         49        DO_ICALL                                         $49     
         50        ASSIGN                                                   !15, $49
   13    51        FETCH_DIM_R                                      ~51     !16, 2
         52        ASSIGN                                                   !17, ~51
   14    53        INIT_FCALL                                               'preg_match'
         54        FETCH_DIM_R                                      ~53     !16, 2
         55        CONCAT                                           ~54     '%23%5EBot+draws+-+', ~53
         56        CONCAT                                           ~55     ~54, '%3A+%3F%28%5C%28%28.%2A%29%5C%29%29%3F%24%23i'
         57        SEND_VAL                                                 ~55
         58        SEND_VAR                                                 !2
         59        SEND_REF                                                 !19
         60        DO_ICALL                                         $56     
         61        ASSIGN                                                   !18, $56
   15    62        ASSIGN                                                   !20, !19
   16    63        FETCH_DIM_R                                      ~59     !19, 2
         64        ASSIGN                                                   !21, ~59
   17    65        INIT_FCALL                                               'print_r'
         66        SEND_VAR                                                 !6
         67        DO_ICALL                                                 
         68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.82 ms | 1405 KiB | 23 Q