3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <title>Reconstructing the Person Class</title> <link type='text/css' rel='stylesheet' href='style.css'/> </head> <body> <p> <!-- Your code here --> <?php class Person{ public $isAlive = true; public $firstname; public $lastname; public $age; public function __contruct($firstname, $lastname, $age){ $this -> firstname = $firstname; $this -> lastname = $lastname; $this -> age = $age; } } $teacher = new Person("boring", "12345", 12345); $student = new Person("Brett", "Thomas", 27); echo $student -> age; ?> </p> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WeV1K
function name:  (null)
number of ops:  17
compiled vars:  !0 = $teacher, !1 = $student
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%09%3Chead%3E%0A%09++%3Ctitle%3EReconstructing+the+Person+Class%3C%2Ftitle%3E%0A++++++%3Clink+type%3D%27text%2Fcss%27+rel%3D%27stylesheet%27+href%3D%27style.css%27%2F%3E%0A%09%3C%2Fhead%3E%0A%09%3Cbody%3E%0A++++++%3Cp%3E%0A++++++++%3C%21--+Your+code+here+--%3E%0A++++++++'
   25     1        NEW                                              $2      'Person'
          2        SEND_VAL_EX                                              'boring'
          3        SEND_VAL_EX                                              '12345'
          4        SEND_VAL_EX                                              12345
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   26     7        NEW                                              $5      'Person'
          8        SEND_VAL_EX                                              'Brett'
          9        SEND_VAL_EX                                              'Thomas'
         10        SEND_VAL_EX                                              27
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $5
   27    13        FETCH_OBJ_R                                      ~8      !1, 'age'
         14        ECHO                                                     ~8
   29    15        ECHO                                                     '++++++%3C%2Fp%3E%0A++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   31    16      > RETURN                                                   1

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

End of function __contruct

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.72 ms | 1395 KiB | 13 Q