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])); while (list(, $value) = each($player)) { echo "Value: $value<br />\n"; } $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
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 20
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 20
Branch analysis from position: 30
Branch analysis from position: 20
filename:       /in/P8b54
function name:  (null)
number of ops:  60
compiled vars:  !0 = $str, !1 = $str1, !2 = $str2, !3 = $pplayer, !4 = $pp, !5 = $player, !6 = $value, !7 = $endplayer, !8 = $sisaplayer, !9 = $ppkartu, !10 = $pk, !11 = $pkartu, !12 = $pbdraw, !13 = $pb, !14 = $pbplayer, !15 = $pbkartu, !16 = $playerval
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                                         $20     
          8        ASSIGN                                                   !3, $20
    6     9        INIT_FCALL                                               'array_map'
         10        SEND_VAL                                                 'trim'
         11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%2C'
         13        FETCH_DIM_R                                      ~22     !4, 3
         14        SEND_VAL                                                 ~22
         15        DO_ICALL                                         $23     
         16        SEND_VAR                                                 $23
         17        DO_ICALL                                         $24     
         18        ASSIGN                                                   !5, $24
    7    19      > JMP                                                      ->24
    8    20    >   ROPE_INIT                                     3  ~27     'Value%3A+'
         21        ROPE_ADD                                      1  ~27     ~27, !6
         22        ROPE_END                                      2  ~26     ~27, '%3Cbr+%2F%3E%0A'
         23        ECHO                                                     ~26
    7    24    >   INIT_FCALL_BY_NAME                                       'each'
         25        SEND_VAR_EX                                              !5
         26        DO_FCALL                                      0  $29     
         27        FETCH_LIST_R                                     $30     $29, 1
         28        ASSIGN                                                   !6, $30
         29      > JMPNZ                                                    $29, ->20
   10    30    >   INIT_FCALL                                               'end'
         31        SEND_REF                                                 !5
         32        DO_ICALL                                         $32     
         33        ASSIGN                                                   !7, $32
   11    34        FETCH_DIM_R                                      ~34     !4, 2
         35        ASSIGN                                                   !8, ~34
   12    36        INIT_FCALL                                               'preg_match'
         37        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'
         38        SEND_VAR                                                 !1
         39        SEND_REF                                                 !10
         40        DO_ICALL                                         $36     
         41        ASSIGN                                                   !9, $36
   13    42        FETCH_DIM_R                                      ~38     !10, 2
         43        ASSIGN                                                   !11, ~38
   14    44        INIT_FCALL                                               'preg_match'
         45        FETCH_DIM_R                                      ~40     !10, 2
         46        CONCAT                                           ~41     '%23%5EBot+draws+-+', ~40
         47        CONCAT                                           ~42     ~41, '%3A+%3F%28%5C%28%28.%2A%29%5C%29%29%3F%24%23i'
         48        SEND_VAL                                                 ~42
         49        SEND_VAR                                                 !2
         50        SEND_REF                                                 !13
         51        DO_ICALL                                         $43     
         52        ASSIGN                                                   !12, $43
   15    53        ASSIGN                                                   !14, !13
   16    54        FETCH_DIM_R                                      ~46     !13, 2
         55        ASSIGN                                                   !15, ~46
   17    56        INIT_FCALL                                               'print_r'
         57        SEND_VAR                                                 !16
         58        DO_ICALL                                                 
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.37 ms | 1400 KiB | 23 Q