3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ private $delta = ['0']; public function test(){ $t = function( $id = 1) { print_r($id); }; return $t; } } $Test = new Test; var_dump($Test->test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5pVV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $Test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ft5pVV%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5pVV
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      1
    6     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ft5pVV%3A5%240

Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t5pVV
function name:  test
number of ops:  4
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ft5pVV%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2      > RETURN                                                   !0
    9     3*     > RETURN                                                   null

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.99 ms | 1387 KiB | 17 Q