3v4l.org

run code in 300+ PHP versions simultaneously
<?php class outer{ private $privateProp = 'Private'; protected $protectedProp = 'Protected'; public $publicProp = 'Public'; public function inner(){ return new class() extends outer{ }; } } $test = (new outer)->inner(); var_dump($test->protectedProp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRRYm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'outer'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'inner'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   25     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~5      !0, 'protectedProp'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class outer@anonymous: [no user functions]
Class outer:
Function inner:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRRYm
function name:  inner
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_ANON_CLASS                               <ptr>   'outer'
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
   19     4*     > RETURN                                                   null

End of function inner

End of class outer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.36 ms | 1395 KiB | 15 Q