3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 1); $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/eoBRH
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'display_errors'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
    4     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeoBRH%3A4%240'
          5        ASSIGN                                                   !0, ~4
    5     6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAL_EX                                              'lulz'
          8        DO_FCALL                                      0          
    7     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeoBRH%3A7%241'
         10        ASSIGN_DIM                                               !1, 'lulz'
         11        OP_DATA                                                  ~8
    8    12        FETCH_DIM_R                                      ~9      !1, 'lulz'
         13        INIT_DYNAMIC_CALL                                        ~9
         14        SEND_VAL_EX                                              'more+lulz'
         15        DO_FCALL                                      0          
   20    16        NEW                                              $11     'c'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !2, $11
   21    19        INIT_METHOD_CALL                                         !2, 'b'
         20        SEND_VAL_EX                                              'asdf'
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FeoBRH%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eoBRH
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     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%2FeoBRH%3A4%240

Function %00%7Bclosure%7D%2Fin%2FeoBRH%3A7%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eoBRH
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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%2FeoBRH%3A7%241

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

End of function %00%7Bclosure%7D%2Fin%2FeoBRH%3A13%242

Class c:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eoBRH
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%2FeoBRH%3A13%242'
          1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  ~1
   14     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/eoBRH
function name:  __call
number of ops:  7
compiled vars:  !0 = $b, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_METHOD_CALL                                         !0
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   17     6*     > RETURN                                                   null

End of function __call

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.46 ms | 1400 KiB | 15 Q