3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Token { public $fix = null; // this would be a function pointer in c++ // ctr public function Token($MyFix) { $this->fix = $MyFix; } } //Create a class $AFix = function(){ return 'foo'; }; $token = new Token($AFix) ; // call echo $token->fix();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1tWDS
function name:  (null)
number of ops:  10
compiled vars:  !0 = $AFix, !1 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1tWDS%3A12%240'
          1        ASSIGN                                                   !0, ~2
   13     2        NEW                                              $4      'Token'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   16     6        INIT_METHOD_CALL                                         !1, 'fix'
          7        DO_FCALL                                      0  $7      
          8        ECHO                                                     $7
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1tWDS%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1tWDS
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'foo'
          1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1tWDS%3A12%240

Class Token:
Function token:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1tWDS
function name:  Token
number of ops:  4
compiled vars:  !0 = $MyFix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'fix'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function token

End of class Token.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.76 ms | 1394 KiB | 13 Q