3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function() { var_dump($this); }; $b = static function() { var_dump($this); }; $a(); $b(); $c = $a->bindTo(new StdClass()); $d = $b->bindTo(new StdClass()); $c(); $d();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHjSu
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcHjSu%3A3%240'
          1        ASSIGN                                                   !0, ~4
    4     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcHjSu%3A4%241'
          3        ASSIGN                                                   !1, ~6
    6     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
    7     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
    9     8        INIT_METHOD_CALL                                         !0, 'bindTo'
          9        NEW                                              $10     'StdClass'
         10        DO_FCALL                                      0          
         11        SEND_VAR_NO_REF_EX                                       $10
         12        DO_FCALL                                      0  $12     
         13        ASSIGN                                                   !2, $12
   10    14        INIT_METHOD_CALL                                         !1, 'bindTo'
         15        NEW                                              $14     'StdClass'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $14
         18        DO_FCALL                                      0  $16     
         19        ASSIGN                                                   !3, $16
   12    20        INIT_DYNAMIC_CALL                                        !2
         21        DO_FCALL                                      0          
   13    22        INIT_DYNAMIC_CALL                                        !3
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcHjSu%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHjSu
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcHjSu%3A3%240

Function %00%7Bclosure%7D%2Fin%2FcHjSu%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHjSu
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcHjSu%3A4%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.08 ms | 1400 KiB | 15 Q