3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function($b) { print "$b\n"; }; $a('lulz'); $b['lulz'] = function($b) { print "$b\n"; }; $b['lulz']('more lulz'); class c { protected $b; public function __construct() { $this->b = function($b) { print "hahahaha\n"; }; } public function __call($b, $args) { return $this->{$b}($args); } } $c = new c; $c->b('asdf');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F71egK%3A2%240'
          1        ASSIGN                                                   !0, ~3
    3     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              'lulz'
          4        DO_FCALL                                      0          
    5     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F71egK%3A5%241'
          6        ASSIGN_DIM                                               !1, 'lulz'
          7        OP_DATA                                                  ~7
    6     8        FETCH_DIM_R                                      ~8      !1, 'lulz'
          9        INIT_DYNAMIC_CALL                                        ~8
         10        SEND_VAL_EX                                              'more+lulz'
         11        DO_FCALL                                      0          
   18    12        NEW                                              $10     'c'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $10
   19    15        INIT_METHOD_CALL                                         !2, 'b'
         16        SEND_VAL_EX                                              'asdf'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F71egK%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '%0A'
          3        ECHO                                                     ~1
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F71egK%3A2%240

Function %00%7Bclosure%7D%2Fin%2F71egK%3A5%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '%0A'
          3        ECHO                                                     ~1
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F71egK%3A5%241

Function %00%7Bclosure%7D%2Fin%2F71egK%3A11%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        ECHO                                                     'hahahaha%0A'
          2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F71egK%3A11%242

Class c:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F71egK%3A11%242'
          1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  ~1
   12     3      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/71egK
function name:  __call
number of ops:  7
compiled vars:  !0 = $b, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_METHOD_CALL                                         !0
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   15     6*     > RETURN                                                   null

End of function __call

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.19 ms | 1399 KiB | 13 Q