3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT user1,1234; user2,2345; user3,3456; TEXT; var_export( array_reduce( explode(PHP_EOL, $text), function($result, $line) { sscanf($line, '%[^,],%d', $user, $value); $result[$user] = $value; return $result; }, [] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CXOWV
function name:  (null)
number of ops:  15
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'user1%2C1234%3B%0Auser2%2C2345%3B%0Auser3%2C3456%3B'
    9     1        INIT_FCALL                                               'var_export'
   10     2        INIT_FCALL                                               'array_reduce'
   11     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%0A'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
   12     8        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   16     9        SEND_VAL                                                 ~3
   17    10        SEND_VAL                                                 <array>
   10    11        DO_ICALL                                         $4      
   17    12        SEND_VAR                                                 $4
    9    13        DO_ICALL                                                 
   19    14      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CXOWV
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $result, !1 = $line, !2 = $user, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_FCALL                                               'sscanf'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%25%5B%5E%2C%5D%2C%25d'
          5        SEND_REF                                                 !2
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
   14     8        ASSIGN_DIM                                               !0, !2
          9        OP_DATA                                                  !3
   15    10      > RETURN                                                   !0
   16    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.16 ms | 1014 KiB | 17 Q