3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { class Foo_MIXED extends Foo implements \MixinPHP\Mixable { public function bar() { $args = func_get_args(); if (isset($this->__methods__["bar"])) { $cb = $this->__methods__["bar"]; array_unshift($args, function() { return call_user_func_array(array($this, "bar"), func_get_args()); }); } else { $cb = array($this, "bar"); } return call_user_func_array($cb, $args); } public function baz($a, $b, stdClass $c) { $args = func_get_args(); if (isset($this->__methods__["baz"])) { $cb = $this->__methods__["baz"]; array_unshift($args, function() { return call_user_func_array(array($this, "baz"), func_get_args()); }); } else { $cb = array($this, "baz"); } return call_user_func_array($cb, $args); } private $__methods__ = array(); private $__parent__; public function __construct(Foo $object) { $this->__parent__ = $object; } public function mixWith($object) { return \MixinPHP\Mixin::mix($this, $object); } public function __get($name) { return Closure::bind(function() use ($name) { return call_user_func_array(array($this, $name), func_get_args()); }, $this); } public function __set($name, $value) { $this->__methods__[strtolower($name)] = $value; } public function __isset($name) { return isset($this->__methods__[strtolower($name)]); } public function __unset($name) { unset($this->__methods__[strtolower($name)]); } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo_mixed', 'foo'
   50     1      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  {closure}
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'bar'
          3        INIT_USER_CALL                                0          'call_user_func_array', ~1
          4        FUNC_GET_ARGS                                    ~2      
          5        SEND_ARRAY                                               ~2
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   10     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A8%240

Function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A19%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  {closure}
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0
          2        ADD_ARRAY_ELEMENT                                ~1      'baz'
          3        INIT_USER_CALL                                0          'call_user_func_array', ~1
          4        FUNC_GET_ARGS                                    ~2      
          5        SEND_ARRAY                                               ~2
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   21     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A19%241

Function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A36%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   BIND_STATIC                                              !0
   37     1        FETCH_THIS                                       ~1      
          2        INIT_ARRAY                                       ~2      ~1
          3        ADD_ARRAY_ELEMENT                                ~2      !0
          4        INIT_USER_CALL                                0          'call_user_func_array', ~2
          5        FUNC_GET_ARGS                                    ~3      
          6        SEND_ARRAY                                               ~3
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
   38    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ffqv4R%3A36%242

Class Foo_MIXED:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  bar
number of ops:  24
compiled vars:  !0 = $args, !1 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FUNC_GET_ARGS                                    ~2      
          1        ASSIGN                                                   !0, ~2
    6     2        FETCH_OBJ_IS                                     ~4      '__methods__'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~4, 'bar'
          4      > JMPZ                                                     ~5, ->14
    7     5    >   FETCH_OBJ_R                                      ~6      '__methods__'
          6        FETCH_DIM_R                                      ~7      ~6, 'bar'
          7        ASSIGN                                                   !1, ~7
    8     8        INIT_FCALL                                               'array_unshift'
          9        SEND_REF                                                 !0
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ffqv4R%3A8%240'
   10    11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
         13      > JMP                                                      ->18
   12    14    >   FETCH_THIS                                       ~11     
         15        INIT_ARRAY                                       ~12     ~11
         16        ADD_ARRAY_ELEMENT                                ~12     'bar'
         17        ASSIGN                                                   !1, ~12
   14    18    >   INIT_USER_CALL                                0          'call_user_func_array', !1
         19        SEND_ARRAY                                               !0
         20        CHECK_UNDEF_ARGS                                         
         21        DO_FCALL                                      0  $14     
         22      > RETURN                                                   $14
   15    23*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  baz
number of ops:  27
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $args, !4 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        FUNC_GET_ARGS                                    ~5      
          4        ASSIGN                                                   !3, ~5
   17     5        FETCH_OBJ_IS                                     ~7      '__methods__'
          6        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 'baz'
          7      > JMPZ                                                     ~8, ->17
   18     8    >   FETCH_OBJ_R                                      ~9      '__methods__'
          9        FETCH_DIM_R                                      ~10     ~9, 'baz'
         10        ASSIGN                                                   !4, ~10
   19    11        INIT_FCALL                                               'array_unshift'
         12        SEND_REF                                                 !3
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ffqv4R%3A19%241'
   21    14        SEND_VAL                                                 ~12
         15        DO_ICALL                                                 
         16      > JMP                                                      ->21
   23    17    >   FETCH_THIS                                       ~14     
         18        INIT_ARRAY                                       ~15     ~14
         19        ADD_ARRAY_ELEMENT                                ~15     'baz'
         20        ASSIGN                                                   !4, ~15
   25    21    >   INIT_USER_CALL                                0          'call_user_func_array', !4
         22        SEND_ARRAY                                               !3
         23        CHECK_UNDEF_ARGS                                         
         24        DO_FCALL                                      0  $17     
         25      > RETURN                                                   $17
   26    26*     > RETURN                                                   null

End of function baz

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

End of function __construct

Function mixwith:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  mixWith
number of ops:  8
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   33     1        INIT_STATIC_METHOD_CALL                                  'MixinPHP%5CMixin', 'mix'
          2        FETCH_THIS                                       $1      
          3        SEND_VAR_EX                                              $1
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   34     7*     > RETURN                                                   null

End of function mixwith

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  __get
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ffqv4R%3A36%242'
          3        BIND_LEXICAL                                             ~1, !0
   38     4        SEND_VAL                                                 ~1
          5        FETCH_THIS                                       ~2      
          6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   39     9*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  __set
number of ops:  9
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   41     2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        FETCH_OBJ_W                                      $2      '__methods__'
          6        ASSIGN_DIM                                               $2, $3
          7        OP_DATA                                                  !1
   42     8      > RETURN                                                   null

End of function __set

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  __isset
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
   44     1        INIT_FCALL                                               'strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        FETCH_OBJ_IS                                     ~1      '__methods__'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~1, $2
          6      > RETURN                                                   ~3
   45     7*     > RETURN                                                   null

End of function __isset

Function __unset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqv4R
function name:  __unset
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   RECV                                             !0      
   47     1        INIT_FCALL                                               'strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        FETCH_OBJ_UNSET                                  $1      '__methods__'
          5        UNSET_DIM                                                $1, $2
   48     6      > RETURN                                                   null

End of function __unset

End of class Foo_MIXED.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159 ms | 1408 KiB | 17 Q