3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private string $firstName; private string $lastName; private int $age; public function __construct(string $firstName,string $lastName,int $age) { $this->firstName=$firstName; $this->lastName=$lastName; $this->age=$age; } public function renderHtml(){ $html=""; $template="<p><b>%s:</b> %s</p>"; foreach (get_object_vars($this) as $k=>$v) { $html.=sprintf($template,ucfirst($k),$v); } return $html; } } $unaPersona=new Person("Pedro","Serrano",25); echo $unaPersona->renderHtml(); //var_dump($unaPersona); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sG7FP
function name:  (null)
number of ops:  10
compiled vars:  !0 = $unaPersona
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Person'
          1        SEND_VAL_EX                                              'Pedro'
          2        SEND_VAL_EX                                              'Serrano'
          3        SEND_VAL_EX                                              25
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   26     6        INIT_METHOD_CALL                                         !0, 'renderHtml'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
   29     9      > RETURN                                                   1

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sG7FP
function name:  __construct
number of ops:  10
compiled vars:  !0 = $firstName, !1 = $lastName, !2 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   10     3        ASSIGN_OBJ                                               'firstName'
          4        OP_DATA                                                  !0
   11     5        ASSIGN_OBJ                                               'lastName'
          6        OP_DATA                                                  !1
   12     7        ASSIGN_OBJ                                               'age'
          8        OP_DATA                                                  !2
   13     9      > RETURN                                                   null

End of function __construct

Function renderhtml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/sG7FP
function name:  renderHtml
number of ops:  22
compiled vars:  !0 = $html, !1 = $template, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, ''
   17     1        ASSIGN                                                   !1, '%3Cp%3E%3Cb%3E%25s%3A%3C%2Fb%3E+%25s%3C%2Fp%3E'
   18     2        INIT_FCALL                                               'get_object_vars'
          3        FETCH_THIS                                       ~6      
          4        SEND_VAL                                                 ~6
          5        DO_ICALL                                         $7      
          6      > FE_RESET_R                                       $8      $7, ->19
          7    > > FE_FETCH_R                                       ~9      $8, !2, ->19
          8    >   ASSIGN                                                   !3, ~9
   19     9        INIT_FCALL                                               'sprintf'
         10        SEND_VAR                                                 !1
         11        INIT_FCALL                                               'ucfirst'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $11     
         14        SEND_VAR                                                 $11
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ASSIGN_OP                                     8          !0, $12
   18    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $8
   21    20      > RETURN                                                   !0
   22    21*     > RETURN                                                   null

End of function renderhtml

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.12 ms | 1007 KiB | 16 Q