3v4l.org

run code in 300+ PHP versions simultaneously
<?php $item[0] = "apple=5"; $item[1] = "banana=7"; $item[2] = "orange=8"; $result = []; foreach ($item as $string) { [$key, $result[$key]] = sscanf($string, '%[^=]=%d'); } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/eeQos
function name:  (null)
number of ops:  25
compiled vars:  !0 = $item, !1 = $result, !2 = $string, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 0
          1        OP_DATA                                                  'apple%3D5'
    4     2        ASSIGN_DIM                                               !0, 1
          3        OP_DATA                                                  'banana%3D7'
    5     4        ASSIGN_DIM                                               !0, 2
          5        OP_DATA                                                  'orange%3D8'
    7     6        ASSIGN                                                   !1, <array>
    8     7      > FE_RESET_R                                       $8      !0, ->20
          8    > > FE_FETCH_R                                               $8, !2, ->20
    9     9    >   INIT_FCALL                                               'sscanf'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 '%25%5B%5E%3D%5D%3D%25d'
         12        DO_ICALL                                         $9      
         13        FETCH_LIST_R                                     $10     $9, 0
         14        ASSIGN                                                   !3, $10
         15        FETCH_LIST_R                                     $12     $9, 1
         16        ASSIGN_DIM                                               !1, !3
         17        OP_DATA                                                  $12
         18        FREE                                                     $9
    8    19      > JMP                                                      ->8
         20    >   FE_FREE                                                  $8
   11    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.11 ms | 1011 KiB | 15 Q