3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ '133|mickmackusa|100|90|500', '133|mickmackusa|100|90', '133|mickmackusa|100', '133|mickmackusa', '133', '', ]; foreach ($tests as $test) { $matches = sscanf($test, '%d|%[^|]|%d|%d|%d', $user_id, $name, $limit, $remaining, $reset); var_export([ 'matches' => $matches, 'user_id' => $user_id, 'name' => $name, 'limit' => $limit, 'remaining' => $remaining, 'reset' => $reset ]); echo "\n"; unset($matches, $user_id, $name, $limit, $remaining, $reset); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 30
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 30
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/fITgL
function name:  (null)
number of ops:  32
compiled vars:  !0 = $tests, !1 = $test, !2 = $matches, !3 = $user_id, !4 = $name, !5 = $limit, !6 = $remaining, !7 = $reset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $9      !0, ->30
          2    > > FE_FETCH_R                                               $9, !1, ->30
   13     3    >   INIT_FCALL                                               'sscanf'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 '%25d%7C%25%5B%5E%7C%5D%7C%25d%7C%25d%7C%25d'
          6        SEND_REF                                                 !3
          7        SEND_REF                                                 !4
          8        SEND_REF                                                 !5
          9        SEND_REF                                                 !6
         10        SEND_REF                                                 !7
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
   14    13        INIT_FCALL                                               'var_export'
   15    14        INIT_ARRAY                                       ~12     !2, 'matches'
   16    15        ADD_ARRAY_ELEMENT                                ~12     !3, 'user_id'
   17    16        ADD_ARRAY_ELEMENT                                ~12     !4, 'name'
   18    17        ADD_ARRAY_ELEMENT                                ~12     !5, 'limit'
   19    18        ADD_ARRAY_ELEMENT                                ~12     !6, 'remaining'
   20    19        ADD_ARRAY_ELEMENT                                ~12     !7, 'reset'
         20        SEND_VAL                                                 ~12
   14    21        DO_ICALL                                                 
   22    22        ECHO                                                     '%0A'
   23    23        UNSET_CV                                                 !2
         24        UNSET_CV                                                 !3
         25        UNSET_CV                                                 !4
         26        UNSET_CV                                                 !5
         27        UNSET_CV                                                 !6
         28        UNSET_CV                                                 !7
   12    29      > JMP                                                      ->2
         30    >   FE_FREE                                                  $9
   24    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.31 ms | 1004 KiB | 15 Q