3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'oh yea'; public function foo() { $class = new class { protected function bar() { return $this->bar; } }; return $class->bar(); } } var_dump((new Foo)->foo()->bar());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuKUd
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        DO_FCALL                                      0  $2      
          5        INIT_METHOD_CALL                                         $2, 'bar'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class class@anonymous:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuKUd
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'bar'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function bar

End of class class@anonymous.

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JuKUd
function name:  foo
number of ops:  8
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0  $5      
          6      > RETURN                                                   $5
   15     7*     > RETURN                                                   null

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1395 KiB | 15 Q