3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is my test case for an example."; var_export( array_reduce( explode(' ', $string), function($result, $word) { static $last = ''; if ($last) { $result[] = "$last $word"; } $last = $word; return $result; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fCvIk
function name:  (null)
number of ops:  14
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+my+test+case+for+an+example.'
    5     1        INIT_FCALL                                               'var_export'
    6     2        INIT_FCALL                                               'array_reduce'
    7     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
    8     8        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   15     9        SEND_VAL                                                 ~3
    6    10        DO_ICALL                                         $4      
   15    11        SEND_VAR                                                 $4
    5    12        DO_ICALL                                                 
   17    13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/fCvIk
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $result, !1 = $word, !2 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        BIND_STATIC                                              !2
   10     3      > JMPZ                                                     !2, ->9
   11     4    >   ROPE_INIT                                     3  ~5      !2
          5        ROPE_ADD                                      1  ~5      ~5, '+'
          6        ROPE_END                                      2  ~4      ~5, !1
          7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  ~4
   13     9    >   ASSIGN                                                   !2, !1
   14    10      > RETURN                                                   !0
   15    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.12 ms | 1013 KiB | 16 Q