3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title>Pruebas</title> </head> <body> <?php class Cabecera { private $titulo; public function __construct($tit) { $this->titulo=$tit; } public function graficar() { echo '<h1 style="text-align:center">'.$this->titulo.'</h1>'; } } class Cuerpo { private $lineas=array(); public function insertarParrafo($li) { $this->lineas[]=$li; } private function graficar() { for($f=0;$f<count($this->lineas);$f++) { echo '<p>'.$this->lineas[$f].'</p>'; } } } class Pie { private $titulo; public function __construct($tit) { $this->titulo=$tit; } public function graficar() { echo '<h4 style="text-align:left">'.$this->titulo.'</h4>'; } } class Pagina { private $cabecera; private $cuerpo; private $pie; public function __construct($texto1,$texto2) { $this->cabecera=new Cabecera($texto1); $this->cuerpo=new Cuerpo(); $this->pie=new Pie($texto2); } public function insertarCuerpo($texto) { $this->cuerpo->insertarParrafo($texto); } public function graficar() { $this->cabecera->graficar(); $this->cuerpo->graficar(); $this->pie->graficar(); } } $pagina1=new Pagina('Título de la Página','Pie de la página'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 1'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 2'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 3'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 4'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 5'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 6'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 7'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 8'); $pagina1->insertarCuerpo('Esto es una prueba que debe aparecer dentro del cuerpo de la página 9'); $pagina1->graficar(); ?> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  (null)
number of ops:  37
compiled vars:  !0 = $pagina1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3EPruebas%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A'
   68     1        NEW                                              $1      'Pagina'
          2        SEND_VAL_EX                                              'T%C3%ADtulo+de+la+P%C3%A1gina'
          3        SEND_VAL_EX                                              'Pie+de+la+p%C3%A1gina'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   69     6        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
          7        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+1'
          8        DO_FCALL                                      0          
   70     9        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         10        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+2'
         11        DO_FCALL                                      0          
   71    12        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         13        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+3'
         14        DO_FCALL                                      0          
   72    15        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         16        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+4'
         17        DO_FCALL                                      0          
   73    18        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         19        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+5'
         20        DO_FCALL                                      0          
   74    21        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         22        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+6'
         23        DO_FCALL                                      0          
   75    24        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         25        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+7'
         26        DO_FCALL                                      0          
   76    27        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         28        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+8'
         29        DO_FCALL                                      0          
   77    30        INIT_METHOD_CALL                                         !0, 'insertarCuerpo'
         31        SEND_VAL_EX                                              'Esto+es+una+prueba+que+debe+aparecer+dentro+del+cuerpo+de+la+p%C3%A1gina+9'
         32        DO_FCALL                                      0          
   78    33        INIT_METHOD_CALL                                         !0, 'graficar'
         34        DO_FCALL                                      0          
   80    35        ECHO                                                     '%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   81    36      > RETURN                                                   1

Class Cabecera:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $tit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'titulo'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function __construct

Function graficar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  graficar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'titulo'
          1        CONCAT                                           ~1      '%3Ch1+style%3D%22text-align%3Acenter%22%3E', ~0
          2        CONCAT                                           ~2      ~1, '%3C%2Fh1%3E'
          3        ECHO                                                     ~2
   16     4      > RETURN                                                   null

End of function graficar

End of class Cabecera.

Class Cuerpo:
Function insertarparrafo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  insertarParrafo
number of ops:  5
compiled vars:  !0 = $li
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        FETCH_OBJ_W                                      $1      'lineas'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   24     4      > RETURN                                                   null

End of function insertarparrafo

Function graficar:
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 = 12, Position 2 = 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 2
Branch analysis from position: 12
Branch analysis from position: 2
filename:       /in/jdQLc
function name:  graficar
number of ops:  13
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->8
   29     2    >   FETCH_OBJ_R                                      ~2      'lineas'
          3        FETCH_DIM_R                                      ~3      ~2, !0
          4        CONCAT                                           ~4      '%3Cp%3E', ~3
          5        CONCAT                                           ~5      ~4, '%3C%2Fp%3E'
          6        ECHO                                                     ~5
   27     7        PRE_INC                                                  !0
          8    >   FETCH_OBJ_R                                      ~7      'lineas'
          9        COUNT                                            ~8      ~7
         10        IS_SMALLER                                               !0, ~8
         11      > JMPNZ                                                    ~9, ->2
   31    12    > > RETURN                                                   null

End of function graficar

End of class Cuerpo.

Class Pie:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $tit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   38     1        ASSIGN_OBJ                                               'titulo'
          2        OP_DATA                                                  !0
   39     3      > RETURN                                                   null

End of function __construct

Function graficar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  graficar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   FETCH_OBJ_R                                      ~0      'titulo'
          1        CONCAT                                           ~1      '%3Ch4+style%3D%22text-align%3Aleft%22%3E', ~0
          2        CONCAT                                           ~2      ~1, '%3C%2Fh4%3E'
          3        ECHO                                                     ~2
   43     4      > RETURN                                                   null

End of function graficar

End of class Pie.

Class Pagina:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  __construct
number of ops:  17
compiled vars:  !0 = $texto1, !1 = $texto2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   52     2        NEW                                              $3      'Cabecera'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               'cabecera'
          6        OP_DATA                                                  $3
   53     7        NEW                                              $6      'Cuerpo'
          8        DO_FCALL                                      0          
          9        ASSIGN_OBJ                                               'cuerpo'
         10        OP_DATA                                                  $6
   54    11        NEW                                              $9      'Pie'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14        ASSIGN_OBJ                                               'pie'
         15        OP_DATA                                                  $9
   55    16      > RETURN                                                   null

End of function __construct

Function insertarcuerpo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  insertarCuerpo
number of ops:  6
compiled vars:  !0 = $texto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   58     1        FETCH_OBJ_R                                      ~1      'cuerpo'
          2        INIT_METHOD_CALL                                         ~1, 'insertarParrafo'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   59     5      > RETURN                                                   null

End of function insertarcuerpo

Function graficar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdQLc
function name:  graficar
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   FETCH_OBJ_R                                      ~0      'cabecera'
          1        INIT_METHOD_CALL                                         ~0, 'graficar'
          2        DO_FCALL                                      0          
   63     3        FETCH_OBJ_R                                      ~2      'cuerpo'
          4        INIT_METHOD_CALL                                         ~2, 'graficar'
          5        DO_FCALL                                      0          
   64     6        FETCH_OBJ_R                                      ~4      'pie'
          7        INIT_METHOD_CALL                                         ~4, 'graficar'
          8        DO_FCALL                                      0          
   65     9      > RETURN                                                   null

End of function graficar

End of class Pagina.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.5 ms | 1407 KiB | 13 Q