3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $foo; public function __construct($foo) { $this->foo = $foo; } private function bar() { echo 'Доступ к закрытому методу.'; } public function baz(Test $other) { // Мы можем изменить закрытое свойство: $other->foo = 'hello'; var_dump($other->foo); // Мы также можем вызвать закрытый метод: $other->bar(); } } $test = new Test('test'); $test->baz(new Test('other')); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h6hEK
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Test'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        INIT_METHOD_CALL                                         !0, 'baz'
          5        NEW                                              $4      'Test'
          6        SEND_VAL_EX                                              'other'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $4
          9        DO_FCALL                                      0          
   30    10      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h6hEK
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h6hEK
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     '%D0%94%D0%BE%D1%81%D1%82%D1%83%D0%BF+%D0%BA+%D0%B7%D0%B0%D0%BA%D1%80%D1%8B%D1%82%D0%BE%D0%BC%D1%83+%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D1%83.'
   14     1      > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h6hEK
function name:  baz
number of ops:  10
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               !0, 'foo'
          2        OP_DATA                                                  'hello'
   20     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~2      !0, 'foo'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
   23     7        INIT_METHOD_CALL                                         !0, 'bar'
          8        DO_FCALL                                      0          
   24     9      > RETURN                                                   null

End of function baz

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.52 ms | 1396 KiB | 15 Q