3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Car { public $atr1; public $atr2; public $atr3; function _construct($atr1,$atr2,$atr3) { $this->atr1=$atr1; $this->atr1="LOL"; echo "constructor"; echo $this->atr1; $this->atr2=$atr2; $this->atr3=$atr3; } public function getatr1() { echo "function echo"; echo $this->atr1; return $this->atr1; } public function getatr2() { return $this->atr2; } public function getatr3() { return $this->atr3; } } function napln() { $obj1 = new Car("renault","modra",'nieco'); $obj2 = new Car('skoda','zelena','neviem'); $obj3 = new Car('opel','cervena','cojaviem'); echo "tuto"; echo $obj1->getatr1(); echo "tuto"; $pole = array($obj1, $obj2, $obj3); return $pole; } function tabulka() { $table_str='<table>'; $table=napln(); foreach($table as $tab) { $table_str.= '<tr>'; $table_str.='<td>'.$tab -> getatr1().'</td><td>'.$tab -> getatr2().'</td><td>'.$tab -> getatr3().'</td>'; $table_str.='</tr>'; } $table_str.='</table>'; return $table_str; } ?> <html> <head> <title>Page Title</title> </head> <body> <?php echo tabulka(); ?> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3EPage+Title%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A+'
   69     1        INIT_FCALL                                               'tabulka'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   71     4        ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   73     5      > RETURN                                                   1

Function napln:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  napln
number of ops:  29
compiled vars:  !0 = $obj1, !1 = $obj2, !2 = $obj3, !3 = $pole
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   NEW                                              $4      'Car'
          1        SEND_VAL_EX                                              'renault'
          2        SEND_VAL_EX                                              'modra'
          3        SEND_VAL_EX                                              'nieco'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   40     6        NEW                                              $7      'Car'
          7        SEND_VAL_EX                                              'skoda'
          8        SEND_VAL_EX                                              'zelena'
          9        SEND_VAL_EX                                              'neviem'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   41    12        NEW                                              $10     'Car'
         13        SEND_VAL_EX                                              'opel'
         14        SEND_VAL_EX                                              'cervena'
         15        SEND_VAL_EX                                              'cojaviem'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $10
   42    18        ECHO                                                     'tuto'
   43    19        INIT_METHOD_CALL                                         !0, 'getatr1'
         20        DO_FCALL                                      0  $13     
         21        ECHO                                                     $13
   44    22        ECHO                                                     'tuto'
   45    23        INIT_ARRAY                                       ~14     !0
         24        ADD_ARRAY_ELEMENT                                ~14     !1
         25        ADD_ARRAY_ELEMENT                                ~14     !2
         26        ASSIGN                                                   !3, ~14
   46    27      > RETURN                                                   !3
   47    28*     > RETURN                                                   null

End of function napln

Function tabulka:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 22
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/1T1N3
function name:  tabulka
number of ops:  26
compiled vars:  !0 = $table_str, !1 = $table, !2 = $tab
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   ASSIGN                                                   !0, '%3Ctable%3E'
   51     1        INIT_FCALL                                               'napln'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
   52     4      > FE_RESET_R                                       $6      !1, ->22
          5    > > FE_FETCH_R                                               $6, !2, ->22
   54     6    >   ASSIGN_OP                                     8          !0, '%3Ctr%3E'
   55     7        INIT_METHOD_CALL                                         !2, 'getatr1'
          8        DO_FCALL                                      0  $8      
          9        CONCAT                                           ~9      '%3Ctd%3E', $8
         10        CONCAT                                           ~10     ~9, '%3C%2Ftd%3E%3Ctd%3E'
         11        INIT_METHOD_CALL                                         !2, 'getatr2'
         12        DO_FCALL                                      0  $11     
         13        CONCAT                                           ~12     ~10, $11
         14        CONCAT                                           ~13     ~12, '%3C%2Ftd%3E%3Ctd%3E'
         15        INIT_METHOD_CALL                                         !2, 'getatr3'
         16        DO_FCALL                                      0  $14     
         17        CONCAT                                           ~15     ~13, $14
         18        CONCAT                                           ~16     ~15, '%3C%2Ftd%3E'
         19        ASSIGN_OP                                     8          !0, ~16
   56    20        ASSIGN_OP                                     8          !0, '%3C%2Ftr%3E'
   52    21      > JMP                                                      ->5
         22    >   FE_FREE                                                  $6
   58    23        ASSIGN_OP                                     8          !0, '%3C%2Ftable%3E'
   59    24      > RETURN                                                   !0
   60    25*     > RETURN                                                   null

End of function tabulka

Class Car:
Function _construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  _construct
number of ops:  15
compiled vars:  !0 = $atr1, !1 = $atr2, !2 = $atr3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN_OBJ                                               'atr1'
          4        OP_DATA                                                  !0
   10     5        ASSIGN_OBJ                                               'atr1'
          6        OP_DATA                                                  'LOL'
   11     7        ECHO                                                     'constructor'
   12     8        FETCH_OBJ_R                                      ~5      'atr1'
          9        ECHO                                                     ~5
   13    10        ASSIGN_OBJ                                               'atr2'
         11        OP_DATA                                                  !1
   14    12        ASSIGN_OBJ                                               'atr3'
         13        OP_DATA                                                  !2
   16    14      > RETURN                                                   null

End of function _construct

Function getatr1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  getatr1
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'function+echo'
   20     1        FETCH_OBJ_R                                      ~0      'atr1'
          2        ECHO                                                     ~0
   21     3        FETCH_OBJ_R                                      ~1      'atr1'
          4      > RETURN                                                   ~1
   22     5*     > RETURN                                                   null

End of function getatr1

Function getatr2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  getatr2
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                      ~0      'atr2'
          1      > RETURN                                                   ~0
   27     2*     > RETURN                                                   null

End of function getatr2

Function getatr3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1T1N3
function name:  getatr3
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_OBJ_R                                      ~0      'atr3'
          1      > RETURN                                                   ~0
   32     2*     > RETURN                                                   null

End of function getatr3

End of class Car.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.18 ms | 1398 KiB | 15 Q