3v4l.org

run code in 300+ PHP versions simultaneously
<?php class IsolatedTest { protected $closure; public function __construct($closure) { $this->closure = $closure; } public function __invoke() { die('win'); } } $test = new IsolatedTest(function(){ echo 'test'; }); $test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lk1Q9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'IsolatedTest'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLk1Q9%3A19%240'
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   21     5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FLk1Q9%3A19%240

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

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/Lk1Q9
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > EXIT                                                     'win'
   15     1*     > RETURN                                                   null

End of function __invoke

End of class IsolatedTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.76 ms | 1394 KiB | 13 Q