3v4l.org

run code in 500+ PHP versions simultaneously
<?php $txt = <<<TXT Foodbar: +8; Barredfu: -91% TXT; $result = []; foreach (explode("\n", $txt) as $line) { sscanf( $line, '%[^:]:%[+-]%d%[%]', $attr, $result[$attr]['sign'], $result[$attr]['numb'], $result[$attr]['perc'] ); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/9VnSU
function name:  (null)
number of ops:  28
compiled vars:  !0 = $txt, !1 = $result, !2 = $line, !3 = $attr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Foodbar%3A+%2B8%3B%0ABarredfu%3A+-91%25'
    8     1        ASSIGN                                                       !1, <array>
    9     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%0A'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $6      
          6      > FE_RESET_R                                           $7      $6, ->23
          7    > > FE_FETCH_R                                                   $7, !2, ->23
   10     8    >   INIT_FCALL                                                   'sscanf'
   11     9        SEND_VAR                                                     !2
   12    10        SEND_VAL                                                     '%25%5B%5E%3A%5D%3A%25%5B%2B-%5D%25d%25%5B%25%5D'
   13    11        SEND_REF                                                     !3
   14    12        FETCH_DIM_W                                          $8      !1, !3
         13        FETCH_DIM_W                                          $9      $8, 'sign'
         14        SEND_REF                                                     $9
   15    15        FETCH_DIM_W                                          $10     !1, !3
         16        FETCH_DIM_W                                          $11     $10, 'numb'
         17        SEND_REF                                                     $11
   16    18        FETCH_DIM_W                                          $12     !1, !3
         19        FETCH_DIM_W                                          $13     $12, 'perc'
         20        SEND_REF                                                     $13
   10    21        DO_ICALL                                                     
    9    22      > JMP                                                          ->7
         23    >   FE_FREE                                                      $7
   19    24        INIT_FCALL                                                   'var_export'
         25        SEND_VAR                                                     !1
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.89 ms | 1326 KiB | 16 Q