3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Code { public function __construct( public string $value ) {} } function create_code(int $number): Code { $code = "A-$number"; return new Code($code); } $list = [1,2,3,4]; $filteredObjects = array_map( create_code(...), array_filter($list, fn(int $number) => $number >= 3) ); print_r($filteredObjects);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Xpj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $list, !1 = $filteredObjects
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'array_map'
   19     2        INIT_FCALL                                               'create_code'
          3        ZEND_CALLABLE_CONVERT                            ~3      
          4        SEND_VAL                                                 ~3
   20     5        INIT_FCALL                                               'array_filter'
          6        SEND_VAR                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
   18    11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
   23    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > 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/75Xpj
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        IS_SMALLER_OR_EQUAL                              ~1      3, !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Function create_code:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/75Xpj
function name:  create_code
number of ops:  11
compiled vars:  !0 = $number, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        NOP                                                      
          2        FAST_CONCAT                                      ~2      'A-', !0
          3        ASSIGN                                                   !1, ~2
   13     4        NEW                                              $4      'Code'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7        VERIFY_RETURN_TYPE                                       $4
          8      > RETURN                                                   $4
   14     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function create_code

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

End of function __construct

End of class Code.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.86 ms | 1009 KiB | 17 Q