3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array( 'title' => 'My title', 'date' => 'My date' ), array( 'title' => 'Another title', 'name' => 'Another Name' ), array( 'name' => 'Another Name', 'date' => 'Another date' ), array( 'date' => 'Another date', 'name' => 'Another Name' ) ); $data=array_map(function($element){ return [ 'title'=>isset($element['title'])?$element['title']:'', 'name'=>isset($element['name'])?$element['name']:'', 'date'=>isset($element['date'])?$element['date']:'' ]; },$data); print_r($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/usOQS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   28     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
   21     5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
   29     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
Branch analysis from position: 20
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
Branch analysis from position: 13
filename:       /in/usOQS
function name:  {closure}
number of ops:  24
compiled vars:  !0 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'title'
          2      > JMPZ                                                     ~1, ->6
          3    >   FETCH_DIM_R                                      ~2      !0, 'title'
          4        QM_ASSIGN                                        ~3      ~2
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      ''
          7    >   INIT_ARRAY                                       ~4      ~3, 'title'
   24     8        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'name'
          9      > JMPZ                                                     ~5, ->13
         10    >   FETCH_DIM_R                                      ~6      !0, 'name'
         11        QM_ASSIGN                                        ~7      ~6
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      ''
         14    >   ADD_ARRAY_ELEMENT                                ~4      ~7, 'name'
   25    15        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'date'
         16      > JMPZ                                                     ~8, ->20
         17    >   FETCH_DIM_R                                      ~9      !0, 'date'
         18        QM_ASSIGN                                        ~10     ~9
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~10     ''
         21    >   ADD_ARRAY_ELEMENT                                ~4      ~10, 'date'
         22      > RETURN                                                   ~4
   28    23*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.93 ms | 1016 KiB | 15 Q