3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=[ ['Name','Email','Phone Number'], ['Mick','mick@mick.com','01234 324234'], ['james','james@james.com',''], ['reg','reg@reg.com','10293 467289'] ]; foreach($array as $item){ $result[]=[$item[0],$item[1].(strlen($item[2])?" + $item[2]":'')]; } $result[0]=['Name','Info']; var_export($result); echo "\n\n---\n\n"; $result=array_map(function($item){return [$item[0],$item[1].(strlen($item[2])?" + $item[2]":'')];},$array); $result[0]=['Name','Info']; var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/WoVMn
function name:  (null)
number of ops:  39
compiled vars:  !0 = $array, !1 = $item, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $4      !0, ->20
          2    > > FE_FETCH_R                                               $4, !1, ->20
   10     3    >   FETCH_DIM_R                                      ~6      !1, 0
          4        INIT_ARRAY                                       ~7      ~6
          5        FETCH_DIM_R                                      ~8      !1, 1
          6        FETCH_DIM_R                                      ~9      !1, 2
          7        STRLEN                                           ~10     ~9
          8      > JMPZ                                                     ~10, ->14
          9    >   NOP                                                      
         10        FETCH_DIM_R                                      ~11     !1, 2
         11        FAST_CONCAT                                      ~12     '+%2B+', ~11
         12        QM_ASSIGN                                        ~13     ~12
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~13     ''
         15    >   CONCAT                                           ~14     ~8, ~13
         16        ADD_ARRAY_ELEMENT                                ~7      ~14
         17        ASSIGN_DIM                                               !2
         18        OP_DATA                                                  ~7
    9    19      > JMP                                                      ->2
         20    >   FE_FREE                                                  $4
   12    21        ASSIGN_DIM                                               !2, 0
         22        OP_DATA                                                  <array>
   13    23        INIT_FCALL                                               'var_export'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
   15    26        ECHO                                                     '%0A%0A---%0A%0A'
   17    27        INIT_FCALL                                               'array_map'
         28        DECLARE_LAMBDA_FUNCTION                          ~17     [0]
         29        SEND_VAL                                                 ~17
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $18     
         32        ASSIGN                                                   !2, $18
   18    33        ASSIGN_DIM                                               !2, 0
         34        OP_DATA                                                  <array>
   19    35        INIT_FCALL                                               'var_export'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                                 
         38      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WoVMn
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 0
          2        INIT_ARRAY                                       ~2      ~1
          3        FETCH_DIM_R                                      ~3      !0, 1
          4        FETCH_DIM_R                                      ~4      !0, 2
          5        STRLEN                                           ~5      ~4
          6      > JMPZ                                                     ~5, ->12
          7    >   NOP                                                      
          8        FETCH_DIM_R                                      ~6      !0, 2
          9        FAST_CONCAT                                      ~7      '+%2B+', ~6
         10        QM_ASSIGN                                        ~8      ~7
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~8      ''
         13    >   CONCAT                                           ~9      ~3, ~8
         14        ADD_ARRAY_ELEMENT                                ~2      ~9
         15      > RETURN                                                   ~2
         16*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.24 ms | 1006 KiB | 15 Q