3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data= '"CIEL3.SA",35.10,"SAO","+4.71%",+1.58,35.85,34.00,"34.00 - 35.85",8637900,"BRL","3/17/2016","5:08pm"'; $properties=explode(",",$data); $fields = array('Symbol', 'LastTradePriceOnly', 'StockExchange', 'ChangeinPercent', 'Change', 'DaysHigh', 'DaysLow', 'DaysRange', 'Volume', 'Currency', 'LastTradeDate', 'LastTradeTime'); foreach ($properties as $key=>$value) { $quotes[] = array ( $fields[$key] => $value ); }; $results = array ( "query" => array ( "results" => array ( "quote" => $quotes ) ) ); echo json_encode($results); $row = 1; $quotes = null; $stream = fopen('data://text/plain;base64,' . base64_encode($data),'r'); while (($data = fgetcsv($stream, 12, ",")) !== FALSE) { $num = count($data); echo "<p> $num campos na linha $row: <br /></p>\n"; $row++; foreach ($data as $key=>$value) { $quotes[] = array ( $fields[$key] => $value ); }; } $results = array ( "query" => array ( "results" => array ( "quote" => $quotes ) ) ); echo json_encode($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 36
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 53
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 53
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 36
Branch analysis from position: 62
Branch analysis from position: 36
Branch analysis from position: 53
Branch analysis from position: 15
filename:       /in/clNqX
function name:  (null)
number of ops:  71
compiled vars:  !0 = $data, !1 = $properties, !2 = $fields, !3 = $value, !4 = $key, !5 = $quotes, !6 = $results, !7 = $row, !8 = $stream, !9 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%22CIEL3.SA%22%2C35.10%2C%22SAO%22%2C%22%2B4.71%25%22%2C%2B1.58%2C35.85%2C34.00%2C%2234.00+-+35.85%22%2C8637900%2C%22BRL%22%2C%223%2F17%2F2016%22%2C%225%3A08pm%22'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $11     
          5        ASSIGN                                                   !1, $11
    7     6        ASSIGN                                                   !2, <array>
    9     7      > FE_RESET_R                                       $14     !1, ->15
          8    > > FE_FETCH_R                                       ~15     $14, !3, ->15
          9    >   ASSIGN                                                   !4, ~15
   11    10        FETCH_DIM_R                                      ~18     !2, !4
         11        INIT_ARRAY                                       ~19     !3, ~18
   10    12        ASSIGN_DIM                                               !5
   11    13        OP_DATA                                                  ~19
    9    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $14
   18    16        INIT_ARRAY                                       ~20     !5, 'quote'
         17        INIT_ARRAY                                       ~21     ~20, 'results'
         18        INIT_ARRAY                                       ~22     ~21, 'query'
   15    19        ASSIGN                                                   !6, ~22
   23    20        INIT_FCALL                                               'json_encode'
         21        SEND_VAR                                                 !6
         22        DO_ICALL                                         $24     
         23        ECHO                                                     $24
   25    24        ASSIGN                                                   !7, 1
   26    25        ASSIGN                                                   !5, null
   28    26        INIT_FCALL                                               'fopen'
         27        INIT_FCALL                                               'base64_encode'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $27     
         30        CONCAT                                           ~28     'data%3A%2F%2Ftext%2Fplain%3Bbase64%2C', $27
         31        SEND_VAL                                                 ~28
         32        SEND_VAL                                                 'r'
         33        DO_ICALL                                         $29     
         34        ASSIGN                                                   !8, $29
   29    35      > JMP                                                      ->54
   30    36    >   COUNT                                            ~31     !0
         37        ASSIGN                                                   !9, ~31
   31    38        ROPE_INIT                                     5  ~34     '%3Cp%3E+'
         39        ROPE_ADD                                      1  ~34     ~34, !9
         40        ROPE_ADD                                      2  ~34     ~34, '+campos+na+linha+'
         41        ROPE_ADD                                      3  ~34     ~34, !7
         42        ROPE_END                                      4  ~33     ~34, '%3A+%3Cbr+%2F%3E%3C%2Fp%3E%0A'
         43        ECHO                                                     ~33
   32    44        PRE_INC                                                  !7
   33    45      > FE_RESET_R                                       $38     !0, ->53
         46    > > FE_FETCH_R                                       ~39     $38, !3, ->53
         47    >   ASSIGN                                                   !4, ~39
   35    48        FETCH_DIM_R                                      ~42     !2, !4
         49        INIT_ARRAY                                       ~43     !3, ~42
   34    50        ASSIGN_DIM                                               !5
   35    51        OP_DATA                                                  ~43
   33    52      > JMP                                                      ->46
         53    >   FE_FREE                                                  $38
   29    54    >   INIT_FCALL                                               'fgetcsv'
         55        SEND_VAR                                                 !8
         56        SEND_VAL                                                 12
         57        SEND_VAL                                                 '%2C'
         58        DO_ICALL                                         $44     
         59        ASSIGN                                           ~45     !0, $44
         60        TYPE_CHECK                                  1018          ~45
         61      > JMPNZ                                                    ~46, ->36
   44    62    >   INIT_ARRAY                                       ~47     !5, 'quote'
         63        INIT_ARRAY                                       ~48     ~47, 'results'
         64        INIT_ARRAY                                       ~49     ~48, 'query'
   41    65        ASSIGN                                                   !6, ~49
   49    66        INIT_FCALL                                               'json_encode'
         67        SEND_VAR                                                 !6
         68        DO_ICALL                                         $51     
         69        ECHO                                                     $51
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
201.91 ms | 1403 KiB | 23 Q