3v4l.org

run code in 300+ PHP versions simultaneously
<?php class outerClass{ private $privateProp; protected $protectedProp; public function __construct($value){ $this->privateProp = $value; } public function innerClasses($innerClass){ switch($innerClass){ case 'accessPrivate': //return $this->privateProp; return new class($this->value) extends outerClass{ }; } } } $test = new outerClass('testing'); $result = $test->innerClasses('accessPrivate'); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UgcHk
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $2      'outerClass'
          1        SEND_VAL_EX                                              'testing'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   37     4        INIT_METHOD_CALL                                         !0, 'innerClasses'
          5        SEND_VAL_EX                                              'accessPrivate'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   39     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class outerClass@anonymous: [no user functions]
Class outerClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UgcHk
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'privateProp'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function __construct

Function innerclasses:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UgcHk
function name:  innerClasses
number of ops:  12
compiled vars:  !0 = $innerClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   19     1        IS_EQUAL                                                 !0, 'accessPrivate'
          2      > JMPNZ                                                    ~1, ->4
          3    > > JMP                                                      ->11
   23     4    >   DECLARE_ANON_CLASS                               <unknown> 'outerclass'
          5        NEW                                              $3      $2
          6        CHECK_FUNC_ARG                                           
          7        FETCH_OBJ_FUNC_ARG                               $4      'value'
          8        SEND_FUNC_ARG                                            $4
          9        DO_FCALL                                      0          
         10      > RETURN                                                   $3
   31    11    > > RETURN                                                   null

End of function innerclasses

End of class outerClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.97 ms | 1396 KiB | 15 Q