3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected function _new($args) { return $args; } public function __call($method, $args) { if($method === 'new') { return call_user_func_array(array($this, '_new'), $args); } else { throw new LogicException('Unknown method'); } } } $foo = new Foo; echo $foo->new('hello'); // return hello
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WSDI9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'new'
          4        SEND_VAL_EX                                              'hello'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

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

End of function _new

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/WSDI9
function name:  __call
number of ops:  18
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        IS_IDENTICAL                                             !0, 'new'
          3      > JMPZ                                                     ~2, ->13
   12     4    >   FETCH_THIS                                       ~3      
          5        INIT_ARRAY                                       ~4      ~3
          6        ADD_ARRAY_ELEMENT                                ~4      '_new'
          7        INIT_USER_CALL                                0          'call_user_func_array', ~4
          8        SEND_ARRAY                                               !1
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
         12*       JMP                                                      ->17
   14    13    >   NEW                                              $6      'LogicException'
         14        SEND_VAL_EX                                              'Unknown+method'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $6
   16    17*     > RETURN                                                   null

End of function __call

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.28 ms | 1395 KiB | 13 Q