3v4l.org

run code in 300+ PHP versions simultaneously
<?php function square($val) { return pow($val, 2); } $arr = array( 1, 2, 3, 4 ); $squares = array_map('square', $arr); $i = 0; foreach ($squares as $value) { if ($i++ > 0) { echo "."; } echo $value; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/294uW
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr, !1 = $squares, !2 = $i, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'square'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   13     6        ASSIGN                                                   !2, 0
   14     7      > FE_RESET_R                                       $8      !1, ->15
          8    > > FE_FETCH_R                                               $8, !3, ->15
   15     9    >   POST_INC                                         ~9      !2
         10        IS_SMALLER                                               0, ~9
         11      > JMPZ                                                     ~10, ->13
   16    12    >   ECHO                                                     '.'
   19    13    >   ECHO                                                     !3
   14    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $8
   21    16      > RETURN                                                   1

Function square:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/294uW
function name:  square
number of ops:  7
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'pow'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
    5     6*     > RETURN                                                   null

End of function square

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.22 ms | 1400 KiB | 17 Q