3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function() :string { return 'this is test' . PHP_EOL;}; class Def { private $str; public function __construct(string $str){ $this->str = $str; } public function __invoke() { return $this->str . PHP_EOL; } } function foo (callable $c = new Def('this is default')){ echo $c(); } foo(); foo($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaQu8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
          1        ASSIGN                                                   !0, ~1
   19     2        INIT_FCALL                                               'foo'
          3        DO_FCALL                                      0          
   20     4        INIT_FCALL                                               'foo'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaQu8
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   'this+is+test%0A'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaQu8
function name:  foo
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      <const ast>
   16     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   17     4      > RETURN                                                   null

End of function foo

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

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vaQu8
function name:  __invoke
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'str'
          1        CONCAT                                           ~1      ~0, '%0A'
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function __invoke

End of class Def.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.56 ms | 999 KiB | 15 Q