3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2Fh63iF%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h63iF
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%2Fh63iF%3A3%240

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.22 ms | 1400 KiB | 15 Q