3v4l.org

run code in 300+ PHP versions simultaneously
<?php $record_1 = new stdClass(); $record_1->id = 1; $record_2 = new stdClass(); $record_2->id = 2; $record_3 = new stdClass(); $record_3->id = 3; $records = [ $record_1, $record_2, $record_3, ]; $result = array_column($records, function($record) { if ($record->id > 1) return $record; }); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g0JUY
function name:  (null)
number of ops:  29
compiled vars:  !0 = $record_1, !1 = $record_2, !2 = $record_3, !3 = $records, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $5      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    3     3        ASSIGN_OBJ                                               !0, 'id'
          4        OP_DATA                                                  1
    5     5        NEW                                              $9      'stdClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    6     8        ASSIGN_OBJ                                               !1, 'id'
          9        OP_DATA                                                  2
    8    10        NEW                                              $13     'stdClass'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $13
    9    13        ASSIGN_OBJ                                               !2, 'id'
         14        OP_DATA                                                  3
   13    15        INIT_ARRAY                                       ~17     !0
   14    16        ADD_ARRAY_ELEMENT                                ~17     !1
   15    17        ADD_ARRAY_ELEMENT                                ~17     !2
   12    18        ASSIGN                                                   !3, ~17
   21    19        INIT_FCALL                                               'array_column'
         20        SEND_VAR                                                 !3
         21        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fg0JUY%3A21%240'
         22        SEND_VAL                                                 ~19
         23        DO_ICALL                                         $20     
         24        ASSIGN                                                   !4, $20
   23    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !4
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fg0JUY%3A21%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g0JUY
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $record
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      !0, 'id'
          2        IS_SMALLER                                               1, ~1
          3      > JMPZ                                                     ~2, ->5
          4    > > RETURN                                                   !0
          5    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fg0JUY%3A21%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.27 ms | 1396 KiB | 17 Q