3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function hello() { $my_obj = new stdClass(); $my_obj->name = 'Chandra'; $my_obj->age = 21; $my_obj->gender = 'male'; return $my_obj; } } $myc = new MyClass(); echo $myc->hello()->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FLhcI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $myc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $4      
          5        FETCH_OBJ_R                                      ~5      $4, 'name'
          6        ECHO                                                     ~5
          7      > RETURN                                                   1

Class MyClass:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FLhcI
function name:  hello
number of ops:  11
compiled vars:  !0 = $my_obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    8     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'Chandra'
    9     5        ASSIGN_OBJ                                               !0, 'age'
          6        OP_DATA                                                  21
   10     7        ASSIGN_OBJ                                               !0, 'gender'
          8        OP_DATA                                                  'male'
   11     9      > RETURN                                                   !0
   12    10*     > RETURN                                                   null

End of function hello

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.3 ms | 1394 KiB | 13 Q