3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 7 => 'a1455656400,96.64,96.85,94.61,95.02,47490678', 8 => '1,98.12,98.21,96.15,96.67,44390173' ]; $date = new \DateTime('now'); $date->format('U = Y-m-d H:i:s'); $quotations = []; for ($i = 7; $i < 9; $i++) { $matches = []; if (preg_match('/^a?(\d+),(\d+\.\d+),(\d+\.\d+),(\d+\.\d+),(\d+\.\d+),(\d+)$/', $array[$i], $matches)) { if (preg_match('/^a(\d+)/', $array[$i])) { $timestamp = $matches[1]; $date->setTimestamp($timestamp); } else { $date->modify("+{$matches[1]} day"); $timestamp = "NULL"; } $quotations[] = [ 'date' => $date, 't' => $timestamp ]; } } var_dump($quotations);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 11
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 43
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 11
Branch analysis from position: 46
Branch analysis from position: 11
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 11
Branch analysis from position: 46
Branch analysis from position: 11
Branch analysis from position: 43
filename:       /in/uEeGP
function name:  (null)
number of ops:  50
compiled vars:  !0 = $array, !1 = $date, !2 = $quotations, !3 = $i, !4 = $matches, !5 = $timestamp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        NEW                                              $7      'DateTime'
          2        SEND_VAL_EX                                              'now'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
    8     5        INIT_METHOD_CALL                                         !1, 'format'
          6        SEND_VAL_EX                                              'U+%3D+Y-m-d+H%3Ai%3As'
          7        DO_FCALL                                      0          
   10     8        ASSIGN                                                   !2, <array>
   12     9        ASSIGN                                                   !3, 7
         10      > JMP                                                      ->44
   13    11    >   ASSIGN                                                   !4, <array>
   15    12        INIT_FCALL                                               'preg_match'
         13        SEND_VAL                                                 '%2F%5Ea%3F%28%5Cd%2B%29%2C%28%5Cd%2B%5C.%5Cd%2B%29%2C%28%5Cd%2B%5C.%5Cd%2B%29%2C%28%5Cd%2B%5C.%5Cd%2B%29%2C%28%5Cd%2B%5C.%5Cd%2B%29%2C%28%5Cd%2B%29%24%2F'
         14        FETCH_DIM_R                                      ~14     !0, !3
         15        SEND_VAL                                                 ~14
         16        SEND_REF                                                 !4
         17        DO_ICALL                                         $15     
         18      > JMPZ                                                     $15, ->43
   16    19    >   INIT_FCALL                                               'preg_match'
         20        SEND_VAL                                                 '%2F%5Ea%28%5Cd%2B%29%2F'
         21        FETCH_DIM_R                                      ~16     !0, !3
         22        SEND_VAL                                                 ~16
         23        DO_ICALL                                         $17     
         24      > JMPZ                                                     $17, ->31
   17    25    >   FETCH_DIM_R                                      ~18     !4, 1
         26        ASSIGN                                                   !5, ~18
   19    27        INIT_METHOD_CALL                                         !1, 'setTimestamp'
         28        SEND_VAR_EX                                              !5
         29        DO_FCALL                                      0          
   16    30      > JMP                                                      ->39
   21    31    >   INIT_METHOD_CALL                                         !1, 'modify'
         32        ROPE_INIT                                     3  ~23     '%2B'
         33        FETCH_DIM_R                                      ~21     !4, 1
         34        ROPE_ADD                                      1  ~23     ~23, ~21
         35        ROPE_END                                      2  ~22     ~23, '+day'
         36        SEND_VAL_EX                                              ~22
         37        DO_FCALL                                      0          
   23    38        ASSIGN                                                   !5, 'NULL'
   27    39    >   INIT_ARRAY                                       ~28     !1, 'date'
   28    40        ADD_ARRAY_ELEMENT                                ~28     !5, 't'
   26    41        ASSIGN_DIM                                               !2
   28    42        OP_DATA                                                  ~28
   12    43    >   PRE_INC                                                  !3
         44    >   IS_SMALLER                                               !3, 9
         45      > JMPNZ                                                    ~30, ->11
   33    46    >   INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.21 ms | 1004 KiB | 15 Q