3v4l.org

run code in 500+ 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 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 11
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 40
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 11
Branch analysis from position: 43
Branch analysis from position: 11
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 11
Branch analysis from position: 43
Branch analysis from position: 11
Branch analysis from position: 40
filename:       /in/uEeGP
function name:  (null)
number of ops:  47
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                                                          ->41
   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, ->40
   16    19    >   FETCH_DIM_R                                          ~16     !0, !3
         20        FRAMELESS_ICALL_2                preg_match          ~17     '%2F%5Ea%28%5Cd%2B%29%2F', ~16
         21      > JMPZ                                                         ~17, ->28
   17    22    >   FETCH_DIM_R                                          ~18     !4, 1
         23        ASSIGN                                                       !5, ~18
   19    24        INIT_METHOD_CALL                                             !1, 'setTimestamp'
         25        SEND_VAR_EX                                                  !5
         26        DO_FCALL                                          0          
   16    27      > JMP                                                          ->36
   21    28    >   INIT_METHOD_CALL                                             !1, 'modify'
         29        ROPE_INIT                                         3  ~23     '%2B'
         30        FETCH_DIM_R                                          ~21     !4, 1
         31        ROPE_ADD                                          1  ~23     ~23, ~21
         32        ROPE_END                                          2  ~22     ~23, '+day'
         33        SEND_VAL_EX                                                  ~22
         34        DO_FCALL                                          0          
   23    35        ASSIGN                                                       !5, 'NULL'
   27    36    >   INIT_ARRAY                                           ~28     !1, 'date'
   28    37        ADD_ARRAY_ELEMENT                                    ~28     !5, 't'
   26    38        ASSIGN_DIM                                                   !2
   28    39        OP_DATA                                                      ~28
   12    40    >   PRE_INC                                                      !3
         41    >   IS_SMALLER                                                   !3, 9
         42      > JMPNZ                                                        ~30, ->11
   33    43    >   INIT_FCALL                                                   'var_dump'
         44        SEND_VAR                                                     !2
         45        DO_ICALL                                                     
         46      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.66 ms | 2272 KiB | 15 Q