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 innerClases($innerClass){ switch($innerClass){ case 'accessPrivate': echo 'test'; /* return new class extends outerClass{ } */ } } } $test = new outerClass('testing'); $test->innerClass('accessPrivate');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kpCHp
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   NEW                                              $1      'outerClass'
          1        SEND_VAL_EX                                              'testing'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   39     4        INIT_METHOD_CALL                                         !0, 'innerClass'
          5        SEND_VAL_EX                                              'accessPrivate'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class outerClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kpCHp
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 innerclases:
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 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kpCHp
function name:  innerClases
number of ops:  6
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                                                      ->5
   21     4    >   ECHO                                                     'test'
   33     5    > > RETURN                                                   null

End of function innerclases

End of class outerClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.3 ms | 1385 KiB | 13 Q