3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Page { private $title; private $description; private $body; public function __construct($title = '') { if (!empty($title)) { $this->title = $title; } else { $this->title = "TITLE"; } } public function description($description) { $this->description = $description; } public function body($body) { $this->body = $body; } public function display($content = '') { $html = ''; $html .= '<html>\n'; $html .= '<head>\n'; $html .= '<title>'.$this->title.'</title>\n<body'; if(!empty($this->body)) $html .= ' '. $this->body; $html .= '>\n'; $html .= trim($content); $html .= '</body?\n'; $html .= '</html>'; } } $myPage = new Page('test'); $myPage->display("<div>HELLO</div>"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOvVT
function name:  (null)
number of ops:  8
compiled vars:  !0 = $myPage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   NEW                                              $1      'Page'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   45     4        INIT_METHOD_CALL                                         !0, 'display'
          5        SEND_VAL_EX                                              '%3Cdiv%3EHELLO%3C%2Fdiv%3E'
          6        DO_FCALL                                      0          
   48     7      > RETURN                                                   1

Class Page:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
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: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOvVT
function name:  __construct
number of ops:  10
compiled vars:  !0 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      ''
   11     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->7
   13     4    >   ASSIGN_OBJ                                               'title'
          5        OP_DATA                                                  !0
          6      > JMP                                                      ->9
   15     7    >   ASSIGN_OBJ                                               'title'
          8        OP_DATA                                                  'TITLE'
   17     9    > > RETURN                                                   null

End of function __construct

Function description:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOvVT
function name:  description
number of ops:  4
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               'description'
          2        OP_DATA                                                  !0
   22     3      > RETURN                                                   null

End of function description

Function body:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VOvVT
function name:  body
number of ops:  4
compiled vars:  !0 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   26     1        ASSIGN_OBJ                                               'body'
          2        OP_DATA                                                  !0
   27     3      > RETURN                                                   null

End of function body

Function display:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/VOvVT
function name:  display
number of ops:  22
compiled vars:  !0 = $content, !1 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV_INIT                                        !0      ''
   31     1        ASSIGN                                                   !1, ''
   32     2        ASSIGN_OP                                     8          !1, '%3Chtml%3E%5Cn'
   33     3        ASSIGN_OP                                     8          !1, '%3Chead%3E%5Cn'
   34     4        FETCH_OBJ_R                                      ~5      'title'
          5        CONCAT                                           ~6      '%3Ctitle%3E', ~5
          6        CONCAT                                           ~7      ~6, '%3C%2Ftitle%3E%5Cn%3Cbody'
          7        ASSIGN_OP                                     8          !1, ~7
   35     8        ISSET_ISEMPTY_PROP_OBJ                           ~9      'body'
          9        BOOL_NOT                                         ~10     ~9
         10      > JMPZ                                                     ~10, ->14
         11    >   FETCH_OBJ_R                                      ~11     'body'
         12        CONCAT                                           ~12     '+', ~11
         13        ASSIGN_OP                                     8          !1, ~12
   36    14    >   ASSIGN_OP                                     8          !1, '%3E%5Cn'
   37    15        INIT_FCALL                                               'trim'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $15     
         18        ASSIGN_OP                                     8          !1, $15
   38    19        ASSIGN_OP                                     8          !1, '%3C%2Fbody%3F%5Cn'
   39    20        ASSIGN_OP                                     8          !1, '%3C%2Fhtml%3E'
   41    21      > RETURN                                                   null

End of function display

End of class Page.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.35 ms | 1400 KiB | 15 Q