3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimpleClass { public $var = 'a default value'; public function displayVar() { echo $this->var; } } class dog { public $honey = 'fdfd'; public function goat() { $this->honey = new Simpleclass(); $this->honey->va = 'super'; } } class moo extends dog { public function __construct() { $this->goat(); } } $dog = new dog; echo $dog->honey, PHP_EOL; $dog->honey = new Simpleclass(); $dog->honey->va = 'super'; echo $dog->honey->va, PHP_EOL; $dog2 = new dog; $dog2->goat(); echo $object->honey->va, PHP_EOL; $moo = new moo; echo $moo->honey->va;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZBnJn
function name:  (null)
number of ops:  33
compiled vars:  !0 = $dog, !1 = $dog2, !2 = $object, !3 = $moo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $4      'dog'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   36     3        FETCH_OBJ_R                                      ~7      !0, 'honey'
          4        ECHO                                                     ~7
          5        ECHO                                                     '%0A'
   38     6        NEW                                              $9      'Simpleclass'
          7        DO_FCALL                                      0          
          8        ASSIGN_OBJ                                               !0, 'honey'
          9        OP_DATA                                                  $9
   39    10        FETCH_OBJ_W                                      $11     !0, 'honey'
         11        ASSIGN_OBJ                                               $11, 'va'
         12        OP_DATA                                                  'super'
   40    13        FETCH_OBJ_R                                      ~13     !0, 'honey'
         14        FETCH_OBJ_R                                      ~14     ~13, 'va'
         15        ECHO                                                     ~14
         16        ECHO                                                     '%0A'
   42    17        NEW                                              $15     'dog'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $15
   43    20        INIT_METHOD_CALL                                         !1, 'goat'
         21        DO_FCALL                                      0          
   44    22        FETCH_OBJ_R                                      ~19     !2, 'honey'
         23        FETCH_OBJ_R                                      ~20     ~19, 'va'
         24        ECHO                                                     ~20
         25        ECHO                                                     '%0A'
   46    26        NEW                                              $21     'moo'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !3, $21
   47    29        FETCH_OBJ_R                                      ~24     !3, 'honey'
         30        FETCH_OBJ_R                                      ~25     ~24, 'va'
         31        ECHO                                                     ~25
         32      > RETURN                                                   1

Class SimpleClass:
Function displayvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZBnJn
function name:  displayVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'var'
          1        ECHO                                                     ~0
    9     2      > RETURN                                                   null

End of function displayvar

End of class SimpleClass.

Class dog:
Function goat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZBnJn
function name:  goat
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Simpleclass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'honey'
          3        OP_DATA                                                  $1
   19     4        FETCH_OBJ_W                                      $3      'honey'
          5        ASSIGN_OBJ                                               $3, 'va'
          6        OP_DATA                                                  'super'
   20     7      > RETURN                                                   null

End of function goat

End of class dog.

Class moo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZBnJn
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_METHOD_CALL                                         'goat'
          1        DO_FCALL                                      0          
   29     2      > RETURN                                                   null

End of function __construct

Function goat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZBnJn
function name:  goat
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Simpleclass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'honey'
          3        OP_DATA                                                  $1
   19     4        FETCH_OBJ_W                                      $3      'honey'
          5        ASSIGN_OBJ                                               $3, 'va'
          6        OP_DATA                                                  'super'
   20     7      > RETURN                                                   null

End of function goat

End of class moo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.09 ms | 1399 KiB | 13 Q