3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Doge { private $doge; protected $ham; public $yup; public static function factory() { $me = new static(); $me->doge = "Cooper"; $me->ham = "Sandwich"; $me->yup = "nope"; return $me; } } class Dogeness extends Doge { } $doge = Doge::factory(); var_dump($doge); $dogeness = Dogeness::factory(); var_dump($dogeness);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5EvJ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $doge, !1 = $dogeness
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'Doge', 'factory'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   21     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   24     6        INIT_STATIC_METHOD_CALL                                  'Dogeness', 'factory'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   25     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class Doge:
Function factory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5EvJ
function name:  factory
number of ops:  11
compiled vars:  !0 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        ASSIGN_OBJ                                               !0, 'doge'
          4        OP_DATA                                                  'Cooper'
   11     5        ASSIGN_OBJ                                               !0, 'ham'
          6        OP_DATA                                                  'Sandwich'
   12     7        ASSIGN_OBJ                                               !0, 'yup'
          8        OP_DATA                                                  'nope'
   13     9      > RETURN                                                   !0
   14    10*     > RETURN                                                   null

End of function factory

End of class Doge.

Class Dogeness:
Function factory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5EvJ
function name:  factory
number of ops:  11
compiled vars:  !0 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        ASSIGN_OBJ                                               !0, 'doge'
          4        OP_DATA                                                  'Cooper'
   11     5        ASSIGN_OBJ                                               !0, 'ham'
          6        OP_DATA                                                  'Sandwich'
   12     7        ASSIGN_OBJ                                               !0, 'yup'
          8        OP_DATA                                                  'nope'
   13     9      > RETURN                                                   !0
   14    10*     > RETURN                                                   null

End of function factory

End of class Dogeness.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.74 ms | 1405 KiB | 15 Q