3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $bla = ''; public function __construct(){ $this->bla = "fooooo"; } public function __invoke($arg){ $this->bla = $arg + $this->bla; } } Class Foo2 extends Foo { } $blubb = new Foo2(); $blubb("bl0a"); var_dump($blubb);
based on kffRu
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/7UmPp
function name:  (null)
number of ops:  13
compiled vars:  !0 = $blubb
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  17     1        NOP                                                      
         2        NOP                                                      
  22     3        NEW                                              $4      :-4
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  23     6        INIT_DYNAMIC_CALL                                        !0
         7        SEND_VAL_EX                                              'bl0a'
         8        DO_FCALL                                      0          
  24     9        INIT_FCALL                                               'var_dump'
        10        SEND_VAR                                                 !0
        11        DO_ICALL                                                 
        12      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/7UmPp
function name:  __construct
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   ASSIGN_OBJ                                               'bla'
         1        OP_DATA                                                  'fooooo'
   9     2      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/7UmPp
function name:  __invoke
number of ops:  6
compiled vars:  !0 = $arg
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   RECV                                             !0      
  12     1        FETCH_OBJ_R                                      $2      'bla'
         2        ADD                                              ~3      !0, $2
         3        ASSIGN_OBJ                                               'bla'
         4        OP_DATA                                                  ~3
  14     5      > RETURN                                                   null

End of function __invoke

End of class Foo.

Class Foo2:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/7UmPp
function name:  __construct
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   ASSIGN_OBJ                                               'bla'
         1        OP_DATA                                                  'fooooo'
   9     2      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/7UmPp
function name:  __invoke
number of ops:  6
compiled vars:  !0 = $arg
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   RECV                                             !0      
  12     1        FETCH_OBJ_R                                      $2      'bla'
         2        ADD                                              ~3      !0, $2
         3        ASSIGN_OBJ                                               'bla'
         4        OP_DATA                                                  ~3
  14     5      > RETURN                                                   null

End of function __invoke

End of class Foo2.

Generated using Vulcan Logic Dumper, using php 7.3.0