3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<END [account] user = {user1} pwd = {password1} expdate = 2028-01-01 [account] user = {user2} pwd = {password2} expdate = 2028-01-01 [account] user = {user3} pwd = {password3} expdate = 2028-01-01 END; $data = array_map( function($entry) { return parse_ini_string($entry); }, array_filter( explode('[account]', $input), function($entry) { return strlen(trim($entry)); } ) ); print_r($data); //
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bvfF
function name:  (null)
number of ops:  20
compiled vars:  !0 = $input, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Baccount%5D%0Auser+%3D+%7Buser1%7D%0Apwd+%3D+%7Bpassword1%7D%0Aexpdate+%3D+2028-01-01%0A%5Baccount%5D%0Auser+%3D+%7Buser2%7D%0Apwd+%3D+%7Bpassword2%7D%0Aexpdate+%3D+2028-01-01%0A%5Baccount%5D%0Auser+%3D+%7Buser3%7D%0Apwd+%3D+%7Bpassword3%7D%0Aexpdate+%3D+2028-01-01'
   18     1        INIT_FCALL                                               'array_map'
   19     2        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          3        SEND_VAL                                                 ~3
   20     4        INIT_FCALL                                               'array_filter'
   21     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%5Baccount%5D'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
   22    10        DECLARE_LAMBDA_FUNCTION                          ~5      [1]
         11        SEND_VAL                                                 ~5
   20    12        DO_ICALL                                         $6      
   22    13        SEND_VAR                                                 $6
   18    14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !1, $7
   26    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   27    19      > 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/3bvfF
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'parse_ini_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bvfF
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        STRLEN                                           ~2      $1
          5      > RETURN                                                   ~2
          6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.7 ms | 1008 KiB | 19 Q