3v4l.org

run code in 500+ PHP versions simultaneously
<?php $lines = <<<PAYLOAD DATE = FEE = PAYMENT 2021-03-09 = 119.25 = 119.25 = 2021-04-13 2021-03-15 = 119.25 = 119.25 = 2021-04-13 PAYLOAD; $results = []; foreach (explode("\n", $lines) as $row) { if (sscanf($row, '%s = %f', $date, $fee) === 2) { $title = 'example'; $result[] = compact(['date', 'fee', 'title']); } } echo json_encode($result, JSON_PRETTY_PRINT);
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
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/gtGnW
function name:  (null)
number of ops:  30
compiled vars:  !0 = $lines, !1 = $results, !2 = $row, !3 = $date, !4 = $fee, !5 = $title, !6 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'DATE++++++%3D+FEE+%3D+PAYMENT%0A2021-03-09+%3D+119.25+%3D+119.25+%3D+2021-04-13%0A%0A2021-03-15+%3D+119.25+%3D+119.25+%3D+2021-04-13'
   10     1        ASSIGN                                                       !1, <array>
   11     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%0A'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $9      
          6      > FE_RESET_R                                           $10     $9, ->23
          7    > > FE_FETCH_R                                                   $10, !2, ->23
   12     8    >   INIT_FCALL                                                   'sscanf'
          9        SEND_VAR                                                     !2
         10        SEND_VAL                                                     '%25s+%3D+%25f'
         11        SEND_REF                                                     !3
         12        SEND_REF                                                     !4
         13        DO_ICALL                                             $11     
         14        IS_IDENTICAL                                                 $11, 2
         15      > JMPZ                                                         ~12, ->22
   13    16    >   ASSIGN                                                       !5, 'example'
   14    17        INIT_FCALL                                                   'compact'
         18        SEND_VAL                                                     <array>
         19        DO_ICALL                                             $15     
         20        ASSIGN_DIM                                                   !6
         21        OP_DATA                                                      $15
   11    22    > > JMP                                                          ->7
         23    >   FE_FREE                                                      $10
   18    24        INIT_FCALL                                                   'json_encode'
         25        SEND_VAR                                                     !6
         26        SEND_VAL                                                     128
         27        DO_ICALL                                             $16     
         28        ECHO                                                         $16
         29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.74 ms | 1917 KiB | 17 Q