3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function($b) { print "$b\n"; }; $a('lulz'); $b['lulz'] = $a; $b['lulz']('more lulz'); class Lulz { public $do; function __construct(callable $callable) { $this->do = $callable; } } $d = new Lulz(); $d->do('nope'); call_user_func_array(array($d, 'do'), array('nope')); $c = new stdclass(); $c->do = $a; $c->do('nope'); call_user_func_array(array($c, 'do'), array('nope'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oGrJE
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $b, !2 = $d, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FoGrJE%3A3%240'
          1        ASSIGN                                                   !0, ~4
    4     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              'lulz'
          4        DO_FCALL                                      0          
    6     5        ASSIGN_DIM                                               !1, 'lulz'
          6        OP_DATA                                                  !0
    7     7        FETCH_DIM_R                                      ~8      !1, 'lulz'
          8        INIT_DYNAMIC_CALL                                        ~8
          9        SEND_VAL_EX                                              'more+lulz'
         10        DO_FCALL                                      0          
   15    11        NEW                                              $10     'Lulz'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $10
   16    14        INIT_METHOD_CALL                                         !2, 'do'
         15        SEND_VAL_EX                                              'nope'
         16        DO_FCALL                                      0          
   17    17        INIT_ARRAY                                       ~14     !2
         18        ADD_ARRAY_ELEMENT                                ~14     'do'
         19        INIT_USER_CALL                                0          'call_user_func_array', ~14
         20        SEND_ARRAY                                               <array>
         21        CHECK_UNDEF_ARGS                                         
         22        DO_FCALL                                      0          
   19    23        NEW                                              $16     'stdclass'
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !3, $16
   20    26        ASSIGN_OBJ                                               !3, 'do'
         27        OP_DATA                                                  !0
   21    28        INIT_METHOD_CALL                                         !3, 'do'
         29        SEND_VAL_EX                                              'nope'
         30        DO_FCALL                                      0          
   22    31        INIT_ARRAY                                       ~21     !3
         32        ADD_ARRAY_ELEMENT                                ~21     'do'
         33        INIT_USER_CALL                                0          'call_user_func_array', ~21
         34        SEND_ARRAY                                               <array>
         35        CHECK_UNDEF_ARGS                                         
         36        DO_FCALL                                      0          
         37      > RETURN                                                   1

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

Class Lulz:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oGrJE
function name:  __construct
number of ops:  4
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'do'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function __construct

End of class Lulz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.46 ms | 1399 KiB | 13 Q