3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = array( array( 'id' => 2135, 'first_name' => 'John', 'last_name' => 'Doe', ), array( 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith', ), array( 'id' => 5342, 'first_name' => 'Jane', 'last_name' => 'Jones', ), array( 'id' => 5623, 'first_name' => 'Peter', 'last_name' => 'Doe', ) ); $firstNames = array_map( function($record) { return ['first_name' => $record['first_name']]; }, $records ); var_dump($firstNames);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v8Y8Z
function name:  (null)
number of ops:  11
compiled vars:  !0 = $records, !1 = $firstNames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   25     1        INIT_FCALL                                               'array_map'
   26     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fv8Y8Z%3A26%240'
   28     3        SEND_VAL                                                 ~3
   29     4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
   25     6        ASSIGN                                                   !1, $4
   31     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fv8Y8Z%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v8Y8Z
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $record
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        FETCH_DIM_R                                      ~1      !0, 'first_name'
          2        INIT_ARRAY                                       ~2      ~1, 'first_name'
          3      > RETURN                                                   ~2
   28     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fv8Y8Z%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.32 ms | 1386 KiB | 17 Q