3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function setBar($bar) { $this->bar = $bar; } } class Baz extends Foo { public function setBar($bar) { return call_user_func_array("parent::setBar", array($bar)); } } $a = new Baz(); $a->setBar(10); echo "success";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m44hY
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'setBar'
          4        SEND_VAL_EX                                              10
          5        DO_FCALL                                      0          
   22     6        ECHO                                                     'success'
          7      > RETURN                                                   1

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

End of function setbar

End of class Foo.

Class Baz:
Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m44hY
function name:  setBar
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        INIT_USER_CALL                                0          'call_user_func_array', 'parent%3A%3AsetBar'
          2        INIT_ARRAY                                       ~1      !0
          3        SEND_ARRAY                                               ~1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   16     7*     > RETURN                                                   null

End of function setbar

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.53 ms | 1398 KiB | 13 Q