3v4l.org

run code in 300+ PHP versions simultaneously
<?php // include('database.php'); // require('fpdf.php'); class FPDF {} $process = new Process(); class PDF extends FPDF { function Header() { // Logo $this->Image('logo.png',10,6,30); // Arial bold 15 $this->SetFont('Arial','B',15); // Move to the right $this->Cell(80); // Title $this->Cell(30,10,'Title',1,0,'C'); // Line break $this->Ln(20); } function Footer() { // Position at 1.5 cm from bottom $this->SetY(-15); // Arial italic 8 $this->SetFont('Arial','I',8); // Page number $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } } class Process { private $dbconn; private $pdf; private $resultarr = array(); private $identarr = array(); function __construct() { $this->dbconn = new Database(); $this->pdf = new PDF(); $this->init(0); } private function init($i) { switch($i) { case 0: $query = "SELECT ident FROM vm_result WHERE date > NOW() - INTERVAL 7 DAY GROUP BY ident"; break; case 1: break; } $this->load_entries($query); } private function load_entries($query) { $result = $this->dbconn->query($query); while($row = $result->fetch_assoc()) { array_push($this->identarr, $row['ident']); } // loop per customer foreach($this->identarr as $ident) { $this->resultarr = array(); $query = "SELECT name, count, date FROM vm_result WHERE ident = '$ident' ORDER BY date ASC"; $result = $this->dbconn->query($query); while($row = $result->fetch_assoc()) { $str = $row['name'] . ':' . $row['count'] . ':' . $row['date']; array_push($this->resultarr, $str); } // summarize $this->summarize(); } } private function summarize() { foreach($this->resultarr as $entry) { $tmp = explode(":", $entry); $name = $tmp[0]; $count = $tmp[1]; $day = $tmp[2]; } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aijSt
function name:  (null)
number of ops:  4
compiled vars:  !0 = $process
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'Process'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
  119     3      > RETURN                                                   1

Class FPDF: [no user functions]
Class PDF:
Function header:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aijSt
function name:  Header
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_METHOD_CALL                                         'Image'
          1        SEND_VAL_EX                                              'logo.png'
          2        SEND_VAL_EX                                              10
          3        SEND_VAL_EX                                              6
          4        SEND_VAL_EX                                              30
          5        DO_FCALL                                      0          
   17     6        INIT_METHOD_CALL                                         'SetFont'
          7        SEND_VAL_EX                                              'Arial'
          8        SEND_VAL_EX                                              'B'
          9        SEND_VAL_EX                                              15
         10        DO_FCALL                                      0          
   19    11        INIT_METHOD_CALL                                         'Cell'
         12        SEND_VAL_EX                                              80
         13        DO_FCALL                                      0          
   21    14        INIT_METHOD_CALL                                         'Cell'
         15        SEND_VAL_EX                                              30
         16        SEND_VAL_EX                                              10
         17        SEND_VAL_EX                                              'Title'
         18        SEND_VAL_EX                                              1
         19        SEND_VAL_EX                                              0
         20        SEND_VAL_EX                                              'C'
         21        DO_FCALL                                      0          
   23    22        INIT_METHOD_CALL                                         'Ln'
         23        SEND_VAL_EX                                              20
         24        DO_FCALL                                      0          
   24    25      > RETURN                                                   null

End of function header

Function footer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aijSt
function name:  Footer
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_METHOD_CALL                                         'SetY'
          1        SEND_VAL_EX                                              -15
          2        DO_FCALL                                      0          
   31     3        INIT_METHOD_CALL                                         'SetFont'
          4        SEND_VAL_EX                                              'Arial'
          5        SEND_VAL_EX                                              'I'
          6        SEND_VAL_EX                                              8
          7        DO_FCALL                                      0          
   33     8        INIT_METHOD_CALL                                         'Cell'
          9        SEND_VAL_EX                                              0
         10        SEND_VAL_EX                                              10
         11        INIT_METHOD_CALL                                         'PageNo'
         12        DO_FCALL                                      0  $2      
         13        CONCAT                                           ~3      'Page+', $2
         14        CONCAT                                           ~4      ~3, '%2F%7Bnb%7D'
         15        SEND_VAL_EX                                              ~4
         16        SEND_VAL_EX                                              0
         17        SEND_VAL_EX                                              0
         18        SEND_VAL_EX                                              'C'
         19        DO_FCALL                                      0          
   34    20      > RETURN                                                   null

End of function footer

End of class PDF.

Class Process:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aijSt
function name:  __construct
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   NEW                                              $1      'Database'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'dbconn'
          3        OP_DATA                                                  $1
   48     4        NEW                                              $4      'PDF'
          5        DO_FCALL                                      0          
          6        ASSIGN_OBJ                                               'pdf'
          7        OP_DATA                                                  $4
   49     8        INIT_METHOD_CALL                                         'init'
          9        SEND_VAL_EX                                              0
         10        DO_FCALL                                      0          
   51    11      > RETURN                                                   null

