3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person{ var $name; function __construct(string $name){ $this->name = $name; } } class Student extends Person{ public int $age; function __construct(int $age, string $name){ parent::__construct($name); $this->age = $age; } } $ob = new Student(25, "James"); echo $ob->age, " " ,$ob->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sWvoU
function name:  (null)
number of ops:  11
compiled vars:  !0 = $ob
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Student'
          1        SEND_VAL_EX                                              25
          2        SEND_VAL_EX                                              'James'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   21     5        FETCH_OBJ_R                                      ~4      !0, 'age'
          6        ECHO                                                     ~4
          7        ECHO                                                     '+'
          8        FETCH_OBJ_R                                      ~5      !0, 'name'
          9        ECHO                                                     ~5
   22    10      > RETURN                                                   1

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

End of function __construct

End of class Person.

Class Student:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sWvoU
function name:  __construct
number of ops:  8
compiled vars:  !0 = $age, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
   15     5        ASSIGN_OBJ                                               'age'
          6        OP_DATA                                                  !0
   16     7      > RETURN                                                   null

End of function __construct

End of class Student.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
222.72 ms | 1008 KiB | 13 Q