3v4l.org

run code in 300+ PHP versions simultaneously
<?php //just generate some test dates $dates = []; for ($i = 1; $i<=7; $i++) { $dates["date0".$i] = "2022-08-0".$i; } extract($dates); $row = array("table_name" => "test", "threshold" => 5); //generate some random test data foreach ($dates as $key => $val) { $row[$val] = rand(0, 10); } var_dump($row); $rowId = 0; $table_rows = array(); //now for the important bit $html = '<tr> <td style="text-align:center"><b>'.$row['table_name'].'</td> <td style="text-align:center;'.($row["$date07"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date07"].'</td> <td style="text-align:center;'.($row["$date06"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date06"].'</td> <td style="text-align:center;'.($row["$date05"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date05"].'</td> <td style="text-align:center;'.($row["$date04"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date04"].'</td> <td style="text-align:center;'.($row["$date03"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date03"].'</td> <td style="text-align:center;'.($row["$date02"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date02"].'</td> <td style="text-align:center;'.($row["$date01"] < $row["threshold"] ? "background-color:red;" : "").'">'.$row["$date01"].'</td> </tr>'; echo $html;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 82
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 96
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 110
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 124
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 125
Branch analysis from position: 125
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 124
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 110
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 124
Branch analysis from position: 122
Branch analysis from position: 124
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 108, Position 2 = 110
Branch analysis from position: 108
Branch analysis from position: 110
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 96
Branch analysis from position: 94
Branch analysis from position: 96
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 82
Branch analysis from position: 80
Branch analysis from position: 82
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
Branch analysis from position: 68
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
Branch analysis from position: 54
Branch analysis from position: 24
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/NV8vF
function name:  (null)
number of ops:  134
compiled vars:  !0 = $dates, !1 = $i, !2 = $row, !3 = $val, !4 = $key, !5 = $rowId, !6 = $table_rows, !7 = $html, !8 = $date07, !9 = $date06, !10 = $date05, !11 = $date04, !12 = $date03, !13 = $date02, !14 = $date01
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->8
          3    >   CONCAT                                           ~17     'date0', !1
          4        CONCAT                                           ~19     '2022-08-0', !1
          5        ASSIGN_DIM                                               !0, ~17
          6        OP_DATA                                                  ~19
          7        PRE_INC                                                  !1
          8    >   IS_SMALLER_OR_EQUAL                                      !1, 7
          9      > JMPNZ                                                    ~21, ->3
    6    10    >   INIT_FCALL                                               'extract'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
    8    13        ASSIGN                                                   !2, <array>
   10    14      > FE_RESET_R                                       $24     !0, ->24
         15    > > FE_FETCH_R                                       ~25     $24, !3, ->24
         16    >   ASSIGN                                                   !4, ~25
         17        INIT_FCALL                                               'rand'
         18        SEND_VAL                                                 0
         19        SEND_VAL                                                 10
         20        DO_ICALL                                         $28     
         21        ASSIGN_DIM                                               !2, !3
         22        OP_DATA                                                  $28
         23      > JMP                                                      ->15
         24    >   FE_FREE                                                  $24
   11    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
   12    28        ASSIGN                                                   !5, 0
   13    29        ASSIGN                                                   !6, <array>
   17    30        FETCH_DIM_R                                      ~32     !2, 'table_name'
         31        CONCAT                                           ~33     '%3Ctr%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%22%3E%3Cb%3E', ~32
         32        CONCAT                                           ~34     ~33, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   18    33        CAST                                          6  ~35     !8
         34        FETCH_DIM_R                                      ~36     !2, ~35
         35        FETCH_DIM_R                                      ~37     !2, 'threshold'
         36        IS_SMALLER                                               ~36, ~37
         37      > JMPZ                                                     ~38, ->40
         38    >   QM_ASSIGN                                        ~39     'background-color%3Ared%3B'
         39      > JMP                                                      ->41
         40    >   QM_ASSIGN                                        ~39     ''
         41    >   CONCAT                                           ~40     ~34, ~39
         42        CONCAT                                           ~41     ~40, '%22%3E'
         43        CAST                                          6  ~42     !8
         44        FETCH_DIM_R                                      ~43     !2, ~42
         45        CONCAT                                           ~44     ~41, ~43
         46        CONCAT                                           ~45     ~44, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   19    47        CAST                                          6  ~46     !9
         48        FETCH_DIM_R                                      ~47     !2, ~46
         49        FETCH_DIM_R                                      ~48     !2, 'threshold'
         50        IS_SMALLER                                               ~47, ~48
         51      > JMPZ                                                     ~49, ->54
         52    >   QM_ASSIGN                                        ~50     'background-color%3Ared%3B'
         53      > JMP                                                      ->55
         54    >   QM_ASSIGN                                        ~50     ''
         55    >   CONCAT                                           ~51     ~45, ~50
         56        CONCAT                                           ~52     ~51, '%22%3E'
         57        CAST                                          6  ~53     !9
         58        FETCH_DIM_R                                      ~54     !2, ~53
         59        CONCAT                                           ~55     ~52, ~54
         60        CONCAT                                           ~56     ~55, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   20    61        CAST                                          6  ~57     !10
         62        FETCH_DIM_R                                      ~58     !2, ~57
         63        FETCH_DIM_R                                      ~59     !2, 'threshold'
         64        IS_SMALLER                                               ~58, ~59
         65      > JMPZ                                                     ~60, ->68
         66    >   QM_ASSIGN                                        ~61     'background-color%3Ared%3B'
         67      > JMP                                                      ->69
         68    >   QM_ASSIGN                                        ~61     ''
         69    >   CONCAT                                           ~62     ~56, ~61
         70        CONCAT                                           ~63     ~62, '%22%3E'
         71        CAST                                          6  ~64     !10
         72        FETCH_DIM_R                                      ~65     !2, ~64
         73        CONCAT                                           ~66     ~63, ~65
         74        CONCAT                                           ~67     ~66, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   21    75        CAST                                          6  ~68     !11
         76        FETCH_DIM_R                                      ~69     !2, ~68
         77        FETCH_DIM_R                                      ~70     !2, 'threshold'
         78        IS_SMALLER                                               ~69, ~70
         79      > JMPZ                                                     ~71, ->82
         80    >   QM_ASSIGN                                        ~72     'background-color%3Ared%3B'
         81      > JMP                                                      ->83
         82    >   QM_ASSIGN                                        ~72     ''
         83    >   CONCAT                                           ~73     ~67, ~72
         84        CONCAT                                           ~74     ~73, '%22%3E'
         85        CAST                                          6  ~75     !11
         86        FETCH_DIM_R                                      ~76     !2, ~75
         87        CONCAT                                           ~77     ~74, ~76
         88        CONCAT                                           ~78     ~77, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   22    89        CAST                                          6  ~79     !12
         90        FETCH_DIM_R                                      ~80     !2, ~79
         91        FETCH_DIM_R                                      ~81     !2, 'threshold'
         92        IS_SMALLER                                               ~80, ~81
         93      > JMPZ                                                     ~82, ->96
         94    >   QM_ASSIGN                                        ~83     'background-color%3Ared%3B'
         95      > JMP                                                      ->97
         96    >   QM_ASSIGN                                        ~83     ''
         97    >   CONCAT                                           ~84     ~78, ~83
         98        CONCAT                                           ~85     ~84, '%22%3E'
         99        CAST                                          6  ~86     !12
        100        FETCH_DIM_R                                      ~87     !2, ~86
        101        CONCAT                                           ~88     ~85, ~87
        102        CONCAT                                           ~89     ~88, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   23   103        CAST                                          6  ~90     !13
        104        FETCH_DIM_R                                      ~91     !2, ~90
        105        FETCH_DIM_R                                      ~92     !2, 'threshold'
        106        IS_SMALLER                                               ~91, ~92
        107      > JMPZ                                                     ~93, ->110
        108    >   QM_ASSIGN                                        ~94     'background-color%3Ared%3B'
        109      > JMP                                                      ->111
        110    >   QM_ASSIGN                                        ~94     ''
        111    >   CONCAT                                           ~95     ~89, ~94
        112        CONCAT                                           ~96     ~95, '%22%3E'
        113        CAST                                          6  ~97     !13
        114        FETCH_DIM_R                                      ~98     !2, ~97
        115        CONCAT                                           ~99     ~96, ~98
        116        CONCAT                                           ~100    ~99, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3Ctd+style%3D%22text-align%3Acenter%3B'
   24   117        CAST                                          6  ~101    !14
        118        FETCH_DIM_R                                      ~102    !2, ~101
        119        FETCH_DIM_R                                      ~103    !2, 'threshold'
        120        IS_SMALLER                                               ~102, ~103
        121      > JMPZ                                                     ~104, ->124
        122    >   QM_ASSIGN                                        ~105    'background-color%3Ared%3B'
        123      > JMP                                                      ->125
        124    >   QM_ASSIGN                                        ~105    ''
        125    >   CONCAT                                           ~106    ~100, ~105
        126        CONCAT                                           ~107    ~106, '%22%3E'
        127        CAST                                          6  ~108    !14
        128        FETCH_DIM_R                                      ~109    !2, ~108
        129        CONCAT                                           ~110    ~107, ~109
        130        CONCAT                                           ~111    ~110, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++%3C%2Ftr%3E'
   16   131        ASSIGN                                                   !7, ~111
   26   132        ECHO                                                     !7
   27   133      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.95 ms | 1013 KiB | 16 Q