End of function __construct

Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
filename:       /in/aijSt
function name:  init
number of ops:  13
compiled vars:  !0 = $i, !1 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV                                             !0      
   57     1        IS_EQUAL                                                 !0, 0
          2      > JMPNZ                                                    ~2, ->6
   60     3    >   IS_EQUAL                                                 !0, 1
          4      > JMPNZ                                                    ~2, ->8
          5    > > JMP                                                      ->9
   58     6    >   ASSIGN                                                   !1, 'SELECT+ident+FROM+vm_result+WHERE+date+%3E+NOW%28%29+-+INTERVAL+7+DAY+GROUP+BY+ident'
   59     7      > JMP                                                      ->9
   62     8    > > JMP                                                      ->9
   66     9    >   INIT_METHOD_CALL                                         'load_entries'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
   68    12      > RETURN                                                   null

End of function init

Function load_entries:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 52
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 52
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 32
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 32
Branch analysis from position: 49
Branch analysis from position: 32
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/aijSt
function name:  load_entries
number of ops:  54
compiled vars:  !0 = $query, !1 = $result, !2 = $row, !3 = $ident, !4 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   70     0  E >   RECV                                             !0      
   72     1        FETCH_OBJ_R                                      ~5      'dbconn'
          2        INIT_METHOD_CALL                                         ~5, 'query'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   74     6      > JMP                                                      ->13
   76     7    >   INIT_FCALL                                               'array_push'
          8        FETCH_OBJ_W                                      $8      'identarr'
          9        SEND_REF                                                 $8
         10        FETCH_DIM_R                                      ~9      !2, 'ident'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
   74    13    >   INIT_METHOD_CALL                                         !1, 'fetch_assoc'
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                           ~12     !2, $11
         16      > JMPNZ                                                    ~12, ->7
   81    17    >   FETCH_OBJ_R                                      ~13     'identarr'
         18      > FE_RESET_R                                       $14     ~13, ->52
         19    > > FE_FETCH_R                                               $14, !3, ->52
   83    20    >   ASSIGN_OBJ                                               'resultarr'
         21        OP_DATA                                                  <array>
   85    22        ROPE_INIT                                     3  ~17     'SELECT+name%2C+count%2C+date+FROM+vm_result+WHERE+ident+%3D+%27'
         23        ROPE_ADD                                      1  ~17     ~17, !3
         24        ROPE_END                                      2  ~16     ~17, '%27+ORDER+BY+date+ASC'
         25        ASSIGN                                                   !0, ~16
   86    26        FETCH_OBJ_R                                      ~20     'dbconn'
         27        INIT_METHOD_CALL                                         ~20, 'query'
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $21     
         30        ASSIGN                                                   !1, $21
   88    31      > JMP                                                      ->45
   90    32    >   FETCH_DIM_R                                      ~23     !2, 'name'
         33        CONCAT                                           ~24     ~23, '%3A'
         34        FETCH_DIM_R                                      ~25     !2, 'count'
         35        CONCAT                                           ~26     ~24, ~25
         36        CONCAT                                           ~27     ~26, '%3A'
         37        FETCH_DIM_R                                      ~28     !2, 'date'
         38        CONCAT                                           ~29     ~27, ~28
         39        ASSIGN                                                   !4, ~29
   91    40        INIT_FCALL                                               'array_push'
         41        FETCH_OBJ_W                                      $31     'resultarr'
         42        SEND_REF                                                 $31
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                                 
   88    45    >   INIT_METHOD_CALL                                         !1, 'fetch_assoc'
         46        DO_FCALL                                      0  $33     
         47        ASSIGN                                           ~34     !2, $33
         48      > JMPNZ                                                    ~34, ->32
   96    49    >   INIT_METHOD_CALL                                         'summarize'
         50        DO_FCALL                                      0          
   81    51      > JMP                                                      ->19
         52    >   FE_FREE                                                  $14
  101    53      > RETURN                                                   null

End of function load_entries

Function summarize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/aijSt
function name:  summarize
number of ops:  17
compiled vars:  !0 = $entry, !1 = $tmp, !2 = $name, !3 = $count, !4 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  105     0  E >   FETCH_OBJ_R                                      ~5      'resultarr'
          1      > FE_RESET_R                                       $6      ~5, ->15
          2    > > FE_FETCH_R                                               $6, !0, ->15
  107     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%3A'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
  109     8        FETCH_DIM_R                                      ~9      !1, 0
          9        ASSIGN                                                   !2, ~9
  110    10        FETCH_DIM_R                                      ~11     !1, 1
         11        ASSIGN                                                   !3, ~11
  111    12        FETCH_DIM_R                                      ~13     !1, 2
         13        ASSIGN                                                   !4, ~13
  105    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $6
  115    16      > RETURN                                                   null

End of function summarize

End of class Process.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.82 ms | 1412 KiB | 17 Q