3v4l.org

run code in 300+ PHP versions simultaneously
<?php $minAge = 86400; // 24h $rows = array( 'import_1364893316_foobar', 'import_1364893306_foobar', 'import_1364893216_foobar', 'import_1364892316_foobar', 'import_1364883316_foobar', 'import_1364793316_foobar', 'import_1363893316_foobar', 'import_1354893316_foobar', 'import_1354893416', 'import_1354893316', ); $drops = array(); $maxCreatedAt = true === $minAge ? time() - $minAge : time() + 1; foreach ($rows as &$row) { if (preg_match('/_([0-9]+)[0-9]{6}[_a-zA-Z]*$/', $row['table_name'], $matches)) { var_dump($matches[1]); if ($maxCreatedAt > (int) $matches[1]) { $drops[] = $row['table_name']; } } } var_dump($drops);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 125) Position 1 = 16, Position 2 = 36
Branch analysis from position: 16
2 jumps found. (Code = 126) Position 1 = 17, Position 2 = 36
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 35
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 35
Branch analysis from position: 35
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 10
2 jumps found. (Code = 125) Position 1 = 16, Position 2 = 36
Branch analysis from position: 16
Branch analysis from position: 36
filename:       /in/n4vuv
function name:  (null)
number of ops:  41
compiled vars:  !0 = $minAge, !1 = $rows, !2 = $drops, !3 = $maxCreatedAt, !4 = $row, !5 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 86400
    5     1        ASSIGN                                                   !1, <array>
   18     2        ASSIGN                                                   !2, <array>
   20     3        TYPE_CHECK                                    8          !0
          4      > JMPZ                                                     ~9, ->10
   21     5    >   INIT_FCALL                                               'time'
          6        DO_ICALL                                         $10     
          7        SUB                                              ~11     $10, !0
          8        QM_ASSIGN                                        ~12     ~11
          9      > JMP                                                      ->14
   22    10    >   INIT_FCALL                                               'time'
         11        DO_ICALL                                         $13     
         12        ADD                                              ~14     $13, 1
         13        QM_ASSIGN                                        ~12     ~14
   20    14    >   ASSIGN                                                   !3, ~12
   24    15      > FE_RESET_RW                                      $16     !1, ->36
         16    > > FE_FETCH_RW                                              $16, !4, ->36
   25    17    >   INIT_FCALL                                               'preg_match'
         18        SEND_VAL                                                 '%2F_%28%5B0-9%5D%2B%29%5B0-9%5D%7B6%7D%5B_a-zA-Z%5D%2A%24%2F'
         19        FETCH_DIM_R                                      ~17     !4, 'table_name'
         20        SEND_VAL                                                 ~17
         21        SEND_REF                                                 !5
         22        DO_ICALL                                         $18     
         23      > JMPZ                                                     $18, ->35
   26    24    >   INIT_FCALL                                               'var_dump'
         25        FETCH_DIM_R                                      ~19     !5, 1
         26        SEND_VAL                                                 ~19
         27        DO_ICALL                                                 
   27    28        FETCH_DIM_R                                      ~21     !5, 1
         29        CAST                                          4  ~22     ~21
         30        IS_SMALLER                                               ~22, !3
         31      > JMPZ                                                     ~23, ->35
   28    32    >   FETCH_DIM_R                                      ~25     !4, 'table_name'
         33        ASSIGN_DIM                                               !2
         34        OP_DATA                                                  ~25
   24    35    > > JMP                                                      ->16
         36    >   FE_FREE                                                  $16
   33    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.54 ms | 1400 KiB | 19 Q